From f5eee1c0519d8ff054bf55487a3e89a4d26aaf6c Mon Sep 17 00:00:00 2001 From: Tipu_Singh Date: Fri, 22 Aug 2025 13:25:48 +0530 Subject: [PATCH 001/152] feat: added OID4VC/P implementation Signed-off-by: Tipu_Singh --- package.json | 21 +- ...model conflict in AnonCreds and DID.patch} | 32 +- ...0.5.15+001+message-type-for-messages.patch | 43 - ...prettyVc-in-JsonCredential-interface.patch | 13 - ...resentation to avoid abandoned issue.patch | 27 - ....5.15+005+credential-get-format-data.patch | 44 - ...13+001+fix: message type for message.patch | 12 + ...13+001+fix: message type for message.patch | 31 + ...+0.5.3+001+cache-tenant-record-patch.patch | 56 - src/cliAgent.ts | 85 +- src/controllers/agent/AgentController.ts | 2 +- src/controllers/did/DidController.ts | 2 +- .../basic-messages/BasicMessageController.ts | 6 +- .../connections/ConnectionController.ts | 21 +- .../credentials/CredentialController.ts | 40 +- .../didcomm/outofband/OutOfBandController.ts | 54 +- .../didcomm/proofs/ProofController.ts | 35 +- src/controllers/examples.ts | 2 +- .../openid4vc/holder/holder.Controller.ts | 82 + .../openid4vc/holder/holder.service.ts | 254 + .../issuance-sessions.Controller.ts | 110 + .../issuance-sessions.service.ts | 156 + .../openid4vc/issuers/issuer.Controller.ts | 104 + .../openid4vc/issuers/issuer.service.ts | 57 + .../openid4vc/types/holder.types.ts | 25 + .../openid4vc/types/issuer.types.ts | 122 + .../openid4vc/types/verifier.types.ts | 48 + .../verification-sessions.Controller.ts | 82 + .../verification-sessions.service.ts | 109 + .../verifiers/verifier.Controller.ts | 63 + .../openid4vc/verifiers/verifier.service.ts | 56 + src/controllers/types.ts | 38 +- src/enums/enum.ts | 5 + src/errorHandlingService.ts | 4 +- src/events/BasicMessageEvents.ts | 5 +- src/events/ConnectionEvents.ts | 4 +- src/events/CredentialEvents.ts | 31 +- src/events/ProofEvents.ts | 7 +- src/events/ReuseConnectionEvents.ts | 4 +- src/routes/routes.ts | 1121 ++- src/routes/swagger.json | 6058 ++++++++++------- src/utils/agent.ts | 43 +- src/utils/constant.ts | 1 + src/utils/oid4vc-agent.ts | 285 + tsoa.json | 4 +- yarn.lock | 1773 ++--- 46 files changed, 7623 insertions(+), 3554 deletions(-) rename patches/{@credo-ts+anoncreds+0.5.3+001+fix: Extensible model confict in Anoncreds and Did.patch => @credo-ts+anoncreds+0.6.0-alpha-20250325224513+001+fix: extensible model conflict in AnonCreds and DID.patch} (93%) delete mode 100644 patches/@credo-ts+core+0.5.15+001+message-type-for-messages.patch delete mode 100644 patches/@credo-ts+core+0.5.15+003+added-prettyVc-in-JsonCredential-interface.patch delete mode 100644 patches/@credo-ts+core+0.5.15+004+commenting validationPresentation to avoid abandoned issue.patch delete mode 100644 patches/@credo-ts+core+0.5.15+005+credential-get-format-data.patch create mode 100644 patches/@credo-ts+core+0.6.0-alpha-20250325224513+001+fix: message type for message.patch create mode 100644 patches/@credo-ts+didcomm+0.6.0-alpha-20250325224513+001+fix: message type for message.patch delete mode 100644 patches/@credo-ts+tenants+0.5.3+001+cache-tenant-record-patch.patch create mode 100644 src/controllers/openid4vc/holder/holder.Controller.ts create mode 100644 src/controllers/openid4vc/holder/holder.service.ts create mode 100644 src/controllers/openid4vc/issuance-sessions/issuance-sessions.Controller.ts create mode 100644 src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts create mode 100644 src/controllers/openid4vc/issuers/issuer.Controller.ts create mode 100644 src/controllers/openid4vc/issuers/issuer.service.ts create mode 100644 src/controllers/openid4vc/types/holder.types.ts create mode 100644 src/controllers/openid4vc/types/issuer.types.ts create mode 100644 src/controllers/openid4vc/types/verifier.types.ts create mode 100644 src/controllers/openid4vc/verifier-sessions/verification-sessions.Controller.ts create mode 100644 src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts create mode 100644 src/controllers/openid4vc/verifiers/verifier.Controller.ts create mode 100644 src/controllers/openid4vc/verifiers/verifier.service.ts create mode 100644 src/utils/constant.ts create mode 100644 src/utils/oid4vc-agent.ts diff --git a/package.json b/package.json index 8ef8a494..abf8daf1 100644 --- a/package.json +++ b/package.json @@ -40,16 +40,17 @@ }, "dependencies": { "@ayanworks/credo-polygon-w3c-module": "1.0.1-alpha.1", - "@credo-ts/anoncreds": "0.5.15", - "@credo-ts/askar": "0.5.15", - "@credo-ts/core": "0.5.15", - "@credo-ts/indy-vdr": "0.5.15", - "@credo-ts/node": "^0.5.15", + "@credo-ts/anoncreds": "0.6.0-alpha-20250325224513", + "@credo-ts/askar": "0.6.0-alpha-20250325224513", + "@credo-ts/core": "0.6.0-alpha-20250325224513", + "@credo-ts/indy-vdr": "0.6.0-alpha-20250325224513", + "@credo-ts/node": "^0.6.0-alpha-20250325224513", + "@credo-ts/openid4vc": "0.6.0-alpha-20250325224513", "@credo-ts/push-notifications": "^0.7.1", - "@credo-ts/question-answer": "0.5.15", - "@credo-ts/tenants": "0.5.15", + "@credo-ts/question-answer": "0.6.0-alpha-20250325224513", + "@credo-ts/tenants": "0.6.0-alpha-20250325224513", "@hyperledger/anoncreds-nodejs": "0.3.1", - "@hyperledger/aries-askar-nodejs": "0.2.3", + "@openwallet-foundation/askar-nodejs": "^0.3.2", "@hyperledger/indy-vdr-nodejs": "0.2.2", "@opentelemetry/api": "^1.9.0", "@opentelemetry/exporter-logs-otlp-http": "^0.202.0", @@ -115,7 +116,7 @@ "typescript": "^5.8.3" }, "resolutions": { - "@credo-ts/core": "0.5.15", - "@credo-ts/askar": "0.5.15" + "@credo-ts/core": "0.6.0-alpha-20250325224513", + "@credo-ts/askar": "0.6.0-alpha-20250325224513" } } diff --git a/patches/@credo-ts+anoncreds+0.5.3+001+fix: Extensible model confict in Anoncreds and Did.patch b/patches/@credo-ts+anoncreds+0.6.0-alpha-20250325224513+001+fix: extensible model conflict in AnonCreds and DID.patch similarity index 93% rename from patches/@credo-ts+anoncreds+0.5.3+001+fix: Extensible model confict in Anoncreds and Did.patch rename to patches/@credo-ts+anoncreds+0.6.0-alpha-20250325224513+001+fix: extensible model conflict in AnonCreds and DID.patch index 454a3389..1f00b40b 100644 --- a/patches/@credo-ts+anoncreds+0.5.3+001+fix: Extensible model confict in Anoncreds and Did.patch +++ b/patches/@credo-ts+anoncreds+0.6.0-alpha-20250325224513+001+fix: extensible model conflict in AnonCreds and DID.patch @@ -1,16 +1,16 @@ diff --git a/node_modules/@credo-ts/anoncreds/build/AnonCredsApi.d.ts b/node_modules/@credo-ts/anoncreds/build/AnonCredsApi.d.ts -index e9d0a20..479b157 100644 +index 9cbc1d8..ac26d6b 100644 --- a/node_modules/@credo-ts/anoncreds/build/AnonCredsApi.d.ts +++ b/node_modules/@credo-ts/anoncreds/build/AnonCredsApi.d.ts -@@ -1,7 +1,7 @@ +@@ -2,7 +2,7 @@ import type { SimpleQuery } from '@credo-ts/core'; import type { AnonCredsCreateLinkSecretOptions, AnonCredsRegisterCredentialDefinitionOptions, AnonCredsRegisterRevocationRegistryDefinitionOptions, AnonCredsRegisterRevocationStatusListOptions, AnonCredsUpdateRevocationStatusListOptions } from './AnonCredsApiOptions'; import type { AnonCredsSchema } from './models'; - import type { GetCredentialDefinitionReturn, GetCredentialsOptions, GetRevocationRegistryDefinitionReturn, GetRevocationStatusListReturn, GetSchemaReturn, RegisterCredentialDefinitionReturn, RegisterSchemaReturn, RegisterRevocationRegistryDefinitionReturn, RegisterRevocationStatusListReturn } from './services'; + import type { GetCredentialDefinitionReturn, GetCredentialsOptions, GetRevocationRegistryDefinitionReturn, GetRevocationStatusListReturn, GetSchemaReturn, RegisterCredentialDefinitionReturn, RegisterRevocationRegistryDefinitionReturn, RegisterRevocationStatusListReturn, RegisterSchemaReturn } from './services'; -import type { Extensible } from './services/registry/base'; +import type { CredoExtensible } from './services/registry/base'; - import type { SimpleQuery } from '@credo-ts/core'; import { AgentContext } from '@credo-ts/core'; import { AnonCredsModuleConfig } from './AnonCredsModuleConfig'; + import { AnonCredsCredentialDefinitionPrivateRepository, AnonCredsKeyCorrectnessProofRepository, AnonCredsLinkSecretRepository, AnonCredsRevocationRegistryDefinitionPrivateRepository, AnonCredsRevocationRegistryDefinitionRepository } from './repository'; @@ -41,28 +41,28 @@ export declare class AnonCredsApi { * with the {@link schemaId} */ @@ -126,13 +126,13 @@ index 452ec04..f66058d 100644 + [AnonCredsSchemaRecordMetadataKeys.SchemaMetadata]: CredoExtensible; }; diff --git a/node_modules/@credo-ts/anoncreds/build/services/registry/CredentialDefinitionOptions.d.ts b/node_modules/@credo-ts/anoncreds/build/services/registry/CredentialDefinitionOptions.d.ts -index 95c0949..aa82d57 100644 +index 0cedde3..169337b 100644 --- a/node_modules/@credo-ts/anoncreds/build/services/registry/CredentialDefinitionOptions.d.ts +++ b/node_modules/@credo-ts/anoncreds/build/services/registry/CredentialDefinitionOptions.d.ts @@ -1,14 +1,14 @@ + import type { AnonCredsCredentialDefinition } from '../../models/registry'; -import type { AnonCredsOperationStateAction, AnonCredsOperationStateFailed, AnonCredsOperationStateFinished, AnonCredsOperationStateWait, AnonCredsResolutionMetadata, Extensible } from './base'; +import type { AnonCredsOperationStateAction, AnonCredsOperationStateFailed, AnonCredsOperationStateFinished, AnonCredsOperationStateWait, AnonCredsResolutionMetadata, CredoExtensible } from './base'; - import type { AnonCredsCredentialDefinition } from '../../models/registry'; export interface GetCredentialDefinitionReturn { credentialDefinition?: AnonCredsCredentialDefinition; credentialDefinitionId: string; @@ -157,13 +157,13 @@ index 95c0949..aa82d57 100644 + registrationMetadata: CredoExtensible; } diff --git a/node_modules/@credo-ts/anoncreds/build/services/registry/RevocationRegistryDefinitionOptions.d.ts b/node_modules/@credo-ts/anoncreds/build/services/registry/RevocationRegistryDefinitionOptions.d.ts -index e911d79..df4fa0b 100644 +index 7b9ffde..a3c9a53 100644 --- a/node_modules/@credo-ts/anoncreds/build/services/registry/RevocationRegistryDefinitionOptions.d.ts +++ b/node_modules/@credo-ts/anoncreds/build/services/registry/RevocationRegistryDefinitionOptions.d.ts @@ -1,14 +1,14 @@ --import type { AnonCredsOperationStateWait, AnonCredsOperationStateFailed, AnonCredsOperationStateFinished, AnonCredsResolutionMetadata, Extensible, AnonCredsOperationStateAction } from './base'; -+import type { AnonCredsOperationStateWait, AnonCredsOperationStateFailed, AnonCredsOperationStateFinished, AnonCredsResolutionMetadata, CredoExtensible, AnonCredsOperationStateAction } from './base'; import type { AnonCredsRevocationRegistryDefinition } from '../../models/registry'; +-import type { AnonCredsOperationStateAction, AnonCredsOperationStateFailed, AnonCredsOperationStateFinished, AnonCredsOperationStateWait, AnonCredsResolutionMetadata, Extensible } from './base'; ++import type { AnonCredsOperationStateAction, AnonCredsOperationStateFailed, AnonCredsOperationStateFinished, AnonCredsOperationStateWait, AnonCredsResolutionMetadata, CredoExtensible } from './base'; export interface GetRevocationRegistryDefinitionReturn { revocationRegistryDefinition?: AnonCredsRevocationRegistryDefinition; revocationRegistryDefinitionId: string; @@ -188,14 +188,14 @@ index e911d79..df4fa0b 100644 + registrationMetadata: CredoExtensible; } diff --git a/node_modules/@credo-ts/anoncreds/build/services/registry/RevocationStatusListOptions.d.ts b/node_modules/@credo-ts/anoncreds/build/services/registry/RevocationStatusListOptions.d.ts -index b5ee11d..01b38dd 100644 +index c28d20c..eca15ca 100644 --- a/node_modules/@credo-ts/anoncreds/build/services/registry/RevocationStatusListOptions.d.ts +++ b/node_modules/@credo-ts/anoncreds/build/services/registry/RevocationStatusListOptions.d.ts @@ -1,16 +1,16 @@ --import type { AnonCredsOperationStateWait, AnonCredsOperationStateFailed, AnonCredsOperationStateFinished, AnonCredsResolutionMetadata, Extensible, AnonCredsOperationStateAction } from './base'; -+import type { AnonCredsOperationStateWait, AnonCredsOperationStateFailed, AnonCredsOperationStateFinished, AnonCredsResolutionMetadata, CredoExtensible, AnonCredsOperationStateAction } from './base'; - import type { AnonCredsRevocationStatusList } from '../../models/registry'; import type { Optional } from '@credo-ts/core'; + import type { AnonCredsRevocationStatusList } from '../../models/registry'; +-import type { AnonCredsOperationStateAction, AnonCredsOperationStateFailed, AnonCredsOperationStateFinished, AnonCredsOperationStateWait, AnonCredsResolutionMetadata, Extensible } from './base'; ++import type { AnonCredsOperationStateAction, AnonCredsOperationStateFailed, AnonCredsOperationStateFinished, AnonCredsOperationStateWait, AnonCredsResolutionMetadata, CredoExtensible } from './base'; export interface GetRevocationStatusListReturn { revocationStatusList?: AnonCredsRevocationStatusList; resolutionMetadata: AnonCredsResolutionMetadata; @@ -221,13 +221,13 @@ index b5ee11d..01b38dd 100644 + registrationMetadata: CredoExtensible; } diff --git a/node_modules/@credo-ts/anoncreds/build/services/registry/SchemaOptions.d.ts b/node_modules/@credo-ts/anoncreds/build/services/registry/SchemaOptions.d.ts -index 2743b39..6aee13e 100644 +index fcafaa3..c894be4 100644 --- a/node_modules/@credo-ts/anoncreds/build/services/registry/SchemaOptions.d.ts +++ b/node_modules/@credo-ts/anoncreds/build/services/registry/SchemaOptions.d.ts @@ -1,14 +1,14 @@ + import type { AnonCredsSchema } from '../../models/registry'; -import type { AnonCredsOperationStateAction, AnonCredsOperationStateFailed, AnonCredsOperationStateFinished, AnonCredsOperationStateWait, AnonCredsResolutionMetadata, Extensible } from './base'; +import type { AnonCredsOperationStateAction, AnonCredsOperationStateFailed, AnonCredsOperationStateFinished, AnonCredsOperationStateWait, AnonCredsResolutionMetadata, CredoExtensible } from './base'; - import type { AnonCredsSchema } from '../../models/registry'; export interface GetSchemaReturn { schema?: AnonCredsSchema; schemaId: string; @@ -269,4 +269,4 @@ index 3b37667..931bcc6 100644 +export interface AnonCredsResolutionMetadata extends CredoExtensible { error?: 'invalid' | 'notFound' | 'unsupportedAnonCredsMethod' | string; message?: string; - } \ No newline at end of file + } diff --git a/patches/@credo-ts+core+0.5.15+001+message-type-for-messages.patch b/patches/@credo-ts+core+0.5.15+001+message-type-for-messages.patch deleted file mode 100644 index d4ed27a7..00000000 --- a/patches/@credo-ts+core+0.5.15+001+message-type-for-messages.patch +++ /dev/null @@ -1,43 +0,0 @@ -diff --git a/node_modules/@credo-ts/core/build/agent/EnvelopeService.js b/node_modules/@credo-ts/core/build/agent/EnvelopeService.js -index 72821a7..d11d209 100644 ---- a/node_modules/@credo-ts/core/build/agent/EnvelopeService.js -+++ b/node_modules/@credo-ts/core/build/agent/EnvelopeService.js -@@ -38,6 +38,7 @@ let EnvelopeService = class EnvelopeService { - message: encryptedMessage, - }); - recipientKeysBase58 = [routingKeyBase58]; -+ forwardMessage["messageType"] = message['@type']; - this.logger.debug('Forward message created', forwardMessage); - const forwardJson = forwardMessage.toJSON({ - useDidSovPrefixWhereAllowed: agentContext.config.useDidSovPrefixWhereAllowed, -diff --git a/node_modules/@credo-ts/core/build/modules/routing/messages/ForwardMessage.d.ts b/node_modules/@credo-ts/core/build/modules/routing/messages/ForwardMessage.d.ts -index 4f8577b..396f78a 100644 ---- a/node_modules/@credo-ts/core/build/modules/routing/messages/ForwardMessage.d.ts -+++ b/node_modules/@credo-ts/core/build/modules/routing/messages/ForwardMessage.d.ts -@@ -3,6 +3,7 @@ import { EncryptedMessage } from '../../../types'; - export interface ForwardMessageOptions { - id?: string; - to: string; -+ messageType: string; - message: EncryptedMessage; - } - /** -@@ -19,5 +20,6 @@ export declare class ForwardMessage extends AgentMessage { - readonly type: string; - static readonly type: import("../../../utils/messageType").ParsedMessageType; - to: string; -+ messageType: string; - message: EncryptedMessage; - } -diff --git a/node_modules/@credo-ts/core/build/types.d.ts b/node_modules/@credo-ts/core/build/types.d.ts -index 0d52d00..4bdb736 100644 ---- a/node_modules/@credo-ts/core/build/types.d.ts -+++ b/node_modules/@credo-ts/core/build/types.d.ts -@@ -82,6 +82,7 @@ export interface PlaintextMessage { - thid?: string; - pthid?: string; - }; -+ messageType: string; - [key: string]: unknown; - } - export interface OutboundPackage { diff --git a/patches/@credo-ts+core+0.5.15+003+added-prettyVc-in-JsonCredential-interface.patch b/patches/@credo-ts+core+0.5.15+003+added-prettyVc-in-JsonCredential-interface.patch deleted file mode 100644 index 9619e9c3..00000000 --- a/patches/@credo-ts+core+0.5.15+003+added-prettyVc-in-JsonCredential-interface.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/node_modules/@credo-ts/core/build/modules/credentials/formats/jsonld/JsonLdCredentialFormat.d.ts b/node_modules/@credo-ts/core/build/modules/credentials/formats/jsonld/JsonLdCredentialFormat.d.ts -index d12468b..ae70f36 100644 ---- a/node_modules/@credo-ts/core/build/modules/credentials/formats/jsonld/JsonLdCredentialFormat.d.ts -+++ b/node_modules/@credo-ts/core/build/modules/credentials/formats/jsonld/JsonLdCredentialFormat.d.ts -@@ -10,6 +10,8 @@ export interface JsonCredential { - issuanceDate: string; - expirationDate?: string; - credentialSubject: SingleOrArray; -+ //TODO change type -+ prettyVc?: any; - [key: string]: unknown; - } - /** \ No newline at end of file diff --git a/patches/@credo-ts+core+0.5.15+004+commenting validationPresentation to avoid abandoned issue.patch b/patches/@credo-ts+core+0.5.15+004+commenting validationPresentation to avoid abandoned issue.patch deleted file mode 100644 index 4a87cf28..00000000 --- a/patches/@credo-ts+core+0.5.15+004+commenting validationPresentation to avoid abandoned issue.patch +++ /dev/null @@ -1,27 +0,0 @@ -diff --git a/node_modules/@credo-ts/core/build/modules/proofs/formats/dif-presentation-exchange/DifPresentationExchangeProofFormatService.js b/node_modules/@credo-ts/core/build/modules/proofs/formats/dif-presentation-exchange/DifPresentationExchangeProofFormatService.js -index 7644850..db26554 100644 ---- a/node_modules/@credo-ts/core/build/modules/proofs/formats/dif-presentation-exchange/DifPresentationExchangeProofFormatService.js -+++ b/node_modules/@credo-ts/core/build/modules/proofs/formats/dif-presentation-exchange/DifPresentationExchangeProofFormatService.js -@@ -172,7 +172,8 @@ class DifPresentationExchangeProofFormatService { - try { - ps.validatePresentationDefinition(request.presentation_definition); - ps.validatePresentationSubmission(jsonPresentation.presentation_submission); -- ps.validatePresentation(request.presentation_definition, parsedPresentation); -+ // FIXME: Commenting validatePresentation() for now due to intermittent abandoned issue -+ //ps.validatePresentation(request.presentation_definition, parsedPresentation); - let verificationResult; - // FIXME: for some reason it won't accept the input if it doesn't know - // whether it's a JWT or JSON-LD VP even though the input is the same. -diff --git a/node_modules/@credo-ts/core/build/utils/version.d.ts b/node_modules/@credo-ts/core/build/utils/version.d.ts -index 0ad7e14..e0588dc 100644 ---- a/node_modules/@credo-ts/core/build/utils/version.d.ts -+++ b/node_modules/@credo-ts/core/build/utils/version.d.ts -@@ -1,7 +1,7 @@ - export declare function parseVersionString(version: VersionString): Version; - export declare function isFirstVersionHigherThanSecond(first: Version, second: Version): boolean; - export declare function isFirstVersionEqualToSecond(first: Version, second: Version): boolean; --export type VersionString = `${number}.${number}` | `${number}.${number}.${number}`; -+export type VersionString = string; - export type MajorVersion = number; - export type MinorVersion = number; - export type PatchVersion = number; diff --git a/patches/@credo-ts+core+0.5.15+005+credential-get-format-data.patch b/patches/@credo-ts+core+0.5.15+005+credential-get-format-data.patch deleted file mode 100644 index e0a63329..00000000 --- a/patches/@credo-ts+core+0.5.15+005+credential-get-format-data.patch +++ /dev/null @@ -1,44 +0,0 @@ -diff --git a/node_modules/@credo-ts/core/build/modules/credentials/CredentialsApi.js b/node_modules/@credo-ts/core/build/modules/credentials/CredentialsApi.js -index 7b54cfb..3ed891d 100644 ---- a/node_modules/@credo-ts/core/build/modules/credentials/CredentialsApi.js -+++ b/node_modules/@credo-ts/core/build/modules/credentials/CredentialsApi.js -@@ -415,10 +415,17 @@ let CredentialsApi = class CredentialsApi { - return credentialRecord; - } - async getFormatData(credentialRecordId) { -- const credentialRecord = await this.getById(credentialRecordId); -- const protocol = this.getProtocol(credentialRecord.protocolVersion); -- return protocol.getFormatData(this.agentContext, credentialRecordId); -+ try { -+ const credentialRecord = await this.getById(credentialRecordId); -+ const protocol = this.getProtocol(credentialRecord.protocolVersion); -+ return protocol.getFormatData(this.agentContext, credentialRecordId); -+ } catch (error) { -+ this.logger?.error?.(`Error in getFormatData for credential ID ${credentialRecordId}: ${error?.message}`, error); -+ return null; // Prevents application from crashing -+ } - } -+ -+ - /** - * Retrieve a credential record by id - * -@@ -500,11 +507,11 @@ exports.CredentialsApi = CredentialsApi = __decorate([ - (0, plugins_1.injectable)(), - __param(3, (0, plugins_1.inject)(constants_1.InjectionSymbols.Logger)), - __metadata("design:paramtypes", [MessageSender_1.MessageSender, -- services_1.ConnectionService, -- agent_1.AgentContext, Object, CredentialRepository_1.CredentialRepository, -- RoutingService_1.RoutingService, -- DidCommMessageRepository_1.DidCommMessageRepository, -- services_2.RevocationNotificationService, -- CredentialsModuleConfig_1.CredentialsModuleConfig]) -+ services_1.ConnectionService, -+ agent_1.AgentContext, Object, CredentialRepository_1.CredentialRepository, -+ RoutingService_1.RoutingService, -+ DidCommMessageRepository_1.DidCommMessageRepository, -+ services_2.RevocationNotificationService, -+ CredentialsModuleConfig_1.CredentialsModuleConfig]) - ], CredentialsApi); - //# sourceMappingURL=CredentialsApi.js.map -\ No newline at end of file diff --git a/patches/@credo-ts+core+0.6.0-alpha-20250325224513+001+fix: message type for message.patch b/patches/@credo-ts+core+0.6.0-alpha-20250325224513+001+fix: message type for message.patch new file mode 100644 index 00000000..ce9e2a5e --- /dev/null +++ b/patches/@credo-ts+core+0.6.0-alpha-20250325224513+001+fix: message type for message.patch @@ -0,0 +1,12 @@ +diff --git a/node_modules/@credo-ts/core/build/types.d.ts b/node_modules/@credo-ts/core/build/types.d.ts +index 964f309..4447f64 100644 +--- a/node_modules/@credo-ts/core/build/types.d.ts ++++ b/node_modules/@credo-ts/core/build/types.d.ts +@@ -88,6 +88,7 @@ export interface PlaintextMessage { + thid?: string; + pthid?: string; + }; ++ messageType?: string; + [key: string]: unknown; + } + export type EncryptedMessage = { diff --git a/patches/@credo-ts+didcomm+0.6.0-alpha-20250325224513+001+fix: message type for message.patch b/patches/@credo-ts+didcomm+0.6.0-alpha-20250325224513+001+fix: message type for message.patch new file mode 100644 index 00000000..7e6d0d21 --- /dev/null +++ b/patches/@credo-ts+didcomm+0.6.0-alpha-20250325224513+001+fix: message type for message.patch @@ -0,0 +1,31 @@ +diff --git a/node_modules/@credo-ts/didcomm/build/EnvelopeService.js b/node_modules/@credo-ts/didcomm/build/EnvelopeService.js +index c0c84d4..0752b11 100644 +--- a/node_modules/@credo-ts/didcomm/build/EnvelopeService.js ++++ b/node_modules/@credo-ts/didcomm/build/EnvelopeService.js +@@ -38,6 +38,7 @@ let EnvelopeService = class EnvelopeService { + message: encryptedMessage, + }); + recipientKeysBase58 = [routingKeyBase58]; ++ forwardMessage["messageType"] = message['@type']; + this.logger.debug('Forward message created', forwardMessage); + const forwardJson = forwardMessage.toJSON({ + useDidSovPrefixWhereAllowed: didcommConfig.useDidSovPrefixWhereAllowed, +diff --git a/node_modules/@credo-ts/didcomm/build/modules/routing/messages/ForwardMessage.d.ts b/node_modules/@credo-ts/didcomm/build/modules/routing/messages/ForwardMessage.d.ts +index 108b477..d307051 100644 +--- a/node_modules/@credo-ts/didcomm/build/modules/routing/messages/ForwardMessage.d.ts ++++ b/node_modules/@credo-ts/didcomm/build/modules/routing/messages/ForwardMessage.d.ts +@@ -3,6 +3,7 @@ import { EncryptedMessage } from '../../../types'; + export interface ForwardMessageOptions { + id?: string; + to: string; ++ messageType: string; + message: EncryptedMessage; + } + /** +@@ -19,5 +20,6 @@ export declare class ForwardMessage extends AgentMessage { + readonly type: string; + static readonly type: import("../../../util/messageType").ParsedMessageType; + to: string; ++ messageType: string; + message: EncryptedMessage; + } diff --git a/patches/@credo-ts+tenants+0.5.3+001+cache-tenant-record-patch.patch b/patches/@credo-ts+tenants+0.5.3+001+cache-tenant-record-patch.patch deleted file mode 100644 index 8c03a89d..00000000 --- a/patches/@credo-ts+tenants+0.5.3+001+cache-tenant-record-patch.patch +++ /dev/null @@ -1,56 +0,0 @@ -diff --git a/node_modules/@credo-ts/tenants/build/context/TenantAgentContextProvider.d.ts b/node_modules/@credo-ts/tenants/build/context/TenantAgentContextProvider.d.ts -index 91bb8f4..b4dae61 100644 ---- a/node_modules/@credo-ts/tenants/build/context/TenantAgentContextProvider.d.ts -+++ b/node_modules/@credo-ts/tenants/build/context/TenantAgentContextProvider.d.ts -@@ -1,5 +1,5 @@ - import type { TenantRecord } from '../repository'; --import type { AgentContextProvider, UpdateAssistantUpdateOptions } from '@credo-ts/core'; -+import type { AgentContextProvider, UpdateAssistantUpdateOptions , CacheModule, InMemoryLruCache } from '@credo-ts/core'; - import { AgentContext, EventEmitter, Logger } from '@credo-ts/core'; - import { TenantRecordService } from '../services'; - import { TenantSessionCoordinator } from './TenantSessionCoordinator'; -@@ -9,7 +9,9 @@ export declare class TenantAgentContextProvider implements AgentContextProvider - private eventEmitter; - private logger; - private tenantSessionCoordinator; -- constructor(tenantRecordService: TenantRecordService, rootAgentContext: AgentContext, eventEmitter: EventEmitter, tenantSessionCoordinator: TenantSessionCoordinator, logger: Logger); -+ private cacheModule; -+ private inMemoryLruCache; -+ constructor(tenantRecordService: TenantRecordService, rootAgentContext: AgentContext, eventEmitter: EventEmitter, tenantSessionCoordinator: TenantSessionCoordinator, logger: Logger, cache: InMemoryLruCache); - getAgentContextForContextCorrelationId(contextCorrelationId: string): Promise; - getContextForInboundMessage(inboundMessage: unknown, options?: { - contextCorrelationId?: string; -diff --git a/node_modules/@credo-ts/tenants/build/context/TenantAgentContextProvider.js b/node_modules/@credo-ts/tenants/build/context/TenantAgentContextProvider.js -index d491d4e..d60ec79 100644 ---- a/node_modules/@credo-ts/tenants/build/context/TenantAgentContextProvider.js -+++ b/node_modules/@credo-ts/tenants/build/context/TenantAgentContextProvider.js -@@ -24,16 +24,28 @@ let TenantAgentContextProvider = class TenantAgentContextProvider { - this.eventEmitter = eventEmitter; - this.tenantSessionCoordinator = tenantSessionCoordinator; - this.logger = logger; -+ this.cache = new core_1.CacheModule({ -+ cache: new core_1.InMemoryLruCache({ limit: 100 }), -+ }); - // Start listener for newly created routing keys, so we can register a mapping for each new key for the tenant - this.listenForRoutingKeyCreatedEvents(); - } - async getAgentContextForContextCorrelationId(contextCorrelationId) { -+ this.logger.debug('debug ========= Inside getAgentContextForContextCorrelationId') - // It could be that the root agent context is requested, in that case we return the root agent context - if (contextCorrelationId === this.rootAgentContext.contextCorrelationId) { - return this.rootAgentContext; - } - // TODO: maybe we can look at not having to retrieve the tenant record if there's already a context available. -- const tenantRecord = await this.tenantRecordService.getTenantById(this.rootAgentContext, contextCorrelationId); -+ this.logger.debug('debug ========= Get tenantRecord from cache') -+ let tenantRecord = await this.cache.config.cache.get(this.rootAgentContext, `contextCorrelationId-${contextCorrelationId}`) -+ if(!tenantRecord) { -+ // TODO: maybe we can look at not having to retrieve the tenant record if there's already a context available. -+ this.logger.debug('debug ========= TenantRecord not found in cache') -+ tenantRecord = await this.tenantRecordService.getTenantById(this.rootAgentContext, contextCorrelationId) -+ await this.cache.config.cache.set(this.rootAgentContext,`contextCorrelationId-${contextCorrelationId}`,tenantRecord) -+ this.logger.debug(`debug ========= Cached tenant agent context for tenant '${contextCorrelationId}'`) -+ } - const shouldUpdate = !(0, core_1.isStorageUpToDate)(tenantRecord.storageVersion); - // If the tenant storage is not up to date, and autoUpdate is disabled we throw an error - if (shouldUpdate && !this.rootAgentContext.config.autoUpdateStorageOnStartup) { \ No newline at end of file diff --git a/src/cliAgent.ts b/src/cliAgent.ts index 3fc9272d..8e876a28 100644 --- a/src/cliAgent.ts +++ b/src/cliAgent.ts @@ -14,27 +14,35 @@ import { } from '@credo-ts/anoncreds' import { AskarModule, AskarMultiWalletDatabaseScheme } from '@credo-ts/askar' import { - AutoAcceptCredential, - AutoAcceptProof, DidsModule, - ProofsModule, - V2ProofProtocol, - CredentialsModule, - V2CredentialProtocol, - ConnectionsModule, W3cCredentialsModule, KeyDidRegistrar, KeyDidResolver, CacheModule, InMemoryLruCache, WebDidResolver, + LogLevel, + Agent +} from '@credo-ts/core' +import { HttpOutboundTransport, WsOutboundTransport, - LogLevel, - Agent, JsonLdCredentialFormatService, DifPresentationExchangeProofFormatService, -} from '@credo-ts/core' + ConnectionsModule, + ProofsModule, + AutoAcceptCredential, + AutoAcceptProof, + V2ProofProtocol, + CredentialsModule, + V2CredentialProtocol, + DidCommModule, + OutOfBandModule, + MediationRecipientModule, + BasicMessagesModule, + MessagePickupModule, + DiscoverFeaturesModule, +} from '@credo-ts/didcomm' import { IndyVdrAnonCredsRegistry, IndyVdrIndyDidResolver, @@ -45,7 +53,7 @@ import { agentDependencies, HttpInboundTransport, WsInboundTransport } from '@cr import { QuestionAnswerModule } from '@credo-ts/question-answer' import { TenantsModule } from '@credo-ts/tenants' import { anoncreds } from '@hyperledger/anoncreds-nodejs' -import { ariesAskar } from '@hyperledger/aries-askar-nodejs' +import { askar} from '@openwallet-foundation/askar-nodejs' import { indyVdr } from '@hyperledger/indy-vdr-nodejs' import axios from 'axios' import { readFile } from 'fs/promises' @@ -56,6 +64,12 @@ import { isCustomDocumentLoaderEnabled } from './utils/config' import { CustomDocumentLoader } from './utils/customDocumentLoader' import { generateSecretKey } from './utils/helpers' import { TsLogger } from './utils/logger' +import { OpenId4VcHolderModule, OpenId4VcIssuerModule, OpenId4VcVerifierModule } from '@credo-ts/openid4vc' +import { Router } from 'express' +import { getCredentialRequestToCredentialMapper } from './utils/oid4vc-agent' + +const openId4VciRouter = Router() +const openId4VpRouter = Router() export type Transports = 'ws' | 'http' export type InboundTransport = { @@ -137,7 +151,7 @@ const getModules = ( const presentationExchangeProofFormatService = new DifPresentationExchangeProofFormatService() return { askar: new AskarModule({ - ariesAskar, + askar, multiWalletDatabaseScheme: walletScheme || AskarMultiWalletDatabaseScheme.ProfilePerWallet, }), @@ -190,6 +204,14 @@ const getModules = ( documentLoader: CustomDocumentLoader, }) : new W3cCredentialsModule(), + didcomm: new DidCommModule({ + processDidCommMessagesConcurrently: true + }), + 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 }), }), @@ -205,6 +227,21 @@ const getModules = ( rpcUrl: rpcUrl ? rpcUrl : (process.env.RPC_URL as string), serverUrl: fileServerUrl ? fileServerUrl : (process.env.SERVER_URL as string), }), + openId4VcVerifier: new OpenId4VcVerifierModule({ + baseUrl: `http://${process.env.APP_URL}/oid4vp`, + router: openId4VpRouter, + }), + openId4VcIssuer: new OpenId4VcIssuerModule({ + baseUrl: `http://${process.env.APP_URL}/oid4vci`, + router: openId4VciRouter, + statefulCredentialOfferExpirationInSeconds: Number(process.env.OPENID_CRED_OFFER_EXPIRY) || 3600, + accessTokenExpiresInSeconds: Number(process.env.OPENID_ACCESS_TOKEN_EXPIRY) || 3600, + authorizationCodeExpiresInSeconds: Number(process.env.OPENID_AUTH_CODE_EXPIRY) || 3600, + cNonceExpiresInSeconds: Number(process.env.OPENID_CNONCE_EXPIRY) || 3600, + dpopRequired: false, + credentialRequestToCredentialMapper: (...args) => getCredentialRequestToCredentialMapper()(...args), + }), + openId4VcHolderModule: new OpenId4VcHolderModule(), } } @@ -299,8 +336,7 @@ export async function runRestAgent(restConfig: AriesRestConfig) { 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 - processDidCommMessagesConcurrently: true, + // Setting it for now //TODO: check if this is needed } async function fetchLedgerData(ledgerConfig: { @@ -387,8 +423,8 @@ export async function runRestAgent(restConfig: AriesRestConfig) { modules: { ...(afjConfig.tenancy ? { - ...tenantModule, - } + ...tenantModule, + } : {}), ...modules, }, @@ -398,13 +434,26 @@ export async function runRestAgent(restConfig: AriesRestConfig) { // Register outbound transports for (const outboundTransport of outboundTransports) { const OutboundTransport = outboundTransportMapping[outboundTransport] - agent.registerOutboundTransport(new OutboundTransport()) + 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] - agent.registerInboundTransport(new InboundTransport({ port: inboundTransport.port })) + const transport = new InboundTransport({ port: inboundTransport.port }) + agent.modules.didcomm.registerInboundTransport(transport) + + // Configure the oid4vc routers on the http inbound transport + if (transport instanceof HttpInboundTransport) { + transport.app.use('/oid4vci', modules.openId4VcIssuer.config.router as any) + transport.app.use('/oid4vp', modules.openId4VcVerifier.config.router as any) + } } await agent.initialize() diff --git a/src/controllers/agent/AgentController.ts b/src/controllers/agent/AgentController.ts index cb203190..55fd3b76 100644 --- a/src/controllers/agent/AgentController.ts +++ b/src/controllers/agent/AgentController.ts @@ -40,7 +40,7 @@ export class AgentController extends Controller { try { return { label: request.agent.config.label, - endpoints: request.agent.config.endpoints, + endpoints: request.agent.modules.didcomm.config.endpoints, isInitialized: request.agent.isInitialized, publicDid: undefined, } diff --git a/src/controllers/did/DidController.ts b/src/controllers/did/DidController.ts index c5427216..8441d148 100644 --- a/src/controllers/did/DidController.ts +++ b/src/controllers/did/DidController.ts @@ -110,7 +110,7 @@ export class DidController extends Controller { throw Error('keyType is required') } - const didRouting = await agent.mediationRecipient.getRouting({}) + const didRouting = await agent.modules.mediationRecipient.getRouting({}) const didDocument = createPeerDidDocumentFromServices([ { id: 'didcomm', diff --git a/src/controllers/didcomm/basic-messages/BasicMessageController.ts b/src/controllers/didcomm/basic-messages/BasicMessageController.ts index 9ba075cd..ecd5e81c 100644 --- a/src/controllers/didcomm/basic-messages/BasicMessageController.ts +++ b/src/controllers/didcomm/basic-messages/BasicMessageController.ts @@ -1,4 +1,4 @@ -import type { BasicMessageRecord, BasicMessageStorageProps } from '@credo-ts/core' +import type { BasicMessageRecord, BasicMessageStorageProps } from '@credo-ts/didcomm' import { Request as Req } from 'express' import { Body, Controller, Example, Get, Path, Post, Route, Tags, Security, Request } from 'tsoa' @@ -26,7 +26,7 @@ export class BasicMessageController extends Controller { @Path('connectionId') connectionId: RecordId, ): Promise { try { - const basicMessageRecords = await request.agent.basicMessages.findAllByQuery({ connectionId }) + const basicMessageRecords = await request.agent.modules.basicMessages.findAllByQuery({ connectionId }) this.setStatus(200) return basicMessageRecords } catch (error) { @@ -48,7 +48,7 @@ export class BasicMessageController extends Controller { @Body() body: Record<'content', string>, ) { try { - const basicMessageRecord = await request.agent.basicMessages.sendMessage(connectionId, body.content) + const basicMessageRecord = await request.agent.modules.basicMessages.sendMessage(connectionId, body.content) this.setStatus(201) return basicMessageRecord } catch (error) { diff --git a/src/controllers/didcomm/connections/ConnectionController.ts b/src/controllers/didcomm/connections/ConnectionController.ts index db7cc602..ce6c0ac9 100644 --- a/src/controllers/didcomm/connections/ConnectionController.ts +++ b/src/controllers/didcomm/connections/ConnectionController.ts @@ -1,6 +1,6 @@ -import type { ConnectionRecordProps } from '@credo-ts/core' +import type { ConnectionRecordProps } from '@credo-ts/didcomm' -import { DidExchangeState } from '@credo-ts/core' +import { DidExchangeState } from '@credo-ts/didcomm' import { Request as Req } from 'express' import { Controller, Delete, Example, Get, Path, Post, Query, Route, Tags, Security, Request } from 'tsoa' import { injectable } from 'tsyringe' @@ -36,7 +36,7 @@ export class ConnectionController extends Controller { @Query('theirLabel') theirLabel?: string, ) { try { - const connections = await request.agent.connections.findAllByQuery({ + const connections = await request.agent.modules.connections.findAllByQuery({ outOfBandId, alias, myDid, @@ -61,7 +61,7 @@ export class ConnectionController extends Controller { @Get('/didcomm/connections/:connectionId') public async getConnectionById(@Request() request: Req, @Path('connectionId') connectionId: RecordId) { try { - const connection = await request.agent.connections.findById(connectionId) + const connection = await request.agent.modules.connections.findById(connectionId) if (!connection) throw new NotFoundError(`Connection with connection id "${connectionId}" not found.`) @@ -81,7 +81,7 @@ export class ConnectionController extends Controller { public async deleteConnection(@Request() request: Req, @Path('connectionId') connectionId: RecordId) { try { this.setStatus(204) - await request.agent.connections.deleteById(connectionId) + await request.agent.modules.connections.deleteById(connectionId) } catch (error) { throw ErrorHandlingService.handle(error) } @@ -101,7 +101,7 @@ export class ConnectionController extends Controller { @Post('/didcomm/connections/:connectionId/accept-request') public async acceptRequest(@Request() request: Req, @Path('connectionId') connectionId: RecordId) { try { - const connection = await request.agent.connections.acceptRequest(connectionId) + const connection = await request.agent.modules.connections.acceptRequest(connectionId) return connection.toJSON() } catch (error) { throw ErrorHandlingService.handle(error) @@ -122,7 +122,7 @@ export class ConnectionController extends Controller { @Post('/didcomm/connections/:connectionId/accept-response') public async acceptResponse(@Request() request: Req, @Path('connectionId') connectionId: RecordId) { try { - const connection = await request.agent.connections.acceptResponse(connectionId) + const connection = await request.agent.modules.connections.acceptResponse(connectionId) return connection.toJSON() } catch (error) { throw ErrorHandlingService.handle(error) @@ -132,13 +132,12 @@ export class ConnectionController extends Controller { @Get('/didcomm/url/:invitationId') public async getInvitation(@Request() request: Req, @Path('invitationId') invitationId: string) { try { - const outOfBandRecord = await request.agent.oob.findByCreatedInvitationId(invitationId) + const outOfBandRecord = await request.agent.modules.connections.findByInvitationDid(invitationId) - if (!outOfBandRecord || outOfBandRecord.state !== 'await-response') + if (!outOfBandRecord) throw new NotFoundError(`connection with invitationId "${invitationId}" not found.`) - const invitationJson = outOfBandRecord.outOfBandInvitation.toJSON({ useDidSovPrefixWhereAllowed: true }) - return invitationJson + return outOfBandRecord } catch (error) { throw ErrorHandlingService.handle(error) } diff --git a/src/controllers/didcomm/credentials/CredentialController.ts b/src/controllers/didcomm/credentials/CredentialController.ts index 2cacc5bf..76f38fb0 100644 --- a/src/controllers/didcomm/credentials/CredentialController.ts +++ b/src/controllers/didcomm/credentials/CredentialController.ts @@ -1,17 +1,19 @@ import type { - CredentialExchangeRecordProps, - CredentialProtocolVersionType, PeerDidNumAlgo2CreateOptions, - Routing, } from '@credo-ts/core' import { - CredentialState, W3cCredentialService, - CredentialRole, 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' @@ -60,7 +62,7 @@ export class CredentialController extends Controller { @Query('role') role?: CredentialRole, ) { try { - const credentials = await request.agent.credentials.findAllByQuery({ + const credentials = await request.agent.modules.credentials.findAllByQuery({ connectionId, threadId, state, @@ -110,7 +112,7 @@ export class CredentialController extends Controller { @Get('/:credentialRecordId') public async getCredentialById(@Request() request: Req, @Path('credentialRecordId') credentialRecordId: RecordId) { try { - const credential = await request.agent.credentials.getById(credentialRecordId) + const credential = await request.agent.modules.credentials.getById(credentialRecordId) return credential.toJSON() } catch (error) { throw ErrorHandlingService.handle(error) @@ -128,7 +130,7 @@ export class CredentialController extends Controller { @Post('/propose-credential') public async proposeCredential(@Request() request: Req, @Body() proposeCredentialOptions: ProposeCredentialOptions) { try { - const credential = await request.agent.credentials.proposeCredential(proposeCredentialOptions) + const credential = await request.agent.modules.credentials.proposeCredential(proposeCredentialOptions) return credential } catch (error) { throw ErrorHandlingService.handle(error) @@ -150,7 +152,7 @@ export class CredentialController extends Controller { @Body() acceptCredentialProposal: AcceptCredentialProposalOptions, ) { try { - const credential = await request.agent.credentials.acceptProposal(acceptCredentialProposal) + const credential = await request.agent.modules.credentials.acceptProposal(acceptCredentialProposal) return credential } catch (error) { @@ -169,7 +171,7 @@ export class CredentialController extends Controller { @Post('/create-offer') public async createOffer(@Request() request: Req, @Body() createOfferOptions: CreateOfferOptions) { try { - const offer = await request.agent.credentials.offerCredential(createOfferOptions) + const offer = await request.agent.modules.credentials.offerCredential(createOfferOptions) return offer } catch (error) { throw ErrorHandlingService.handle(error) @@ -186,7 +188,7 @@ export class CredentialController extends Controller { if (outOfBandOption?.invitationDid) { invitationDid = outOfBandOption?.invitationDid } else { - routing = await request.agent.mediationRecipient.getRouting({}) + routing = await request.agent.modules.mediationRecipient.getRouting({}) const didDocument = createPeerDidDocumentFromServices([ { id: 'didcomm', @@ -205,7 +207,7 @@ export class CredentialController extends Controller { invitationDid = did.didState.did } - const offerOob = await request.agent.credentials.createOffer({ + const offerOob = await request.agent.modules.credentials.createOffer({ protocolVersion: outOfBandOption.protocolVersion as CredentialProtocolVersionType<[]>, credentialFormats: outOfBandOption.credentialFormats, autoAcceptCredential: outOfBandOption.autoAcceptCredential, @@ -213,7 +215,7 @@ export class CredentialController extends Controller { }) const credentialMessage = offerOob.message - const outOfBandRecord = await request.agent.oob.createInvitation({ + const outOfBandRecord = await request.agent.modules.oob.createInvitation({ label: outOfBandOption.label, messages: [credentialMessage], autoAcceptConnection: true, @@ -223,10 +225,10 @@ export class CredentialController extends Controller { }) return { invitationUrl: outOfBandRecord.outOfBandInvitation.toUrl({ - domain: request.agent.config.endpoints[0], + domain: request.agent.modules.didcomm.config.endpoints[0], }), invitation: outOfBandRecord.outOfBandInvitation.toJSON({ - useDidSovPrefixWhereAllowed: request.agent.config.useDidSovPrefixWhereAllowed, + useDidSovPrefixWhereAllowed: request.agent.modules.didcomm.config.useDidSovPrefixWhereAllowed, }), outOfBandRecord: outOfBandRecord.toJSON(), outOfBandRecordId: outOfBandRecord.id, @@ -251,7 +253,7 @@ export class CredentialController extends Controller { public async acceptOffer(@Request() request: Req, @Body() acceptCredentialOfferOptions: CredentialOfferOptions) { try { await this.ensureLinkSecretExists(request.agent) - const acceptOffer = await request.agent.credentials.acceptOffer(acceptCredentialOfferOptions) + const acceptOffer = await request.agent.modules.credentials.acceptOffer(acceptCredentialOfferOptions) return acceptOffer } catch (error) { throw ErrorHandlingService.handle(error) @@ -273,7 +275,7 @@ export class CredentialController extends Controller { @Body() acceptCredentialRequestOptions: AcceptCredentialRequestOptions, ) { try { - const credential = await request.agent.credentials.acceptRequest(acceptCredentialRequestOptions) + const credential = await request.agent.modules.credentials.acceptRequest(acceptCredentialRequestOptions) return credential } catch (error) { throw ErrorHandlingService.handle(error) @@ -291,7 +293,7 @@ export class CredentialController extends Controller { @Post('/accept-credential') public async acceptCredential(@Request() request: Req, @Body() acceptCredential: AcceptCredential) { try { - const credential = await request.agent.credentials.acceptCredential(acceptCredential) + const credential = await request.agent.modules.credentials.acceptCredential(acceptCredential) return credential } catch (error) { throw ErrorHandlingService.handle(error) @@ -307,7 +309,7 @@ export class CredentialController extends Controller { @Get('/:credentialRecordId/form-data') public async credentialFormData(@Request() request: Req, @Path('credentialRecordId') credentialRecordId: string) { try { - const credentialDetails = await request.agent.credentials.getFormatData(credentialRecordId) + const credentialDetails = await request.agent.modules.credentials.getFormatData(credentialRecordId) return credentialDetails } catch (error) { throw ErrorHandlingService.handle(error) diff --git a/src/controllers/didcomm/outofband/OutOfBandController.ts b/src/controllers/didcomm/outofband/OutOfBandController.ts index ff5d40e4..8af9eea9 100644 --- a/src/controllers/didcomm/outofband/OutOfBandController.ts +++ b/src/controllers/didcomm/outofband/OutOfBandController.ts @@ -1,21 +1,24 @@ import type { OutOfBandInvitationProps, OutOfBandRecordWithInvitationProps } from '../../examples' import type { AgentMessageType, RecipientKeyOption, CreateInvitationOptions } from '../../types' import type { - ConnectionRecordProps, - CreateLegacyInvitationConfig, PeerDidNumAlgo2CreateOptions, - Routing, } from '@credo-ts/core' import { - AgentMessage, JsonTransformer, - OutOfBandInvitation, Key, KeyType, createPeerDidDocumentFromServices, PeerDidNumAlgo, } from '@credo-ts/core' + +import { + ConnectionRecordProps, + CreateLegacyInvitationConfig, + Routing, + OutOfBandInvitation, + AgentMessage +} from '@credo-ts/didcomm' import { Request as Req } from 'express' import { Body, Controller, Delete, Example, Get, Path, Post, Query, Route, Tags, Security, Request } from 'tsoa' import { injectable } from 'tsyringe' @@ -45,7 +48,7 @@ export class OutOfBandController extends Controller { invitationId: invitationId, } : {} - const outOfBandRecords = await request.agent.oob.findAllByQuery(query) + const outOfBandRecords = await request.agent.modules.oob.findAllByQuery(query) return outOfBandRecords.map((c) => c.toJSON()) } catch (error) { @@ -62,7 +65,7 @@ export class OutOfBandController extends Controller { @Get('/:outOfBandId') public async getOutOfBandRecordById(@Request() request: Req, @Path('outOfBandId') outOfBandId: RecordId) { try { - const outOfBandRecord = await request.agent.oob.findById(outOfBandId) + const outOfBandRecord = await request.agent.modules.oob.findById(outOfBandId) if (!outOfBandRecord) throw new NotFoundError(`Out of band record with id "${outOfBandId}" not found.`) @@ -97,7 +100,7 @@ export class OutOfBandController extends Controller { if (config?.invitationDid) { invitationDid = config?.invitationDid } else { - const didRouting = await request.agent.mediationRecipient.getRouting({}) + const didRouting = await request.agent.modules.mediationRecipient.getRouting({}) const didDocument = createPeerDidDocumentFromServices([ { id: 'didcomm', @@ -121,13 +124,13 @@ export class OutOfBandController extends Controller { } } - const outOfBandRecord = await request.agent.oob.createInvitation({ ...config, invitationDid }) + const outOfBandRecord = await request.agent.modules.oob.createInvitation({ ...config, invitationDid }) return { invitationUrl: outOfBandRecord.outOfBandInvitation.toUrl({ - domain: request.agent.config.endpoints[0], + domain: request.agent.modules.didcomm.config.endpoints[0], }), invitation: outOfBandRecord.outOfBandInvitation.toJSON({ - useDidSovPrefixWhereAllowed: request.agent.config.useDidSovPrefixWhereAllowed, + useDidSovPrefixWhereAllowed: request.agent.modules.didcomm.config.useDidSovPrefixWhereAllowed, }), outOfBandRecord: outOfBandRecord.toJSON(), invitationDid: config?.invitationDid ? '' : invitationDid, @@ -158,25 +161,25 @@ export class OutOfBandController extends Controller { let routing: Routing if (config?.recipientKey) { routing = { - endpoints: request.agent.config.endpoints, + endpoints: request.agent.modules.didcomm.config.endpoints, routingKeys: [], recipientKey: Key.fromPublicKeyBase58(config.recipientKey, KeyType.Ed25519), mediatorId: undefined, } } else { - routing = await request.agent.mediationRecipient.getRouting({}) + routing = await request.agent.modules.mediationRecipient.getRouting({}) } - const { outOfBandRecord, invitation } = await request.agent.oob.createLegacyInvitation({ + const { outOfBandRecord, invitation } = await request.agent.modules.oob.createLegacyInvitation({ ...config, routing, }) return { invitationUrl: invitation.toUrl({ - domain: request.agent.config.endpoints[0], - useDidSovPrefixWhereAllowed: request.agent.config.useDidSovPrefixWhereAllowed, + domain: request.agent.modules.didcomm.config.endpoints[0], + useDidSovPrefixWhereAllowed: request.agent.modules.didcomm.config.useDidSovPrefixWhereAllowed, }), invitation: invitation.toJSON({ - useDidSovPrefixWhereAllowed: request.agent.config.useDidSovPrefixWhereAllowed, + useDidSovPrefixWhereAllowed: request.agent.modules.didcomm.config.useDidSovPrefixWhereAllowed, }), outOfBandRecord: outOfBandRecord.toJSON(), ...(config?.recipientKey ? {} : { recipientKey: routing.recipientKey.publicKeyBase58 }), @@ -205,14 +208,15 @@ export class OutOfBandController extends Controller { @Body() config: { recordId: string - message: AgentMessageType - domain: string + message: Record; + domain: string, + routing?: Routing; }, ) { try { - const agentMessage = JsonTransformer.fromJSON(config.message, AgentMessage) + const agentMessage = JsonTransformer.fromJSON(config.message, AgentMessage) as AgentMessage - return await request.agent.oob.createLegacyConnectionlessInvitation({ + return await request.agent.modules.oob.createLegacyConnectionlessInvitation({ ...config, message: agentMessage, }) @@ -239,7 +243,7 @@ export class OutOfBandController extends Controller { try { const invite = new OutOfBandInvitation({ ...invitation, handshakeProtocols: invitation.handshake_protocols }) - const { outOfBandRecord, connectionRecord } = await request.agent.oob.receiveInvitation(invite, config) + const { outOfBandRecord, connectionRecord } = await request.agent.modules.oob.receiveInvitation(invite, config) return { outOfBandRecord: outOfBandRecord.toJSON(), @@ -274,7 +278,7 @@ export class OutOfBandController extends Controller { // if (linkSecretIds.length === 0) { // await request.agent.modules.anoncreds.createLinkSecret() // } - const { outOfBandRecord, connectionRecord } = await request.agent.oob.receiveInvitationFromUrl( + const { outOfBandRecord, connectionRecord } = await request.agent.modules.oob.receiveInvitationFromUrl( invitationUrl, config, ) @@ -302,7 +306,7 @@ export class OutOfBandController extends Controller { @Body() acceptInvitationConfig: AcceptInvitationConfig, ) { try { - const { outOfBandRecord, connectionRecord } = await request.agent.oob.acceptInvitation( + const { outOfBandRecord, connectionRecord } = await request.agent.modules.oob.acceptInvitation( outOfBandId, acceptInvitationConfig, ) @@ -325,7 +329,7 @@ export class OutOfBandController extends Controller { public async deleteOutOfBandRecord(@Request() request: Req, @Path('outOfBandId') outOfBandId: RecordId) { try { this.setStatus(204) - await request.agent.oob.deleteById(outOfBandId) + await request.agent.modules.oob.deleteById(outOfBandId) } catch (error) { throw ErrorHandlingService.handle(error) } diff --git a/src/controllers/didcomm/proofs/ProofController.ts b/src/controllers/didcomm/proofs/ProofController.ts index b2b99e9f..55b8de31 100644 --- a/src/controllers/didcomm/proofs/ProofController.ts +++ b/src/controllers/didcomm/proofs/ProofController.ts @@ -1,10 +1,13 @@ import type { - AcceptProofRequestOptions, PeerDidNumAlgo2CreateOptions, +} from '@credo-ts/core' + +import { + AcceptProofRequestOptions, ProofExchangeRecordProps, ProofsProtocolVersionType, Routing, -} from '@credo-ts/core' +} from '@credo-ts/didcomm' import { PeerDidNumAlgo, createPeerDidDocumentFromServices } from '@credo-ts/core' import { Request as Req } from 'express' @@ -37,7 +40,7 @@ export class ProofController extends Controller { public async getAllProofs(@Request() request: Req, @Query('threadId') threadId?: string) { try { const query = threadId ? { threadId } : {} - const proofs = await request.agent.proofs.findAllByQuery(query) + const proofs = await request.agent.modules.proofs.findAllByQuery(query) return proofs.map((proof) => proof.toJSON()) } catch (error) { @@ -55,7 +58,7 @@ export class ProofController extends Controller { @Example(ProofRecordExample) public async getProofById(@Request() request: Req, @Path('proofRecordId') proofRecordId: RecordId) { try { - const proof = await request.agent.proofs.getById(proofRecordId) + const proof = await request.agent.modules.proofs.getById(proofRecordId) return proof.toJSON() } catch (error) { @@ -74,7 +77,7 @@ export class ProofController extends Controller { @Example(ProofRecordExample) public async proposeProof(@Request() request: Req, @Body() requestProofProposalOptions: RequestProofProposalOptions) { try { - const proof = await request.agent.proofs.proposeProof({ + const proof = await request.agent.modules.proofs.proposeProof({ connectionId: requestProofProposalOptions.connectionId, protocolVersion: 'v1' as ProofsProtocolVersionType<[]>, proofFormats: requestProofProposalOptions.proofFormats, @@ -102,7 +105,7 @@ export class ProofController extends Controller { @Example(ProofRecordExample) public async acceptProposal(@Request() request: Req, @Body() acceptProposal: AcceptProofProposal) { try { - const proof = await request.agent.proofs.acceptProposal(acceptProposal) + const proof = await request.agent.modules.proofs.acceptProposal(acceptProposal) return proof } catch (error) { @@ -127,7 +130,7 @@ export class ProofController extends Controller { parentThreadId: requestProofOptions.parentThreadId, willConfirm: requestProofOptions.willConfirm, } - const proof = await request.agent.proofs.requestProof(requestProofPayload) + const proof = await request.agent.modules.proofs.requestProof(requestProofPayload) return proof } catch (error) { @@ -148,7 +151,7 @@ export class ProofController extends Controller { if (createRequestOptions?.invitationDid) { invitationDid = createRequestOptions?.invitationDid } else { - routing = await request.agent.mediationRecipient.getRouting({}) + routing = await request.agent.modules.mediationRecipient.getRouting({}) const didDocument = createPeerDidDocumentFromServices([ { id: 'didcomm', @@ -167,7 +170,7 @@ export class ProofController extends Controller { invitationDid = did.didState.did } - const proof = await request.agent.proofs.createRequest({ + const proof = await request.agent.modules.proofs.createRequest({ protocolVersion: createRequestOptions.protocolVersion as ProofsProtocolVersionType<[]>, proofFormats: createRequestOptions.proofFormats, goalCode: createRequestOptions.goalCode, @@ -177,7 +180,7 @@ export class ProofController extends Controller { comment: createRequestOptions.comment, }) const proofMessage = proof.message - const outOfBandRecord = await request.agent.oob.createInvitation({ + const outOfBandRecord = await request.agent.modules.oob.createInvitation({ label: createRequestOptions.label, messages: [proofMessage], autoAcceptConnection: true, @@ -188,10 +191,10 @@ export class ProofController extends Controller { return { invitationUrl: outOfBandRecord.outOfBandInvitation.toUrl({ - domain: request.agent.config.endpoints[0], + domain: request.agent.modules.didcomm.config.endpoints[0], }), invitation: outOfBandRecord.outOfBandInvitation.toJSON({ - useDidSovPrefixWhereAllowed: request.agent.config.useDidSovPrefixWhereAllowed, + useDidSovPrefixWhereAllowed: request.agent.modules.didcomm.config.useDidSovPrefixWhereAllowed, }), outOfBandRecord: outOfBandRecord.toJSON(), invitationDid: createRequestOptions?.invitationDid ? '' : invitationDid, @@ -224,7 +227,7 @@ export class ProofController extends Controller { }, ) { try { - const requestedCredentials = await request.agent.proofs.selectCredentialsForRequest({ + const requestedCredentials = await request.agent.modules.proofs.selectCredentialsForRequest({ proofRecordId, }) @@ -234,7 +237,7 @@ export class ProofController extends Controller { proofFormats: requestedCredentials.proofFormats, } - const proof = await request.agent.proofs.acceptRequest(acceptProofRequest) + const proof = await request.agent.modules.proofs.acceptRequest(acceptProofRequest) return proof.toJSON() } catch (error) { @@ -253,7 +256,7 @@ export class ProofController extends Controller { @Example(ProofRecordExample) public async acceptPresentation(@Request() request: Req, @Path('proofRecordId') proofRecordId: string) { try { - const proof = await request.agent.proofs.acceptPresentation({ proofRecordId }) + const proof = await request.agent.modules.proofs.acceptPresentation({ proofRecordId }) return proof } catch (error) { throw ErrorHandlingService.handle(error) @@ -271,7 +274,7 @@ export class ProofController extends Controller { // TODO: Add return type public async proofFormData(@Request() request: Req, @Path('proofRecordId') proofRecordId: string) { try { - const proof = await request.agent.proofs.getFormatData(proofRecordId) + const proof = await request.agent.modules.proofs.getFormatData(proofRecordId) return proof } catch (error) { throw ErrorHandlingService.handle(error) diff --git a/src/controllers/examples.ts b/src/controllers/examples.ts index 7a125b4c..d7094905 100644 --- a/src/controllers/examples.ts +++ b/src/controllers/examples.ts @@ -12,7 +12,7 @@ import type { OutOfBandRole, OutOfBandState, CredentialRole, -} from '@credo-ts/core' +} from '@credo-ts/didcomm' /** * @example "821f9b26-ad04-4f56-89b6-e2ef9c72b36e" diff --git a/src/controllers/openid4vc/holder/holder.Controller.ts b/src/controllers/openid4vc/holder/holder.Controller.ts new file mode 100644 index 00000000..0f3f5ff7 --- /dev/null +++ b/src/controllers/openid4vc/holder/holder.Controller.ts @@ -0,0 +1,82 @@ +import { Agent } from '@credo-ts/core' +import { Body, Get, Post, Route, Security, Tags } from 'tsoa' +import { injectable } from 'tsyringe' + +import { + AuthorizeRequestCredentialOffer, + RequestCredentialBody, + ResolveCredentialOfferBody, + ResolveProofRequest, +} from '../types/holder.types' + +import { HolderService } from './holder.service' + +@Tags('oid4vc holders') +@Security('apiKey') +@Route('openid4vc/holder') +@injectable() +export class HolderController { + private agent: Agent + private holderService: HolderService + + public constructor(agent: Agent) { + this.agent = agent + this.holderService = new HolderService() + } + + /** + * Get SdJwt type of credentials + */ + @Get('/sd-jwt-vcs') + public async getSdJwtCredentials() { + return await this.holderService.getSdJwtCredentials(this.agent) + } + + /** + * Fetch all mso mdoc credentials in wallet + */ + @Get('/mdoc-vcs') + public async getMdocCredentials() { + return await this.holderService.getMdocCredentials(this.agent) + } + + /** + * Resolve a credential offer + */ + // @Post('resolve-credential-offer') + // public async resolveCredOffer(@Body() body: ResolveCredentialOfferBody) { + // return await this.holderService.resolveCredentialOffer(this.agent, body) + // } + + /** + * Initiate an OID4VCI authorization request + */ + @Post('authorization-request') + public async requestAuthorizationForCredential(@Body() body: AuthorizeRequestCredentialOffer) { + return await this.holderService.requestAuthorizationForCredential(this.agent, body) + } + + /** + * Initiates a token request, then requests credentials from issuer + */ + @Post('request-credential') + public async requestCredential(@Body() body: RequestCredentialBody) { + return await this.holderService.requestCredential(this.agent, body) + } + + /** + * Resolve a proof request + */ + @Post('resolve-proof-request') + public async resolveProofRequest(@Body() body: ResolveProofRequest) { + return await this.holderService.resolveProofRequest(this.agent, body) + } + + /** + * Accept a proof request + */ + @Post('accept-proof-request') + public async acceptProofRequest(@Body() body: ResolveProofRequest) { + return await this.holderService.acceptPresentationRequest(this.agent, body) + } +} diff --git a/src/controllers/openid4vc/holder/holder.service.ts b/src/controllers/openid4vc/holder/holder.service.ts new file mode 100644 index 00000000..0fa210ef --- /dev/null +++ b/src/controllers/openid4vc/holder/holder.service.ts @@ -0,0 +1,254 @@ +import type { + AuthorizeRequestCredentialOffer, + RequestCredentialBody, + ResolveCredentialOfferBody, + ResolveProofRequest, +} from '../types/holder.types' +import type { Agent } 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' + +type MappedAttributesReturnType = + | string + | number + | boolean + | { [key: string]: MappedAttributesReturnType } + | null + | undefined + | Array + +function recursivelyMapAttribues(value: unknown): MappedAttributesReturnType { + if (value === null || value === undefined || typeof value === 'number' || typeof value === 'boolean') return value + if (typeof value === 'string') return value + if (value instanceof Map) { + return Object.fromEntries(Array.from(value.entries()).map(([key, value]) => [key, recursivelyMapAttribues(value)])) + } + if (Array.isArray(value)) return value.map(recursivelyMapAttribues) + return Object.fromEntries(Object.entries(value).map(([key, value]) => [key, recursivelyMapAttribues(value)])) +} + +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(agent: Agent) { + return await agent.sdJwtVc.getAll() + } + + public async getMdocCredentials(agent: Agent) { + return await agent.mdoc.getAll() + } + + // public async resolveCredentialOffer(agent: Agent, body: ResolveCredentialOfferBody) { + // return await agent.modules.openId4VcHolderModule.resolveCredentialOffer(body.credentialOfferUri) + // } + + public async requestAuthorizationForCredential(agent: Agent, body: AuthorizeRequestCredentialOffer) { + console.log('Requesting authorization for credential offer:', body) + const resolvedCredentialOffer = await agent.modules.openId4VcHolderModule.resolveCredentialOffer( + body.credentialOfferUri, + ) + console.log('Resolved credential offer:', resolvedCredentialOffer) + const resolvedAuthorization = await this.initiateAuthorization( + agent, + resolvedCredentialOffer, + body.credentialsToRequest, + ) + + 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 + } + + return { actionToTake, authorizationRequestUrl, codeVerifier } + } + + public async requestCredential(agent: Agent, body: RequestCredentialBody) { + const resolvedCredentialOffer = await 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 + } + + return await this.requestAndStoreCredentials(agent, resolvedCredentialOffer, options) + } + + private async requestAndStoreCredentials( + agent: Agent, + resolvedCredentialOffer: OpenId4VciResolvedCredentialOffer, + options: OpenId4VciTokenRequestOptions, + ) { + const tokenResponse = await agent.modules.openId4VcHolderModule.requestToken({ ...options }) + const credentialResponse = await 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 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 agent.w3cCredentials.storeCredential({ credential }) + } + if (credential instanceof Mdoc) { + return await agent.mdoc.store(credential) + } + return await agent.sdJwtVc.store(credential.compact) + }), + ) + + return storedCredentials + } + + private async initiateAuthorization( + agent: Agent, + resolvedCredentialOffer: OpenId4VciResolvedCredentialOffer, + credentialsToRequest: string[], + ) { + console.log("agent::::::::::::::", Object.keys(agent.modules.openId4VcHolderModule)) + + console.log('Initiating authorization with resolvedCredentialOffer:', resolvedCredentialOffer) + console.log('Credentials to request:', credentialsToRequest) + + 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 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 resolved = await agent.modules.openId4VcHolderModule.resolveIssuanceAuthorizationRequest( + 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, + } + } + + return { + ...resolved, + authorizationFlow: 'Oauth2Redirect' as const, + } + } + + // ❌ Unsupported grant + throw new Error('Unsupported grant type') + } + + public async resolveProofRequest(agent: Agent, body: ResolveProofRequest) { + return await agent.modules.openId4VcHolderModule.resolveOpenId4VpAuthorizationRequest(body.proofRequestUri) + } + + public async acceptPresentationRequest(agent: Agent, body: ResolveProofRequest) { + const resolved = await agent.modules.openId4VcHolderModule.resolveOpenId4VpAuthorizationRequest( + body.proofRequestUri, + ) + const presentationExchangeService = agent.dependencyManager.resolve(DifPresentationExchangeService) + + if (!resolved.presentationExchange) throw new Error('Missing presentation exchange on request') + + const submissionResult = await agent.modules.openId4VcHolderModule.acceptOpenId4VpAuthorizationRequest({ + authorizationRequestPayload: resolved.authorizationRequestPayload, + presentationExchange: { + credentials: presentationExchangeService.selectCredentialsForRequest( + resolved.presentationExchange.credentialsForRequest, + ), + }, + }) + + return submissionResult.serverResponse + } +} diff --git a/src/controllers/openid4vc/issuance-sessions/issuance-sessions.Controller.ts b/src/controllers/openid4vc/issuance-sessions/issuance-sessions.Controller.ts new file mode 100644 index 00000000..567ece1a --- /dev/null +++ b/src/controllers/openid4vc/issuance-sessions/issuance-sessions.Controller.ts @@ -0,0 +1,110 @@ +import { Agent } from '@credo-ts/core' +import { OpenId4VcIssuanceSessionState } from '@credo-ts/openid4vc' +import { Body, Controller, Delete, Get, Path, Post, Put, Query, Request, Route, Tags, Security } from 'tsoa' +import { injectable } from 'tsyringe' +// eslint-disable-next-line import/order +import ErrorHandlingService from '../../../errorHandlingService' + +// import { AgentWithRootOrTenant } from '../../types/agent' +import { OpenId4VcIssuanceSessionsCreateOffer } from '../types/issuer.types' +import { Request as Req } from 'express' + +import { issuanceSessionService } from './issuance-sessions.service' +import { SCOPES } from '../../../enums' +/** + * 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 { + // const agent = 'rootAgent' in request ? request.rootAgent : request.tenantAgent + 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) + } + } + + /** + * 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) + } + } + + /** + * 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 new file mode 100644 index 00000000..4b8a6be4 --- /dev/null +++ b/src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts @@ -0,0 +1,156 @@ +import type { RestAgentModules, RestMultiTenantAgentModules } from '../../../cliAgent' +import type { OpenId4VcIssuanceSessionsCreateOffer, X509GenericRecord } from '../types/issuer.types' +import type { Agent } from '@credo-ts/core' +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' +import { X509_CERTIFICATE_RECORD } from '../../../utils/constant' +import { Request as Req } from 'express' + +class IssuanceSessionsService { + public async createCredentialOffer( + options: OpenId4VcIssuanceSessionsCreateOffer, + agentReq: Req + ) { + const { credentials, signerOption, publicIssuerId } = options + + const issuer = await agentReq.agent.modules.openId4VcIssuer.getIssuerByIssuerId(publicIssuerId) + + if (!signerOption || !signerOption.method) { + throw new BadRequestError(`signerOption must be provided with one of: ${Object.values(SignerMethod).join(', ')}`) + } + if (signerOption.method === SignerMethod.Did && !signerOption.did) { + throw new BadRequestError(`'did' must be provided when signer method is 'did'`) + } + + const mappedCredentials = credentials.map((c) => { + const supported = issuer.credentialConfigurationsSupported[c.credentialSupportedId] + if (!supported) { + throw new Error(`CredentialSupportedId '${c.credentialSupportedId}' is not supported by issuer`) + } + if (supported.format !== c.format) { + throw new Error( + `Format mismatch for '${c.credentialSupportedId}': expected '${supported.format}', got '${c.format}'`, + ) + } + return { + ...c, + payload: { + ...c.payload, + vct: c.payload?.vct ?? (typeof supported.vct === 'string' ? supported.vct : undefined), + }, + } + // format: c.format as OpenId4VciCredentialFormatProfile, TODO: fix this type + }) + + options.issuanceMetadata ||= {} + + if (signerOption.method === SignerMethod.Did) { + options.issuanceMetadata.issuerDid = signerOption.did + } else if (signerOption.method === SignerMethod.X5c) { + const record = (await agentReq.agent.genericRecords.findById(X509_CERTIFICATE_RECORD)) as X509GenericRecord + if (!signerOption.x5c && !record) { + throw new Error('x5c certificate is required') + } + const cert = record?.content?.dcs + const certArray = Array.isArray(cert) ? cert : typeof cert === 'string' ? [cert] : [] + if (!certArray.length) { + throw new Error('x509 certificate must be non-empty') + } + options.issuanceMetadata.issuerx509certificate = signerOption.x5c ?? [...certArray] + } + + 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 new file mode 100644 index 00000000..acf230ed --- /dev/null +++ b/src/controllers/openid4vc/issuers/issuer.Controller.ts @@ -0,0 +1,104 @@ +import { Agent } from '@credo-ts/core' +import { + Controller, + Delete, + Get, + Post, + Put, + Route, + Tags, + Path, + Query, + Body, + Security, + Request +} from 'tsoa' +import { injectable } from 'tsyringe' + +import ErrorHandlingService from '../../../errorHandlingService' +import { UpdateIssuerRecordOptions } from '../types/issuer.types' +import { Request as Req } from 'express' + +import { issuerService } from './issuer.service' +import { SCOPES } from '../../../enums' +@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() + public async createIssuer(@Request() request: Req, @Body() createIssuerOptions: any) { + 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) + } + } + + /** + * 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) + } + } + + /** + * 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) + } + } +} diff --git a/src/controllers/openid4vc/issuers/issuer.service.ts b/src/controllers/openid4vc/issuers/issuer.service.ts new file mode 100644 index 00000000..aff9f7fb --- /dev/null +++ b/src/controllers/openid4vc/issuers/issuer.service.ts @@ -0,0 +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() diff --git a/src/controllers/openid4vc/types/holder.types.ts b/src/controllers/openid4vc/types/holder.types.ts new file mode 100644 index 00000000..550e7572 --- /dev/null +++ b/src/controllers/openid4vc/types/holder.types.ts @@ -0,0 +1,25 @@ +export interface ResolveCredentialOfferBody { + credentialOfferUri: string +} + +export interface RequestCredentialBody { + credentialOfferUri: string + credentialsToRequest: string[] + authorizationCode?: string + codeVerifier?: string + txCode?: string +} + +export interface AuthorizeRequestCredentialOffer { + credentialOfferUri: string + credentialsToRequest: string[] +} + +export interface ResolveProofRequest { + proofRequestUri: string +} + +export interface AcceptProofRequest { + proofRequestUri: string + // selectedCredentials?: { [inputDescriptorId: string]: string } +} diff --git a/src/controllers/openid4vc/types/issuer.types.ts b/src/controllers/openid4vc/types/issuer.types.ts new file mode 100644 index 00000000..97977fc2 --- /dev/null +++ b/src/controllers/openid4vc/types/issuer.types.ts @@ -0,0 +1,122 @@ +export enum SignerMethod { + Did = 'did', + X5c = 'x5c', +} + +export interface OpenId4VcIssuanceSessionCreateOfferSdJwtCredentialOptions { + credentialSupportedId: string + format: string + payload: { + vct?: string + [key: string]: unknown + } + disclosureFrame?: Record> +} + +export interface OpenId4VcIssuanceSessionsCreateOffer { + publicIssuerId: string + signerOption: { + method: SignerMethod + did?: string + x5c?: string[] + } + credentials: Array + authorizationCodeFlowConfig?: { + authorizationServerUrl: string + requirePresentationDuringIssuance?: boolean + issuerState?: string + } + preAuthorizedCodeFlowConfig?: { + preAuthorizedCode?: string + txCode?: { + description?: string + length?: number + input_mode?: 'numeric' | 'text' + } + authorizationServerUrl: string + } + issuanceMetadata?: Record +} + +export interface X509GenericRecordContent { + dcs?: string | string[] + root?: string +} + +export interface X509GenericRecord { + id: string + content?: X509GenericRecordContent +} + +export interface Logo { + uri?: string + alt_text?: string + [key: string]: unknown +} + +export interface CredentialDisplay { + name?: string + locale?: string + logo?: Logo + [key: string]: unknown +} + +export interface AuthorizationServerClientAuth { + clientId: string + clientSecret: string +} + +export interface AuthorizationServerConfig { + issuer: string + clientAuthentication?: AuthorizationServerClientAuth +} + +export interface BatchCredentialIssuanceOptions { + batchSize: number +} + +export interface ProofTypeConfig { + proof_signing_alg_values_supported: string[] +} + +export interface CredentialConfigurationDisplay { + name: string + locale?: string + logo?: Logo + description?: string + background_color?: string + background_image?: Logo + text_color?: string +} + +export interface CredentialDefinition { + type: string[] + [key: string]: any +} + +export interface CredentialConfigurationSupportedWithFormats { + format: 'jwt_vc_json' + scope?: string + cryptographic_binding_methods_supported?: string[] + credential_signing_alg_values_supported?: string[] + proof_types_supported?: Record + credential_definition: CredentialDefinition + display?: CredentialConfigurationDisplay[] +} + +export interface CreateIssuerOptions { + issuerId?: string + accessTokenSignerKeyType?: string + display?: CredentialDisplay[] + authorizationServerConfigs?: AuthorizationServerConfig[] + dpopSigningAlgValuesSupported?: string[] + credentialConfigurationsSupported: Record + batchCredentialIssuance?: BatchCredentialIssuanceOptions +} + +export interface UpdateIssuerRecordOptions { + display?: CredentialDisplay[] + dpopSigningAlgValuesSupported?: string[] + credentialConfigurationsSupported: Record + batchCredentialIssuance?: BatchCredentialIssuanceOptions +} diff --git a/src/controllers/openid4vc/types/verifier.types.ts b/src/controllers/openid4vc/types/verifier.types.ts new file mode 100644 index 00000000..e0fb544a --- /dev/null +++ b/src/controllers/openid4vc/types/verifier.types.ts @@ -0,0 +1,48 @@ +/* eslint-disable @typescript-eslint/explicit-member-accessibility */ +import type { DifPresentationExchangeDefinitionV2 } from '@credo-ts/core' +import type { SubmissionRequirement, Format, Issuance, InputDescriptorV2 } from '@sphereon/pex-models' + +export enum ResponseModeEnum { + DIRECT_POST = 'direct_post', + DIRECT_POSJWT = 'direct_post.jwt', +}// export interface SubmissionRequirementModel extends SubmissionRequirement { + +export interface InputDescriptorV2Model extends InputDescriptorV2 { + format?: Format + group?: string[] + issuance?: Issuance[] + // constraints already inherited +} + +export interface DifPresentationExchangeDefinitionV2Model extends DifPresentationExchangeDefinitionV2 { + format?: Format + submission_requirements?: any[] + input_descriptors: InputDescriptorV2Model[] + frame?: object +} + +export interface PresentationDefinition { + definition: DifPresentationExchangeDefinitionV2Model +} + +export interface CreateAuthorizationRequest { + verifierId: string + verifierDid: string + presentationExchange: PresentationDefinition + responseMode?: ResponseModeEnum +} + +export class OpenId4VcSiopVerifierClientMetadata { + client_name?: string + logo_uri?: string +} + +export class OpenId4VcSiopCreateVerifierOptions { + verifierId?: string + clientMetadata?: OpenId4VcSiopVerifierClientMetadata +} + +export class OpenId4VcUpdateVerifierRecordOptions { + verifierId!: string + clientMetadata?: OpenId4VcSiopVerifierClientMetadata +} diff --git a/src/controllers/openid4vc/verifier-sessions/verification-sessions.Controller.ts b/src/controllers/openid4vc/verifier-sessions/verification-sessions.Controller.ts new file mode 100644 index 00000000..39e23518 --- /dev/null +++ b/src/controllers/openid4vc/verifier-sessions/verification-sessions.Controller.ts @@ -0,0 +1,82 @@ +import { Agent } from '@credo-ts/core' +import { OpenId4VcVerificationSessionState } from '@credo-ts/openid4vc' +import { Body, Controller, Get, Path, Post, Query, Route, Tags } from 'tsoa' +import { injectable } from 'tsyringe' + +import ErrorHandlingService from '../../../errorHandlingService' +// import { CreateAuthorizationRequest } from '../types/verifier.types' + +import { verificationSessionService } from './verification-sessions.service' + +@Tags('oid4vc verification sessions') +@Route('/openid4vc/verification-sessions') +@injectable() +export class VerificationSessionsController extends Controller { + private agent: Agent + + public constructor(agent: Agent) { + super() + this.agent = agent + } + + /** + * Create an authorization request, acting as a Relying Party (RP) + */ +// @Post('/create-presentation-request') +// public async createProofRequest(@Body() createAuthorizationRequest: any) { +// try { +// return await verificationSessionService.createProofRequest(this.agent, createAuthorizationRequest) +// } catch (error) { +// throw ErrorHandlingService.handle(error) +// } +// } + + /** + * Retrieve all verification session records + */ + @Get('/') + public async getAllVerificationSessions( + @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( + this.agent, + publicVerifierId, + payloadState, + state, + authorizationRequestUri, + nonce, + ) + } catch (error) { + throw ErrorHandlingService.handle(error) + } + } + + /** + * Get verification session by ID + */ + @Get('/:verificationSessionId') + public async getVerificationSessionsById(@Path('verificationSessionId') verificationSessionId: string) { + try { + return await verificationSessionService.getVerificationSessionsById(this.agent, 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(@Path('verificationSessionId') verificationSessionId: string) { + // try { + // return await verificationSessionService.getVerifiedAuthorizationResponse(this.agent, 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 new file mode 100644 index 00000000..bce34b82 --- /dev/null +++ b/src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts @@ -0,0 +1,109 @@ +import type { RestAgentModules, RestMultiTenantAgentModules } from '../../../cliAgent' + +import { + Agent, + ClaimFormat, + DidKey, + Jwt, + W3cJsonLdVerifiablePresentation, + W3cJwtVerifiablePresentation, +} from '@credo-ts/core' +import { OpenId4VcVerificationSessionState } from '@credo-ts/openid4vc' +import { injectable } from 'tsyringe' + +// import { CreateAuthorizationRequest } from '../types/verifier.types' + +@injectable() +class VerificationSessionsService { +// public async createProofRequest( +// verifierAgent: Agent | Agent, +// dto: any, // CreateAuthorizationRequest +// ) { +// const didDocument = await verifierAgent.dids.resolveDidDocument(dto.verifierDid) + +// let verifierDidUrl: string | undefined = undefined +// if (!verifierDidUrl && didDocument.verificationMethod?.[0].id) { +// verifierDidUrl = didDocument.verificationMethod?.[0].id +// } + +// if (!verifierDidUrl) throw new Error('No matching verification method found') + +// return await verifierAgent.modules.openId4VcVerifier.createAuthorizationRequest({ +// requestSigner: { +// method: 'did', +// didUrl: verifierDidUrl, +// }, +// verifierId: dto.verifierId, +// presentationExchange: dto.presentationExchange, +// responseMode: dto.responseMode, +// }) +// } + + public async findVerificationSessionsByQuery( + verifierAgent: Agent | Agent, + publicVerifierId?: string, + payloadState?: string, + state?: OpenId4VcVerificationSessionState, + authorizationRequestUri?: string, + nonce?: string, + ) { + return await verifierAgent.modules.openId4VcVerifier.findVerificationSessionsByQuery({ + verifierId: publicVerifierId, + payloadState, + state, + authorizationRequestUri, + nonce, + }) + } + + public async getVerificationSessionsById( + verifierAgent: Agent | Agent, + verificationSessionId: string, + ) { + return await verifierAgent.modules.openId4VcVerifier.getVerificationSessionById(verificationSessionId) + } + + public async getVerifiedAuthorizationResponse( + verifierAgent: Agent | Agent, + verificationSessionId: string, + ) { + const verifiedAuthorizationResponse = + await verifierAgent.modules.openId4VcVerifier.getVerifiedAuthorizationResponse(verificationSessionId) + + const presentations = verifiedAuthorizationResponse.presentationExchange?.presentations.map((presentation) => { + if (presentation instanceof W3cJsonLdVerifiablePresentation) { + return { + format: presentation.claimFormat, + encoded: presentation.toJSON(), + vcPayload: presentation.toJSON(), + } + } else if (presentation instanceof W3cJwtVerifiablePresentation) { + return { + format: presentation.claimFormat, + encoded: presentation.serializedJwt, + vcPayload: presentation.presentation.toJSON(), + signedPayload: presentation.jwt.payload.toJson(), + header: presentation.jwt.header, + } + } else { + const sdJwtPresentation: any = presentation + return { + format: ClaimFormat.SdJwtVc, + encoded: sdJwtPresentation.compact, + vcPayload: sdJwtPresentation.prettyClaims, + signedPayload: sdJwtPresentation.payload, + header: sdJwtPresentation.header as Jwt['header'], + } + } + }) + + return { + ...verifiedAuthorizationResponse, + presentationExchange: verifiedAuthorizationResponse.presentationExchange + ? { ...verifiedAuthorizationResponse.presentationExchange, presentations } + : undefined, + } + } +} + +export const verificationSessionService = new VerificationSessionsService() diff --git a/src/controllers/openid4vc/verifiers/verifier.Controller.ts b/src/controllers/openid4vc/verifiers/verifier.Controller.ts new file mode 100644 index 00000000..43f53897 --- /dev/null +++ b/src/controllers/openid4vc/verifiers/verifier.Controller.ts @@ -0,0 +1,63 @@ +import { Agent } from '@credo-ts/core' +import { Body, Delete, Get, Path, Post, Put, Query, Route, Tags } from 'tsoa' + +// import { OpenId4VcSiopCreateVerifierOptions, OpenId4VcUpdateVerifierRecordOptions } from '../types/verifier.types' +import { VerifierService } from '../verifiers/verifier.service' + +@Tags('oid4vc verifiers') +@Route('openid4vc/verifier') +export class VerifierController { + private agent: Agent + private verifierService: VerifierService + + public constructor(agent: Agent) { + this.agent = agent + this.verifierService = new VerifierService() + } + + /** + * Create a new verifier and store the verifier record + */ + @Post('/') + public async createVerifier(@Body() options: any) { + return await this.verifierService.createVerifier(this.agent, options) + } + + /** + * Update verifier metadata + */ + @Put('{publicVerifierId}') + public async updateVerifierMetadata( + @Path('publicVerifierId') publicVerifierId: string, + @Body() verifierRecordOptions: any, + ) { + return await this.verifierService.updateVerifierMetadata(this.agent, { + verifierId: publicVerifierId, + clientMetadata: verifierRecordOptions.clientMetadata, + }) + } + + /** + * Get verifiers by query + */ + @Get('/') + public async getVerifiersByQuery(@Query() publicVerifierId?: string) { + return await this.verifierService.getVerifiersByQuery(this.agent, publicVerifierId) + } + + /** + * Get single verifier by ID + */ + @Get('{publicVerifierId}') + public async getVerifier(@Path('publicVerifierId') publicVerifierId: string) { + return await this.verifierService.getVerifier(this.agent, publicVerifierId) + } + + /** + * Delete verifier by ID + */ + @Delete('{verifierId}') + public async deleteVerifier(@Path('verifierId') verifierId: string): Promise { + await this.verifierService.deleteVerifier(this.agent, verifierId) + } +} diff --git a/src/controllers/openid4vc/verifiers/verifier.service.ts b/src/controllers/openid4vc/verifiers/verifier.service.ts new file mode 100644 index 00000000..56b5aaa0 --- /dev/null +++ b/src/controllers/openid4vc/verifiers/verifier.service.ts @@ -0,0 +1,56 @@ +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' + +export class VerifierService { + public async createVerifier( + agent: Agent | Agent, + options: OpenId4VcSiopCreateVerifierOptions, + ) { + const verifierRecord = await agent.modules.openId4VcVerifier.createVerifier(options) + return verifierRecord + } + + public async updateVerifierMetadata( + agent: Agent | Agent, + options: OpenId4VcUpdateVerifierRecordOptions, + ) { + // console.log(`Updating verifier ${options.verifierId}`) + + await agent.modules.openId4VcVerifier.updateVerifierMetadata(options) + const verifierRecord = await this.getVerifier(agent, options.verifierId) + return verifierRecord + } + + public async getVerifiersByQuery( + agent: Agent | Agent, + publicVerifierId?: string, + ) { + const verifierRepository = agent.dependencyManager.resolve(OpenId4VcVerifierRepository) + const verifiers = await verifierRepository.findByQuery(agent.context, { + verifierId: publicVerifierId, + }) + + return verifiers + } + + public async getVerifier( + agent: Agent | Agent, + publicVerifierId: string, + ) { + return await agent.modules.openId4VcVerifier.getVerifierByVerifierId(publicVerifierId) + } + + public async deleteVerifier( + agent: Agent | Agent, + publicVerifierId: string, + ) { + const verifierRepository = agent.dependencyManager.resolve(OpenId4VcVerifierRepository) + await verifierRepository.deleteById(agent.context, publicVerifierId) + } +} + +export const issuerService = new VerifierService() diff --git a/src/controllers/types.ts b/src/controllers/types.ts index 8f9ded7f..4149ead4 100644 --- a/src/controllers/types.ts +++ b/src/controllers/types.ts @@ -2,29 +2,15 @@ import type { RecordId } from './examples' import type { CustomHandshakeProtocol } from '../enums' import type { AnonCredsCredentialFormat, LegacyIndyCredentialFormat } from '@credo-ts/anoncreds' import type { - AutoAcceptCredential, - AutoAcceptProof, - CredentialFormatPayload, - HandshakeProtocol, - ReceiveOutOfBandInvitationConfig, - OutOfBandDidCommService, DidResolutionMetadata, DidDocumentMetadata, - ProofExchangeRecord, - ProofFormat, DidRegistrationExtraOptions, DidDocument, DidRegistrationSecretOptions, InitConfig, WalletConfig, - CredentialExchangeRecord, DidResolutionOptions, - JsonCredential, - AgentMessage, - Routing, - Attachment, KeyType, - JsonLdCredentialFormat, JsonObject, W3cJsonLdVerifyCredentialOptions, DataIntegrityProofOptions, @@ -32,11 +18,29 @@ import type { W3cCredential, W3cCredentialSubject, } from '@credo-ts/core' + +import type { + AutoAcceptCredential, + AutoAcceptProof, + JsonLdCredentialFormat, + JsonCredential, + AgentMessage, + Routing, + Attachment, + CredentialExchangeRecord, + ProofExchangeRecord, + ProofFormat, + CredentialFormatPayload, + HandshakeProtocol, + ReceiveOutOfBandInvitationConfig, + OutOfBandDidCommService, +} from '@credo-ts/didcomm' import type { LinkedDataProofOptions } from '@credo-ts/core/build/modules/vc/data-integrity/models/LinkedDataProof' import type { SingleOrArray } from '@credo-ts/core/build/utils' import type { DIDDocument } from 'did-resolver' -export type CustomTenantConfig = Pick & { +export type CustomTenantConfig = Pick & { + connectionImageUrl?: string walletConfig: Pick } @@ -437,3 +441,7 @@ export type ExtensibleW3cCredential = W3cCredential & { export type CustomW3cJsonLdSignCredentialOptions = Omit & { [key: string]: unknown } + +export type DisclosureFrame = { + [key: string]: boolean | DisclosureFrame +} \ No newline at end of file diff --git a/src/enums/enum.ts b/src/enums/enum.ts index d01d77c3..16ee0de1 100644 --- a/src/enums/enum.ts +++ b/src/enums/enum.ts @@ -93,3 +93,8 @@ export enum SCOPES { TENANT_AGENT = 'tenant', DEDICATED_AGENT = 'dedicated', } + +export enum SignerMethod { + Did = 'did', + X5c = 'x5c', +} \ No newline at end of file diff --git a/src/errorHandlingService.ts b/src/errorHandlingService.ts index 5fa11a21..317ee472 100644 --- a/src/errorHandlingService.ts +++ b/src/errorHandlingService.ts @@ -5,9 +5,9 @@ import { CredoError, RecordNotFoundError, RecordDuplicateError, - ClassValidationError, - MessageSendingError, + ClassValidationError } from '@credo-ts/core' +import { MessageSendingError } from '@credo-ts/didcomm' import { IndyVdrError } from '@hyperledger/indy-vdr-nodejs' import { RecordDuplicateError as CustomRecordDuplicateError, NotFoundError, InternalServerError } from './errors/errors' diff --git a/src/events/BasicMessageEvents.ts b/src/events/BasicMessageEvents.ts index d062e56b..73d3cb2a 100644 --- a/src/events/BasicMessageEvents.ts +++ b/src/events/BasicMessageEvents.ts @@ -1,7 +1,6 @@ import type { ServerConfig } from '../utils/ServerConfig' -import type { Agent, BasicMessageStateChangedEvent } from '@credo-ts/core' - -import { BasicMessageEventTypes } from '@credo-ts/core' +import type { Agent } from '@credo-ts/core' +import { BasicMessageEventTypes,BasicMessageStateChangedEvent } from '@credo-ts/didcomm' import { sendWebSocketEvent } from './WebSocketEvents' import { sendWebhookEvent } from './WebhookEvent' diff --git a/src/events/ConnectionEvents.ts b/src/events/ConnectionEvents.ts index 562caa2f..28451f06 100644 --- a/src/events/ConnectionEvents.ts +++ b/src/events/ConnectionEvents.ts @@ -1,7 +1,7 @@ import type { ServerConfig } from '../utils/ServerConfig' -import type { Agent, ConnectionStateChangedEvent } from '@credo-ts/core' +import type { Agent } from '@credo-ts/core' -import { ConnectionEventTypes } from '@credo-ts/core' +import { ConnectionEventTypes, ConnectionStateChangedEvent } from '@credo-ts/didcomm' import { sendWebSocketEvent } from './WebSocketEvents' import { sendWebhookEvent } from './WebhookEvent' diff --git a/src/events/CredentialEvents.ts b/src/events/CredentialEvents.ts index 9ebbbcda..41530e7e 100644 --- a/src/events/CredentialEvents.ts +++ b/src/events/CredentialEvents.ts @@ -1,8 +1,8 @@ import type { RestMultiTenantAgentModules } from '../cliAgent' import type { ServerConfig } from '../utils/ServerConfig' -import type { Agent, CredentialStateChangedEvent } from '@credo-ts/core' +import type { Agent } from '@credo-ts/core' -import { CredentialEventTypes } from '@credo-ts/core' +import { CredentialEventTypes, CredentialStateChangedEvent } from '@credo-ts/didcomm' import { sendWebSocketEvent } from './WebSocketEvents' import { sendWebhookEvent } from './WebhookEvent' @@ -19,33 +19,12 @@ export const credentialEvents = async (agent: Agent, config: ServerConfig) => { } if (record?.connectionId) { - let connectionRecord - if (event.metadata.contextCorrelationId && event.metadata.contextCorrelationId !== 'default') { - await (agent as Agent).modules.tenants.withTenantAgent( - { tenantId: body.contextCorrelationId as string }, - async (tenantAgent) => { - connectionRecord = await tenantAgent.connections.findById(record.connectionId ? record.connectionId : '') - }, - ) - } else { - connectionRecord = await agent.connections.getById(record.connectionId) - } + const connectionRecord = await agent.modules.connections.findById(record.connectionId!) body.outOfBandId = connectionRecord?.outOfBandId } - let formatData = null - if (event.metadata.contextCorrelationId && event.metadata.contextCorrelationId !== 'default') { - await (agent as Agent).modules.tenants.withTenantAgent( - { tenantId: body.contextCorrelationId as string }, - async (tenantAgent) => { - formatData = await tenantAgent.credentials.getFormatData(record.id) - }, - ) - } else { - formatData = await agent.credentials.getFormatData(record.id) - } - - body.credentialData = formatData + const data = await agent.modules.credentials.getFormatData(record.id) + body.credentialData = data if (config.webhookUrl) { await sendWebhookEvent(config.webhookUrl + '/credentials', body, agent.config.logger) diff --git a/src/events/ProofEvents.ts b/src/events/ProofEvents.ts index ca0ed7a0..65ac477f 100644 --- a/src/events/ProofEvents.ts +++ b/src/events/ProofEvents.ts @@ -1,7 +1,6 @@ import type { ServerConfig } from '../utils/ServerConfig' -import type { Agent, ProofStateChangedEvent } from '@credo-ts/core' - -import { ProofEventTypes } from '@credo-ts/core' +import type { Agent, } from '@credo-ts/core' +import { ProofStateChangedEvent, ProofEventTypes } from '@credo-ts/didcomm' import { sendWebSocketEvent } from './WebSocketEvents' import { sendWebhookEvent } from './WebhookEvent' @@ -20,7 +19,7 @@ export const proofEvents = async (agent: Agent, config: ServerConfig) => { //Emit webhook for dedicated agent if (event.metadata.contextCorrelationId === 'default') { - const data = await agent.proofs.getFormatData(record.id) + const data = await agent.modules.proofs.getFormatData(record.id) body.proofData = data } diff --git a/src/events/ReuseConnectionEvents.ts b/src/events/ReuseConnectionEvents.ts index c4ee435f..8865dd32 100644 --- a/src/events/ReuseConnectionEvents.ts +++ b/src/events/ReuseConnectionEvents.ts @@ -1,7 +1,7 @@ import type { ServerConfig } from '../utils/ServerConfig' -import type { Agent, HandshakeReusedEvent } from '@credo-ts/core' +import type { Agent } from '@credo-ts/core' -import { OutOfBandEventTypes } from '@credo-ts/core' +import { OutOfBandEventTypes, HandshakeReusedEvent } from '@credo-ts/didcomm' import { sendWebSocketEvent } from './WebSocketEvents' import { sendWebhookEvent } from './WebhookEvent' diff --git a/src/routes/routes.ts b/src/routes/routes.ts index 2a30e20a..4f5292c3 100644 --- a/src/routes/routes.ts +++ b/src/routes/routes.ts @@ -29,6 +29,16 @@ import { ConnectionController } from './../controllers/didcomm/connections/Conne 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 { 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 { 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 { 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'; @@ -792,7 +802,6 @@ const models: TsoaRoute.Models = { "@type": {"dataType":"string","required":true}, "@id": {"dataType":"string","required":true}, "~thread": {"dataType":"nestedObjectLiteral","nestedProperties":{"pthid":{"dataType":"string"},"thid":{"dataType":"string"}}}, - "messageType": {"dataType":"string","required":true}, }, "additionalProperties": {"dataType":"any"}, }, @@ -845,10 +854,17 @@ const models: TsoaRoute.Models = { "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 + "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": {"dataType":"buffer","required":true}, + "publicKey": {"ref":"Uint8Array","required":true}, "keyType": {"ref":"KeyType","required":true}, }, "additionalProperties": false, @@ -957,15 +973,6 @@ const models: TsoaRoute.Models = { "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 - "AgentMessageType": { - "dataType": "refObject", - "properties": { - "@id": {"dataType":"string","required":true}, - "@type": {"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 "CustomHandshakeProtocol": { "dataType": "refEnum", "enums": ["https://didcomm.org/didexchange/1.1","https://didcomm.org/connections/1.0"], @@ -1142,7 +1149,6 @@ const models: TsoaRoute.Models = { "issuanceDate": {"dataType":"string","required":true}, "expirationDate": {"dataType":"string"}, "credentialSubject": {"ref":"SingleOrArray_JsonObject_","required":true}, - "prettyVc": {"dataType":"any"}, }, "additionalProperties": {"dataType":"any"}, }, @@ -1378,6 +1384,11 @@ const models: TsoaRoute.Models = { "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":{}}, @@ -1388,9 +1399,9 @@ const models: TsoaRoute.Models = { "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-or-connectionImageUrl_": { + "Pick_InitConfig.label_": { "dataType": "refAlias", - "type": {"dataType":"nestedObjectLiteral","nestedProperties":{"label":{"dataType":"string","required":true},"connectionImageUrl":{"dataType":"string"}},"validators":{}}, + "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": { @@ -1405,7 +1416,7 @@ const models: TsoaRoute.Models = { // WARNING: This 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-or-connectionImageUrl_"},{"dataType":"nestedObjectLiteral","nestedProperties":{"walletConfig":{"ref":"Pick_WalletConfig.id-or-key-or-keyDerivationMethod_","required":true}}}],"validators":{}}, + "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": { @@ -1444,6 +1455,206 @@ const models: TsoaRoute.Models = { "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 + "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 + "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 + "OpenId4VcIssuanceSessionCreateOfferSdJwtCredentialOptions": { + "dataType": "refObject", + "properties": { + "credentialSupportedId": {"dataType":"string","required":true}, + "format": {"dataType":"string","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 + "OpenId4VcIssuanceSessionsCreateOffer": { + "dataType": "refObject", + "properties": { + "publicIssuerId": {"dataType":"string","required":true}, + "signerOption": {"dataType":"nestedObjectLiteral","nestedProperties":{"x5c":{"dataType":"array","array":{"dataType":"string"}},"did":{"dataType":"string"},"method":{"ref":"SignerMethod","required":true}},"required":true}, + "credentials": {"dataType":"array","array":{"dataType":"refObject","ref":"OpenId4VcIssuanceSessionCreateOfferSdJwtCredentialOptions"},"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 + "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 + "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 + "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 + "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":"enum","enums":["jwt_vc_json"],"required":true}, + "scope": {"dataType":"string"}, + "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","required":true}, + "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 + "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 + "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 + "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 }; const templateService = new ExpressTemplateService(models, {"noImplicitAdditionalProperties":"throw-on-extras","bodyCoercion":true}); @@ -2835,7 +3046,7 @@ export function RegisterRoutes(app: Router) { // WARNING: This 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":{"domain":{"dataType":"string","required":true},"message":{"ref":"AgentMessageType","required":true},"recordId":{"dataType":"string","required":true}}}, + 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"]}]), @@ -3921,6 +4132,884 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This 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 argsHolderController_getSdJwtCredentials: Record = { + }; + app.get('/openid4vc/holder/sd-jwt-vcs', + authenticateMiddleware([{"apiKey":[]}]), + ...(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 = { + }; + app.get('/openid4vc/holder/mdoc-vcs', + authenticateMiddleware([{"apiKey":[]}]), + ...(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_requestAuthorizationForCredential: Record = { + body: {"in":"body","name":"body","required":true,"ref":"AuthorizeRequestCredentialOffer"}, + }; + app.post('/openid4vc/holder/authorization-request', + authenticateMiddleware([{"apiKey":[]}]), + ...(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 = { + body: {"in":"body","name":"body","required":true,"ref":"RequestCredentialBody"}, + }; + app.post('/openid4vc/holder/request-credential', + authenticateMiddleware([{"apiKey":[]}]), + ...(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 = { + body: {"in":"body","name":"body","required":true,"ref":"ResolveProofRequest"}, + }; + app.post('/openid4vc/holder/resolve-proof-request', + authenticateMiddleware([{"apiKey":[]}]), + ...(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 = { + body: {"in":"body","name":"body","required":true,"ref":"ResolveProofRequest"}, + }; + app.post('/openid4vc/holder/accept-proof-request', + authenticateMiddleware([{"apiKey":[]}]), + ...(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 argsIssuerController_createIssuer: Record = { + request: {"in":"request","name":"request","required":true,"dataType":"object"}, + createIssuerOptions: {"in":"body","name":"createIssuerOptions","required":true,"dataType":"any"}, + }; + 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_getAllVerificationSessions: Record = { + 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', + ...(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 = { + verificationSessionId: {"in":"path","name":"verificationSessionId","required":true,"dataType":"string"}, + }; + app.get('/openid4vc/verification-sessions/:verificationSessionId', + ...(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 argsVerifierController_createVerifier: Record = { + options: {"in":"body","name":"options","required":true,"dataType":"any"}, + }; + app.post('/openid4vc/verifier', + ...(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 = { + publicVerifierId: {"in":"path","name":"publicVerifierId","required":true,"dataType":"string"}, + verifierRecordOptions: {"in":"body","name":"verifierRecordOptions","required":true,"dataType":"any"}, + }; + app.put('/openid4vc/verifier/:publicVerifierId', + ...(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 = { + publicVerifierId: {"in":"query","name":"publicVerifierId","dataType":"string"}, + }; + app.get('/openid4vc/verifier', + ...(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 = { + publicVerifierId: {"in":"path","name":"publicVerifierId","required":true,"dataType":"string"}, + }; + app.get('/openid4vc/verifier/:publicVerifierId', + ...(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 = { + verifierId: {"in":"path","name":"verifierId","required":true,"dataType":"string"}, + }; + app.delete('/openid4vc/verifier/:verifierId', + ...(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 diff --git a/src/routes/swagger.json b/src/routes/swagger.json index b1ae2ef3..cc78611c 100644 --- a/src/routes/swagger.json +++ b/src/routes/swagger.json @@ -1809,15 +1809,11 @@ } }, "type": "object" - }, - "messageType": { - "type": "string" } }, "required": [ "@type", - "@id", - "messageType" + "@id" ], "type": "object", "additionalProperties": {} @@ -1903,11 +1899,16 @@ "AgentMessage": { "$ref": "#/components/schemas/PlaintextMessage" }, + "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 + }, "Key": { "properties": { "publicKey": { - "type": "string", - "format": "byte" + "$ref": "#/components/schemas/Uint8Array" }, "keyType": { "$ref": "#/components/schemas/KeyType" @@ -2161,22 +2162,6 @@ "OutOfBandRecord": { "$ref": "#/components/schemas/Record_string.unknown_" }, - "AgentMessageType": { - "properties": { - "@id": { - "type": "string" - }, - "@type": { - "type": "string" - } - }, - "required": [ - "@id", - "@type" - ], - "type": "object", - "additionalProperties": {} - }, "CustomHandshakeProtocol": { "enum": [ "https://didcomm.org/didexchange/1.1", @@ -2624,8 +2609,7 @@ }, "credentialSubject": { "$ref": "#/components/schemas/SingleOrArray_JsonObject_" - }, - "prettyVc": {} + } }, "required": [ "@context", @@ -3143,6 +3127,9 @@ ], "type": "string" }, + "ConnectionRecord": { + "$ref": "#/components/schemas/Record_string.unknown_" + }, "BasicMessageRecord": { "$ref": "#/components/schemas/Record_string.unknown_" }, @@ -3158,13 +3145,11 @@ "type": "object", "description": "Construct a type with a set of properties K of type T" }, - "Pick_InitConfig.label-or-connectionImageUrl_": { + "Pick_InitConfig.label_": { "properties": { "label": { - "type": "string" - }, - "connectionImageUrl": { - "type": "string" + "type": "string", + "description": "Agent public endpoints, sorted by priority (higher priority first)" } }, "required": [ @@ -3203,7 +3188,7 @@ "TenantConfig": { "allOf": [ { - "$ref": "#/components/schemas/Pick_InitConfig.label-or-connectionImageUrl_" + "$ref": "#/components/schemas/Pick_InitConfig.label_" }, { "properties": { @@ -3244,7 +3229,8 @@ "Pick_CustomTenantConfig.Exclude_keyofCustomTenantConfig.walletConfig__": { "properties": { "label": { - "type": "string" + "type": "string", + "description": "Agent public endpoints, sorted by priority (higher priority first)" }, "connectionImageUrl": { "type": "string" @@ -3271,187 +3257,1173 @@ ], "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": { - "/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" - } - } + "OpenId4VcIssuanceSessionRecord": { + "$ref": "#/components/schemas/Record_string.unknown_" + }, + "SignerMethod": { + "enum": [ + "did", + "x5c" + ], + "type": "string" + }, + "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_" } - } + ] }, - "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": {} + "type": "object", + "description": "Construct a type with a set of properties K of type T" + }, + "OpenId4VcIssuanceSessionCreateOfferSdJwtCredentialOptions": { + "properties": { + "credentialSupportedId": { + "type": "string" + }, + "format": { + "type": "string" + }, + "payload": { + "properties": { + "vct": { + "type": "string" } - } + }, + "additionalProperties": {}, + "type": "object" + }, + "disclosureFrame": { + "$ref": "#/components/schemas/Record_string.boolean-or-Record_string.boolean__" } }, - "description": "Create polygon based W3C schema", - "tags": [ - "Polygon" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } + "required": [ + "credentialSupportedId", + "format", + "payload" ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { + "type": "object", + "additionalProperties": false + }, + "OpenId4VcIssuanceSessionsCreateOffer": { + "properties": { + "publicIssuerId": { + "type": "string" + }, + "signerOption": { + "properties": { + "x5c": { + "items": { + "type": "string" + }, + "type": "array" + }, + "did": { + "type": "string" + }, + "method": { + "$ref": "#/components/schemas/SignerMethod" + } + }, + "required": [ + "method" + ], + "type": "object" + }, + "credentials": { + "items": { + "$ref": "#/components/schemas/OpenId4VcIssuanceSessionCreateOfferSdJwtCredentialOptions" + }, + "type": "array" + }, + "authorizationCodeFlowConfig": { + "properties": { + "issuerState": { + "type": "string" + }, + "requirePresentationDuringIssuance": { + "type": "boolean" + }, + "authorizationServerUrl": { + "type": "string" + } + }, + "required": [ + "authorizationServerUrl" + ], + "type": "object" + }, + "preAuthorizedCodeFlowConfig": { + "properties": { + "authorizationServerUrl": { + "type": "string" + }, + "txCode": { "properties": { - "schema": { - "$ref": "#/components/schemas/Record_string.unknown_" + "input_mode": { + "type": "string", + "enum": [ + "numeric", + "text" + ] }, - "schemaName": { - "type": "string" + "length": { + "type": "number", + "format": "double" }, - "did": { + "description": { "type": "string" } }, - "required": [ - "schema", - "schemaName", - "did" - ], "type": "object" + }, + "preAuthorizedCode": { + "type": "string" } - } - } - } - } - }, - "/polygon/estimate-transaction": { - "post": { - "operationId": "EstimateTransaction", - "responses": { - "200": { - "description": "Transaction Object", - "content": { - "application/json": { - "schema": {} - } - } + }, + "required": [ + "authorizationServerUrl" + ], + "type": "object" + }, + "issuanceMetadata": { + "$ref": "#/components/schemas/Record_string.unknown_" } }, - "description": "Estimate transaction", - "tags": [ - "Polygon" + "required": [ + "publicIssuerId", + "signerOption", + "credentials" ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated", - "Basewallet" - ] - } + "type": "object", + "additionalProperties": false + }, + "OpenId4VcIssuanceSessionState": { + "enum": [ + "OfferCreated", + "OfferUriRetrieved", + "AuthorizationInitiated", + "AuthorizationGranted", + "AccessTokenRequested", + "AccessTokenCreated", + "CredentialRequestReceived", + "CredentialsPartiallyIssued", + "Completed", + "Error" ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DidOperationOptions" - } - } - } + "type": "string" + }, + "SdJwtVcRecord": { + "$ref": "#/components/schemas/Record_string.unknown_" + }, + "MdocRecord": { + "$ref": "#/components/schemas/Record_string.unknown_" + }, + "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 + }, + "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": {} + }, + "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": { + "type": "string", + "enum": [ + "jwt_vc_json" + ], + "nullable": false + }, + "scope": { + "type": "string" + }, + "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", + "credential_definition" + ], + "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 + }, + "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 + }, + "OpenId4VcVerificationSessionRecord": { + "$ref": "#/components/schemas/Record_string.unknown_" + }, + "OpenId4VcVerificationSessionState": { + "enum": [ + "RequestCreated", + "RequestUriRetrieved", + "ResponseVerified", + "Error" + ], + "type": "string" + }, + "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" + } + }, + "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": { + "/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" + } + } + } } } }, - "/polygon/{did}/{schemaId}": { + "/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": "Schema Object", + "description": "get schema by Id", "content": { "application/json": { - "schema": {} + "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": "Fetch schema details", + "description": "Retrieve credential definition by credential definition id", "tags": [ - "Polygon" + "Anoncreds - Credential Definitions" ], "security": [ { @@ -3464,48 +4436,222 @@ "parameters": [ { "in": "path", - "name": "did", + "name": "credentialDefinitionId", "required": true, "schema": { - "type": "string" + "$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": [ { - "in": "path", - "name": "schemaId", - "required": true, - "schema": { - "type": "string" + "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" + } } } - ] + } } }, - "/anoncreds/transactions/endorse": { + "/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": "EndorserTransaction", + "operationId": "GetAgentToken", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "properties": { - "signedTransaction": { - "type": "string" - } - }, - "required": [ - "signedTransaction" - ], - "type": "object" + "$ref": "#/components/schemas/AgentToken" } } } } }, + "description": "Retrieve agent token", "tags": [ - "Anoncreds - EndorserTransaction" + "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": [ { @@ -3521,30 +4667,40 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EndorserTransaction" + "$ref": "#/components/schemas/VerifyDataOptions" } } } } } }, - "/anoncreds/transactions/set-endorser-role": { + "/agent/credential/sign": { "post": { - "operationId": "DidNymTransaction", + "operationId": "SignCredential", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DidCreateResult_DidOperationStateActionBase_" + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/components/schemas/Record_string.any_" + }, + { + "$ref": "#/components/schemas/W3cCredentialRecord" + } + ] } } } } }, "tags": [ - "Anoncreds - EndorserTransaction" + "Agent" ], "security": [ { @@ -3554,61 +4710,64 @@ ] } ], - "parameters": [], + "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": { - "$ref": "#/components/schemas/DidNymTransaction" + "anyOf": [ + { + "$ref": "#/components/schemas/CustomW3cJsonLdSignCredentialOptions" + }, + { + "$ref": "#/components/schemas/SignDataOptions" + } + ] } } } } } }, - "/anoncreds/transactions/write": { + "/agent/credential/verify": { "post": { - "operationId": "WriteSchemaAndCredDefOnLedger", + "operationId": "VerifyCredential", "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" - } - ] + "$ref": "#/components/schemas/W3cVerifyCredentialResult" } } } } }, "tags": [ - "Anoncreds - EndorserTransaction" + "Agent" ], "security": [ { @@ -3624,93 +4783,34 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WriteTransaction" + "$ref": "#/components/schemas/SafeW3cJsonLdVerifyCredentialOptions" } } } } } }, - "/dids/{did}": { + "/didcomm/question-answer": { "get": { - "operationId": "GetDidRecordByDid", + "operationId": "GetQuestionAnswerRecords", "responses": { "200": { - "description": "DidResolutionResult", + "description": "QuestionAnswerRecord[]", "content": { "application/json": { "schema": { - "properties": { - "didDocumentMetadata": { - "$ref": "#/components/schemas/DIDDocumentMetadata" - }, - "didResolutionMetadata": { - "$ref": "#/components/schemas/DidResolutionMetadata" - }, - "didDocument": { - "$ref": "#/components/schemas/Record_string.any_" - } + "items": { + "$ref": "#/components/schemas/Record_string.unknown_" }, - "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" - } - } - } + "type": "array" } } } } }, - "description": "Resolves did and returns did resolution result", + "description": "Retrieve question and answer records by query", "tags": [ - "Dids" + "DIDComm - Question Answer" ], "security": [ { @@ -3722,58 +4822,65 @@ ], "parameters": [ { - "description": "Decentralized Identifier", - "in": "path", - "name": "did", - "required": true, + "description": "Connection identifier", + "in": "query", + "name": "connectionId", + "required": false, "schema": { - "$ref": "#/components/schemas/Did" + "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" } } ] } }, - "/dids/write": { + "/didcomm/question-answer/question/{connectionId}": { "post": { - "operationId": "WriteDid", + "operationId": "SendQuestion", "responses": { "200": { - "description": "DidResolutionResult", + "description": "Ok", "content": { "application/json": { - "schema": {}, + "schema": { + "$ref": "#/components/schemas/Record_string.unknown_" + }, "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" - ] - } - } - } + "Example 1": {} } } } } }, - "description": "Did nym registration", + "description": "Send a question to a connection", "tags": [ - "Dids" + "DIDComm - Question Answer" ], "security": [ { @@ -3783,39 +4890,65 @@ ] } ], - "parameters": [], + "parameters": [ + { + "description": "Connection identifier", + "in": "path", + "name": "connectionId", + "required": true, + "schema": { + "$ref": "#/components/schemas/RecordId" + } + } + ], "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DidCreate" + "properties": { + "detail": { + "type": "string" + }, + "validResponses": { + "items": { + "$ref": "#/components/schemas/ValidResponse" + }, + "type": "array" + }, + "question": { + "type": "string" + } + }, + "required": [ + "validResponses", + "question" + ], + "type": "object" } } } } } }, - "/dids": { - "get": { - "operationId": "GetDids", + "/didcomm/question-answer/answer/{id}": { + "post": { + "operationId": "SendAnswer", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "items": { - "$ref": "#/components/schemas/DidRecord" - }, - "type": "array" + "$ref": "#/components/schemas/Record_string.unknown_" } } } } }, + "description": "Send a answer to question", "tags": [ - "Dids" + "DIDComm - Question Answer" ], "security": [ { @@ -3825,41 +4958,47 @@ ] } ], - "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/Record_response.string_" + } + } + } + } } }, - "/anoncreds/schemas/{schemaId}": { + "/didcomm/question-answer/{id}": { "get": { - "operationId": "GetSchemaById", + "operationId": "GetQuestionAnswerRecordById", "responses": { "200": { - "description": "get schema by Id", + "description": "ConnectionRecord", "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 - } - } + "$ref": "#/components/schemas/Record_string.unknown_" } } } } }, - "description": "Get schema by schemaId", + "description": "Retrieve question answer record by id", "tags": [ - "Anoncreds - Schemas" + "DIDComm - Question Answer" ], "security": [ { @@ -3872,57 +5011,50 @@ "parameters": [ { "in": "path", - "name": "schemaId", + "name": "id", "required": true, "schema": { - "$ref": "#/components/schemas/SchemaId" + "$ref": "#/components/schemas/RecordId" } } ] } }, - "/anoncreds/schemas": { - "post": { - "operationId": "CreateSchema", + "/didcomm/proofs": { + "get": { + "operationId": "GetAllProofs", "responses": { "200": { - "description": "get schema", + "description": "ProofRecord[]", "content": { "application/json": { "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/RegisterSchemaReturn" - }, - { - "$ref": "#/components/schemas/RegisterSchemaReturnStateFinished" - } - ] + "items": { + "$ref": "#/components/schemas/Record_string.unknown_" + }, + "type": "array" }, "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" - } + "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": "Create schema", + "description": "Retrieve all proof records", "tags": [ - "Anoncreds - Schemas" + "DIDComm - Proofs" ], "security": [ { @@ -3932,63 +5064,38 @@ ] } ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateSchemaInput" - } + "parameters": [ + { + "in": "query", + "name": "threadId", + "required": false, + "schema": { + "type": "string" } } - } + ] } }, - "/anoncreds/credential-definitions/{credentialDefinitionId}": { + "/didcomm/proofs/{proofRecordId}": { "get": { - "operationId": "GetCredentialDefinitionById", + "operationId": "GetProofById", "responses": { "200": { - "description": "CredDef", + "description": "ProofRecord", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GetCredentialDefinitionReturn" + "$ref": "#/components/schemas/Record_string.unknown_" }, "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" - } - } + "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" } } } @@ -3996,94 +5103,60 @@ } } }, - "description": "Retrieve credential definition by credential definition id", + "description": "Retrieve proof record by proof record id", "tags": [ - "Anoncreds - Credential Definitions" + "DIDComm - Proofs" ], "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" - } - } + ] + } + ], + "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" } } } } } - }, - "202": { - "description": "Wait for action to complete" } }, - "description": "Creates a new credential definition.", + "description": "Initiate a new presentation exchange as prover by sending a presentation proposal request\nto the connection with the specified connection id.", "tags": [ - "Anoncreds - Credential Definitions" + "DIDComm - Proofs" ], "security": [ { @@ -4099,104 +5172,95 @@ "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" + "$ref": "#/components/schemas/RequestProofProposalOptions" } } } } } }, - "/agent": { - "get": { - "operationId": "GetAgentInfo", + "/didcomm/proofs/{proofRecordId}/accept-proposal": { + "post": { + "operationId": "AcceptProposal", "responses": { "200": { - "description": "Ok", + "description": "ProofRecord", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AgentInfo" + "$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": "Retrieve basic agent information", + "description": "Accept a presentation proposal as verifier by sending an accept proposal message\nto the connection associated with the proof record.", "tags": [ - "Agent" + "DIDComm - Proofs" ], "security": [ { "jwt": [ "tenant", - "dedicated", - "Basewallet" + "dedicated" ] } ], - "parameters": [] + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AcceptProofProposal" + } + } + } + } } }, - "/agent/token": { + "/didcomm/proofs/request-proof": { "post": { - "operationId": "GetAgentToken", + "operationId": "RequestProof", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AgentToken" + "$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": "Retrieve agent token", - "tags": [ - "Agent" - ], - "security": [ - { - "apiKey": [] - } - ], - "parameters": [] - } - }, - "/agent/wallet": { - "delete": { - "operationId": "DeleteWallet", - "responses": { - "204": { - "description": "No content" - } - }, - "description": "Delete wallet", + "description": "Creates a presentation request bound to existing connection", "tags": [ - "Agent" + "DIDComm - Proofs" ], "security": [ { @@ -4206,27 +5270,77 @@ ] } ], - "parameters": [] + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RequestProofOptions" + } + } + } + } } }, - "/agent/verify": { + "/didcomm/proofs/create-request-oob": { "post": { - "operationId": "Verify", + "operationId": "CreateRequest", "responses": { "200": { - "description": "isValidSignature - true if signature is valid, false otherwise", + "description": "Ok", "content": { "application/json": { "schema": { - "type": "boolean" + "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": "Verify data using a key", + "description": "Creates a presentation request not bound to any proposal or existing connection", "tags": [ - "Agent" + "DIDComm - Proofs" ], "security": [ { @@ -4242,40 +5356,43 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/VerifyDataOptions" + "$ref": "#/components/schemas/CreateProofRequestOobOptions" } } } } } }, - "/agent/credential/sign": { + "/didcomm/proofs/{proofRecordId}/accept-request": { "post": { - "operationId": "SignCredential", + "operationId": "AcceptRequest", "responses": { "200": { - "description": "Ok", + "description": "ProofRecord", "content": { "application/json": { "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "$ref": "#/components/schemas/Record_string.any_" - }, - { - "$ref": "#/components/schemas/W3cCredentialRecord" + "$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": [ - "Agent" + "DIDComm - Proofs" ], "security": [ { @@ -4287,23 +5404,11 @@ ], "parameters": [ { - "in": "query", - "name": "storeCredential", - "required": true, - "schema": { - "type": "boolean" - } - }, - { - "in": "query", - "name": "dataTypeToSign", + "in": "path", + "name": "proofRecordId", "required": true, "schema": { - "type": "string", - "enum": [ - "rawData", - "jsonLd" - ] + "type": "string" } } ], @@ -4312,37 +5417,54 @@ "content": { "application/json": { "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/CustomW3cJsonLdSignCredentialOptions" + "properties": { + "comment": { + "type": "string" }, - { - "$ref": "#/components/schemas/SignDataOptions" + "filterByNonRevocationRequirements": { + "type": "boolean" + }, + "filterByPresentationPreview": { + "type": "boolean" } - ] + }, + "type": "object" } } } } } }, - "/agent/credential/verify": { + "/didcomm/proofs/{proofRecordId}/accept-presentation": { "post": { - "operationId": "VerifyCredential", + "operationId": "AcceptPresentation", "responses": { "200": { - "description": "Ok", + "description": "ProofRecord", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/W3cVerifyCredentialResult" + "$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": [ - "Agent" + "DIDComm - Proofs" ], "security": [ { @@ -4352,40 +5474,48 @@ ] } ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SafeW3cJsonLdVerifyCredentialOptions" - } + "parameters": [ + { + "in": "path", + "name": "proofRecordId", + "required": true, + "schema": { + "type": "string" } } - } + ] } }, - "/didcomm/question-answer": { + "/didcomm/proofs/{proofRecordId}/form-data": { "get": { - "operationId": "GetQuestionAnswerRecords", + "operationId": "ProofFormData", "responses": { "200": { - "description": "QuestionAnswerRecord[]", + "description": "ProofRecord", "content": { "application/json": { "schema": { - "items": { - "$ref": "#/components/schemas/Record_string.unknown_" - }, - "type": "array" + "$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": "Retrieve question and answer records by query", + "description": "Return proofRecord", "tags": [ - "DIDComm - Question Answer" + "DIDComm - Proofs" ], "security": [ { @@ -4397,37 +5527,9 @@ ], "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, + "in": "path", + "name": "proofRecordId", + "required": true, "schema": { "type": "string" } @@ -4435,27 +5537,71 @@ ] } }, - "/didcomm/question-answer/question/{connectionId}": { - "post": { - "operationId": "SendQuestion", + "/didcomm/oob": { + "get": { + "operationId": "GetAllOutOfBandRecords", "responses": { "200": { - "description": "Ok", + "description": "OutOfBandRecord[]", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Record_string.unknown_" + "items": { + "$ref": "#/components/schemas/Record_string.unknown_" + }, + "type": "array" }, "examples": { - "Example 1": {} + "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": "Send a question to a connection", + "description": "Retrieve all out of band records", "tags": [ - "DIDComm - Question Answer" + "DIDComm - Out Of Band" ], "security": [ { @@ -4467,63 +5613,77 @@ ], "parameters": [ { - "description": "Connection identifier", - "in": "path", - "name": "connectionId", - "required": true, + "description": "invitation identifier", + "in": "query", + "name": "invitationId", + "required": false, "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", + "/didcomm/oob/{outOfBandId}": { + "get": { + "operationId": "GetOutOfBandRecordById", "responses": { "200": { - "description": "Ok", + "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": "Send a answer to question", + "description": "Retrieve an out of band record by id", "tags": [ - "DIDComm - Question Answer" + "DIDComm - Out Of Band" ], "security": [ { @@ -4535,45 +5695,25 @@ ], "parameters": [ { - "description": "The id of the question answer record", "in": "path", - "name": "id", + "name": "outOfBandId", "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", + ] + }, + "delete": { + "operationId": "DeleteOutOfBandRecord", "responses": { - "200": { - "description": "ConnectionRecord", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Record_string.unknown_" - } - } - } + "204": { + "description": "No content" } }, - "description": "Retrieve question answer record by id", + "description": "Deletes an out of band record from the repository.", "tags": [ - "DIDComm - Question Answer" + "DIDComm - Out Of Band" ], "security": [ { @@ -4585,8 +5725,9 @@ ], "parameters": [ { + "description": "Record identifier", "in": "path", - "name": "id", + "name": "outOfBandId", "required": true, "schema": { "$ref": "#/components/schemas/RecordId" @@ -4595,41 +5736,113 @@ ] } }, - "/didcomm/proofs": { - "get": { - "operationId": "GetAllProofs", + "/didcomm/oob/create-invitation": { + "post": { + "operationId": "CreateInvitation", "responses": { "200": { - "description": "ProofRecord[]", + "description": "Out of band record", "content": { "application/json": { "schema": { - "items": { - "$ref": "#/components/schemas/Record_string.unknown_" + "properties": { + "invitationDid": { + "type": "string" + }, + "outOfBandRecord": { + "$ref": "#/components/schemas/Record_string.unknown_" + }, + "invitation": { + "$ref": "#/components/schemas/PlaintextMessage" + }, + "invitationUrl": { + "type": "string" + } }, - "type": "array" + "required": [ + "invitationDid", + "outOfBandRecord", + "invitation", + "invitationUrl" + ], + "type": "object" }, "examples": { "Example 1": { - "value": [ - { + "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": "821f9b26-ad04-4f56-89b6-e2ef9c72b36e", + "id": "42a95528-0e30-4f86-a462-0efb02178b53", "createdAt": "2022-01-01T00:00:00.000Z", - "connectionId": "2aecf74c-3073-4f98-9acb-92415d096834", - "threadId": "0019d466-5eea-4269-8c40-031b4896c5b7", - "protocolVersion": "v1" + "reusable": false } - ] + } } } } } } }, - "description": "Retrieve all proof records", + "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 - Proofs" + "DIDComm - Out Of Band" ], "security": [ { @@ -4639,38 +5852,123 @@ ] } ], - "parameters": [ - { - "in": "query", - "name": "threadId", - "required": false, - "schema": { - "type": "string" + "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/proofs/{proofRecordId}": { - "get": { - "operationId": "GetProofById", + "/didcomm/oob/create-legacy-invitation": { + "post": { + "operationId": "CreateLegacyInvitation", "responses": { "200": { - "description": "ProofRecord", + "description": "out-of-band record and invitation", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Record_string.unknown_" + "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": { - "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" + "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 + } } } } @@ -4678,9 +5976,9 @@ } } }, - "description": "Retrieve proof record by proof record id", + "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 - Proofs" + "DIDComm - Out Of Band" ], "security": [ { @@ -4690,38 +5988,63 @@ ] } ], - "parameters": [ - { - "in": "path", - "name": "proofRecordId", - "required": true, - "schema": { - "$ref": "#/components/schemas/RecordId" + "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/proofs/propose-proof": { + "/didcomm/oob/create-legacy-connectionless-invitation": { "post": { - "operationId": "ProposeProof", + "operationId": "CreateLegacyConnectionlessInvitation", "responses": { "200": { - "description": "ProofRecord", + "description": "a message and a invitationUrl", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProofExchangeRecord" + "properties": { + "outOfBandRecord": { + "$ref": "#/components/schemas/OutOfBandRecord" + }, + "invitationUrl": { + "type": "string" + }, + "message": { + "$ref": "#/components/schemas/AgentMessage" + } + }, + "required": [ + "outOfBandRecord", + "invitationUrl", + "message" + ], + "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" + "message": { + "@id": "eac4ff4e-b4fb-4c1d-aef3-b29c89d1cc00", + "@type": "https://didcomm.org/connections/1.0/invitation" + }, + "invitationUrl": "http://example.com/invitation_url" } } } @@ -4729,9 +6052,9 @@ } } }, - "description": "Initiate a new presentation exchange as prover by sending a presentation proposal request\nto the connection with the specified connection id.", + "description": "Creates a new connectionless legacy invitation.", "tags": [ - "DIDComm - Proofs" + "DIDComm - Out Of Band" ], "security": [ { @@ -4743,37 +6066,117 @@ ], "parameters": [], "requestBody": { + "description": "configuration of how a connection invitation should be created", "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RequestProofProposalOptions" + "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/proofs/{proofRecordId}/accept-proposal": { + "/didcomm/oob/receive-invitation": { "post": { - "operationId": "AcceptProposal", + "operationId": "ReceiveInvitation", "responses": { "200": { - "description": "ProofRecord", + "description": "out-of-band record and connection record if one has been created.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProofExchangeRecord" + "properties": { + "connectionRecord": { + "$ref": "#/components/schemas/Record_string.unknown_" + }, + "outOfBandRecord": { + "$ref": "#/components/schemas/Record_string.unknown_" + } + }, + "required": [ + "connectionRecord", + "outOfBandRecord" + ], + "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" + "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" + } } } } @@ -4781,9 +6184,9 @@ } } }, - "description": "Accept a presentation proposal as verifier by sending an accept proposal message\nto the connection associated with the proof record.", + "description": "Creates inbound out-of-band record and assigns out-of-band invitation message to it if the\nmessage is valid.", "tags": [ - "DIDComm - Proofs" + "DIDComm - Out Of Band" ], "security": [ { @@ -4799,33 +6202,92 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AcceptProofProposal" + "$ref": "#/components/schemas/ReceiveInvitationProps" } } } } } }, - "/didcomm/proofs/request-proof": { + "/didcomm/oob/receive-invitation-url": { "post": { - "operationId": "RequestProof", + "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/ProofExchangeRecord" + "properties": { + "connectionRecord": { + "$ref": "#/components/schemas/Record_string.unknown_" + }, + "outOfBandRecord": { + "$ref": "#/components/schemas/Record_string.unknown_" + } + }, + "required": [ + "connectionRecord", + "outOfBandRecord" + ], + "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" + "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" + } } } } @@ -4833,9 +6295,9 @@ } } }, - "description": "Creates a presentation request bound to existing connection", + "description": "Creates inbound out-of-band record and assigns out-of-band invitation message to it if the\nmessage is valid.", "tags": [ - "DIDComm - Proofs" + "DIDComm - Out Of Band" ], "security": [ { @@ -4851,16 +6313,16 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RequestProofOptions" + "$ref": "#/components/schemas/ReceiveInvitationByUrlProps" } } } } } }, - "/didcomm/proofs/create-request-oob": { + "/didcomm/oob/{outOfBandId}/accept-invitation": { "post": { - "operationId": "CreateRequest", + "operationId": "AcceptInvitation", "responses": { "200": { "description": "Ok", @@ -4868,44 +6330,75 @@ "application/json": { "schema": { "properties": { - "proofMessageId": { - "type": "string" - }, - "proofRecordThId": { - "type": "string" - }, - "invitationDid": { - "type": "string" + "connectionRecord": { + "$ref": "#/components/schemas/Record_string.unknown_" }, "outOfBandRecord": { "$ref": "#/components/schemas/Record_string.unknown_" - }, - "invitation": { - "$ref": "#/components/schemas/PlaintextMessage" - }, - "invitationUrl": { - "type": "string" } }, "required": [ - "proofMessageId", - "proofRecordThId", - "invitationDid", - "outOfBandRecord", - "invitation", - "invitationUrl" + "connectionRecord", + "outOfBandRecord" ], "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" + "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" + } } } } @@ -4913,9 +6406,9 @@ } } }, - "description": "Creates a presentation request not bound to any proposal or existing connection", + "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 - Proofs" + "DIDComm - Out Of Band" ], "security": [ { @@ -4925,49 +6418,75 @@ ] } ], - "parameters": [], + "parameters": [ + { + "in": "path", + "name": "outOfBandId", + "required": true, + "schema": { + "$ref": "#/components/schemas/RecordId" + } + } + ], "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateProofRequestOobOptions" + "$ref": "#/components/schemas/AcceptInvitationConfig" } } } } } }, - "/didcomm/proofs/{proofRecordId}/accept-request": { - "post": { - "operationId": "AcceptRequest", + "/didcomm/credentials": { + "get": { + "operationId": "GetAllCredentials", "responses": { "200": { - "description": "ProofRecord", + "description": "CredentialExchangeRecord[]", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Record_string.unknown_" + "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" - } + "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 presentation request as prover by sending an accept request message\nto the connection associated with the proof record.", + "description": "Retrieve all credential exchange records", "tags": [ - "DIDComm - Proofs" + "DIDComm - Credentials" ], "security": [ { @@ -4979,67 +6498,68 @@ ], "parameters": [ { - "in": "path", - "name": "proofRecordId", - "required": true, + "in": "query", + "name": "threadId", + "required": false, "schema": { - "type": "string" + "$ref": "#/components/schemas/ThreadId" } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "properties": { - "comment": { - "type": "string" - }, - "filterByNonRevocationRequirements": { - "type": "boolean" - }, - "filterByPresentationPreview": { - "type": "boolean" - } - }, - "type": "object" - } + }, + { + "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/proofs/{proofRecordId}/accept-presentation": { - "post": { - "operationId": "AcceptPresentation", + "/didcomm/credentials/w3c": { + "get": { + "operationId": "GetAllW3c", "responses": { "200": { - "description": "ProofRecord", + "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" - } - } + "items": { + "$ref": "#/components/schemas/W3cCredentialRecord" + }, + "type": "array" } } } } }, - "description": "Accept a presentation as prover by sending an accept presentation message\nto the connection associated with the proof record.", "tags": [ - "DIDComm - Proofs" + "DIDComm - Credentials" ], "security": [ { @@ -5049,48 +6569,26 @@ ] } ], - "parameters": [ - { - "in": "path", - "name": "proofRecordId", - "required": true, - "schema": { - "type": "string" - } - } - ] + "parameters": [] } }, - "/didcomm/proofs/{proofRecordId}/form-data": { + "/didcomm/credentials/w3c/{id}": { "get": { - "operationId": "ProofFormData", + "operationId": "GetW3cById", "responses": { "200": { - "description": "ProofRecord", + "description": "Ok", "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" - } - } + "$ref": "#/components/schemas/W3cCredentialRecord" } } } } }, - "description": "Return proofRecord", "tags": [ - "DIDComm - Proofs" + "DIDComm - Credentials" ], "security": [ { @@ -5103,7 +6601,7 @@ "parameters": [ { "in": "path", - "name": "proofRecordId", + "name": "id", "required": true, "schema": { "type": "string" @@ -5112,71 +6610,48 @@ ] } }, - "/didcomm/oob": { + "/didcomm/credentials/{credentialRecordId}": { "get": { - "operationId": "GetAllOutOfBandRecords", + "operationId": "GetCredentialById", "responses": { "200": { - "description": "OutOfBandRecord[]", + "description": "CredentialExchangeRecord", "content": { "application/json": { "schema": { - "items": { - "$ref": "#/components/schemas/Record_string.unknown_" - }, - "type": "array" + "$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 - } - ] + "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 out of band records", + "description": "Retrieve credential exchange record by credential record id", "tags": [ - "DIDComm - Out Of Band" + "DIDComm - Credentials" ], "security": [ { @@ -5188,10 +6663,9 @@ ], "parameters": [ { - "description": "invitation identifier", - "in": "query", - "name": "invitationId", - "required": false, + "in": "path", + "name": "credentialRecordId", + "required": true, "schema": { "$ref": "#/components/schemas/RecordId" } @@ -5199,56 +6673,38 @@ ] } }, - "/didcomm/oob/{outOfBandId}": { - "get": { - "operationId": "GetOutOfBandRecordById", + "/didcomm/credentials/propose-credential": { + "post": { + "operationId": "ProposeCredential", "responses": { "200": { - "description": "OutOfBandRecord", + "description": "CredentialExchangeRecord", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Record_string.unknown_" + "$ref": "#/components/schemas/CredentialExchangeRecord" }, "examples": { "Example 1": { "value": { "_tags": { - "invitationId": "1cbd22e4-1906-41e9-8807-83d84437f978", - "state": "await-response", - "role": "sender", - "recipientKeyFingerprints": [ - "z6MktUCPZjfRJXD4GMcYuXiqX2qZ8vBw6UAYpDFiHEUfwuLj" - ] + "state": "offer-sent", + "threadId": "82701488-b43c-4d7b-9244-4bb204a7ae26", + "connectionId": "ac6d0fdd-0db8-4f52-8a3d-de7ff8ddc14b" }, - "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": { + "_internal/indyCredential": { + "credentialDefinitionId": "q7ATwTYbQDgiigVijUAej:3:CL:318187:latest", + "schemaId": "q7ATwTYbQDgiigVijUAej:2:Employee Badge:1.0" + } }, - "metadata": {}, - "id": "42a95528-0e30-4f86-a462-0efb02178b53", + "credentials": [], + "id": "821f9b26-ad04-4f56-89b6-e2ef9c72b36e", "createdAt": "2022-01-01T00:00:00.000Z", - "reusable": false + "connectionId": "ac6d0fdd-0db8-4f52-8a3d-de7ff8ddc14b", + "threadId": "82701488-b43c-4d7b-9244-4bb204a7ae26", + "credentialAttributes": [], + "protocolVersion": "v1" } } } @@ -5256,9 +6712,9 @@ } } }, - "description": "Retrieve an out of band record by id", + "description": "Initiate a new credential exchange as holder by sending a propose credential message\nto the connection with a specified connection id.", "tags": [ - "DIDComm - Out Of Band" + "DIDComm - Credentials" ], "security": [ { @@ -5268,27 +6724,61 @@ ] } ], - "parameters": [ - { - "in": "path", - "name": "outOfBandId", - "required": true, - "schema": { - "$ref": "#/components/schemas/RecordId" + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProposeCredentialOptions" + } } } - ] - }, - "delete": { - "operationId": "DeleteOutOfBandRecord", + } + } + }, + "/didcomm/credentials/accept-proposal": { + "post": { + "operationId": "AcceptProposal", "responses": { - "204": { - "description": "No content" + "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": "Deletes an out of band record from the repository.", + "description": "Accept a credential proposal as issuer by sending an accept proposal message\nto the connection associated with the credential exchange record.", "tags": [ - "DIDComm - Out Of Band" + "DIDComm - Credentials" ], "security": [ { @@ -5298,116 +6788,51 @@ ] } ], - "parameters": [ - { - "description": "Record identifier", - "in": "path", - "name": "outOfBandId", - "required": true, - "schema": { - "$ref": "#/components/schemas/RecordId" + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AcceptCredentialProposalOptions" + } } } - ] + } } }, - "/didcomm/oob/create-invitation": { + "/didcomm/credentials/create-offer": { "post": { - "operationId": "CreateInvitation", + "operationId": "CreateOffer", "responses": { "200": { - "description": "Out of band record", + "description": "AgentMessage, CredentialExchangeRecord", "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" + "$ref": "#/components/schemas/CredentialExchangeRecord" }, "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": [] - } - ] + "_tags": { + "state": "offer-sent", + "threadId": "82701488-b43c-4d7b-9244-4bb204a7ae26", + "connectionId": "ac6d0fdd-0db8-4f52-8a3d-de7ff8ddc14b" }, - "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 - } + "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" } } } @@ -5415,9 +6840,9 @@ } } }, - "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.", + "description": "Initiate a new credential exchange as issuer by creating a credential offer\nwithout specifying a connection id", "tags": [ - "DIDComm - Out Of Band" + "DIDComm - Credentials" ], "security": [ { @@ -5429,36 +6854,36 @@ ], "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" + "$ref": "#/components/schemas/CreateOfferOptions" } } } } } }, - "/didcomm/oob/create-legacy-invitation": { + "/didcomm/credentials/create-offer-oob": { "post": { - "operationId": "CreateLegacyInvitation", + "operationId": "CreateOfferOob", "responses": { "200": { - "description": "out-of-band record and invitation", + "description": "Ok", "content": { "application/json": { "schema": { "properties": { + "invitationDid": { + "type": "string" + }, + "credentialRequestThId": { + "type": "string" + }, + "outOfBandRecordId": { + "type": "string" + }, "outOfBandRecord": { "$ref": "#/components/schemas/Record_string.unknown_" }, @@ -5467,83 +6892,78 @@ }, "invitationUrl": { "type": "string" - }, - "recipientKey": { - "type": "string" } }, "required": [ + "invitationDid", + "credentialRequestThId", + "outOfBandRecordId", "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 - } + } + } + } + } + }, + "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" } } } @@ -5551,9 +6971,9 @@ } } }, - "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.", + "description": "Accept a credential offer as holder by sending an accept offer message\nto the connection associated with the credential exchange record.", "tags": [ - "DIDComm - Out Of Band" + "DIDComm - Credentials" ], "security": [ { @@ -5565,61 +6985,49 @@ ], "parameters": [], "requestBody": { - "description": "configuration of how a invitation should be created", - "required": false, + "required": true, "content": { "application/json": { "schema": { - "allOf": [ - { - "$ref": "#/components/schemas/Omit_CreateLegacyInvitationConfig.routing_" - }, - { - "$ref": "#/components/schemas/RecipientKeyOption" - } - ], - "description": "configuration of how a invitation should be created" + "$ref": "#/components/schemas/CredentialOfferOptions" } } } } } }, - "/didcomm/oob/create-legacy-connectionless-invitation": { + "/didcomm/credentials/accept-request": { "post": { - "operationId": "CreateLegacyConnectionlessInvitation", + "operationId": "AcceptRequest", "responses": { "200": { - "description": "a message and a invitationUrl", + "description": "CredentialExchangeRecord", "content": { "application/json": { "schema": { - "properties": { - "outOfBandRecord": { - "$ref": "#/components/schemas/OutOfBandRecord" - }, - "invitationUrl": { - "type": "string" - }, - "message": { - "$ref": "#/components/schemas/AgentMessage" - } - }, - "required": [ - "outOfBandRecord", - "invitationUrl", - "message" - ], - "type": "object" + "$ref": "#/components/schemas/CredentialExchangeRecord" }, "examples": { "Example 1": { "value": { - "message": { - "@id": "eac4ff4e-b4fb-4c1d-aef3-b29c89d1cc00", - "@type": "https://didcomm.org/connections/1.0/invitation" + "_tags": { + "state": "offer-sent", + "threadId": "82701488-b43c-4d7b-9244-4bb204a7ae26", + "connectionId": "ac6d0fdd-0db8-4f52-8a3d-de7ff8ddc14b" }, - "invitationUrl": "http://example.com/invitation_url" + "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" } } } @@ -5627,9 +7035,9 @@ } } }, - "description": "Creates a new connectionless legacy invitation.", + "description": "Accept a credential request as issuer by sending an accept request message\nto the connection associated with the credential exchange record.", "tags": [ - "DIDComm - Out Of Band" + "DIDComm - Credentials" ], "security": [ { @@ -5641,114 +7049,49 @@ ], "parameters": [], "requestBody": { - "description": "configuration of how a connection invitation should be created", "required": true, "content": { "application/json": { "schema": { - "properties": { - "domain": { - "type": "string" - }, - "message": { - "$ref": "#/components/schemas/AgentMessageType" - }, - "recordId": { - "type": "string" - } - }, - "required": [ - "domain", - "message", - "recordId" - ], - "type": "object", - "description": "configuration of how a connection invitation should be created" + "$ref": "#/components/schemas/AcceptCredentialRequestOptions" } } } } } }, - "/didcomm/oob/receive-invitation": { + "/didcomm/credentials/accept-credential": { "post": { - "operationId": "ReceiveInvitation", + "operationId": "AcceptCredential", "responses": { "200": { - "description": "out-of-band record and connection record if one has been created.", + "description": "CredentialExchangeRecord", "content": { "application/json": { "schema": { - "properties": { - "connectionRecord": { - "$ref": "#/components/schemas/Record_string.unknown_" - }, - "outOfBandRecord": { - "$ref": "#/components/schemas/Record_string.unknown_" - } - }, - "required": [ - "connectionRecord", - "outOfBandRecord" - ], - "type": "object" + "$ref": "#/components/schemas/CredentialExchangeRecord" }, "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 + "_tags": { + "state": "offer-sent", + "threadId": "82701488-b43c-4d7b-9244-4bb204a7ae26", + "connectionId": "ac6d0fdd-0db8-4f52-8a3d-de7ff8ddc14b" }, - "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" - } + "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" } } } @@ -5756,9 +7099,9 @@ } } }, - "description": "Creates inbound out-of-band record and assigns out-of-band invitation message to it if the\nmessage is valid.", + "description": "Accept a credential as holder by sending an accept credential message\nto the connection associated with the credential exchange record.", "tags": [ - "DIDComm - Out Of Band" + "DIDComm - Credentials" ], "security": [ { @@ -5774,78 +7117,70 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ReceiveInvitationProps" + "$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/oob/receive-invitation-url": { - "post": { - "operationId": "ReceiveInvitationFromUrl", + "/didcomm/connections": { + "get": { + "operationId": "GetAllConnections", "responses": { "200": { - "description": "out-of-band record and connection record if one has been created.", + "description": "ConnectionRecord[]", "content": { "application/json": { "schema": { - "properties": { - "connectionRecord": { - "$ref": "#/components/schemas/Record_string.unknown_" - }, - "outOfBandRecord": { - "$ref": "#/components/schemas/Record_string.unknown_" - } + "items": { + "$ref": "#/components/schemas/Record_string.unknown_" }, - "required": [ - "connectionRecord", - "outOfBandRecord" - ], - "type": "object" + "type": "array" }, "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": { + "value": [ + { "_tags": { "invitationDid": "did:peer:2.SeyJzIjoiaHR0cHM6Ly9kYTIzLTg5LTIwLTE2Mi0xNDYubmdyb2suaW8iLCJ0IjoiZGlkLWNvbW11bmljYXRpb24iLCJwcmlvcml0eSI6MCwicmVjaXBpZW50S2V5cyI6WyJkaWQ6a2V5Ono2TWtualg3U1lXRmdHMThCYkNEZHJnemhuQnA0UlhyOGVITHZxQ3FvRXllckxiTiN6Nk1rbmpYN1NZV0ZnRzE4QmJDRGRyZ3pobkJwNFJYcjhlSEx2cUNxb0V5ZXJMYk4iXSwiciI6W119", "did": "did:peer:1zQmfQh1T3rSqarP2FZ37uKjdQHPKFdVyo2mGiAPHZ8Ep7hv", @@ -5860,16 +7195,16 @@ "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.", + "description": "Retrieve all connections records", "tags": [ - "DIDComm - Out Of Band" + "DIDComm - Connections" ], "security": [ { @@ -5879,98 +7214,180 @@ ] } ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ReceiveInvitationByUrlProps" - } + "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/oob/{outOfBandId}/accept-invitation": { - "post": { - "operationId": "AcceptInvitation", + "/didcomm/connections/{connectionId}": { + "get": { + "operationId": "GetConnectionById", "responses": { "200": { - "description": "Ok", + "description": "ConnectionRecord", "content": { "application/json": { "schema": { - "properties": { - "connectionRecord": { - "$ref": "#/components/schemas/Record_string.unknown_" - }, - "outOfBandRecord": { - "$ref": "#/components/schemas/Record_string.unknown_" - } - }, - "required": [ - "connectionRecord", - "outOfBandRecord" - ], - "type": "object" + "$ref": "#/components/schemas/Record_string.unknown_" }, "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", + "_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 connection record by connection id", + "tags": [ + "DIDComm - Connections" + ], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } + ], + "parameters": [ + { + "description": "Connection identifier", + "in": "path", + "name": "connectionId", + "required": true, + "schema": { + "$ref": "#/components/schemas/RecordId" + } + } + ] + }, + "delete": { + "operationId": "DeleteConnection", + "responses": { + "204": { + "description": "No content" + } + }, + "description": "Deletes a connection record from the connection repository.", + "tags": [ + "DIDComm - Connections" + ], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } + ], + "parameters": [ + { + "description": "Connection identifier", + "in": "path", + "name": "connectionId", + "required": true, + "schema": { + "$ref": "#/components/schemas/RecordId" + } + } + ] + } + }, + "/didcomm/connections/{connectionId}/accept-request": { + "post": { + "operationId": "AcceptRequest", + "responses": { + "200": { + "description": "ConnectionRecord", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Record_string.unknown_" + }, + "examples": { + "Example 1": { + "value": { + "_tags": { "invitationDid": "did:peer:2.SeyJzIjoiaHR0cHM6Ly9kYTIzLTg5LTIwLTE2Mi0xNDYubmdyb2suaW8iLCJ0IjoiZGlkLWNvbW11bmljYXRpb24iLCJwcmlvcml0eSI6MCwicmVjaXBpZW50S2V5cyI6WyJkaWQ6a2V5Ono2TWtualg3U1lXRmdHMThCYkNEZHJnemhuQnA0UlhyOGVITHZxQ3FvRXllckxiTiN6Nk1rbmpYN1NZV0ZnRzE4QmJDRGRyZ3pobkJwNFJYcjhlSEx2cUNxb0V5ZXJMYk4iXSwiciI6W119", - "outOfBandId": "edbc89fe-785f-4774-a288-46012486881d" - } + "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" } } } @@ -5978,9 +7395,9 @@ } } }, - "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.", + "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 - Out Of Band" + "DIDComm - Connections" ], "security": [ { @@ -5992,73 +7409,54 @@ ], "parameters": [ { + "description": "Connection identifier", "in": "path", - "name": "outOfBandId", + "name": "connectionId", "required": true, "schema": { "$ref": "#/components/schemas/RecordId" } } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AcceptInvitationConfig" - } - } - } - } + ] } }, - "/didcomm/credentials": { - "get": { - "operationId": "GetAllCredentials", + "/didcomm/connections/{connectionId}/accept-response": { + "post": { + "operationId": "AcceptResponse", "responses": { "200": { - "description": "CredentialExchangeRecord[]", + "description": "ConnectionRecord", "content": { "application/json": { "schema": { - "items": { - "$ref": "#/components/schemas/Record_string.unknown_" - }, - "type": "array" + "$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" - } - ] + "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 credential exchange records", + "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 - Credentials" + "DIDComm - Connections" ], "security": [ { @@ -6070,51 +7468,20 @@ ], "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", + "description": "Connection identifier", + "in": "path", "name": "connectionId", - "required": false, + "required": true, "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": { + "/didcomm/url/{invitationId}": { "get": { - "operationId": "GetAllW3c", + "operationId": "GetInvitation", "responses": { "200": { "description": "Ok", @@ -6122,7 +7489,7 @@ "application/json": { "schema": { "items": { - "$ref": "#/components/schemas/W3cCredentialRecord" + "$ref": "#/components/schemas/ConnectionRecord" }, "type": "array" } @@ -6131,36 +7498,60 @@ } }, "tags": [ - "DIDComm - Credentials" + "DIDComm - Connections" ], - "security": [ + "security": [], + "parameters": [ { - "jwt": [ - "tenant", - "dedicated" - ] + "in": "path", + "name": "invitationId", + "required": true, + "schema": { + "type": "string" + } } - ], - "parameters": [] + ] } }, - "/didcomm/credentials/w3c/{id}": { + "/didcomm/basic-messages/{connectionId}": { "get": { - "operationId": "GetW3cById", + "operationId": "GetBasicMessages", "responses": { "200": { - "description": "Ok", + "description": "BasicMessageRecord[]", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/W3cCredentialRecord" + "items": { + "$ref": "#/components/schemas/BasicMessageRecord" + }, + "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", "tags": [ - "DIDComm - Credentials" + "DIDComm - Basic Messages" ], "security": [ { @@ -6172,48 +7563,39 @@ ], "parameters": [ { + "description": "Connection identifier", "in": "path", - "name": "id", + "name": "connectionId", "required": true, "schema": { - "type": "string" + "$ref": "#/components/schemas/RecordId" } } ] - } - }, - "/didcomm/credentials/{credentialRecordId}": { - "get": { - "operationId": "GetCredentialById", + }, + "post": { + "operationId": "SendMessage", "responses": { "200": { - "description": "CredentialExchangeRecord", + "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Record_string.unknown_" + "$ref": "#/components/schemas/BasicMessageRecord" }, "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" + "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" } } } @@ -6221,9 +7603,9 @@ } } }, - "description": "Retrieve credential exchange record by credential record id", + "description": "Send a basic message to a connection", "tags": [ - "DIDComm - Credentials" + "DIDComm - Basic Messages" ], "security": [ { @@ -6235,64 +7617,88 @@ ], "parameters": [ { + "description": "Connection identifier", "in": "path", - "name": "credentialRecordId", + "name": "connectionId", "required": true, "schema": { "$ref": "#/components/schemas/RecordId" } } - ] + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Record_content.string_" + } + } + } + } } }, - "/didcomm/credentials/propose-credential": { + "/multi-tenancy/create-tenant": { "post": { - "operationId": "ProposeCredential", + "operationId": "CreateTenant", "responses": { "200": { - "description": "CredentialExchangeRecord", + "description": "Ok", "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" + "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" } } } } }, - "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" + "MultiTenancy" ], "security": [ { "jwt": [ - "tenant", - "dedicated" + "Basewallet" ] } ], @@ -6302,177 +7708,195 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProposeCredentialOptions" + "$ref": "#/components/schemas/CreateTenantOptions" } } } } } }, - "/didcomm/credentials/accept-proposal": { + "/multi-tenancy/get-token/{tenantId}": { "post": { - "operationId": "AcceptProposal", + "operationId": "GetTenantToken", "responses": { "200": { - "description": "CredentialExchangeRecord", + "description": "Ok", + "content": { + "application/json": { + "schema": {} + } + } + }, + "404": { + "description": "", "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" + "properties": { + "reason": { + "type": "string" } - } + }, + "required": [ + "reason" + ], + "type": "object" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" } } } } }, - "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" + "MultiTenancy" ], "security": [ { "jwt": [ - "tenant", - "dedicated" + "Basewallet" ] } ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AcceptCredentialProposalOptions" - } + "parameters": [ + { + "in": "path", + "name": "tenantId", + "required": true, + "schema": { + "type": "string" } } - } + ] } }, - "/didcomm/credentials/create-offer": { - "post": { - "operationId": "CreateOffer", + "/multi-tenancy/{tenantId}": { + "get": { + "operationId": "GetTenantById", "responses": { "200": { - "description": "AgentMessage, CredentialExchangeRecord", + "description": "Ok", + "content": { + "application/json": { + "schema": {} + } + } + }, + "404": { + "description": "", "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" + "properties": { + "reason": { + "type": "string" } - } + }, + "required": [ + "reason" + ], + "type": "object" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" } } } } }, - "description": "Initiate a new credential exchange as issuer by creating a credential offer\nwithout specifying a connection id", "tags": [ - "DIDComm - Credentials" + "MultiTenancy" ], "security": [ { "jwt": [ - "tenant", - "dedicated" + "Basewallet" ] } ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateOfferOptions" - } + "parameters": [ + { + "in": "path", + "name": "tenantId", + "required": true, + "schema": { + "type": "string" } } - } - } - }, - "/didcomm/credentials/create-offer-oob": { - "post": { - "operationId": "CreateOfferOob", + ] + }, + "delete": { + "operationId": "DeleteTenantById", "responses": { "200": { "description": "Ok", + "content": { + "application/json": { + "schema": {} + } + } + }, + "404": { + "description": "", "content": { "application/json": { "schema": { "properties": { - "invitationDid": { - "type": "string" - }, - "credentialRequestThId": { - "type": "string" - }, - "outOfBandRecordId": { + "reason": { "type": "string" - }, - "outOfBandRecord": { - "$ref": "#/components/schemas/Record_string.unknown_" - }, - "invitation": { - "$ref": "#/components/schemas/PlaintextMessage" - }, - "invitationUrl": { + } + }, + "required": [ + "reason" + ], + "type": "object" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "message": { "type": "string" } }, "required": [ - "invitationDid", - "credentialRequestThId", - "outOfBandRecordId", - "outOfBandRecord", - "invitation", - "invitationUrl" + "message" ], "type": "object" } @@ -6481,71 +7905,57 @@ } }, "tags": [ - "DIDComm - Credentials" + "MultiTenancy" ], "security": [ { "jwt": [ - "tenant", - "dedicated" + "Basewallet" ] } ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateOfferOobOptions" - } + "parameters": [ + { + "in": "path", + "name": "tenantId", + "required": true, + "schema": { + "type": "string" } } - } + ] } }, - "/didcomm/credentials/accept-offer": { + "/openid4vc/issuance-sessions/create-credential-offer": { "post": { - "operationId": "AcceptOffer", + "operationId": "CreateCredentialOffer", "responses": { "200": { - "description": "CredentialExchangeRecord", + "description": "Ok", "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" + "properties": { + "issuanceSession": { + "$ref": "#/components/schemas/OpenId4VcIssuanceSessionRecord" + }, + "credentialOffer": { + "type": "string" } - } + }, + "required": [ + "issuanceSession", + "credentialOffer" + ], + "type": "object" } } } } }, - "description": "Accept a credential offer as holder by sending an accept offer message\nto the connection associated with the credential exchange record.", + "description": "Creates a credential offer with the specified credential configurations and authorization type.", "tags": [ - "DIDComm - Credentials" + "oid4vc issuance sessions" ], "security": [ { @@ -6561,55 +7971,31 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CredentialOfferOptions" + "$ref": "#/components/schemas/OpenId4VcIssuanceSessionsCreateOffer" } } } } } }, - "/didcomm/credentials/accept-request": { - "post": { - "operationId": "AcceptRequest", + "/openid4vc/issuance-sessions/{issuanceSessionId}": { + "get": { + "operationId": "GetIssuanceSessionsById", "responses": { "200": { - "description": "CredentialExchangeRecord", + "description": "Ok", "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" - } - } + "$ref": "#/components/schemas/OpenId4VcIssuanceSessionRecord" } } } } }, - "description": "Accept a credential request as issuer by sending an accept request message\nto the connection associated with the credential exchange record.", + "description": "Get issuance details by issuance SessionId", "tags": [ - "DIDComm - Credentials" + "oid4vc issuance sessions" ], "security": [ { @@ -6619,61 +8005,34 @@ ] } ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AcceptCredentialRequestOptions" - } + "parameters": [ + { + "in": "path", + "name": "issuanceSessionId", + "required": true, + "schema": { + "type": "string" } } - } - } - }, - "/didcomm/credentials/accept-credential": { - "post": { - "operationId": "AcceptCredential", + ] + }, + "put": { + "operationId": "UpdateSessionById", "responses": { "200": { - "description": "CredentialExchangeRecord", + "description": "Ok", "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" - } - } + "$ref": "#/components/schemas/OpenId4VcIssuanceSessionRecord" } } } } }, - "description": "Accept a credential as holder by sending an accept credential message\nto the connection associated with the credential exchange record.", + "description": "Update issuance session metadata by session ID", "tags": [ - "DIDComm - Credentials" + "oid4vc issuance sessions" ], "security": [ { @@ -6683,37 +8042,37 @@ ] } ], - "parameters": [], + "parameters": [ + { + "in": "path", + "name": "issuanceSessionId", + "required": true, + "schema": { + "type": "string" + } + } + ], "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_" - } + "schema": { + "$ref": "#/components/schemas/Record_string.unknown_" } } } + } + }, + "delete": { + "operationId": "DeleteIssuanceSessionById", + "responses": { + "204": { + "description": "No content" + } }, - "description": "Return credentialRecord", + "description": "Delete issuance session by session ID", "tags": [ - "DIDComm - Credentials" + "oid4vc issuance sessions" ], "security": [ { @@ -6726,7 +8085,7 @@ "parameters": [ { "in": "path", - "name": "credentialRecordId", + "name": "issuanceSessionId", "required": true, "schema": { "type": "string" @@ -6735,48 +8094,27 @@ ] } }, - "/didcomm/connections": { + "/openid4vc/issuance-sessions": { "get": { - "operationId": "GetAllConnections", + "operationId": "GetIssuanceSessionsByQuery", "responses": { "200": { - "description": "ConnectionRecord[]", + "description": "Ok", "content": { "application/json": { "schema": { "items": { - "$ref": "#/components/schemas/Record_string.unknown_" + "$ref": "#/components/schemas/OpenId4VcIssuanceSessionRecord" }, "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", + "description": "Fetch all issuance sessions by query", "tags": [ - "DIDComm - Connections" + "oid4vc issuance sessions" ], "security": [ { @@ -6789,52 +8127,47 @@ "parameters": [ { "in": "query", - "name": "outOfBandId", + "name": "cNonce", "required": false, "schema": { "type": "string" } }, { - "description": "Alias", "in": "query", - "name": "alias", + "name": "publicIssuerId", "required": false, "schema": { "type": "string" } }, { - "description": "Connection state", "in": "query", - "name": "state", + "name": "preAuthorizedCode", "required": false, "schema": { - "$ref": "#/components/schemas/DidExchangeState" + "type": "string" } }, { - "description": "My DID", "in": "query", - "name": "myDid", + "name": "state", "required": false, "schema": { - "type": "string" + "$ref": "#/components/schemas/OpenId4VcIssuanceSessionState" } }, { - "description": "Their DID", "in": "query", - "name": "theirDid", + "name": "credentialOfferUri", "required": false, "schema": { "type": "string" } }, { - "description": "Their label", "in": "query", - "name": "theirLabel", + "name": "authorizationCode", "required": false, "schema": { "type": "string" @@ -6843,43 +8176,245 @@ ] } }, - "/didcomm/connections/{connectionId}": { + "/openid4vc/holder/sd-jwt-vcs": { "get": { - "operationId": "GetConnectionById", + "operationId": "GetSdJwtCredentials", "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": { + "$ref": "#/components/schemas/SdJwtVcRecord" + }, + "type": "array" + } + } + } + } + }, + "description": "Get SdJwt type of credentials", + "tags": [ + "oid4vc holders" + ], + "security": [ + { + "apiKey": [] + } + ], + "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": [ + { + "apiKey": [] + } + ], + "parameters": [] + } + }, + "/openid4vc/holder/authorization-request": { + "post": { + "operationId": "RequestAuthorizationForCredential", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "properties": { + "codeVerifier": { + "type": "string" + }, + "authorizationRequestUrl": { + "type": "string" + }, + "actionToTake": { + "type": "string" } - } + }, + "required": [ + "codeVerifier", + "authorizationRequestUrl", + "actionToTake" + ], + "type": "object" + } + } + } + } + }, + "description": "Resolve a credential offer", + "tags": [ + "oid4vc holders" + ], + "security": [ + { + "apiKey": [] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthorizeRequestCredentialOffer" + } + } + } + } + } + }, + "/openid4vc/holder/request-credential": { + "post": { + "operationId": "RequestCredential", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "items": {}, + "type": "array" + } + } + } + } + }, + "description": "Initiates a token request, then requests credentials from issuer", + "tags": [ + "oid4vc holders" + ], + "security": [ + { + "apiKey": [] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RequestCredentialBody" + } + } + } + } + } + }, + "/openid4vc/holder/resolve-proof-request": { + "post": { + "operationId": "ResolveProofRequest", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": {} + } + } + } + }, + "description": "Resolve a proof request", + "tags": [ + "oid4vc holders" + ], + "security": [ + { + "apiKey": [] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResolveProofRequest" + } + } + } + } + } + }, + "/openid4vc/holder/accept-proof-request": { + "post": { + "operationId": "AcceptProofRequest", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": {} + } + } + } + }, + "description": "Accept a proof request", + "tags": [ + "oid4vc holders" + ], + "security": [ + { + "apiKey": [] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResolveProofRequest" + } + } + } + } + } + }, + "/openid4vc/issuer": { + "post": { + "operationId": "CreateIssuer", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenId4VcIssuerRecord" } } } } }, - "description": "Retrieve connection record by connection id", + "description": "Creates an issuer with issuer metadata.", "tags": [ - "DIDComm - Connections" + "oid4vc issuers" ], "security": [ { @@ -6889,28 +8424,36 @@ ] } ], - "parameters": [ - { - "description": "Connection identifier", - "in": "path", - "name": "connectionId", - "required": true, - "schema": { - "$ref": "#/components/schemas/RecordId" + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": {} } } - ] + } }, - "delete": { - "operationId": "DeleteConnection", + "get": { + "operationId": "GetIssuersByQuery", "responses": { - "204": { - "description": "No content" + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/OpenId4VcIssuerRecord" + }, + "type": "array" + } + } + } } }, - "description": "Deletes a connection record from the connection repository.", + "description": "Query issuers by optional publicIssuerId.", "tags": [ - "DIDComm - Connections" + "oid4vc issuers" ], "security": [ { @@ -6922,54 +8465,34 @@ ], "parameters": [ { - "description": "Connection identifier", - "in": "path", - "name": "connectionId", - "required": true, + "in": "query", + "name": "publicIssuerId", + "required": false, "schema": { - "$ref": "#/components/schemas/RecordId" + "type": "string" } } ] } }, - "/didcomm/connections/{connectionId}/accept-request": { - "post": { - "operationId": "AcceptRequest", + "/openid4vc/issuer/{publicIssuerId}": { + "put": { + "operationId": "UpdateIssuerMetadata", "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" - } - } + "$ref": "#/components/schemas/OpenId4VcIssuerRecord" } } } } }, - "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.", + "description": "Updates issuer metadata for a given publicIssuerId.", "tags": [ - "DIDComm - Connections" + "oid4vc issuers" ], "security": [ { @@ -6981,54 +8504,42 @@ ], "parameters": [ { - "description": "Connection identifier", "in": "path", - "name": "connectionId", + "name": "publicIssuerId", "required": true, "schema": { - "$ref": "#/components/schemas/RecordId" + "type": "string" } } - ] - } - }, - "/didcomm/connections/{connectionId}/accept-response": { - "post": { - "operationId": "AcceptResponse", + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateIssuerRecordOptions" + } + } + } + } + }, + "get": { + "operationId": "GetIssuer", "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" - } - } + "$ref": "#/components/schemas/OpenId4VcIssuerRecord" } } } } }, - "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.", + "description": "Returns a specific issuer by publicIssuerId.", "tags": [ - "DIDComm - Connections" + "oid4vc issuers" ], "security": [ { @@ -7040,40 +8551,48 @@ ], "parameters": [ { - "description": "Connection identifier", "in": "path", - "name": "connectionId", + "name": "publicIssuerId", "required": true, "schema": { - "$ref": "#/components/schemas/RecordId" + "type": "string" } } ] } }, - "/didcomm/url/{invitationId}": { + "/openid4vc/issuer/{issuerId}/metadata": { "get": { - "operationId": "GetInvitation", + "operationId": "GetIssuerAgentMetaData", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PlaintextMessage" + "type": "number", + "format": "double" } } } } }, + "description": "Returns metadata for a specific issuer.", "tags": [ - "DIDComm - Connections" + "oid4vc issuers" + ], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } ], - "security": [], "parameters": [ { "in": "path", - "name": "invitationId", + "name": "issuerId", "required": true, "schema": { "type": "string" @@ -7082,45 +8601,17 @@ ] } }, - "/didcomm/basic-messages/{connectionId}": { - "get": { - "operationId": "GetBasicMessages", + "/openid4vc/issuer/{id}": { + "delete": { + "operationId": "DeleteIssuer", "responses": { - "200": { - "description": "BasicMessageRecord[]", - "content": { - "application/json": { - "schema": { - "items": { - "$ref": "#/components/schemas/BasicMessageRecord" - }, - "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" - } - ] - } - } - } - } + "204": { + "description": "No content" } }, - "description": "Retrieve basic messages by connection id", + "description": "Deletes a specific issuer by record id.", "tags": [ - "DIDComm - Basic Messages" + "oid4vc issuers" ], "security": [ { @@ -7132,222 +8623,172 @@ ], "parameters": [ { - "description": "Connection identifier", "in": "path", - "name": "connectionId", + "name": "id", "required": true, "schema": { - "$ref": "#/components/schemas/RecordId" + "type": "string" } } ] - }, - "post": { - "operationId": "SendMessage", + } + }, + "/openid4vc/verification-sessions": { + "get": { + "operationId": "GetAllVerificationSessions", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/BasicMessageRecord" - }, - "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" - } - } + "items": { + "$ref": "#/components/schemas/OpenId4VcVerificationSessionRecord" + }, + "type": "array" } } } } }, - "description": "Send a basic message to a connection", + "description": "Create an authorization request, acting as a Relying Party (RP)", "tags": [ - "DIDComm - Basic Messages" + "oid4vc verification sessions" ], - "security": [ + "security": [], + "parameters": [ { - "jwt": [ - "tenant", - "dedicated" - ] + "in": "query", + "name": "publicVerifierId", + "required": false, + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "payloadState", + "required": false, + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "state", + "required": false, + "schema": { + "$ref": "#/components/schemas/OpenId4VcVerificationSessionState" + } + }, + { + "in": "query", + "name": "authorizationRequestUri", + "required": false, + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "nonce", + "required": false, + "schema": { + "type": "string" + } + } + ] + } + }, + "/openid4vc/verification-sessions/{verificationSessionId}": { + "get": { + "operationId": "GetVerificationSessionsById", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenId4VcVerificationSessionRecord" + } + } + } } + }, + "description": "Get verification session by ID", + "tags": [ + "oid4vc verification sessions" ], + "security": [], "parameters": [ { - "description": "Connection identifier", "in": "path", - "name": "connectionId", + "name": "verificationSessionId", "required": true, "schema": { - "$ref": "#/components/schemas/RecordId" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Record_content.string_" - } + "type": "string" } } - } + ] } }, - "/multi-tenancy/create-tenant": { + "/openid4vc/verifier": { "post": { - "operationId": "CreateTenant", + "operationId": "CreateVerifier", "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/OpenId4VcVerifierRecord" } } } } }, + "description": "Create a new verifier and store the verifier record", "tags": [ - "MultiTenancy" - ], - "security": [ - { - "jwt": [ - "Basewallet" - ] - } + "oid4vc verifiers" ], + "security": [], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateTenantOptions" - } + "schema": {} } } } - } - }, - "/multi-tenancy/get-token/{tenantId}": { - "post": { - "operationId": "GetTenantToken", + }, + "get": { + "operationId": "GetVerifiersByQuery", "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" - } + "items": { + "$ref": "#/components/schemas/OpenId4VcVerifierRecord" }, - "required": [ - "message" - ], - "type": "object" + "type": "array" } } } } }, + "description": "Get verifiers by query", "tags": [ - "MultiTenancy" - ], - "security": [ - { - "jwt": [ - "Basewallet" - ] - } + "oid4vc verifiers" ], + "security": [], "parameters": [ { - "in": "path", - "name": "tenantId", - "required": true, + "in": "query", + "name": "publicVerifierId", + "required": false, "schema": { "type": "string" } @@ -7355,138 +8796,93 @@ ] } }, - "/multi-tenancy/{tenantId}": { - "get": { - "operationId": "GetTenantById", + "/openid4vc/verifier/{publicVerifierId}": { + "put": { + "operationId": "UpdateVerifierMetadata", "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" + "$ref": "#/components/schemas/OpenId4VcVerifierRecord" } } } } }, + "description": "Update verifier metadata", "tags": [ - "MultiTenancy" - ], - "security": [ - { - "jwt": [ - "Basewallet" - ] - } + "oid4vc verifiers" ], + "security": [], "parameters": [ { "in": "path", - "name": "tenantId", + "name": "publicVerifierId", "required": true, "schema": { "type": "string" } } - ] + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": {} + } + } + } }, - "delete": { - "operationId": "DeleteTenantById", + "get": { + "operationId": "GetVerifier", "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" + "$ref": "#/components/schemas/OpenId4VcVerifierRecord" } } } } }, + "description": "Get single verifier by ID", "tags": [ - "MultiTenancy" + "oid4vc verifiers" ], - "security": [ + "security": [], + "parameters": [ { - "jwt": [ - "Basewallet" - ] + "in": "path", + "name": "publicVerifierId", + "required": true, + "schema": { + "type": "string" + } + } + ] + } + }, + "/openid4vc/verifier/{verifierId}": { + "delete": { + "operationId": "DeleteVerifier", + "responses": { + "204": { + "description": "No content" } + }, + "description": "Delete verifier by ID", + "tags": [ + "oid4vc verifiers" ], + "security": [], "parameters": [ { "in": "path", - "name": "tenantId", + "name": "verifierId", "required": true, "schema": { "type": "string" diff --git a/src/utils/agent.ts b/src/utils/agent.ts index b01aecf1..4a664452 100644 --- a/src/utils/agent.ts +++ b/src/utils/agent.ts @@ -12,27 +12,34 @@ import { } from '@credo-ts/anoncreds' import { AskarModule } from '@credo-ts/askar' import { - AutoAcceptCredential, - CredentialsModule, DidsModule, - JsonLdCredentialFormatService, KeyDidRegistrar, KeyDidResolver, - DifPresentationExchangeProofFormatService, - ProofsModule, - V2CredentialProtocol, - V2ProofProtocol, WebDidResolver, Agent, - ConnectionInvitationMessage, - HttpOutboundTransport, LogLevel, } from '@credo-ts/core' + +import { + HttpOutboundTransport, + JsonLdCredentialFormatService, + DifPresentationExchangeProofFormatService, + ProofsModule, + AutoAcceptCredential, + V2ProofProtocol, + CredentialsModule, + V2CredentialProtocol, + DidCommModule, + OutOfBandModule, + MediationRecipientModule, + BasicMessagesModule, + ConnectionInvitationMessage +} from '@credo-ts/didcomm' import { IndyVdrAnonCredsRegistry, IndyVdrModule } from '@credo-ts/indy-vdr' import { agentDependencies, HttpInboundTransport } from '@credo-ts/node' import { TenantsModule } from '@credo-ts/tenants' import { anoncreds } from '@hyperledger/anoncreds-nodejs' -import { ariesAskar } from '@hyperledger/aries-askar-nodejs' +import { askar } from '@openwallet-foundation/askar-nodejs' import { indyVdr } from '@hyperledger/indy-vdr-nodejs' import { TsLogger } from './logger' @@ -42,7 +49,7 @@ export const setupAgent = async ({ name, endpoints, port }: { name: string; endp const config: InitConfig = { label: name, - endpoints: endpoints, + // endpoints: endpoints, walletConfig: { id: name, key: name, @@ -67,7 +74,7 @@ export const setupAgent = async ({ name, endpoints, port }: { name: string; endp ], }), askar: new AskarModule({ - ariesAskar, + askar, }), anoncreds: new AnonCredsModule({ @@ -109,6 +116,12 @@ export const setupAgent = async ({ name, endpoints, port }: { name: string; endp ], }), tenants: new TenantsModule(), + didcomm: new DidCommModule({ + processDidCommMessagesConcurrently: true, + }), + oob: new OutOfBandModule(), + mediationRecipient: new MediationRecipientModule(), + basicMessages: new BasicMessagesModule(), polygon: new PolygonModule({ didContractAddress: '', schemaManagerContractAddress: '', @@ -124,9 +137,9 @@ export const setupAgent = async ({ name, endpoints, port }: { name: string; endp port: port, }) - agent.registerInboundTransport(httpInbound) + agent.modules.didcomm.registerInboundTransport(httpInbound) - agent.registerOutboundTransport(new HttpOutboundTransport()) + agent.modules.didcomm.registerOutboundTransport(new HttpOutboundTransport()) httpInbound.app.get('/invitation', async (req, res) => { if (typeof req.query.d_m === 'string') { @@ -137,7 +150,7 @@ export const setupAgent = async ({ name, endpoints, port }: { name: string; endp const invitation = await ConnectionInvitationMessage.fromUrl(req.url) res.send(invitation.toJSON()) } else { - const { outOfBandInvitation } = await agent.oob.createInvitation() + const { outOfBandInvitation } = await agent.modules.oob.createInvitation() res.send(outOfBandInvitation.toUrl({ domain: endpoints + '/invitation' })) } diff --git a/src/utils/constant.ts b/src/utils/constant.ts new file mode 100644 index 00000000..643be69a --- /dev/null +++ b/src/utils/constant.ts @@ -0,0 +1 @@ +export const X509_CERTIFICATE_RECORD = 'X509_CERTIFICATE' \ No newline at end of file diff --git a/src/utils/oid4vc-agent.ts b/src/utils/oid4vc-agent.ts new file mode 100644 index 00000000..a3392891 --- /dev/null +++ b/src/utils/oid4vc-agent.ts @@ -0,0 +1,285 @@ +import type { DisclosureFrame } from '../controllers/types' +import type { + OpenId4VcCredentialHolderBinding, + OpenId4VcCredentialHolderDidBinding, + OpenId4VciCredentialRequestToCredentialMapper, + OpenId4VciSignMdocCredentials, + OpenId4VciSignSdJwtCredentials, + OpenId4VciSignW3cCredentials, +} from '@credo-ts/openid4vc' + +import { DidsApi } from '@credo-ts/core' +import { + ClaimFormat, + CredoError, + JsonTransformer, + W3cCredential, + W3cCredentialSubject, + W3cIssuer, + X509ModuleConfig, + parseDid, + w3cDate, +} from '@credo-ts/core' +import { OpenId4VciCredentialFormatProfile } from '@credo-ts/openid4vc' + +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 + }) => { + const issuanceMetadata = issuanceSession.issuanceMetadata + const issuerDid = issuanceMetadata?.['issuerDid'] as string | undefined + const issuerx509certificate = issuanceMetadata?.['issuerx509certificate'] as string[] | undefined + + if (!issuerDid && !issuerx509certificate) { + throw new Error('Either issuerDid or issuerx509certificate must be provided') + } + + let issuerDidUrl: string | undefined = '' + if (issuerDid) { + const didsApi = await agentContext.dependencyManager.resolve(DidsApi) + const didDocument = await didsApi.resolveDidDocument(issuerDid) + + // Set the first verificationMethod as backup, in case we won't find a match + if (!issuerDidUrl && didDocument.verificationMethod?.[0].id) { + issuerDidUrl = didDocument.verificationMethod?.[0].id + } + } + + if (!issuerDidUrl && !issuerx509certificate) { + throw new Error('No matching verification method found') + } + + 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) => c.credentialSupportedId === credentialConfigurationId) + : [] + const credentialConfiguration = supported[credentialConfigurationId] + + 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: issuerDidUrl ?? '', + } + : { method: 'x5c', x5c: trustedCertificates, issuer: 'ISSUER_HOST ' }, + })), + } satisfies OpenId4VciSignSdJwtCredentials + } + + if (credentialConfiguration.format === OpenId4VciCredentialFormatProfile.JwtVcJson) { + for (const holderBinding of holderBindings) { + assertDidBasedHolderBinding(holderBinding) + } + + 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, + } + // console.log(`Final ClaimFormat.JwtVc ---> ${JSON.stringify(finalVC)}`) + return finalVC + }), + } satisfies OpenId4VciSignW3cCredentials + } + + if (credentialConfiguration.format === OpenId4VciCredentialFormatProfile.SdJwtVc) { + const disclosureFramePayload = { + _sd: credentialPayload[0].disclosureFrame + ? Array.isArray(credentialPayload[0].disclosureFrame._sd) + ? credentialPayload[0].disclosureFrame._sd + : [] + : [], + } + + return { + credentialConfigurationId, + format: ClaimFormat.SdJwtVc, + credentials: holderBindings.map((holderBinding) => ({ + // payload: { + // vct: credentialConfiguration.vct, + // university: 'innsbruck', + // degree: 'bachelor', + // authorized_user: authorization.accessToken.payload.sub, + // }, + payload: credentialPayload[0].payload, + holder: holderBinding, + issuer: issuerDidUrl + ? { + method: 'did', + didUrl: issuerDidUrl, + //didUrl: `${issuerDidKey.did}#${issuerDidKey.key.fingerprint}`, + } + : { + method: 'x5c', + x5c: issuerx509certificate ?? [], //[issuerx509certificate??""], + issuer: process.env.AGENT_HOST ?? 'http://localhost:4001', + }, + disclosureFrame: disclosureFramePayload, + //disclosureFrame: { _sd: ['university', 'degree', 'authorized_user'] }, + })), + } satisfies OpenId4VciSignSdJwtCredentials + } + + // if (credentialConfiguration.format === OpenId4VciCredentialFormatProfile.MsoMdoc) { + // if (!issuerx509certificate) + // throw new Error( + // `issuerx509certificate is mot 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 + // let namespace = credentialConfiguration.doctype + + // return { + // credentialConfigurationId, + // format: ClaimFormat.MsoMdoc, + // credentials: holderBindings.map((holderBinding) => ({ + // issuerCertificate: issuerx509certificate[0], + // holderKey: holderBinding.key, + // namespaces: { + // [namespace]: { + // ...credentialPayload[0].payload, + // }, + // }, + // docType: credentialConfiguration.doctype, + // })), + // } satisfies OpenId4VciSignMdocCredentials + // } + + throw new Error('Invalid request') + } +} + +function assertDidBasedHolderBinding( + holderBinding: OpenId4VcCredentialHolderBinding, +): asserts holderBinding is OpenId4VcCredentialHolderDidBinding { + if (holderBinding.method !== 'did') { + throw new CredoError('Only did based holder bindings supported for this credential type') + } +} + +// async function fetchCredentialConfiguration(credentialConfigurationId: string, issuerDid: string) { +// // Fetch from database or API instead of static imports +// return database.findOne("credential_configurations", { id: credentialConfigurationId, issuerDid }); +// } + +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 +} diff --git a/tsoa.json b/tsoa.json index 92e95bd7..7e8fb938 100644 --- a/tsoa.json +++ b/tsoa.json @@ -5,6 +5,7 @@ "spec": { "outputDirectory": "src/routes", "specVersion": 3, + "tsconfig": "tsconfig.build.json", "securityDefinitions": { "apiKey": { "type": "apiKey", @@ -20,7 +21,8 @@ }, "routes": { "routesDir": "./src/routes", + "tsconfig": "tsconfig.build.json", "iocModule": "./src/utils/tsyringeTsoaIocContainer", "authenticationModule": "src/authentication" } -} +} \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 37da031c..aa544109 100644 --- a/yarn.lock +++ b/yarn.lock @@ -37,24 +37,24 @@ "@jridgewell/gen-mapping" "^0.3.5" "@jridgewell/trace-mapping" "^0.3.24" -"@animo-id/mdoc@0.2.38": - version "0.2.38" - resolved "https://registry.yarnpkg.com/@animo-id/mdoc/-/mdoc-0.2.38.tgz#e708a0df5eba3491b4c8e858d53ba9504f6ae472" - integrity sha512-98KQ0jvwTYsFOffTGvvHXBDo23b5xmhYjPiMIX6e807I6iS4fZZ9ypfBySdA5IiGUvXELKqEv27AUaayQa/9bg== +"@animo-id/mdoc@^0.5.2": + version "0.5.2" + resolved "https://registry.yarnpkg.com/@animo-id/mdoc/-/mdoc-0.5.2.tgz#77c4ac564925126f3dac9a989be888ad9e38afa1" + integrity sha512-EQVsNOOeXFfBaEHkiKoh24jbSEQ1MORB/kUu0rnNrAEETpY5GK/H9iWevYFdmNDIqQTIEJlkU7S+sIj3pe66eA== dependencies: compare-versions "^6.1.1" -"@animo-id/pex@4.1.1-alpha.0": - version "4.1.1-alpha.0" - resolved "https://registry.yarnpkg.com/@animo-id/pex/-/pex-4.1.1-alpha.0.tgz#037665dd143315e9b18380647d6eb8511a65807e" - integrity sha512-6ieHhH9UE9DLFOJegMCabG3qUFlQk4TLhBefxInpyjx2Ly6kuloVMScJYcnQTs/E6nuHGMd7ebUaKy4+0+ZbOA== +"@animo-id/pex@5.2.0": + version "5.2.0" + resolved "https://registry.yarnpkg.com/@animo-id/pex/-/pex-5.2.0.tgz#540895b7ffb36da800d303cd2aee12daebd52850" + integrity sha512-W0nopdAS1boDOuhH1L5yUyNOo4LJwIqVc3x90ua0ypNXuOv6gDkr78nNTqIjaF0eBKakagTYegbDZrfQrlmRBQ== dependencies: "@astronautlabs/jsonpath" "^1.1.2" "@sd-jwt/decode" "^0.7.2" "@sd-jwt/present" "^0.7.2" "@sd-jwt/types" "^0.7.2" - "@sphereon/pex-models" "^2.3.1" - "@sphereon/ssi-types" "0.30.2-next.135" + "@sphereon/pex-models" "^2.3.2" + "@sphereon/ssi-types" "0.33.0" ajv "^8.12.0" ajv-formats "^2.1.1" jwt-decode "^3.1.2" @@ -135,40 +135,40 @@ picocolors "^1.1.1" "@babel/compat-data@^7.27.2": - version "7.27.3" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.27.3.tgz#cc49c2ac222d69b889bf34c795f537c0c6311111" - integrity sha512-V42wFfx1ymFte+ecf6iXghnnP8kWTO+ZLXIyZq+1LAXHHvTZdVxicn4yiVYdYMGaCO3tmqub11AorKkv+iodqw== + version "7.28.0" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.28.0.tgz#9fc6fd58c2a6a15243cd13983224968392070790" + integrity sha512-60X7qkglvrap8mn1lh2ebxXdZYtUcpd7gsmy9kLaBJ4i/WdY8PqTSdxyA8qraikqKQK5C1KRBKXqznrVapyNaw== "@babel/core@^7.11.6", "@babel/core@^7.12.3", "@babel/core@^7.14.6", "@babel/core@^7.23.9": - version "7.27.3" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.27.3.tgz#d7d05502bccede3cab36373ed142e6a1df554c2f" - integrity sha512-hyrN8ivxfvJ4i0fIJuV4EOlV0WDMz5Ui4StRTgVaAvWeiRCilXgwVvxJKtFQ3TKtHgJscB2YiXKGNJuVwhQMtA== + version "7.28.3" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.28.3.tgz#aceddde69c5d1def69b839d09efa3e3ff59c97cb" + integrity sha512-yDBHV9kQNcr2/sUr9jghVyz9C3Y5G2zUM2H2lo+9mKv4sFgbA8s8Z9t8D1jiTkGoO/NoIfKMyKWr4s6CN23ZwQ== dependencies: "@ampproject/remapping" "^2.2.0" "@babel/code-frame" "^7.27.1" - "@babel/generator" "^7.27.3" + "@babel/generator" "^7.28.3" "@babel/helper-compilation-targets" "^7.27.2" - "@babel/helper-module-transforms" "^7.27.3" - "@babel/helpers" "^7.27.3" - "@babel/parser" "^7.27.3" + "@babel/helper-module-transforms" "^7.28.3" + "@babel/helpers" "^7.28.3" + "@babel/parser" "^7.28.3" "@babel/template" "^7.27.2" - "@babel/traverse" "^7.27.3" - "@babel/types" "^7.27.3" + "@babel/traverse" "^7.28.3" + "@babel/types" "^7.28.2" convert-source-map "^2.0.0" debug "^4.1.0" gensync "^1.0.0-beta.2" json5 "^2.2.3" semver "^6.3.1" -"@babel/generator@^7.27.3", "@babel/generator@^7.7.2": - version "7.27.3" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.27.3.tgz#ef1c0f7cfe3b5fc8cbb9f6cc69f93441a68edefc" - integrity sha512-xnlJYj5zepml8NXtjkG0WquFUv8RskFqyFcVgTBp5k+NaA/8uw/K+OSVf8AMGw5e9HKP2ETd5xpK5MLZQD6b4Q== +"@babel/generator@^7.28.3", "@babel/generator@^7.7.2": + version "7.28.3" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.28.3.tgz#9626c1741c650cbac39121694a0f2d7451b8ef3e" + integrity sha512-3lSpxGgvnmZznmBkCRnVREPUFJv2wrv9iAoFDvADJc0ypmdOxdUtcLeBgBJ6zE0PMeTKnxeQzyk0xTBq4Ep7zw== dependencies: - "@babel/parser" "^7.27.3" - "@babel/types" "^7.27.3" - "@jridgewell/gen-mapping" "^0.3.5" - "@jridgewell/trace-mapping" "^0.3.25" + "@babel/parser" "^7.28.3" + "@babel/types" "^7.28.2" + "@jridgewell/gen-mapping" "^0.3.12" + "@jridgewell/trace-mapping" "^0.3.28" jsesc "^3.0.2" "@babel/helper-compilation-targets@^7.27.2": @@ -182,6 +182,11 @@ lru-cache "^5.1.1" semver "^6.3.1" +"@babel/helper-globals@^7.28.0": + version "7.28.0" + resolved "https://registry.yarnpkg.com/@babel/helper-globals/-/helper-globals-7.28.0.tgz#b9430df2aa4e17bc28665eadeae8aa1d985e6674" + integrity sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw== + "@babel/helper-module-imports@^7.27.1": version "7.27.1" resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.27.1.tgz#7ef769a323e2655e126673bb6d2d6913bbead204" @@ -190,14 +195,14 @@ "@babel/traverse" "^7.27.1" "@babel/types" "^7.27.1" -"@babel/helper-module-transforms@^7.27.1", "@babel/helper-module-transforms@^7.27.3": - version "7.27.3" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.27.3.tgz#db0bbcfba5802f9ef7870705a7ef8788508ede02" - integrity sha512-dSOvYwvyLsWBeIRyOeHXp5vPj5l1I011r52FM1+r1jCERv+aFXYk4whgQccYEGYxK2H3ZAIA8nuPkQ0HaUo3qg== +"@babel/helper-module-transforms@^7.27.1", "@babel/helper-module-transforms@^7.28.3": + version "7.28.3" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.28.3.tgz#a2b37d3da3b2344fe085dab234426f2b9a2fa5f6" + integrity sha512-gytXUbs8k2sXS9PnQptz5o0QnpLL51SwASIORY6XaBKF88nsOT0Zw9szLqlSGQDP/4TljBAD5y98p2U1fqkdsw== dependencies: "@babel/helper-module-imports" "^7.27.1" "@babel/helper-validator-identifier" "^7.27.1" - "@babel/traverse" "^7.27.3" + "@babel/traverse" "^7.28.3" "@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.18.9", "@babel/helper-plugin-utils@^7.27.1", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": version "7.27.1" @@ -219,20 +224,20 @@ resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.27.1.tgz#fa52f5b1e7db1ab049445b421c4471303897702f" integrity sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg== -"@babel/helpers@^7.27.3": - version "7.27.3" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.27.3.tgz#387d65d279290e22fe7a47a8ffcd2d0c0184edd0" - integrity sha512-h/eKy9agOya1IGuLaZ9tEUgz+uIRXcbtOhRtUyyMf8JFmn1iT13vnl/IGVWSkdOCG/pC57U4S1jnAabAavTMwg== +"@babel/helpers@^7.28.3": + version "7.28.3" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.28.3.tgz#b83156c0a2232c133d1b535dd5d3452119c7e441" + integrity sha512-PTNtvUQihsAsDHMOP5pfobP8C6CM4JWXmP8DrEIt46c3r2bf87Ua1zoqevsMo9g+tWDwgWrFP5EIxuBx5RudAw== dependencies: "@babel/template" "^7.27.2" - "@babel/types" "^7.27.3" + "@babel/types" "^7.28.2" -"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.20.7", "@babel/parser@^7.23.9", "@babel/parser@^7.27.2", "@babel/parser@^7.27.3": - version "7.27.3" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.27.3.tgz#1b7533f0d908ad2ac545c4d05cbe2fb6dc8cfaaf" - integrity sha512-xyYxRj6+tLNDTWi0KCBcZ9V7yg3/lwL9DWh9Uwh/RIVlIfFidggcgxKX3GCXwCiswwcGRawBKbEg2LG/Y8eJhw== +"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.20.7", "@babel/parser@^7.23.9", "@babel/parser@^7.27.2", "@babel/parser@^7.28.3": + version "7.28.3" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.28.3.tgz#d2d25b814621bca5fe9d172bc93792547e7a2a71" + integrity sha512-7+Ey1mAgYqFAx2h0RuoxcQT5+MlG3GTV0TQrgr7/ZliKsm/MNDxVVutlWaziMq7wJNAz8MTqz55XLpWvva6StA== dependencies: - "@babel/types" "^7.27.3" + "@babel/types" "^7.28.2" "@babel/plugin-proposal-export-namespace-from@^7.14.5": version "7.18.9" @@ -385,23 +390,23 @@ "@babel/parser" "^7.27.2" "@babel/types" "^7.27.1" -"@babel/traverse@^7.27.1", "@babel/traverse@^7.27.3": - version "7.27.3" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.27.3.tgz#8b62a6c2d10f9d921ba7339c90074708509cffae" - integrity sha512-lId/IfN/Ye1CIu8xG7oKBHXd2iNb2aW1ilPszzGcJug6M8RCKfVNcYhpI5+bMvFYjK7lXIM0R+a+6r8xhHp2FQ== +"@babel/traverse@^7.27.1", "@babel/traverse@^7.28.3": + version "7.28.3" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.28.3.tgz#6911a10795d2cce43ec6a28cffc440cca2593434" + integrity sha512-7w4kZYHneL3A6NP2nxzHvT3HCZ7puDZZjFMqDpBPECub79sTtSO5CGXDkKrTQq8ksAwfD/XI2MRFX23njdDaIQ== dependencies: "@babel/code-frame" "^7.27.1" - "@babel/generator" "^7.27.3" - "@babel/parser" "^7.27.3" + "@babel/generator" "^7.28.3" + "@babel/helper-globals" "^7.28.0" + "@babel/parser" "^7.28.3" "@babel/template" "^7.27.2" - "@babel/types" "^7.27.3" + "@babel/types" "^7.28.2" debug "^4.3.1" - globals "^11.1.0" -"@babel/types@^7.0.0", "@babel/types@^7.20.7", "@babel/types@^7.27.1", "@babel/types@^7.27.3", "@babel/types@^7.3.3": - version "7.27.3" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.27.3.tgz#c0257bedf33aad6aad1f406d35c44758321eb3ec" - integrity sha512-Y1GkI4ktrtvmawoSq+4FCVHNryea6uR+qUQy0AGxLSsjCX0nVmkYQMBLHDkXZuo5hGx7eYdnIaslsdBFm7zbUw== +"@babel/types@^7.0.0", "@babel/types@^7.20.7", "@babel/types@^7.27.1", "@babel/types@^7.28.2", "@babel/types@^7.3.3": + version "7.28.2" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.28.2.tgz#da9db0856a9a88e0a13b019881d7513588cf712b" + integrity sha512-ruv7Ae4J5dUYULmeXw1gmb7rYRz57OWCPM57pHojnLq/3Z1CK2lNSLTCVjxVk1F/TZHwOZZrOWi0ur95BbLxNQ== dependencies: "@babel/helper-string-parser" "^7.27.1" "@babel/helper-validator-identifier" "^7.27.1" @@ -411,72 +416,69 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@credo-ts/anoncreds@0.5.15": - version "0.5.15" - resolved "https://registry.yarnpkg.com/@credo-ts/anoncreds/-/anoncreds-0.5.15.tgz#38916d94670f480e4f3872deb548fccd4b7ba190" - integrity sha512-b9LkFl/icptDV69QO/DJKfyP7oVuRUlj57xxnMYuJyPnFtfXwkGJr7Fdb62Izi8eZXAOIOtnsXt6P4KEV2cnYA== +"@credo-ts/anoncreds@0.6.0-alpha-20250325224513": + version "0.6.0-alpha-20250325224513" + resolved "https://registry.yarnpkg.com/@credo-ts/anoncreds/-/anoncreds-0.6.0-alpha-20250325224513.tgz#cf9bec49a96c058a356489ee742b79c4c22eb543" + integrity sha512-l4cGks+X5tRLUGZrtNW11R6CM310z0wODuqYzVQcROmz9qf0uM2ZKn2RunDbLLfouoxU66TISqG728oqX7IG+Q== dependencies: "@astronautlabs/jsonpath" "^1.1.2" - "@credo-ts/core" "0.5.15" - "@sphereon/pex-models" "^2.3.1" - big-integer "^1.6.51" - bn.js "^5.2.1" + "@credo-ts/core" "0.6.0-alpha-20250325224513" + "@credo-ts/didcomm" "0.6.0-alpha-20250325224513" + "@sphereon/pex-models" "^2.3.2" class-transformer "0.5.1" class-validator "0.14.1" reflect-metadata "^0.1.13" -"@credo-ts/askar@0.5.15", "@credo-ts/askar@0.5.3": - version "0.5.15" - resolved "https://registry.yarnpkg.com/@credo-ts/askar/-/askar-0.5.15.tgz#0720c55600662232330f9c806b1ce738696a9744" - integrity sha512-eSoiQQEEntTZHsw87BIlafGKash5HAP+34VnVl4T9xKs59KNN7BvpdG6/6lqhS0G8DxeN998KuW4D1CEWh7AhA== +"@credo-ts/askar@0.5.3", "@credo-ts/askar@0.6.0-alpha-20250325224513": + version "0.6.0-alpha-20250325224513" + resolved "https://registry.yarnpkg.com/@credo-ts/askar/-/askar-0.6.0-alpha-20250325224513.tgz#62009e8618cef60cc014eb2f104aa1c3030ba5be" + integrity sha512-zj8U2QXB3wEqGWhQyZHLMvkvrsksuX2eyYl+ewfQqdPW/dS0A/eZqPxOwBEGLuqWzzWt4Ny/lOX/ioYst2/uew== dependencies: - "@credo-ts/core" "0.5.15" - bn.js "^5.2.1" + "@credo-ts/core" "0.6.0-alpha-20250325224513" class-transformer "0.5.1" class-validator "0.14.1" rxjs "^7.8.0" tsyringe "^4.8.0" -"@credo-ts/core@0.5.15", "@credo-ts/core@0.5.3": - version "0.5.15" - resolved "https://registry.yarnpkg.com/@credo-ts/core/-/core-0.5.15.tgz#18f9e2f5c42d8cef955c230edad77028a6cd2cd4" - integrity sha512-3BYjncNY1Y6JDtxnbza1WVID8OoPgIZEno3z2F8a11xvsemsZCyy9vpyVgQi/Dz3P6/6JLZ/mnJAUwGKFZPnqA== +"@credo-ts/core@0.5.3", "@credo-ts/core@0.6.0-alpha-20250325224513", "@credo-ts/core@0.6.0-pr-2324-20250728121454": + version "0.6.0-alpha-20250325224513" + resolved "https://registry.yarnpkg.com/@credo-ts/core/-/core-0.6.0-alpha-20250325224513.tgz#8cede1953352b4a3899a939b26e1db61d65ab263" + integrity sha512-DJ5m3NR4zWBD1Tsi5xvZz7+fy7MlxdI2pi1SyHWGsfMFaNaprKfR12ydF/Db6S3Id23KC//8HWYTj4i+fufIQg== dependencies: - "@animo-id/mdoc" "0.2.38" - "@animo-id/pex" "4.1.1-alpha.0" + "@animo-id/mdoc" "^0.5.2" + "@animo-id/pex" "5.2.0" "@astronautlabs/jsonpath" "^1.1.2" "@digitalcredentials/jsonld" "^6.0.0" "@digitalcredentials/jsonld-signatures" "^9.4.0" "@digitalcredentials/vc" "^6.0.1" "@multiformats/base-x" "^4.0.1" - "@noble/curves" "^1.6.0" - "@noble/hashes" "^1.5.0" - "@peculiar/asn1-ecc" "^2.3.8" - "@peculiar/asn1-schema" "^2.3.8" - "@peculiar/asn1-x509" "^2.3.8" - "@peculiar/x509" "^1.11.0" - "@sd-jwt/core" "^0.7.0" - "@sd-jwt/decode" "^0.7.0" - "@sd-jwt/jwt-status-list" "^0.7.0" - "@sd-jwt/sd-jwt-vc" "^0.7.0" - "@sd-jwt/types" "^0.7.0" - "@sd-jwt/utils" "^0.7.0" - "@sphereon/pex-models" "^2.3.1" - "@sphereon/ssi-types" "0.30.2-next.135" + "@noble/curves" "^1.8.1" + "@noble/hashes" "^1.7.1" + "@peculiar/asn1-ecc" "^2.3.13" + "@peculiar/asn1-schema" "^2.3.13" + "@peculiar/asn1-x509" "^2.3.13" + "@peculiar/x509" "^1.12.1" + "@sd-jwt/core" "^0.7.2" + "@sd-jwt/decode" "^0.7.2" + "@sd-jwt/jwt-status-list" "^0.7.2" + "@sd-jwt/present" "^0.7.2" + "@sd-jwt/sd-jwt-vc" "^0.7.2" + "@sd-jwt/types" "^0.7.2" + "@sd-jwt/utils" "^0.7.2" + "@sphereon/pex-models" "^2.3.2" + "@sphereon/ssi-types" "0.33.0" "@stablelib/ed25519" "^1.0.2" "@types/ws" "^8.5.4" - abort-controller "^3.0.0" - big-integer "^1.6.51" borc "^3.0.0" buffer "^6.0.3" class-transformer "0.5.1" class-validator "0.14.1" + dcql "^0.2.20" did-resolver "^4.1.0" + ec-compression "0.0.1-alpha.11" lru_map "^0.4.1" - luxon "^3.5.0" make-error "^1.3.6" object-inspect "^1.10.3" - query-string "^7.0.1" reflect-metadata "^0.1.13" rxjs "^7.8.0" tsyringe "^4.8.0" @@ -485,26 +487,65 @@ web-did-resolver "^2.0.21" webcrypto-core "^1.8.0" -"@credo-ts/indy-vdr@0.5.15": - version "0.5.15" - resolved "https://registry.yarnpkg.com/@credo-ts/indy-vdr/-/indy-vdr-0.5.15.tgz#b65276c59616afa3c582d17fefef6a264b9f6ea8" - integrity sha512-+ZANXK+7WW5fTvRhQCCHevihHwApmk69PniJ8dwdtGAmGZbswpYmZfHFJYExsA8Absk2dOPPzMKMdDQOkwagBw== +"@credo-ts/didcomm@0.6.0-alpha-20250325224513": + version "0.6.0-alpha-20250325224513" + resolved "https://registry.yarnpkg.com/@credo-ts/didcomm/-/didcomm-0.6.0-alpha-20250325224513.tgz#87fdac5ca23bb717a6ffc905edeff71f97cba61f" + integrity sha512-nJGCJmVPJbd/5vYRjjEBr1IPpRntEax4WsFFdmH5almCFRf7Wwr40gzPSohY469aMV68VfBoP/qX3wmQQslu0g== + dependencies: + "@credo-ts/core" "0.6.0-alpha-20250325224513" + class-transformer "0.5.1" + class-validator "0.14.1" + luxon "^3.5.0" + query-string "^7.0.1" + rxjs "^7.8.0" + +"@credo-ts/didcomm@0.6.0-pr-2324-20250728121454": + version "0.6.0-pr-2324-20250728121454" + resolved "https://registry.yarnpkg.com/@credo-ts/didcomm/-/didcomm-0.6.0-pr-2324-20250728121454.tgz#37b94da1f5eaf1a7de9e2fc39f0a149face0e475" + integrity sha512-1oT1WjCGV4Z/lHzzGgGnsvjp/KbiSZA/EmOhXAOzJmpTk2fcWHQtvDMTOla4Jp55x3p4bd45BQIG5J0cToErkw== + dependencies: + "@credo-ts/core" "0.6.0-pr-2324-20250728121454" + class-transformer "0.5.1" + class-validator "0.14.1" + luxon "^3.5.0" + query-string "^7.0.1" + rxjs "^7.8.2" + +"@credo-ts/indy-vdr@0.6.0-alpha-20250325224513": + version "0.6.0-alpha-20250325224513" + resolved "https://registry.yarnpkg.com/@credo-ts/indy-vdr/-/indy-vdr-0.6.0-alpha-20250325224513.tgz#ba72ec4ef9cb81f282b91b599099872deebddbe5" + integrity sha512-dFVZtBKVkZkgNb/ai9DxQNcN9Bw/6sysLVR3sstHqbn2+DWK4k2j5CCkHjFdJFizHpeH5RBKjy5ESS+SdENk2g== dependencies: - "@credo-ts/anoncreds" "0.5.15" - "@credo-ts/core" "0.5.15" + "@credo-ts/anoncreds" "0.6.0-alpha-20250325224513" + "@credo-ts/core" "0.6.0-alpha-20250325224513" -"@credo-ts/node@^0.5.15": - version "0.5.15" - resolved "https://registry.yarnpkg.com/@credo-ts/node/-/node-0.5.15.tgz#2514edeb1493c57ad40f3030390c4d788c26cbcf" - integrity sha512-oLGwWGX3TKzZakfps9Dgb7UGJWsFaW7WpQ1n4gIYg54L3Ew0K6e/A1McJ/atOS8RhU3YS2/DVhs8uBY5xqbfuQ== +"@credo-ts/node@^0.6.0-alpha-20250325224513": + version "0.6.0-pr-2324-20250728121454" + resolved "https://registry.yarnpkg.com/@credo-ts/node/-/node-0.6.0-pr-2324-20250728121454.tgz#c63fa27bc99a93e47e50bcf90d3fe326345d925f" + integrity sha512-Oall4TL+cfVnP5T94SiWAFcPY1tlVRWNmSi8hUT/Qqzy2zpr6uTkS9rsII7F5bspdECUwUMUrsyQ9CmM5zJV4g== dependencies: "@2060.io/ffi-napi" "^4.0.9" "@2060.io/ref-napi" "^3.0.6" - "@credo-ts/core" "0.5.15" - "@types/express" "^4.17.15" - express "^4.17.1" + "@credo-ts/core" "0.6.0-pr-2324-20250728121454" + "@credo-ts/didcomm" "0.6.0-pr-2324-20250728121454" + "@types/express" "^4.17.23" + express "^4.21.2" + rxjs "^7.8.2" + ws "^8.18.2" + +"@credo-ts/openid4vc@0.6.0-alpha-20250325224513": + version "0.6.0-alpha-20250325224513" + resolved "https://registry.yarnpkg.com/@credo-ts/openid4vc/-/openid4vc-0.6.0-alpha-20250325224513.tgz#04aebd7f631353c406795fa520999a06e8a0e630" + integrity sha512-DRgMZ3gX3mCnocY6XNKmFllLmH7L58r6UQue/bHPKj8YcrfiLW2Pha2abg9W/7y13E4oNvpgznup64bvUn8VqQ== + dependencies: + "@credo-ts/core" "0.6.0-alpha-20250325224513" + "@openid4vc/oauth2" "0.3.0-alpha-20250322171044" + "@openid4vc/openid4vci" "0.3.0-alpha-20250322171044" + "@openid4vc/openid4vp" "0.3.0-alpha-20250322171044" + "@openid4vc/utils" "0.3.0-alpha-20250322171044" + class-transformer "^0.5.1" rxjs "^7.8.0" - ws "^8.13.0" + zod "^3.23.8" "@credo-ts/push-notifications@^0.7.1": version "0.7.1" @@ -515,22 +556,24 @@ class-validator "0.14.1" tsyringe "^4.6.0" -"@credo-ts/question-answer@0.5.15": - version "0.5.15" - resolved "https://registry.yarnpkg.com/@credo-ts/question-answer/-/question-answer-0.5.15.tgz#9906387e7ef470c8cf01149d69fe2a5a1a19bb6d" - integrity sha512-5K2x9HoQXge4l/gnRhZtt3rDGUNtROsZnXE5gHKGpLtzh/X1dH99ukEBTrFJX3k+EcuJe34dh+HtkoEQayVO7A== +"@credo-ts/question-answer@0.6.0-alpha-20250325224513": + version "0.6.0-alpha-20250325224513" + resolved "https://registry.yarnpkg.com/@credo-ts/question-answer/-/question-answer-0.6.0-alpha-20250325224513.tgz#69b528e70104eea117d297eaabe69328c1d76149" + integrity sha512-Xa/hnN5gHB61ZuiLvLlU053jGimLAXHXlClw6n77R2E5E9EVvHXAGJ9FeL+tPNWAqGjtmGsDUI16ZhsthN3MJw== dependencies: - "@credo-ts/core" "0.5.15" + "@credo-ts/core" "0.6.0-alpha-20250325224513" + "@credo-ts/didcomm" "0.6.0-alpha-20250325224513" class-transformer "0.5.1" class-validator "0.14.1" rxjs "^7.8.0" -"@credo-ts/tenants@0.5.15": - version "0.5.15" - resolved "https://registry.yarnpkg.com/@credo-ts/tenants/-/tenants-0.5.15.tgz#5e164ab04dc59a1907d98c4c82fd53c6a1b5073d" - integrity sha512-4ikl1Fv1T/3MA6KqqecfMOwSWGOjmz2AoUvuEpWA2Og7MZ+X6n8VnNbPw42Sqlm94zDRdWikfq3R0LuW9M+TwQ== +"@credo-ts/tenants@0.6.0-alpha-20250325224513": + version "0.6.0-alpha-20250325224513" + resolved "https://registry.yarnpkg.com/@credo-ts/tenants/-/tenants-0.6.0-alpha-20250325224513.tgz#8fbee1e755ba5005076629d6f54b640c214fab07" + integrity sha512-YbYHdYCCwGYrPrZRKgJ4HvlHTp0CcPYYa+hrcQl56lLcAlhdG+/lbItcyHJwbqio7DCjD3TmwyatgLkva6qznA== dependencies: - "@credo-ts/core" "0.5.15" + "@credo-ts/core" "0.6.0-alpha-20250325224513" + "@credo-ts/didcomm" "0.6.0-alpha-20250325224513" async-mutex "^0.4.0" "@cspotcode/source-map-support@^0.8.0": @@ -713,24 +756,24 @@ fix-esm "^1.0.1" "@emnapi/core@^1.4.3": - version "1.4.3" - resolved "https://registry.yarnpkg.com/@emnapi/core/-/core-1.4.3.tgz#9ac52d2d5aea958f67e52c40a065f51de59b77d6" - integrity sha512-4m62DuCE07lw01soJwPiBGC0nAww0Q+RY70VZ+n49yDIO13yyinhbWCeNnaob0lakDtWQzSdtNWzJeOJt2ma+g== + version "1.4.5" + resolved "https://registry.yarnpkg.com/@emnapi/core/-/core-1.4.5.tgz#bfbb0cbbbb9f96ec4e2c4fd917b7bbe5495ceccb" + integrity sha512-XsLw1dEOpkSX/WucdqUhPWP7hDxSvZiY+fsUC14h+FtQ2Ifni4znbBt8punRX+Uj2JG/uDb8nEHVKvrVlvdZ5Q== dependencies: - "@emnapi/wasi-threads" "1.0.2" + "@emnapi/wasi-threads" "1.0.4" tslib "^2.4.0" "@emnapi/runtime@^1.4.3": - version "1.4.3" - resolved "https://registry.yarnpkg.com/@emnapi/runtime/-/runtime-1.4.3.tgz#c0564665c80dc81c448adac23f9dfbed6c838f7d" - integrity sha512-pBPWdu6MLKROBX05wSNKcNb++m5Er+KQ9QkB+WVM+pW2Kx9hoSrVTnu3BdkI5eBLZoKu/J6mW/B6i6bJB2ytXQ== + version "1.4.5" + resolved "https://registry.yarnpkg.com/@emnapi/runtime/-/runtime-1.4.5.tgz#c67710d0661070f38418b6474584f159de38aba9" + integrity sha512-++LApOtY0pEEz1zrd9vy1/zXVaVJJ/EbAF3u0fXIzPJEDtnITsBGbbK0EkM72amhl/R5b+5xx0Y/QhcVOpuulg== dependencies: tslib "^2.4.0" -"@emnapi/wasi-threads@1.0.2": - version "1.0.2" - resolved "https://registry.yarnpkg.com/@emnapi/wasi-threads/-/wasi-threads-1.0.2.tgz#977f44f844eac7d6c138a415a123818c655f874c" - integrity sha512-5n3nTJblwRi8LlXkJ9eBzu+kZR8Yxcc7ubakyQTFzPMtIhFpUBRbsnc2Dv88IZDIbCDlBiWrknhB4Lsz7mg6BA== +"@emnapi/wasi-threads@1.0.4": + version "1.0.4" + resolved "https://registry.yarnpkg.com/@emnapi/wasi-threads/-/wasi-threads-1.0.4.tgz#703fc094d969e273b1b71c292523b2f792862bf4" + integrity sha512-PJR+bOmMOPH8AtcTGAyYNiuJ3/Fcoj2XN/gBEWzDIKh254XO+mM9XoXHk5GNEhodxeMznbg7BlRojVbKN+gC6g== dependencies: tslib "^2.4.0" @@ -746,24 +789,24 @@ resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.12.1.tgz#cfc6cffe39df390a3841cde2abccf92eaa7ae0e0" integrity sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ== -"@eslint/config-array@^0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@eslint/config-array/-/config-array-0.20.0.tgz#7a1232e82376712d3340012a2f561a2764d1988f" - integrity sha512-fxlS1kkIjx8+vy2SjuCB94q3htSNrufYTXubwiBFeaQHbH6Ipi43gFJq2zCMt6PHhImH3Xmr0NksKDvchWlpQQ== +"@eslint/config-array@^0.21.0": + version "0.21.0" + resolved "https://registry.yarnpkg.com/@eslint/config-array/-/config-array-0.21.0.tgz#abdbcbd16b124c638081766392a4d6b509f72636" + integrity sha512-ENIdc4iLu0d93HeYirvKmrzshzofPw6VkZRKQGe9Nv46ZnWUzcF1xV01dcvEg/1wXUR61OmmlSfyeyO7EvjLxQ== dependencies: "@eslint/object-schema" "^2.1.6" debug "^4.3.1" minimatch "^3.1.2" -"@eslint/config-helpers@^0.2.1": - version "0.2.2" - resolved "https://registry.yarnpkg.com/@eslint/config-helpers/-/config-helpers-0.2.2.tgz#3779f76b894de3a8ec4763b79660e6d54d5b1010" - integrity sha512-+GPzk8PlG0sPpzdU5ZvIRMPidzAnZDl/s9L+y13iodqvb8leL53bTannOrQ/Im7UkpsmFU5Ily5U60LWixnmLg== +"@eslint/config-helpers@^0.3.1": + version "0.3.1" + resolved "https://registry.yarnpkg.com/@eslint/config-helpers/-/config-helpers-0.3.1.tgz#d316e47905bd0a1a931fa50e669b9af4104d1617" + integrity sha512-xR93k9WhrDYpXHORXpxVL5oHj3Era7wo6k/Wd8/IsQNnZUTzkGS29lyn3nAT05v6ltUuTFVCCYDEGfy2Or/sPA== -"@eslint/core@^0.14.0": - version "0.14.0" - resolved "https://registry.yarnpkg.com/@eslint/core/-/core-0.14.0.tgz#326289380968eaf7e96f364e1e4cf8f3adf2d003" - integrity sha512-qIbV0/JZr7iSDjqAc60IqbLdsj9GDt16xQtWD+B78d/HAlvysGdZZ6rpJHGAc2T0FQx1X6thsSPdnoiGKdNtdg== +"@eslint/core@^0.15.2": + version "0.15.2" + resolved "https://registry.yarnpkg.com/@eslint/core/-/core-0.15.2.tgz#59386327d7862cc3603ebc7c78159d2dcc4a868f" + integrity sha512-78Md3/Rrxh83gCxoUc0EiciuOHsIITzLy53m3d9UyiW8y9Dj2D29FeETqyKA+BRK76tnTp6RXWb3pCay8Oyomg== dependencies: "@types/json-schema" "^7.0.15" @@ -782,22 +825,22 @@ minimatch "^3.1.2" strip-json-comments "^3.1.1" -"@eslint/js@9.27.0": - version "9.27.0" - resolved "https://registry.yarnpkg.com/@eslint/js/-/js-9.27.0.tgz#181a23460877c484f6dd03890f4e3fa2fdeb8ff0" - integrity sha512-G5JD9Tu5HJEu4z2Uo4aHY2sLV64B7CDMXxFzqzjl3NKd6RVzSXNoE80jk7Y0lJkTTkjiIhBAqmlYwjuBY3tvpA== +"@eslint/js@9.33.0": + version "9.33.0" + resolved "https://registry.yarnpkg.com/@eslint/js/-/js-9.33.0.tgz#475c92fdddab59b8b8cab960e3de2564a44bf368" + integrity sha512-5K1/mKhWaMfreBGJTwval43JJmkip0RmM+3+IuqupeSKNC/Th2Kc7ucaq5ovTSra/OOKB9c58CGSz3QMVbWt0A== "@eslint/object-schema@^2.1.6": version "2.1.6" resolved "https://registry.yarnpkg.com/@eslint/object-schema/-/object-schema-2.1.6.tgz#58369ab5b5b3ca117880c0f6c0b0f32f6950f24f" integrity sha512-RBMg5FRL0I0gs51M/guSAj5/e14VQ4tpZnQNWwuDT66P14I43ItmPfIZRhO9fUVIPOAQXU47atlywZ/czoqFPA== -"@eslint/plugin-kit@^0.3.1": - version "0.3.1" - resolved "https://registry.yarnpkg.com/@eslint/plugin-kit/-/plugin-kit-0.3.1.tgz#b71b037b2d4d68396df04a8c35a49481e5593067" - integrity sha512-0J+zgWxHN+xXONWIyPWKFMgVuJoZuGiIFu8yxk7RJjxkzpGmyja5wRFqZIVtjDVOQpV+Rw0iOAjYPE2eQyjr0w== +"@eslint/plugin-kit@^0.3.5": + version "0.3.5" + resolved "https://registry.yarnpkg.com/@eslint/plugin-kit/-/plugin-kit-0.3.5.tgz#fd8764f0ee79c8ddab4da65460c641cefee017c5" + integrity sha512-Z5kJ+wU3oA7MMIqVR9tyZRtjYPr4OC004Q4Rw7pgOKUOKkJfZ3O24nz3WYfGRpMDNmcOi3TwQOmgm7B7Tpii0w== dependencies: - "@eslint/core" "^0.14.0" + "@eslint/core" "^0.15.2" levn "^0.4.1" "@ethersproject/abi@5.8.0", "@ethersproject/abi@^5.1.2", "@ethersproject/abi@^5.8.0": @@ -1253,9 +1296,9 @@ integrity sha512-w+lKW+yRrLhJu620jT3y+5g2mHqnKfepreykvdOcl9/6up8GrQQn+l3FRTsjHTKbkbfQFkuksHpdv2EcpKcJ4Q== "@hapi/hapi@^21.3.12": - version "21.4.0" - resolved "https://registry.yarnpkg.com/@hapi/hapi/-/hapi-21.4.0.tgz#6f1493ffd6d83ef2d06a95b6e855f554545e3703" - integrity sha512-kqiRWbYYLSSt2rYbxyNj8svPsXP715p4W/K3OXpXeiiVLNSdBX4f+zfmC+dY6eyb6rqTqTAbx6x8b5HpJTkviQ== + version "21.4.3" + resolved "https://registry.yarnpkg.com/@hapi/hapi/-/hapi-21.4.3.tgz#e829eef35659d7618831f4431382229107a71d07" + integrity sha512-Q7g0ZY4gxU69wabFKH75qR0AFOdiOECj6vGqTHBSO5Lrwe6TwD8r9LkYQIbvtG8N423VDpdVsiZP8MnBwmD6Hw== dependencies: "@hapi/accept" "^6.0.3" "@hapi/ammo" "^6.0.1" @@ -1265,13 +1308,13 @@ "@hapi/catbox" "^12.1.1" "@hapi/catbox-memory" "^6.0.2" "@hapi/heavy" "^8.0.1" - "@hapi/hoek" "^11.0.6" + "@hapi/hoek" "^11.0.7" "@hapi/mimos" "^7.0.1" - "@hapi/podium" "^5.0.1" - "@hapi/shot" "^6.0.1" + "@hapi/podium" "^5.0.2" + "@hapi/shot" "^6.0.2" "@hapi/somever" "^4.1.1" "@hapi/statehood" "^8.2.0" - "@hapi/subtext" "^8.1.0" + "@hapi/subtext" "^8.1.1" "@hapi/teamwork" "^6.0.0" "@hapi/topo" "^6.0.2" "@hapi/validate" "^2.0.1" @@ -1285,7 +1328,7 @@ "@hapi/hoek" "^11.0.2" "@hapi/validate" "^2.0.1" -"@hapi/hoek@^11.0.2", "@hapi/hoek@^11.0.6": +"@hapi/hoek@^11.0.2", "@hapi/hoek@^11.0.7": version "11.0.7" resolved "https://registry.yarnpkg.com/@hapi/hoek/-/hoek-11.0.7.tgz#56a920793e0a42d10e530da9a64cc0d3919c4002" integrity sha512-HV5undWkKzcB4RZUusqOpcgxOaq6VOAH7zhhIr2g3G8NF/MlFO75SjOr2NfuSx0Mh40+1FqCkagKLJRykUWoFQ== @@ -1333,7 +1376,7 @@ "@hapi/hoek" "^11.0.2" "@hapi/nigel" "^5.0.1" -"@hapi/podium@^5.0.0", "@hapi/podium@^5.0.1": +"@hapi/podium@^5.0.0", "@hapi/podium@^5.0.2": version "5.0.2" resolved "https://registry.yarnpkg.com/@hapi/podium/-/podium-5.0.2.tgz#6b1431bec13f55525cdfa83b2a7684c212c96189" integrity sha512-T7gf2JYHQQfEfewTQFbsaXoZxSvuXO/QBIGljucUQ/lmPnTTNAepoIKOakWNVWvo2fMEDjycu77r8k6dhreqHA== @@ -1342,10 +1385,10 @@ "@hapi/teamwork" "^6.0.0" "@hapi/validate" "^2.0.1" -"@hapi/shot@^6.0.1": - version "6.0.1" - resolved "https://registry.yarnpkg.com/@hapi/shot/-/shot-6.0.1.tgz#ea84d1810b7c8599d5517c23b4ec55a529d7dc16" - integrity sha512-s5ynMKZXYoDd3dqPw5YTvOR/vjHvMTxc388+0qL0jZZP1+uwXuUD32o9DuuuLsmTlyXCWi02BJl1pBpwRuUrNA== +"@hapi/shot@^6.0.2": + version "6.0.2" + resolved "https://registry.yarnpkg.com/@hapi/shot/-/shot-6.0.2.tgz#30f0688a9fb800d8ad6dbf4b2033173335dd5571" + integrity sha512-WKK1ShfJTrL1oXC0skoIZQYzvLsyMDEF8lfcWuQBjpjCN29qivr9U36ld1z0nt6edvzv28etNMOqUF4klnHryw== dependencies: "@hapi/hoek" "^11.0.2" "@hapi/validate" "^2.0.1" @@ -1371,10 +1414,10 @@ "@hapi/iron" "^7.0.1" "@hapi/validate" "^2.0.1" -"@hapi/subtext@^8.1.0": - version "8.1.0" - resolved "https://registry.yarnpkg.com/@hapi/subtext/-/subtext-8.1.0.tgz#58733020a6655bc4d978df9e2f75e31696ff3f91" - integrity sha512-PyaN4oSMtqPjjVxLny1k0iYg4+fwGusIhaom9B2StinBclHs7v46mIW706Y+Wo21lcgulGyXbQrmT/w4dus6ww== +"@hapi/subtext@^8.1.1": + version "8.1.1" + resolved "https://registry.yarnpkg.com/@hapi/subtext/-/subtext-8.1.1.tgz#48b93ab9196f7bf5902060ec92459fc354acba6e" + integrity sha512-ex1Y2s/KuJktS8Ww0k6XJ5ysSKrzNym4i5pDVuCwlSgHHviHUsT1JNzE6FYhNU9TTHSNdyfue/t2m89bpkX9Jw== dependencies: "@hapi/boom" "^10.0.1" "@hapi/bourne" "^3.0.0" @@ -1473,25 +1516,6 @@ dependencies: tar "^7.4.3" -"@hyperledger/aries-askar-nodejs@0.2.3": - version "0.2.3" - resolved "https://registry.yarnpkg.com/@hyperledger/aries-askar-nodejs/-/aries-askar-nodejs-0.2.3.tgz#f939c19047c78b9903b422f992b4f5406ac3aae3" - integrity sha512-2BnGqK08Y96DEB8tDuXy2x+soetChyMGB0+L1yqdHx1Xv5FvRerYrTXdTjJXTW6ANb48k2Np8WlJ4YNePSo6ww== - dependencies: - "@2060.io/ffi-napi" "^4.0.9" - "@2060.io/ref-napi" "^3.0.6" - "@hyperledger/aries-askar-shared" "0.2.3" - "@mapbox/node-pre-gyp" "^1.0.11" - ref-array-di "^1.2.2" - ref-struct-di "^1.1.1" - -"@hyperledger/aries-askar-shared@0.2.3": - version "0.2.3" - resolved "https://registry.yarnpkg.com/@hyperledger/aries-askar-shared/-/aries-askar-shared-0.2.3.tgz#670fea675982e3b0a2f416131b04d0f1e058cd1b" - integrity sha512-g9lao8qa80kPCLqqp02ovNqEfQIrm6cAf4xZVzD5P224VmOhf4zM6AKplQTvQx7USNKoXroe93JrOOSVxPeqrA== - dependencies: - buffer "^6.0.3" - "@hyperledger/indy-vdr-nodejs@0.2.2": version "0.2.2" resolved "https://registry.yarnpkg.com/@hyperledger/indy-vdr-nodejs/-/indy-vdr-nodejs-0.2.2.tgz#f1f5ed1b9c34103703882dbc6c10fe480d33b0e6" @@ -1736,13 +1760,12 @@ "@types/yargs" "^17.0.8" chalk "^4.0.0" -"@jridgewell/gen-mapping@^0.3.5": - version "0.3.8" - resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.8.tgz#4f0e06362e01362f823d348f1872b08f666d8142" - integrity sha512-imAbBGkb+ebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA== +"@jridgewell/gen-mapping@^0.3.12", "@jridgewell/gen-mapping@^0.3.5": + version "0.3.13" + resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz#6342a19f44347518c93e43b1ac69deb3c4656a1f" + integrity sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA== dependencies: - "@jridgewell/set-array" "^1.2.1" - "@jridgewell/sourcemap-codec" "^1.4.10" + "@jridgewell/sourcemap-codec" "^1.5.0" "@jridgewell/trace-mapping" "^0.3.24" "@jridgewell/resolve-uri@^3.0.3", "@jridgewell/resolve-uri@^3.1.0": @@ -1750,15 +1773,10 @@ resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz#7a0ee601f60f99a20c7c7c5ff0c80388c1189bd6" integrity sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw== -"@jridgewell/set-array@^1.2.1": - version "1.2.1" - resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.2.1.tgz#558fb6472ed16a4c850b889530e6b36438c49280" - integrity sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A== - -"@jridgewell/sourcemap-codec@^1.4.10", "@jridgewell/sourcemap-codec@^1.4.14": - version "1.5.0" - resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz#3188bcb273a414b0d215fd22a58540b989b9409a" - integrity sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ== +"@jridgewell/sourcemap-codec@^1.4.10", "@jridgewell/sourcemap-codec@^1.4.14", "@jridgewell/sourcemap-codec@^1.5.0": + version "1.5.5" + resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz#6912b00d2c631c0d15ce1a7ab57cd657f2a8f8ba" + integrity sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og== "@jridgewell/trace-mapping@0.3.9": version "0.3.9" @@ -1768,10 +1786,10 @@ "@jridgewell/resolve-uri" "^3.0.3" "@jridgewell/sourcemap-codec" "^1.4.10" -"@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.18", "@jridgewell/trace-mapping@^0.3.24", "@jridgewell/trace-mapping@^0.3.25": - version "0.3.25" - resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz#15f190e98895f3fc23276ee14bc76b675c2e50f0" - integrity sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ== +"@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.18", "@jridgewell/trace-mapping@^0.3.24", "@jridgewell/trace-mapping@^0.3.28": + version "0.3.30" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.30.tgz#4a76c4daeee5df09f5d3940e087442fb36ce2b99" + integrity sha512-GQ7Nw5G2lTu/BtHTKfXhKHok2WGetd4XYcVKGx00SjAk8GMwgJM3zr6zORiPGuOE+/vkc90KtTosSSvaCjKb2Q== dependencies: "@jridgewell/resolve-uri" "^3.1.0" "@jridgewell/sourcemap-codec" "^1.4.14" @@ -1791,7 +1809,7 @@ resolved "https://registry.yarnpkg.com/@js-sdsl/ordered-map/-/ordered-map-4.4.2.tgz#9299f82874bab9e4c7f9c48d865becbfe8d6907c" integrity sha512-iUKgm52T8HOE/makSxjqoWhe95ZJA1/G1sYsGev2JDKUSS14KAgg1LHb+Ba+IPow0xflbnSkOsZcO08C7w1gYw== -"@mapbox/node-pre-gyp@^1.0.10", "@mapbox/node-pre-gyp@^1.0.11": +"@mapbox/node-pre-gyp@^1.0.10": version "1.0.11" resolved "https://registry.yarnpkg.com/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.11.tgz#417db42b7f5323d79e93b34a6d7a2a12c0df43fa" integrity sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ== @@ -1811,14 +1829,14 @@ resolved "https://registry.yarnpkg.com/@multiformats/base-x/-/base-x-4.0.1.tgz#95ff0fa58711789d53aefb2590a8b7a4e715d121" integrity sha512-eMk0b9ReBbV23xXU693TAIrLyeO5iTgBZGSJfpqriG8UkYvr/hC9u9pyMlAakDNHWmbhMZCDs6KQO0jzKD8OTw== -"@napi-rs/wasm-runtime@^0.2.10": - version "0.2.10" - resolved "https://registry.yarnpkg.com/@napi-rs/wasm-runtime/-/wasm-runtime-0.2.10.tgz#f3b7109419c6670000b2401e0c778b98afc25f84" - integrity sha512-bCsCyeZEwVErsGmyPNSzwfwFn4OdxBj0mmv6hOFucB/k81Ojdu68RbZdxYsRQUPc9l6SU5F/cG+bXgWs3oUgsQ== +"@napi-rs/wasm-runtime@^0.2.11": + version "0.2.12" + resolved "https://registry.yarnpkg.com/@napi-rs/wasm-runtime/-/wasm-runtime-0.2.12.tgz#3e78a8b96e6c33a6c517e1894efbd5385a7cb6f2" + integrity sha512-ZVWUcfwY4E/yPitQJl481FjFo3K22D6qF0DuFH6Y/nbnE11GY5uguDxZMGXPQ8WQ0128MXQD7TnfHyK4oWoIJQ== dependencies: "@emnapi/core" "^1.4.3" "@emnapi/runtime" "^1.4.3" - "@tybys/wasm-util" "^0.9.0" + "@tybys/wasm-util" "^0.10.0" "@noble/curves@1.2.0": version "1.2.0" @@ -1827,10 +1845,10 @@ dependencies: "@noble/hashes" "1.3.2" -"@noble/curves@^1.6.0": - version "1.9.1" - resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.9.1.tgz#9654a0bc6c13420ae252ddcf975eaf0f58f0a35c" - integrity sha512-k11yZxZg+t+gWvBbIswW0yoJlu8cHOC7dhunwOzoWH/mXGBiYyR4YY6hAEK/3EUs4UpB8la1RfdRpeGsFHkWsA== +"@noble/curves@^1.8.1": + version "1.9.7" + resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.9.7.tgz#79d04b4758a43e4bca2cbdc62e7771352fa6b951" + integrity sha512-gbKGcRUYIjA3/zCCNaWDciTMFI0dCkvou3TL8Zmy5Nc7sJ47a0jtOeZoTaMxkuqRo9cRhjOdZJXegxYE5FN/xw== dependencies: "@noble/hashes" "1.8.0" @@ -1839,7 +1857,12 @@ resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.3.2.tgz#6f26dbc8fbc7205873ce3cee2f690eba0d421b39" integrity sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ== -"@noble/hashes@1.8.0", "@noble/hashes@^1.1.5", "@noble/hashes@^1.5.0": +"@noble/hashes@1.6.1": + version "1.6.1" + resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.6.1.tgz#df6e5943edcea504bac61395926d6fd67869a0d5" + integrity sha512-pq5D8h10hHBjyqX+cfBm0i8JUXJ0UhczFc4r74zbuT9XgewFo2E3J1cOaGtdZynILNmQ685YWGzGE1Zv6io50w== + +"@noble/hashes@1.8.0", "@noble/hashes@^1.1.5", "@noble/hashes@^1.7.1": version "1.8.0" resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.8.0.tgz#cee43d801fcef9644b11b8194857695acd5f815a" integrity sha512-jCs9ldd7NwzpgXDIf6P3+NrHh9/sD6CQdxHyjQI+h/6rDNo88ypBxxz45UDuZHz9r3tNz7N/VInSVoVdtXEI4A== @@ -1866,9 +1889,9 @@ fastq "^1.6.0" "@nomicfoundation/hardhat-verify@^2.0.3": - version "2.0.14" - resolved "https://registry.yarnpkg.com/@nomicfoundation/hardhat-verify/-/hardhat-verify-2.0.14.tgz#ba80918fac840f1165825f2a422a694486f82f6f" - integrity sha512-z3iVF1WYZHzcdMMUuureFpSAfcnlfJbJx3faOnGrOYg6PRTki1Ut9JAuRccnFzMHf1AmTEoSUpWcyvBCoxL5Rg== + version "2.1.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/hardhat-verify/-/hardhat-verify-2.1.1.tgz#0af5fc4228df860062865fcafb4a01bc0b89f8a3" + integrity sha512-K1plXIS42xSHDJZRkrE2TZikqxp9T4y6jUMUNI/imLgN5uCcEQokmfU0DlyP9zzHncYK92HlT5IWP35UVCLrPw== dependencies: "@ethersproject/abi" "^5.1.2" "@ethersproject/address" "^5.0.2" @@ -1880,6 +1903,40 @@ table "^6.8.0" undici "^5.14.0" +"@openid4vc/oauth2@0.3.0-alpha-20250322171044": + version "0.3.0-alpha-20250322171044" + resolved "https://registry.yarnpkg.com/@openid4vc/oauth2/-/oauth2-0.3.0-alpha-20250322171044.tgz#75adec0345f01504c7d9abe16ddc30c72c0132c3" + integrity sha512-NylLLsYhj2239CgQW20WyR5bHfyqm+8VpMeXKrN0b9ds+ViHaNMpwtouYCK2rGzg8lnY7ugacfdo8RmnC49T3Q== + dependencies: + "@openid4vc/utils" "0.3.0-alpha-20250322171044" + zod "^3.24.1" + +"@openid4vc/openid4vci@0.3.0-alpha-20250322171044": + version "0.3.0-alpha-20250322171044" + resolved "https://registry.yarnpkg.com/@openid4vc/openid4vci/-/openid4vci-0.3.0-alpha-20250322171044.tgz#9ac667e56d5e20ff4e71d27cd98a5065923fbccb" + integrity sha512-mhNNuI6xinAX7VOFqnhoUGr9IFQswU/5ZCWNW++INbNAJxgjIDYLwCnpx2F4Nx0B+jbZbUpOwnHnVEIGdQAP8A== + dependencies: + "@openid4vc/oauth2" "0.3.0-alpha-20250322171044" + "@openid4vc/utils" "0.3.0-alpha-20250322171044" + zod "^3.24.1" + +"@openid4vc/openid4vp@0.3.0-alpha-20250322171044": + version "0.3.0-alpha-20250322171044" + resolved "https://registry.yarnpkg.com/@openid4vc/openid4vp/-/openid4vp-0.3.0-alpha-20250322171044.tgz#909bd853463f9f94db29f4af36983f8098c57cf5" + integrity sha512-BkvTegk4hsULPXRf7qOJrcFRevg2fziE79DlmAUa2xOmn+9V9VVZO5PMBfpEp0wKvBNkXyCZ0C6A24U9z75TuA== + dependencies: + "@openid4vc/oauth2" "0.3.0-alpha-20250322171044" + "@openid4vc/utils" "0.3.0-alpha-20250322171044" + zod "^3.24.1" + +"@openid4vc/utils@0.3.0-alpha-20250322171044": + version "0.3.0-alpha-20250322171044" + resolved "https://registry.yarnpkg.com/@openid4vc/utils/-/utils-0.3.0-alpha-20250322171044.tgz#58fa8c83fcdd73fed063cc7b4ddd62a90d1b9a30" + integrity sha512-OBYnixgHR+NA5ssQBUnfyq/9Gq7xaICaJk3OmlAFMfxxhZmkCcSbeCkR2q9DSbmwCucmu6pEqHaSI8A7WGGP9Q== + dependencies: + buffer "^6.0.3" + zod "^3.24.1" + "@opentelemetry/api-logs@0.202.0": version "0.202.0" resolved "https://registry.yarnpkg.com/@opentelemetry/api-logs/-/api-logs-0.202.0.tgz#78ddb3b4a30232fd0916b99f27777b1936355d03" @@ -2032,9 +2089,9 @@ "@opentelemetry/semantic-conventions" "^1.29.0" "@opentelemetry/instrumentation-express@^0.51.0": - version "0.51.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-express/-/instrumentation-express-0.51.0.tgz#b63fdf82ff68dbbe685f790ce4c85c613ebea10c" - integrity sha512-v1mgfvyeQh7yfsZ8wZlr+jgFGk9FxzLfNH0EH0UYGO9das8fCIkixsEasZMWhjwAJKjlf+ElTZ2jE2pT7I3DyQ== + version "0.51.1" + resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-express/-/instrumentation-express-0.51.1.tgz#e9ea96ea67c7698c8e2939f518d94835fd036bfd" + integrity sha512-cKmzev7RolYGedQ82hVUoH+74BP4E0xmhUCEagOxmW3aKilXYx01KwsNN6wnx3IXR7u2nlYugQsEsLLA4d829A== dependencies: "@opentelemetry/core" "^2.0.0" "@opentelemetry/instrumentation" "^0.202.0" @@ -2051,9 +2108,9 @@ forwarded-parse "2.1.2" "@opentelemetry/instrumentation-nestjs-core@^0.48.0": - version "0.48.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-nestjs-core/-/instrumentation-nestjs-core-0.48.0.tgz#86f1d1af48a6654adc8497a8fccd31eb234a6357" - integrity sha512-ytK4ABSkWcD9vyMU8GpinvodAGaRxBFuxybP/m7sgLtEboXMJjdWnEHb7lH/CX1ICiVKRXWdYg9npdu6yBCW5Q== + version "0.48.1" + resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-nestjs-core/-/instrumentation-nestjs-core-0.48.1.tgz#117f416992570e643c83f02fc51eb54f869eb1b2" + integrity sha512-rH0IUQRf9wjxEkiPfltM17DVqgSe/rgeIlg1CKRDAhuxWkbXlcHwdOnBfngGKhJNGOlGUo6HzZesavPAlmm3Fw== dependencies: "@opentelemetry/instrumentation" "^0.202.0" "@opentelemetry/semantic-conventions" "^1.30.0" @@ -2184,9 +2241,28 @@ "@opentelemetry/sdk-trace-base" "2.0.1" "@opentelemetry/semantic-conventions@^1.27.0", "@opentelemetry/semantic-conventions@^1.29.0", "@opentelemetry/semantic-conventions@^1.30.0", "@opentelemetry/semantic-conventions@^1.34.0": - version "1.34.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/semantic-conventions/-/semantic-conventions-1.34.0.tgz#8b6a46681b38a4d5947214033ac48128328c1738" - integrity sha512-aKcOkyrorBGlajjRdVoJWHTxfxO1vCNHLJVlSDaRHDIdjU+pX8IYQPvPDkYiujKLbRnWU+1TBwEt0QRgSm4SGA== + version "1.36.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/semantic-conventions/-/semantic-conventions-1.36.0.tgz#149449bd4df4d0464220915ad4164121e0d75d4d" + integrity sha512-TtxJSRD8Ohxp6bKkhrm27JRHAxPczQA7idtcTOMYI+wQRRrfgqxHv1cFbCApcSnNjtXkmzFozn6jQtFrOmbjPQ== + +"@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== + dependencies: + "@2060.io/ffi-napi" "^4.0.9" + "@2060.io/ref-napi" "^3.0.6" + "@openwallet-foundation/askar-shared" "0.3.2" + 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== + dependencies: + buffer "^6.0.3" + tar "^7.4.3" "@paralleldrive/cuid2@^2.2.2": version "2.2.2" @@ -2195,109 +2271,109 @@ dependencies: "@noble/hashes" "^1.1.5" -"@peculiar/asn1-cms@^2.3.13", "@peculiar/asn1-cms@^2.3.15": - version "2.3.15" - resolved "https://registry.yarnpkg.com/@peculiar/asn1-cms/-/asn1-cms-2.3.15.tgz#8baf1fcf51dae2e9122126e13acf6a2e1698d35c" - integrity sha512-B+DoudF+TCrxoJSTjjcY8Mmu+lbv8e7pXGWrhNp2/EGJp9EEcpzjBCar7puU57sGifyzaRVM03oD5L7t7PghQg== +"@peculiar/asn1-cms@^2.3.15", "@peculiar/asn1-cms@^2.4.0": + version "2.4.0" + resolved "https://registry.yarnpkg.com/@peculiar/asn1-cms/-/asn1-cms-2.4.0.tgz#327c459460d6fa6d3e582208784543a4b7aeaa73" + integrity sha512-TJvw5Tna/txvzzwnKUlCFd6zIz4R7qysHCaU6M2oe/MUT6EkvJDOzGGNY0hdjJYpuuHoqanQbIqEBhSLSWe1Tg== dependencies: - "@peculiar/asn1-schema" "^2.3.15" - "@peculiar/asn1-x509" "^2.3.15" - "@peculiar/asn1-x509-attr" "^2.3.15" - asn1js "^3.0.5" + "@peculiar/asn1-schema" "^2.4.0" + "@peculiar/asn1-x509" "^2.4.0" + "@peculiar/asn1-x509-attr" "^2.4.0" + asn1js "^3.0.6" tslib "^2.8.1" -"@peculiar/asn1-csr@^2.3.13": - version "2.3.15" - resolved "https://registry.yarnpkg.com/@peculiar/asn1-csr/-/asn1-csr-2.3.15.tgz#a99375f2ffde6e759c70f73ce5c6600101457a57" - integrity sha512-caxAOrvw2hUZpxzhz8Kp8iBYKsHbGXZPl2KYRMIPvAfFateRebS3136+orUpcVwHRmpXWX2kzpb6COlIrqCumA== +"@peculiar/asn1-csr@^2.3.15": + version "2.4.0" + resolved "https://registry.yarnpkg.com/@peculiar/asn1-csr/-/asn1-csr-2.4.0.tgz#2182dd35061b03930bdc10034b3d548c38cf1264" + integrity sha512-9yQz0hQ9ynGr/I1X1v64QQGfRMbviHXyqY07cy69UzXa8s4ayCKx/TncU6lDWcTKs7P/X/AEcuJcG7Xbw0cl1A== dependencies: - "@peculiar/asn1-schema" "^2.3.15" - "@peculiar/asn1-x509" "^2.3.15" - asn1js "^3.0.5" + "@peculiar/asn1-schema" "^2.4.0" + "@peculiar/asn1-x509" "^2.4.0" + asn1js "^3.0.6" tslib "^2.8.1" -"@peculiar/asn1-ecc@^2.3.14", "@peculiar/asn1-ecc@^2.3.8": - version "2.3.15" - resolved "https://registry.yarnpkg.com/@peculiar/asn1-ecc/-/asn1-ecc-2.3.15.tgz#2301cff76a089bfa2ec93b4cfd9071a382aa677f" - integrity sha512-/HtR91dvgog7z/WhCVdxZJ/jitJuIu8iTqiyWVgRE9Ac5imt2sT/E4obqIVGKQw7PIy+X6i8lVBoT6wC73XUgA== +"@peculiar/asn1-ecc@^2.3.13", "@peculiar/asn1-ecc@^2.3.15": + version "2.4.0" + resolved "https://registry.yarnpkg.com/@peculiar/asn1-ecc/-/asn1-ecc-2.4.0.tgz#e21f87b12a0be3e57d6a914e576b6d10aa4a35d4" + integrity sha512-fJiYUBCJBDkjh347zZe5H81BdJ0+OGIg0X9z06v8xXUoql3MFeENUX0JsjCaVaU9A0L85PefLPGYkIoGpTnXLQ== dependencies: - "@peculiar/asn1-schema" "^2.3.15" - "@peculiar/asn1-x509" "^2.3.15" - asn1js "^3.0.5" + "@peculiar/asn1-schema" "^2.4.0" + "@peculiar/asn1-x509" "^2.4.0" + asn1js "^3.0.6" tslib "^2.8.1" -"@peculiar/asn1-pfx@^2.3.15": - version "2.3.15" - resolved "https://registry.yarnpkg.com/@peculiar/asn1-pfx/-/asn1-pfx-2.3.15.tgz#644b189e8ac88aa31ab96288fe79838106624c11" - integrity sha512-E3kzQe3J2xV9DP6SJS4X6/N1e4cYa2xOAK46VtvpaRk8jlheNri8v0rBezKFVPB1rz/jW8npO+u1xOvpATFMWg== +"@peculiar/asn1-pfx@^2.4.0": + version "2.4.0" + resolved "https://registry.yarnpkg.com/@peculiar/asn1-pfx/-/asn1-pfx-2.4.0.tgz#654327b736ca24f585e5b687d8a3f661dc60d0b1" + integrity sha512-fhpeoJ6T4nCLWT5tt3Un+BbyM1lLFnGXcRC2Ioe5ra2I0yptdjw05j20rV8BlUVzPIvUYpatq6joMQKe3ibh0w== dependencies: - "@peculiar/asn1-cms" "^2.3.15" - "@peculiar/asn1-pkcs8" "^2.3.15" - "@peculiar/asn1-rsa" "^2.3.15" - "@peculiar/asn1-schema" "^2.3.15" - asn1js "^3.0.5" + "@peculiar/asn1-cms" "^2.4.0" + "@peculiar/asn1-pkcs8" "^2.4.0" + "@peculiar/asn1-rsa" "^2.4.0" + "@peculiar/asn1-schema" "^2.4.0" + asn1js "^3.0.6" tslib "^2.8.1" -"@peculiar/asn1-pkcs8@^2.3.15": - version "2.3.15" - resolved "https://registry.yarnpkg.com/@peculiar/asn1-pkcs8/-/asn1-pkcs8-2.3.15.tgz#ecfa5152ecdf24164887c6fa3170163476c40fd5" - integrity sha512-/PuQj2BIAw1/v76DV1LUOA6YOqh/UvptKLJHtec/DQwruXOCFlUo7k6llegn8N5BTeZTWMwz5EXruBw0Q10TMg== +"@peculiar/asn1-pkcs8@^2.4.0": + version "2.4.0" + resolved "https://registry.yarnpkg.com/@peculiar/asn1-pkcs8/-/asn1-pkcs8-2.4.0.tgz#53c3c8dd2e99a2499f4a1e1639b8b4284f0b6a46" + integrity sha512-4r2LtsAM0HWXLxetGTYKyBumky7W6C1EuiOctqhl7zFK5MHjiZ+9WOeaoeTPR1g3OEoeG7KEWIkaUOyRH4ojTw== dependencies: - "@peculiar/asn1-schema" "^2.3.15" - "@peculiar/asn1-x509" "^2.3.15" - asn1js "^3.0.5" + "@peculiar/asn1-schema" "^2.4.0" + "@peculiar/asn1-x509" "^2.4.0" + asn1js "^3.0.6" tslib "^2.8.1" -"@peculiar/asn1-pkcs9@^2.3.13": - version "2.3.15" - resolved "https://registry.yarnpkg.com/@peculiar/asn1-pkcs9/-/asn1-pkcs9-2.3.15.tgz#91c55fd0c0134983a6bd2bae7de026c59a7080de" - integrity sha512-yiZo/1EGvU1KiQUrbcnaPGWc0C7ElMMskWn7+kHsCFm+/9fU0+V1D/3a5oG0Jpy96iaXggQpA9tzdhnYDgjyFg== - dependencies: - "@peculiar/asn1-cms" "^2.3.15" - "@peculiar/asn1-pfx" "^2.3.15" - "@peculiar/asn1-pkcs8" "^2.3.15" - "@peculiar/asn1-schema" "^2.3.15" - "@peculiar/asn1-x509" "^2.3.15" - "@peculiar/asn1-x509-attr" "^2.3.15" - asn1js "^3.0.5" +"@peculiar/asn1-pkcs9@^2.3.15": + version "2.4.0" + resolved "https://registry.yarnpkg.com/@peculiar/asn1-pkcs9/-/asn1-pkcs9-2.4.0.tgz#6ceb3041358b31bd2b3f68545ec1aefa3ad1af43" + integrity sha512-D7paqEVpu9wuWuClMN+vR5cqJWJITNPaMoa9R+FmkJ8ywF9UaS2JFI0RYclKILNoLdLg1N4eUCoJvM+ubsIIZQ== + dependencies: + "@peculiar/asn1-cms" "^2.4.0" + "@peculiar/asn1-pfx" "^2.4.0" + "@peculiar/asn1-pkcs8" "^2.4.0" + "@peculiar/asn1-schema" "^2.4.0" + "@peculiar/asn1-x509" "^2.4.0" + "@peculiar/asn1-x509-attr" "^2.4.0" + asn1js "^3.0.6" tslib "^2.8.1" -"@peculiar/asn1-rsa@^2.3.13", "@peculiar/asn1-rsa@^2.3.15": - version "2.3.15" - resolved "https://registry.yarnpkg.com/@peculiar/asn1-rsa/-/asn1-rsa-2.3.15.tgz#0e24aadcc96b34f57b488c6c95e3eedbb1cb1c73" - integrity sha512-p6hsanvPhexRtYSOHihLvUUgrJ8y0FtOM97N5UEpC+VifFYyZa0iZ5cXjTkZoDwxJ/TTJ1IJo3HVTB2JJTpXvg== +"@peculiar/asn1-rsa@^2.3.15", "@peculiar/asn1-rsa@^2.4.0": + version "2.4.0" + resolved "https://registry.yarnpkg.com/@peculiar/asn1-rsa/-/asn1-rsa-2.4.0.tgz#da988b4b0a8d97f7f515f1a8f583accb43a475e7" + integrity sha512-6PP75voaEnOSlWR9sD25iCQyLgFZHXbmxvUfnnDcfL6Zh5h2iHW38+bve4LfH7a60x7fkhZZNmiYqAlAff9Img== dependencies: - "@peculiar/asn1-schema" "^2.3.15" - "@peculiar/asn1-x509" "^2.3.15" - asn1js "^3.0.5" + "@peculiar/asn1-schema" "^2.4.0" + "@peculiar/asn1-x509" "^2.4.0" + asn1js "^3.0.6" tslib "^2.8.1" -"@peculiar/asn1-schema@^2.3.13", "@peculiar/asn1-schema@^2.3.15", "@peculiar/asn1-schema@^2.3.8": - version "2.3.15" - resolved "https://registry.yarnpkg.com/@peculiar/asn1-schema/-/asn1-schema-2.3.15.tgz#e926bfdeed51945a06f38be703499e7d8341a5d3" - integrity sha512-QPeD8UA8axQREpgR5UTAfu2mqQmm97oUqahDtNdBcfj3qAnoXzFdQW+aNf/tD2WVXF8Fhmftxoj0eMIT++gX2w== +"@peculiar/asn1-schema@^2.3.13", "@peculiar/asn1-schema@^2.3.15", "@peculiar/asn1-schema@^2.3.8", "@peculiar/asn1-schema@^2.4.0": + version "2.4.0" + resolved "https://registry.yarnpkg.com/@peculiar/asn1-schema/-/asn1-schema-2.4.0.tgz#e3aa7917d433b4c3fcfa1fcb57eac233b1c38787" + integrity sha512-umbembjIWOrPSOzEGG5vxFLkeM8kzIhLkgigtsOrfLKnuzxWxejAcUX+q/SoZCdemlODOcr5WiYa7+dIEzBXZQ== dependencies: - asn1js "^3.0.5" + asn1js "^3.0.6" pvtsutils "^1.3.6" tslib "^2.8.1" -"@peculiar/asn1-x509-attr@^2.3.15": - version "2.3.15" - resolved "https://registry.yarnpkg.com/@peculiar/asn1-x509-attr/-/asn1-x509-attr-2.3.15.tgz#036ea4ff68427fa9b51d6adb7051b7f1f91091b4" - integrity sha512-TWJVJhqc+IS4MTEML3l6W1b0sMowVqdsnI4dnojg96LvTuP8dga9f76fjP07MUuss60uSyT2ckoti/2qHXA10A== +"@peculiar/asn1-x509-attr@^2.4.0": + version "2.4.0" + resolved "https://registry.yarnpkg.com/@peculiar/asn1-x509-attr/-/asn1-x509-attr-2.4.0.tgz#f68346bf24ee2691682e5e58b5116e81cb91e280" + integrity sha512-Tr5Zi+wcE2sfR0gKRvsPwXoA1U8CuDnwiFbxCS+5Z1Nck9zlHj86+4/EZhwucjKXwPEHk1ekhqb3iwISY/+E/w== dependencies: - "@peculiar/asn1-schema" "^2.3.15" - "@peculiar/asn1-x509" "^2.3.15" - asn1js "^3.0.5" + "@peculiar/asn1-schema" "^2.4.0" + "@peculiar/asn1-x509" "^2.4.0" + asn1js "^3.0.6" tslib "^2.8.1" -"@peculiar/asn1-x509@^2.3.13", "@peculiar/asn1-x509@^2.3.15", "@peculiar/asn1-x509@^2.3.8": - version "2.3.15" - resolved "https://registry.yarnpkg.com/@peculiar/asn1-x509/-/asn1-x509-2.3.15.tgz#55adc616a075512ace64128eb34a9e071841ab14" - integrity sha512-0dK5xqTqSLaxv1FHXIcd4Q/BZNuopg+u1l23hT9rOmQ1g4dNtw0g/RnEi+TboB0gOwGtrWn269v27cMgchFIIg== +"@peculiar/asn1-x509@^2.3.13", "@peculiar/asn1-x509@^2.3.15", "@peculiar/asn1-x509@^2.4.0": + version "2.4.0" + resolved "https://registry.yarnpkg.com/@peculiar/asn1-x509/-/asn1-x509-2.4.0.tgz#ca8ec0d409678e1a47bc324c3dc739085186123f" + integrity sha512-F7mIZY2Eao2TaoVqigGMLv+NDdpwuBKU1fucHPONfzaBS4JXXCNCmfO0Z3dsy7JzKGqtDcYC1mr9JjaZQZNiuw== dependencies: - "@peculiar/asn1-schema" "^2.3.15" - asn1js "^3.0.5" + "@peculiar/asn1-schema" "^2.4.0" + asn1js "^3.0.6" pvtsutils "^1.3.6" tslib "^2.8.1" @@ -2319,32 +2395,32 @@ tslib "^2.6.2" webcrypto-core "^1.8.0" -"@peculiar/x509@^1.11.0": - version "1.12.3" - resolved "https://registry.yarnpkg.com/@peculiar/x509/-/x509-1.12.3.tgz#af3db2c637a861d9bd6ca29c4bd659048d8d42b1" - integrity sha512-+Mzq+W7cNEKfkNZzyLl6A6ffqc3r21HGZUezgfKxpZrkORfOqgRXnS80Zu0IV6a9Ue9QBJeKD7kN0iWfc3bhRQ== +"@peculiar/x509@^1.12.1": + version "1.13.0" + resolved "https://registry.yarnpkg.com/@peculiar/x509/-/x509-1.13.0.tgz#c404d075aac4dfa52320e0a1cb11268efacdb9dd" + integrity sha512-r9BOb1GZ3gx58Pog7u9x70spnHlCQPFm7u/ZNlFv+uBsU7kTDY9QkUD+l+X0awopDuCK1fkH3nEIZeMDSG/jlw== dependencies: - "@peculiar/asn1-cms" "^2.3.13" - "@peculiar/asn1-csr" "^2.3.13" - "@peculiar/asn1-ecc" "^2.3.14" - "@peculiar/asn1-pkcs9" "^2.3.13" - "@peculiar/asn1-rsa" "^2.3.13" - "@peculiar/asn1-schema" "^2.3.13" - "@peculiar/asn1-x509" "^2.3.13" - pvtsutils "^1.3.5" + "@peculiar/asn1-cms" "^2.3.15" + "@peculiar/asn1-csr" "^2.3.15" + "@peculiar/asn1-ecc" "^2.3.15" + "@peculiar/asn1-pkcs9" "^2.3.15" + "@peculiar/asn1-rsa" "^2.3.15" + "@peculiar/asn1-schema" "^2.3.15" + "@peculiar/asn1-x509" "^2.3.15" + pvtsutils "^1.3.6" reflect-metadata "^0.2.2" - tslib "^2.7.0" - tsyringe "^4.8.0" + tslib "^2.8.1" + tsyringe "^4.10.0" "@pkgjs/parseargs@^0.11.0": version "0.11.0" resolved "https://registry.yarnpkg.com/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33" integrity sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg== -"@pkgr/core@^0.2.4": - version "0.2.4" - resolved "https://registry.yarnpkg.com/@pkgr/core/-/core-0.2.4.tgz#d897170a2b0ba51f78a099edccd968f7b103387c" - integrity sha512-ROFF39F6ZrnzSUEmQQZUar0Jt4xVoP9WnDRdWwF4NNcXs3xBTLgBUDoOwW141y1jP+S8nahIbdxbFC7IShw9Iw== +"@pkgr/core@^0.2.9": + version "0.2.9" + resolved "https://registry.yarnpkg.com/@pkgr/core/-/core-0.2.9.tgz#d229a7b7f9dac167a156992ef23c7f023653f53b" + integrity sha512-QNqXyfVS2wm9hweSYD2O7F0G06uurj9kZ96TRQE5Y9hU7+tgdZwIkbAKc5Ocy1HxEY2kuDQa6cQ1WRs/O5LFKA== "@protobufjs/aspromise@^1.1.1", "@protobufjs/aspromise@^1.1.2": version "1.1.2" @@ -2409,7 +2485,7 @@ resolved "https://registry.yarnpkg.com/@scarf/scarf/-/scarf-1.4.0.tgz#3bbb984085dbd6d982494538b523be1ce6562972" integrity sha512-xxeapPiUXdZAE3che6f3xogoJPeZgig6omHEy1rIY5WVsB3H2BHNnZH+gHG6x91SCWyQCzWGsuL2Hh3ClO5/qQ== -"@sd-jwt/core@0.7.2", "@sd-jwt/core@^0.7.0": +"@sd-jwt/core@0.7.2", "@sd-jwt/core@^0.7.2": version "0.7.2" resolved "https://registry.yarnpkg.com/@sd-jwt/core/-/core-0.7.2.tgz#cfbcd853d507e2c31bf66ea5b2c1748291924ec3" integrity sha512-vix1GplUFc1A9H42r/yXkg7cKYthggyqZEwlFdsBbn4xdZNE+AHVF4N7kPa1pPxipwN3UIHd4XnQ5MJV15mhsQ== @@ -2419,7 +2495,7 @@ "@sd-jwt/types" "0.7.2" "@sd-jwt/utils" "0.7.2" -"@sd-jwt/decode@0.7.2", "@sd-jwt/decode@^0.7.0", "@sd-jwt/decode@^0.7.2": +"@sd-jwt/decode@0.7.2", "@sd-jwt/decode@^0.7.2": version "0.7.2" resolved "https://registry.yarnpkg.com/@sd-jwt/decode/-/decode-0.7.2.tgz#a0dd90d82c0b8b5e68adb22257a3db4b72de8529" integrity sha512-dan2LSvK63SKwb62031G4r7TE4TaiI0EK1KbPXqS+LCXNkNDUHqhtYp9uOpj+grXceCsMtMa2f8VnUfsjmwHHg== @@ -2427,7 +2503,15 @@ "@sd-jwt/types" "0.7.2" "@sd-jwt/utils" "0.7.2" -"@sd-jwt/jwt-status-list@0.7.2", "@sd-jwt/jwt-status-list@^0.7.0": +"@sd-jwt/decode@^0.9.2": + version "0.9.2" + resolved "https://registry.yarnpkg.com/@sd-jwt/decode/-/decode-0.9.2.tgz#3f2df7b22bfce1ff4640f46b1e51d513c9c1446d" + integrity sha512-jHY7hqk7EMkp6E2cB13QmXvRZN7njvAveVh+zKKy0kxpAM7DmcR4TqcDA4mc5y4lP8zWFUgbk7oGLCx2wiBq+w== + dependencies: + "@sd-jwt/types" "0.9.2" + "@sd-jwt/utils" "0.9.2" + +"@sd-jwt/jwt-status-list@0.7.2", "@sd-jwt/jwt-status-list@^0.7.2": version "0.7.2" resolved "https://registry.yarnpkg.com/@sd-jwt/jwt-status-list/-/jwt-status-list-0.7.2.tgz#13cd1b4abbcb08217a44efb59f0fd2a134fe398a" integrity sha512-o/Mg/Zg21poFsPXuxtPD9sdXq2b/0L+rb9gxU2k1rp1aT+DWmqD0k8v0Ttr2tlMc8l1xXQNA8FLXbL1AdLRmbQ== @@ -2445,7 +2529,7 @@ "@sd-jwt/types" "0.7.2" "@sd-jwt/utils" "0.7.2" -"@sd-jwt/sd-jwt-vc@^0.7.0": +"@sd-jwt/sd-jwt-vc@^0.7.2": version "0.7.2" resolved "https://registry.yarnpkg.com/@sd-jwt/sd-jwt-vc/-/sd-jwt-vc-0.7.2.tgz#565a4fcebfe97915a995fd26b0e3cb1fdd56ff6a" integrity sha512-rryYmnoJHRSNqHcrs0Atta+bfJzU2yT7mYumR2D4lTfxJKWZd0OHHFq57uZSEm/wXPI6uytUJXYbEboCqLUAtw== @@ -2454,12 +2538,17 @@ "@sd-jwt/jwt-status-list" "0.7.2" "@sd-jwt/utils" "0.7.2" -"@sd-jwt/types@0.7.2", "@sd-jwt/types@^0.7.0", "@sd-jwt/types@^0.7.2": +"@sd-jwt/types@0.7.2", "@sd-jwt/types@^0.7.2": version "0.7.2" resolved "https://registry.yarnpkg.com/@sd-jwt/types/-/types-0.7.2.tgz#29b5bf923eaed041b1375624afd7ce522f954f66" integrity sha512-1NRKowiW0ZiB9SGLApLPBH4Xk8gDQJ+nA9NdZ+uy6MmJKLEwjuJxO7yTvRIv/jX/0/Ebh339S7Kq4RD2AiFuRg== -"@sd-jwt/utils@0.7.2", "@sd-jwt/utils@^0.7.0": +"@sd-jwt/types@0.9.2": + version "0.9.2" + resolved "https://registry.yarnpkg.com/@sd-jwt/types/-/types-0.9.2.tgz#17a9d62e36d9863b2c20a127be22a3e77005a6a8" + integrity sha512-eV/MY80ekeTrqaohzPpkrgwPki6Igx69D6RniduV1Ehv6o/zaJQ2F0hY/RqBAkJhQtBQoOzouwKYHme40k1Dlw== + +"@sd-jwt/utils@0.7.2", "@sd-jwt/utils@^0.7.2": version "0.7.2" resolved "https://registry.yarnpkg.com/@sd-jwt/utils/-/utils-0.7.2.tgz#4309fa2f5ebe214947de4fb07a1e06a70c29710b" integrity sha512-aMPY7uHRMgyI5PlDvEiIc+eBFGC1EM8OCQRiEjJ8HGN0pajWMYj0qwSw7pS90A49/DsYU1a5Zpvb7nyjgGH0Yg== @@ -2467,6 +2556,14 @@ "@sd-jwt/types" "0.7.2" js-base64 "^3.7.6" +"@sd-jwt/utils@0.9.2": + version "0.9.2" + resolved "https://registry.yarnpkg.com/@sd-jwt/utils/-/utils-0.9.2.tgz#7e15091a5b7c636379932014f1fedb1713dc4217" + integrity sha512-GpTD0isav2f+JyMyzeyf6wV3nYcD5e3oL+sVVr/61Y3oaIBGMWLtGGGhBRMCimSnd8kbb0P9jLxvp7ioASk6vw== + dependencies: + "@sd-jwt/types" "0.9.2" + js-base64 "^3.7.6" + "@sideway/address@^4.1.5": version "4.1.5" resolved "https://registry.yarnpkg.com/@sideway/address/-/address-4.1.5.tgz#4bc149a0076623ced99ca8208ba780d65a99b9d5" @@ -2513,30 +2610,32 @@ resolved "https://registry.yarnpkg.com/@sovpro/delimited-stream/-/delimited-stream-1.1.0.tgz#4334bba7ee241036e580fdd99c019377630d26b4" integrity sha512-kQpk267uxB19X3X2T1mvNMjyvIEonpNSHrMlK5ZaBU6aZxw7wPbpgKJOjHN3+/GPVpXgAV9soVT2oyHpLkLtyw== -"@sphereon/kmp-mdl-mdoc@0.2.0-SNAPSHOT.22": - version "0.2.0-SNAPSHOT.22" - resolved "https://registry.yarnpkg.com/@sphereon/kmp-mdl-mdoc/-/kmp-mdl-mdoc-0.2.0-SNAPSHOT.22.tgz#958ed3831fba25175f80333c7287842dca332fc0" - integrity sha512-uAZZExVy+ug9JLircejWa5eLtAZ7bnBP6xb7DO2+86LRsHNLh2k2jMWJYxp+iWtGHTsh6RYsZl14ScQLvjiQ/A== +"@sphereon/kmp-mdoc-core@0.2.0-SNAPSHOT.26": + version "0.2.0-SNAPSHOT.26" + resolved "https://registry.yarnpkg.com/@sphereon/kmp-mdoc-core/-/kmp-mdoc-core-0.2.0-SNAPSHOT.26.tgz#fb5372a6b76cccad1d641bbdca72fbeae268a7a2" + integrity sha512-QXJ6R8ENiZV2rPMbn06cw5JKwqUYN1kzVRbYfONqE1PEXx1noQ4md7uxr2zSczi0ubKkNcbyYDNtIMTZIhGzmQ== dependencies: "@js-joda/core" "5.6.3" "@js-joda/timezone" "2.3.0" format-util "^1.0.5" -"@sphereon/pex-models@^2.3.1": +"@sphereon/pex-models@^2.3.2": version "2.3.2" resolved "https://registry.yarnpkg.com/@sphereon/pex-models/-/pex-models-2.3.2.tgz#88bb330745ef8011e4b13fb0a586593095888c6e" integrity sha512-foFxfLkRwcn/MOp/eht46Q7wsvpQGlO7aowowIIb5Tz9u97kYZ2kz6K2h2ODxWuv5CRA7Q0MY8XUBGE2lfOhOQ== -"@sphereon/ssi-types@0.30.2-next.135": - version "0.30.2-next.135" - resolved "https://registry.yarnpkg.com/@sphereon/ssi-types/-/ssi-types-0.30.2-next.135.tgz#bcdbfa6351ff88d1458f31a63f574671215da266" - integrity sha512-YLQfFMPUlOJUxHbOS9v01nG3cgLwTk3d95/rTnOmEQx9kXgXjoXdvt7D0uGcMRL3RHeQ9biT/jWY//mDvCirVQ== +"@sphereon/ssi-types@0.33.0": + version "0.33.0" + resolved "https://registry.yarnpkg.com/@sphereon/ssi-types/-/ssi-types-0.33.0.tgz#866a8c7d369cd1033351293e5f5cf9fdf40cb560" + integrity sha512-OQnWLKZQU6lHlMw3JS5308q5Kctv1eT/NNQthGNXETarsgJFiD711pWMOJvi0p5kLpU8N1e7/okaH3mXsVAW0A== dependencies: - "@sd-jwt/decode" "^0.7.2" - "@sphereon/kmp-mdl-mdoc" "0.2.0-SNAPSHOT.22" + "@noble/hashes" "1.6.1" + "@sd-jwt/decode" "^0.9.2" + "@sphereon/kmp-mdoc-core" "0.2.0-SNAPSHOT.26" debug "^4.3.5" events "^3.3.0" - jwt-decode "^3.1.2" + jwt-decode "^4.0.0" + uint8arrays "3.1.1" "@stablelib/binary@^1.0.1": version "1.0.1" @@ -2644,10 +2743,10 @@ reflect-metadata "^0.2.2" validator "^13.12.0" -"@tybys/wasm-util@^0.9.0": - version "0.9.0" - resolved "https://registry.yarnpkg.com/@tybys/wasm-util/-/wasm-util-0.9.0.tgz#3e75eb00604c8d6db470bf18c37b7d984a0e3355" - integrity sha512-6+7nlbMVX/PVDCwaIQ8nTOPveOcFLSt8GcXdx8hD0bt39uWxYT88uXzqTd4fTvqta7oeUJqudepapKNt2DYJFw== +"@tybys/wasm-util@^0.10.0": + version "0.10.0" + resolved "https://registry.yarnpkg.com/@tybys/wasm-util/-/wasm-util-0.10.0.tgz#2fd3cd754b94b378734ce17058d0507c45c88369" + integrity sha512-VyyPYFlOMNylG45GoAe0xDoLwWuowvf92F9kySqzYh8vmYm7D2u4iUJKa1tOUpS70Ku13ASrOkS4ScXFsTaCNQ== dependencies: tslib "^2.4.0" @@ -2685,16 +2784,16 @@ "@babel/types" "^7.0.0" "@types/babel__traverse@*", "@types/babel__traverse@^7.0.6": - version "7.20.7" - resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.20.7.tgz#968cdc2366ec3da159f61166428ee40f370e56c2" - integrity sha512-dkO5fhS7+/oos4ciWxyEyjWe48zmG6wbCheo/G2ZnHx4fs3EU6YC6UM8rk56gAjNJ9P3MTH2jo5jb92/K6wbng== + version "7.28.0" + resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.28.0.tgz#07d713d6cce0d265c9849db0cbe62d3f61f36f74" + integrity sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q== dependencies: - "@babel/types" "^7.20.7" + "@babel/types" "^7.28.2" "@types/body-parser@*", "@types/body-parser@^1.19.5": - version "1.19.5" - resolved "https://registry.yarnpkg.com/@types/body-parser/-/body-parser-1.19.5.tgz#04ce9a3b677dc8bd681a17da1ab9835dc9d3ede4" - integrity sha512-fB3Zu92ucau0iQ0JMCFQE7b/dv8Ot07NI3KaZIkIUNXq82k4eBAqUaneXfleGY9JWskeS9y+u0nXMyspcuQrCg== + version "1.19.6" + resolved "https://registry.yarnpkg.com/@types/body-parser/-/body-parser-1.19.6.tgz#1859bebb8fd7dac9918a45d54c1971ab8b5af474" + integrity sha512-HLFeCYgz89uk22N5Qg3dvGvsv46B8GLvKKo1zKG4NybA8U2DiEO3w9lqGg29t/tfLRJpJ6iQxnVw4OnB7MoM9g== dependencies: "@types/connect" "*" "@types/node" "*" @@ -2737,9 +2836,9 @@ "@types/node" "*" "@types/cors@^2.8.18": - version "2.8.18" - resolved "https://registry.yarnpkg.com/@types/cors/-/cors-2.8.18.tgz#101e033b3ca06695f3d73c587cd7f9eb348135d1" - integrity sha512-nX3d0sxJW41CqQvfOzVG1NCTXfFDrDWIghCZncpHeWlVFd81zxB/DLhg7avFg6eHLCRX7ckBmoIIcqa++upvJA== + version "2.8.19" + resolved "https://registry.yarnpkg.com/@types/cors/-/cors-2.8.19.tgz#d93ea2673fd8c9f697367f5eeefc2bbfa94f0342" + integrity sha512-mFNylyeyqN93lfe/9CSxOGREz8cpzAhH+E93xJ4xWQf62V8sQ/24reV2nyzUWM6H6Xji+GGHpkbLe7pVoUEskg== dependencies: "@types/node" "*" @@ -2752,9 +2851,9 @@ "@types/json-schema" "*" "@types/estree@*", "@types/estree@^1.0.6": - version "1.0.7" - resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.7.tgz#4158d3105276773d5b7695cd4834b1722e4f37a8" - integrity sha512-w28IoSUCJpidD/TGviZwwMJckNESJZXFu7NBZ5YJ4mEUnNraUn9Pm8HSZm/jDF1pDWYKspWE7oVphigUPRakIQ== + version "1.0.8" + resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.8.tgz#958b91c991b1867ced318bedea0e215ee050726e" + integrity sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w== "@types/express-serve-static-core@^4.17.33": version "4.19.6" @@ -2767,9 +2866,9 @@ "@types/send" "*" "@types/express-serve-static-core@^5.0.0", "@types/express-serve-static-core@^5.0.6": - version "5.0.6" - resolved "https://registry.yarnpkg.com/@types/express-serve-static-core/-/express-serve-static-core-5.0.6.tgz#41fec4ea20e9c7b22f024ab88a95c6bb288f51b8" - integrity sha512-3xhRnjJPkULekpSzgtoNYYcTWgEZkp4myc+Saevii5JPnHNvHMRlBSHDbs7Bh1iPPoVTERHEZXyhyLbMEsExsA== + version "5.0.7" + resolved "https://registry.yarnpkg.com/@types/express-serve-static-core/-/express-serve-static-core-5.0.7.tgz#2fa94879c9d46b11a5df4c74ac75befd6b283de6" + integrity sha512-R+33OsgWw7rOhD1emjU7dzCDHucJrgJXMA5PYCzJxVil0dsyx5iBEPHqpPfiKNJQb7lZ1vxwoLR4Z87bBUpeGQ== dependencies: "@types/node" "*" "@types/qs" "*" @@ -2777,18 +2876,18 @@ "@types/send" "*" "@types/express@*", "@types/express@^5.0.2": - version "5.0.2" - resolved "https://registry.yarnpkg.com/@types/express/-/express-5.0.2.tgz#7be9e337a5745d6b43ef5b0c352dad94a7f0c256" - integrity sha512-BtjL3ZwbCQriyb0DGw+Rt12qAXPiBTPs815lsUvtt1Grk0vLRMZNMUZ741d5rjk+UQOxfDiBZ3dxpX00vSkK3g== + version "5.0.3" + resolved "https://registry.yarnpkg.com/@types/express/-/express-5.0.3.tgz#6c4bc6acddc2e2a587142e1d8be0bce20757e956" + integrity sha512-wGA0NX93b19/dZC1J18tKWVIYWyyF2ZjT9vin/NRu0qzzvfVzWjs04iq2rQ3H65vCTQYlRqs3YHfY7zjdV+9Kw== dependencies: "@types/body-parser" "*" "@types/express-serve-static-core" "^5.0.0" "@types/serve-static" "*" -"@types/express@^4.17.15": - version "4.17.22" - resolved "https://registry.yarnpkg.com/@types/express/-/express-4.17.22.tgz#14cfcf120f7eb56ebb8ca77b7fa9a14d21de7c96" - integrity sha512-eZUmSnhRX9YRSkplpz0N+k6NljUUn5l3EWZIKZvYzhvMphEuNiyyy1viH/ejgt66JWgALwC/gtSUAeQKtSwW/w== +"@types/express@^4.17.23": + version "4.17.23" + resolved "https://registry.yarnpkg.com/@types/express/-/express-4.17.23.tgz#35af3193c640bfd4d7fe77191cd0ed411a433bef" + integrity sha512-Crp6WY9aTYP3qPi2wGDo9iUe/rceX01UMhnF1jmwDcKCFM6cx7YhGP/Mpr3y9AASpfHixIG0E6azCcL5OcDHsQ== dependencies: "@types/body-parser" "*" "@types/express-serve-static-core" "^4.17.33" @@ -2812,7 +2911,7 @@ resolved "https://registry.yarnpkg.com/@types/http-cache-semantics/-/http-cache-semantics-4.0.4.tgz#b979ebad3919799c979b17c72621c0bc0a31c6c4" integrity sha512-1m0bIFVc7eJWyve9S0RnuRgcQqF/Xd5QsUZAZeQFr1Q3/p9JWoQQEqmVy+DPTNpGXwhgIetAoYF8JSc33q29QA== -"@types/http-errors@*": +"@types/http-errors@*", "@types/http-errors@^2": version "2.0.5" resolved "https://registry.yarnpkg.com/@types/http-errors/-/http-errors-2.0.5.tgz#5b749ab2b16ba113423feb1a64a95dcd30398472" integrity sha512-r8Tayk8HJnX0FztbZN7oVqGccWgw98T/0neJphO91KkmOzug1KkofZURD4UaD5uH8AqcFLfdPErnBod0u71/qg== @@ -2855,9 +2954,9 @@ integrity sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ== "@types/jsonwebtoken@^9.0.9": - version "9.0.9" - resolved "https://registry.yarnpkg.com/@types/jsonwebtoken/-/jsonwebtoken-9.0.9.tgz#a4c3a446c0ebaaf467a58398382616f416345fb3" - integrity sha512-uoe+GxEuHbvy12OUQct2X9JenKM3qAscquYymuQN4fMWG9DBQtykrQEFcAbVACF7qaLw9BePSodUL0kquqBJpQ== + version "9.0.10" + resolved "https://registry.yarnpkg.com/@types/jsonwebtoken/-/jsonwebtoken-9.0.10.tgz#a7932a47177dcd4283b6146f3bd5c26d82647f09" + integrity sha512-asx5hIG9Qmf/1oStypjanR7iKTv0gXQ1Ov/jfrX6kS/EO0OFni8orbmGCn0672NHR3kXHwpAwR+B368ZGN/2rA== dependencies: "@types/ms" "*" "@types/node" "*" @@ -2881,7 +2980,21 @@ dependencies: "@types/koa" "*" -"@types/koa@*", "@types/koa@^2.15.0": +"@types/koa@*": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@types/koa/-/koa-3.0.0.tgz#5df2b3b30da902f01b6ec78ef56403e6eb62fa6e" + integrity sha512-MOcVYdVYmkSutVHZZPh8j3+dAjLyR5Tl59CN0eKgpkE1h/LBSmPAsQQuWs+bKu7WtGNn+hKfJH9Gzml+PulmDg== + dependencies: + "@types/accepts" "*" + "@types/content-disposition" "*" + "@types/cookies" "*" + "@types/http-assert" "*" + "@types/http-errors" "^2" + "@types/keygrip" "*" + "@types/koa-compose" "*" + "@types/node" "*" + +"@types/koa@^2.15.0": version "2.15.0" resolved "https://registry.yarnpkg.com/@types/koa/-/koa-2.15.0.tgz#eca43d76f527c803b491731f95df575636e7b6f2" integrity sha512-7QFsywoE5URbuVnG3loe03QXuGajrnotr3gQkXcEBShORai23MePfFYdhz90FEtBBpkyIYQbVD+evKtloCgX3g== @@ -2911,26 +3024,26 @@ integrity sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA== "@types/multer@^1.4.12": - version "1.4.12" - resolved "https://registry.yarnpkg.com/@types/multer/-/multer-1.4.12.tgz#da67bd0c809f3a63fe097c458c0d4af1fea50ab7" - integrity sha512-pQ2hoqvXiJt2FP9WQVLPRO+AmiIm/ZYkavPlIQnx282u4ZrVdztx0pkh3jjpQt0Kz+YI0YhSG264y08UJKoUQg== + version "1.4.13" + resolved "https://registry.yarnpkg.com/@types/multer/-/multer-1.4.13.tgz#be483f909a77f13e0624cac3d001859eb12ae68b" + integrity sha512-bhhdtPw7JqCiEfC9Jimx5LqX9BDIPJEh2q/fQ4bqbBPtyEZYr3cvF22NwG0DmPZNYA0CAf2CnqDB4KIGGpJcaw== dependencies: "@types/express" "*" "@types/node-fetch@^2.6.4": - version "2.6.12" - resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.12.tgz#8ab5c3ef8330f13100a7479e2cd56d3386830a03" - integrity sha512-8nneRWKCg3rMtF69nLQJnOYUcbafYeFSjqkw3jCRLsqkWFlHaoQrr5mXmofFGOx3DKn7UfmBMyov8ySvLRVldA== + version "2.6.13" + resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.13.tgz#e0c9b7b5edbdb1b50ce32c127e85e880872d56ee" + integrity sha512-QGpRVpzSaUs30JBSGPjOg4Uveu384erbHBoT1zeONvyCfwQxIkUshLAOqN/k9EjGviPRmWTTe6aH2qySWKTVSw== dependencies: "@types/node" "*" - form-data "^4.0.0" + form-data "^4.0.4" -"@types/node@*": - version "22.15.24" - resolved "https://registry.yarnpkg.com/@types/node/-/node-22.15.24.tgz#3b31f1650571c0123388db29d95c12e6f6761744" - integrity sha512-w9CZGm9RDjzTh/D+hFwlBJ3ziUaVw7oufKA3vOFSOZlzmW9AkZnfjPb+DLnrV6qtgL/LNmP0/2zBNCFHL3F0ng== +"@types/node@*", "@types/node@>=13.7.0": + version "24.3.0" + resolved "https://registry.yarnpkg.com/@types/node/-/node-24.3.0.tgz#89b09f45cb9a8ee69466f18ee5864e4c3eb84dec" + integrity sha512-aPTXCrfwnDLj4VvXrm+UUCQjNEvJgNA8s5F1cvwQU+3KNltTOkBm1j30uNLyqqPNe7gE3KFzImYoZEfLhp4Yow== dependencies: - undici-types "~6.21.0" + undici-types "~7.10.0" "@types/node@22.7.5": version "22.7.5" @@ -2939,19 +3052,12 @@ dependencies: undici-types "~6.19.2" -"@types/node@>=13.7.0": - version "24.0.4" - resolved "https://registry.yarnpkg.com/@types/node/-/node-24.0.4.tgz#dbae889912bda33a7f57669fb8587c1a56bc0c1f" - integrity sha512-ulyqAkrhnuNq9pB76DRBTkcS6YsmDALy6Ua63V8OhrOBgbcYt6IOdzpw5P1+dyRIyMerzLkeYWBeOXPpA9GMAA== - dependencies: - undici-types "~7.8.0" - "@types/node@^20.17.0": - version "20.17.52" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.17.52.tgz#0cf582371f88529c61f384fcd57a21b797c56c6e" - integrity sha512-2aj++KfxubvW/Lc0YyXE3OEW7Es8TWn1MsRzYgcOGyTNQxi0L8rxQUCZ7ZbyOBWZQD5I63PV9egZWMsapVaklg== + version "20.19.11" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.19.11.tgz#728cab53092bd5f143beed7fbba7ba99de3c16c4" + integrity sha512-uug3FEEGv0r+jrecvUUpbY8lLisvIjg6AAic6a2bSP5OEOLeJsDSnvhCDov7ipFFMXS3orMpzlmi0ZcuGkBbow== dependencies: - undici-types "~6.19.2" + undici-types "~6.21.0" "@types/node@^8.10.50": version "8.10.66" @@ -3060,9 +3166,9 @@ integrity sha512-7gqG38EyHgyP1S+7+xomFtL+ZNHcKv6DwNaCZmJmo1vgMugyF3TCnXVg4t1uk89mLNwnLtnY3TpOpCOyp1/xHQ== "@types/validator@^13.11.8": - version "13.15.1" - resolved "https://registry.yarnpkg.com/@types/validator/-/validator-13.15.1.tgz#52f3617eb5ba30dd0018380c64568440d0b4de0a" - integrity sha512-9gG6ogYcoI2mCMLdcO0NYI0AYrbxIjv0MDmy/5Ywo6CpWWrqYayc+mmgxRsCgtcGJm9BSbXkMsmxGah1iGHAAQ== + version "13.15.2" + resolved "https://registry.yarnpkg.com/@types/validator/-/validator-13.15.2.tgz#ee533a20ab977df36917a454754c7e0df4aa6f8f" + integrity sha512-y7pa/oEJJ4iGYBxOpfAKn5b9+xuihvzDVnC/OSvlVnGxVg0pOqmjiMafiJ1KVNQEaPZf9HsEp5icEwGg8uIe5Q== "@types/ws@^8.18.1", "@types/ws@^8.5.4": version "8.18.1" @@ -3091,77 +3197,78 @@ "@types/node" "*" "@typescript-eslint/eslint-plugin@^8.32.1": - version "8.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.33.0.tgz#51ed03649575ba51bcee7efdbfd85283249b5447" - integrity sha512-CACyQuqSHt7ma3Ns601xykeBK/rDeZa3w6IS6UtMQbixO5DWy+8TilKkviGDH6jtWCo8FGRKEK5cLLkPvEammQ== + version "8.40.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.40.0.tgz#19f959f273b32f5082c891903645e6a85328db4e" + integrity sha512-w/EboPlBwnmOBtRbiOvzjD+wdiZdgFeo17lkltrtn7X37vagKKWJABvyfsJXTlHe6XBzugmYgd4A4nW+k8Mixw== dependencies: "@eslint-community/regexpp" "^4.10.0" - "@typescript-eslint/scope-manager" "8.33.0" - "@typescript-eslint/type-utils" "8.33.0" - "@typescript-eslint/utils" "8.33.0" - "@typescript-eslint/visitor-keys" "8.33.0" + "@typescript-eslint/scope-manager" "8.40.0" + "@typescript-eslint/type-utils" "8.40.0" + "@typescript-eslint/utils" "8.40.0" + "@typescript-eslint/visitor-keys" "8.40.0" graphemer "^1.4.0" ignore "^7.0.0" natural-compare "^1.4.0" ts-api-utils "^2.1.0" "@typescript-eslint/parser@^8.26.0": - version "8.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-8.33.0.tgz#8e523c2b447ad7cd6ac91b719d8b37449481784d" - integrity sha512-JaehZvf6m0yqYp34+RVnihBAChkqeH+tqqhS0GuX1qgPpwLvmTPheKEs6OeCK6hVJgXZHJ2vbjnC9j119auStQ== - dependencies: - "@typescript-eslint/scope-manager" "8.33.0" - "@typescript-eslint/types" "8.33.0" - "@typescript-eslint/typescript-estree" "8.33.0" - "@typescript-eslint/visitor-keys" "8.33.0" + version "8.40.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-8.40.0.tgz#1bc9f3701ced29540eb76ff2d95ce0d52ddc7e69" + integrity sha512-jCNyAuXx8dr5KJMkecGmZ8KI61KBUhkCob+SD+C+I5+Y1FWI2Y3QmY4/cxMCC5WAsZqoEtEETVhUiUMIGCf6Bw== + dependencies: + "@typescript-eslint/scope-manager" "8.40.0" + "@typescript-eslint/types" "8.40.0" + "@typescript-eslint/typescript-estree" "8.40.0" + "@typescript-eslint/visitor-keys" "8.40.0" debug "^4.3.4" -"@typescript-eslint/project-service@8.33.0": - version "8.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/project-service/-/project-service-8.33.0.tgz#71f37ef9010de47bf20963914743c5cbef851e08" - integrity sha512-d1hz0u9l6N+u/gcrk6s6gYdl7/+pp8yHheRTqP6X5hVDKALEaTn8WfGiit7G511yueBEL3OpOEpD+3/MBdoN+A== +"@typescript-eslint/project-service@8.40.0": + version "8.40.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/project-service/-/project-service-8.40.0.tgz#1b7ba6079ff580c3215882fe75a43e5d3ed166b9" + integrity sha512-/A89vz7Wf5DEXsGVvcGdYKbVM9F7DyFXj52lNYUDS1L9yJfqjW/fIp5PgMuEJL/KeqVTe2QSbXAGUZljDUpArw== dependencies: - "@typescript-eslint/tsconfig-utils" "^8.33.0" - "@typescript-eslint/types" "^8.33.0" + "@typescript-eslint/tsconfig-utils" "^8.40.0" + "@typescript-eslint/types" "^8.40.0" debug "^4.3.4" -"@typescript-eslint/scope-manager@8.33.0": - version "8.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-8.33.0.tgz#459cf0c49d410800b1a023b973c62d699b09bf4c" - integrity sha512-LMi/oqrzpqxyO72ltP+dBSP6V0xiUb4saY7WLtxSfiNEBI8m321LLVFU9/QDJxjDQG9/tjSqKz/E3380TEqSTw== +"@typescript-eslint/scope-manager@8.40.0": + version "8.40.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-8.40.0.tgz#2fbfcc8643340d8cd692267e61548b946190be8a" + integrity sha512-y9ObStCcdCiZKzwqsE8CcpyuVMwRouJbbSrNuThDpv16dFAj429IkM6LNb1dZ2m7hK5fHyzNcErZf7CEeKXR4w== dependencies: - "@typescript-eslint/types" "8.33.0" - "@typescript-eslint/visitor-keys" "8.33.0" + "@typescript-eslint/types" "8.40.0" + "@typescript-eslint/visitor-keys" "8.40.0" -"@typescript-eslint/tsconfig-utils@8.33.0", "@typescript-eslint/tsconfig-utils@^8.33.0": - version "8.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.33.0.tgz#316adab038bbdc43e448781d5a816c2973eab73e" - integrity sha512-sTkETlbqhEoiFmGr1gsdq5HyVbSOF0145SYDJ/EQmXHtKViCaGvnyLqWFFHtEXoS0J1yU8Wyou2UGmgW88fEug== +"@typescript-eslint/tsconfig-utils@8.40.0", "@typescript-eslint/tsconfig-utils@^8.40.0": + version "8.40.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.40.0.tgz#8e8fdb9b988854aedd04abdde3239c4bdd2d26e4" + integrity sha512-jtMytmUaG9d/9kqSl/W3E3xaWESo4hFDxAIHGVW/WKKtQhesnRIJSAJO6XckluuJ6KDB5woD1EiqknriCtAmcw== -"@typescript-eslint/type-utils@8.33.0": - version "8.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-8.33.0.tgz#f06124b2d6db8a51b24990cb123c9543af93fef5" - integrity sha512-lScnHNCBqL1QayuSrWeqAL5GmqNdVUQAAMTaCwdYEdWfIrSrOGzyLGRCHXcCixa5NK6i5l0AfSO2oBSjCjf4XQ== +"@typescript-eslint/type-utils@8.40.0": + version "8.40.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-8.40.0.tgz#a7e4a1f0815dd0ba3e4eef945cc87193ca32c422" + integrity sha512-eE60cK4KzAc6ZrzlJnflXdrMqOBaugeukWICO2rB0KNvwdIMaEaYiywwHMzA1qFpTxrLhN9Lp4E/00EgWcD3Ow== dependencies: - "@typescript-eslint/typescript-estree" "8.33.0" - "@typescript-eslint/utils" "8.33.0" + "@typescript-eslint/types" "8.40.0" + "@typescript-eslint/typescript-estree" "8.40.0" + "@typescript-eslint/utils" "8.40.0" debug "^4.3.4" ts-api-utils "^2.1.0" -"@typescript-eslint/types@8.33.0", "@typescript-eslint/types@^8.33.0": - version "8.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-8.33.0.tgz#02a7dbba611a8abf1ad2a9e00f72f7b94b5ab0ee" - integrity sha512-DKuXOKpM5IDT1FA2g9x9x1Ug81YuKrzf4mYX8FAVSNu5Wo/LELHWQyM1pQaDkI42bX15PWl0vNPt1uGiIFUOpg== +"@typescript-eslint/types@8.40.0", "@typescript-eslint/types@^8.40.0": + version "8.40.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-8.40.0.tgz#0b580fdf643737aa5c01285314b5c6e9543846a9" + integrity sha512-ETdbFlgbAmXHyFPwqUIYrfc12ArvpBhEVgGAxVYSwli26dn8Ko+lIo4Su9vI9ykTZdJn+vJprs/0eZU0YMAEQg== -"@typescript-eslint/typescript-estree@8.33.0": - version "8.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-8.33.0.tgz#abcc1d3db75a8e9fd2e274ee8c4099fa2399abfd" - integrity sha512-vegY4FQoB6jL97Tu/lWRsAiUUp8qJTqzAmENH2k59SJhw0Th1oszb9Idq/FyyONLuNqT1OADJPXfyUNOR8SzAQ== +"@typescript-eslint/typescript-estree@8.40.0": + version "8.40.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-8.40.0.tgz#295149440ce7da81c790a4e14e327599a3a1e5c9" + integrity sha512-k1z9+GJReVVOkc1WfVKs1vBrR5MIKKbdAjDTPvIK3L8De6KbFfPFt6BKpdkdk7rZS2GtC/m6yI5MYX+UsuvVYQ== dependencies: - "@typescript-eslint/project-service" "8.33.0" - "@typescript-eslint/tsconfig-utils" "8.33.0" - "@typescript-eslint/types" "8.33.0" - "@typescript-eslint/visitor-keys" "8.33.0" + "@typescript-eslint/project-service" "8.40.0" + "@typescript-eslint/tsconfig-utils" "8.40.0" + "@typescript-eslint/types" "8.40.0" + "@typescript-eslint/visitor-keys" "8.40.0" debug "^4.3.4" fast-glob "^3.3.2" is-glob "^4.0.3" @@ -3169,23 +3276,23 @@ semver "^7.6.0" ts-api-utils "^2.1.0" -"@typescript-eslint/utils@8.33.0": - version "8.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-8.33.0.tgz#574ad5edee371077b9e28ca6fb804f2440f447c1" - integrity sha512-lPFuQaLA9aSNa7D5u2EpRiqdAUhzShwGg/nhpBlc4GR6kcTABttCuyjFs8BcEZ8VWrjCBof/bePhP3Q3fS+Yrw== +"@typescript-eslint/utils@8.40.0": + version "8.40.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-8.40.0.tgz#8d0c6430ed2f5dc350784bb0d8be514da1e54054" + integrity sha512-Cgzi2MXSZyAUOY+BFwGs17s7ad/7L+gKt6Y8rAVVWS+7o6wrjeFN4nVfTpbE25MNcxyJ+iYUXflbs2xR9h4UBg== dependencies: "@eslint-community/eslint-utils" "^4.7.0" - "@typescript-eslint/scope-manager" "8.33.0" - "@typescript-eslint/types" "8.33.0" - "@typescript-eslint/typescript-estree" "8.33.0" + "@typescript-eslint/scope-manager" "8.40.0" + "@typescript-eslint/types" "8.40.0" + "@typescript-eslint/typescript-estree" "8.40.0" -"@typescript-eslint/visitor-keys@8.33.0": - version "8.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-8.33.0.tgz#fbae16fd3594531f8cad95d421125d634e9974fe" - integrity sha512-7RW7CMYoskiz5OOGAWjJFxgb7c5UNjTG292gYhWeOAcFmYCtVCSqjqSBj5zMhxbXo2JOW95YYrUWJfU0zrpaGQ== +"@typescript-eslint/visitor-keys@8.40.0": + version "8.40.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-8.40.0.tgz#c1b45196981311fed7256863be4bfb2d3eda332a" + integrity sha512-8CZ47QwalyRjsypfwnbI3hKy5gJDPmrkLjkgMxhi0+DZZ2QNx2naS6/hWoVYUHU7LU2zleF68V9miaVZvhFfTA== dependencies: - "@typescript-eslint/types" "8.33.0" - eslint-visitor-keys "^4.2.0" + "@typescript-eslint/types" "8.40.0" + eslint-visitor-keys "^4.2.1" "@unimodules/core@*": version "7.1.2" @@ -3202,92 +3309,102 @@ expo-modules-autolinking "^0.0.3" invariant "^2.2.4" -"@unrs/resolver-binding-darwin-arm64@1.7.8": - version "1.7.8" - resolved "https://registry.yarnpkg.com/@unrs/resolver-binding-darwin-arm64/-/resolver-binding-darwin-arm64-1.7.8.tgz#d78b964ed64e16103b5324b50dcb4277afeda4d7" - integrity sha512-rsRK8T7yxraNRDmpFLZCWqpea6OlXPNRRCjWMx24O1V86KFol7u2gj9zJCv6zB1oJjtnzWceuqdnCgOipFcJPA== - -"@unrs/resolver-binding-darwin-x64@1.7.8": - version "1.7.8" - resolved "https://registry.yarnpkg.com/@unrs/resolver-binding-darwin-x64/-/resolver-binding-darwin-x64-1.7.8.tgz#d095a6c941b2d7892179c3afbd7c34e2416094fd" - integrity sha512-16yEMWa+Olqkk8Kl6Bu0ltT5OgEedkSAsxcz1B3yEctrDYp3EMBu/5PPAGhWVGnwhtf3hNe3y15gfYBAjOv5tQ== - -"@unrs/resolver-binding-freebsd-x64@1.7.8": - version "1.7.8" - resolved "https://registry.yarnpkg.com/@unrs/resolver-binding-freebsd-x64/-/resolver-binding-freebsd-x64-1.7.8.tgz#0330e52103c400d0c9d5d27050bfda39c40ccae2" - integrity sha512-ST4uqF6FmdZQgv+Q73FU1uHzppeT4mhX3IIEmHlLObrv5Ep50olWRz0iQ4PWovadjHMTAmpuJAGaAuCZYb7UAQ== - -"@unrs/resolver-binding-linux-arm-gnueabihf@1.7.8": - version "1.7.8" - resolved "https://registry.yarnpkg.com/@unrs/resolver-binding-linux-arm-gnueabihf/-/resolver-binding-linux-arm-gnueabihf-1.7.8.tgz#dcc2c61b6c49886c225ad25ab3e73bbaf768d906" - integrity sha512-Z/A/4Rm2VWku2g25C3tVb986fY6unx5jaaCFpx1pbAj0OKkyuJ5wcQLHvNbIcJ9qhiYwXfrkB7JNlxrAbg7YFg== - -"@unrs/resolver-binding-linux-arm-musleabihf@1.7.8": - version "1.7.8" - resolved "https://registry.yarnpkg.com/@unrs/resolver-binding-linux-arm-musleabihf/-/resolver-binding-linux-arm-musleabihf-1.7.8.tgz#269f5d78cbfdfe3591005c7602bf9c559a6f6928" - integrity sha512-HN0p7o38qKmDo3bZUiQa6gP7Qhf0sKgJZtRfSHi6JL2Gi4NaUVF0EO1sQ1RHbeQ4VvfjUGMh3QE5dxEh06BgQQ== - -"@unrs/resolver-binding-linux-arm64-gnu@1.7.8": - version "1.7.8" - resolved "https://registry.yarnpkg.com/@unrs/resolver-binding-linux-arm64-gnu/-/resolver-binding-linux-arm64-gnu-1.7.8.tgz#43c30aeecdb1d36aa2201196568209c46d99c234" - integrity sha512-HsoVqDBt9G69AN0KWeDNJW+7i8KFlwxrbbnJffgTGpiZd6Jw+Q95sqkXp8y458KhKduKLmXfVZGnKBTNxAgPjw== - -"@unrs/resolver-binding-linux-arm64-musl@1.7.8": - version "1.7.8" - resolved "https://registry.yarnpkg.com/@unrs/resolver-binding-linux-arm64-musl/-/resolver-binding-linux-arm64-musl-1.7.8.tgz#fc6cc665195a1d8f276cc3a83f4956ee3c1c0a6b" - integrity sha512-VfR2yTDUbUvn+e/Aw22CC9fQg9zdShHAfwWctNBdOk7w9CHWl2OtYlcMvjzMAns8QxoHQoqn3/CEnZ4Ts7hfrA== - -"@unrs/resolver-binding-linux-ppc64-gnu@1.7.8": - version "1.7.8" - resolved "https://registry.yarnpkg.com/@unrs/resolver-binding-linux-ppc64-gnu/-/resolver-binding-linux-ppc64-gnu-1.7.8.tgz#bde19d505eab59ce82e812e8824c9d3e17ca71cf" - integrity sha512-xUauVQNz4uDgs4UJJiUAwMe3N0PA0wvtImh7V0IFu++UKZJhssXbKHBRR4ecUJpUHCX2bc4Wc8sGsB6P+7BANg== - -"@unrs/resolver-binding-linux-riscv64-gnu@1.7.8": - version "1.7.8" - resolved "https://registry.yarnpkg.com/@unrs/resolver-binding-linux-riscv64-gnu/-/resolver-binding-linux-riscv64-gnu-1.7.8.tgz#9b96ddfc4e88720d795629ad3c0cd7a2bcc4afa8" - integrity sha512-GqyIB+CuSHGhhc8ph5RrurtNetYJjb6SctSHafqmdGcRuGi6uyTMR8l18hMEhZFsXdFMc/MpInPLvmNV22xn+A== - -"@unrs/resolver-binding-linux-riscv64-musl@1.7.8": - version "1.7.8" - resolved "https://registry.yarnpkg.com/@unrs/resolver-binding-linux-riscv64-musl/-/resolver-binding-linux-riscv64-musl-1.7.8.tgz#287690c24f2b8106531968d22ad277af13bca57a" - integrity sha512-eEU3rWIFRv60xaAbtsgwHNWRZGD7cqkpCvNtio/f1TjEE3HfKLzPNB24fA9X/8ZXQrGldE65b7UKK3PmO4eWIQ== - -"@unrs/resolver-binding-linux-s390x-gnu@1.7.8": - version "1.7.8" - resolved "https://registry.yarnpkg.com/@unrs/resolver-binding-linux-s390x-gnu/-/resolver-binding-linux-s390x-gnu-1.7.8.tgz#b58bf7ed52f13753c9240fc59c2bd21cc348ee4e" - integrity sha512-GVLI0f4I4TlLqEUoOFvTWedLsJEdvsD0+sxhdvQ5s+N+m2DSynTs8h9jxR0qQbKlpHWpc2Ortz3z48NHRT4l+w== - -"@unrs/resolver-binding-linux-x64-gnu@1.7.8": - version "1.7.8" - resolved "https://registry.yarnpkg.com/@unrs/resolver-binding-linux-x64-gnu/-/resolver-binding-linux-x64-gnu-1.7.8.tgz#578efe1a96f0e737ec9c65dd9211aff9c4bd4b99" - integrity sha512-GX1pZ/4ncUreB0Rlp1l7bhKAZ8ZmvDIgXdeb5V2iK0eRRF332+6gRfR/r5LK88xfbtOpsmRHU6mQ4N8ZnwvGEA== - -"@unrs/resolver-binding-linux-x64-musl@1.7.8": - version "1.7.8" - resolved "https://registry.yarnpkg.com/@unrs/resolver-binding-linux-x64-musl/-/resolver-binding-linux-x64-musl-1.7.8.tgz#1f1aab9d047a2ab8830a2bb65dee950d7583518b" - integrity sha512-n1N84MnsvDupzVuYqJGj+2pb9s8BI1A5RgXHvtVFHedGZVBCFjDpQVRlmsFMt6xZiKwDPaqsM16O/1isCUGt7w== - -"@unrs/resolver-binding-wasm32-wasi@1.7.8": - version "1.7.8" - resolved "https://registry.yarnpkg.com/@unrs/resolver-binding-wasm32-wasi/-/resolver-binding-wasm32-wasi-1.7.8.tgz#85b627a4bf93d439df5e5c77c135f98699c1aa35" - integrity sha512-x94WnaU5g+pCPDVedfnXzoG6lCOF2xFGebNwhtbJCWfceE94Zj8aysSxdxotlrZrxnz5D3ijtyFUYtpz04n39Q== - dependencies: - "@napi-rs/wasm-runtime" "^0.2.10" - -"@unrs/resolver-binding-win32-arm64-msvc@1.7.8": - version "1.7.8" - resolved "https://registry.yarnpkg.com/@unrs/resolver-binding-win32-arm64-msvc/-/resolver-binding-win32-arm64-msvc-1.7.8.tgz#3acb45dbf6561c7c05d2fb554e36d2c46502bf1c" - integrity sha512-vst2u8EJZ5L6jhJ6iLis3w9rg16aYqRxQuBAMYQRVrPMI43693hLP7DuqyOBRKgsQXy9/jgh204k0ViHkqQgdg== - -"@unrs/resolver-binding-win32-ia32-msvc@1.7.8": - version "1.7.8" - resolved "https://registry.yarnpkg.com/@unrs/resolver-binding-win32-ia32-msvc/-/resolver-binding-win32-ia32-msvc-1.7.8.tgz#63628b5e12d14dd6275ec499398272ed5c272479" - integrity sha512-yb3LZOLMFqnA+/ShlE1E5bpYPGDsA590VHHJPB+efnyowT776GJXBoh82em6O9WmYBUq57YblGTcMYAFBm72HA== - -"@unrs/resolver-binding-win32-x64-msvc@1.7.8": - version "1.7.8" - resolved "https://registry.yarnpkg.com/@unrs/resolver-binding-win32-x64-msvc/-/resolver-binding-win32-x64-msvc-1.7.8.tgz#ee29c817f285ccb328b206356eeee588a7388d2b" - integrity sha512-hHKFx+opG5BA3/owMXon8ypwSotBGTdblG6oda/iOu9+OEYnk0cxD2uIcGyGT8jCK578kV+xMrNxqbn8Zjlpgw== +"@unrs/resolver-binding-android-arm-eabi@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@unrs/resolver-binding-android-arm-eabi/-/resolver-binding-android-arm-eabi-1.11.1.tgz#9f5b04503088e6a354295e8ea8fe3cb99e43af81" + integrity sha512-ppLRUgHVaGRWUx0R0Ut06Mjo9gBaBkg3v/8AxusGLhsIotbBLuRk51rAzqLC8gq6NyyAojEXglNjzf6R948DNw== + +"@unrs/resolver-binding-android-arm64@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@unrs/resolver-binding-android-arm64/-/resolver-binding-android-arm64-1.11.1.tgz#7414885431bd7178b989aedc4d25cccb3865bc9f" + integrity sha512-lCxkVtb4wp1v+EoN+HjIG9cIIzPkX5OtM03pQYkG+U5O/wL53LC4QbIeazgiKqluGeVEeBlZahHalCaBvU1a2g== + +"@unrs/resolver-binding-darwin-arm64@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@unrs/resolver-binding-darwin-arm64/-/resolver-binding-darwin-arm64-1.11.1.tgz#b4a8556f42171fb9c9f7bac8235045e82aa0cbdf" + integrity sha512-gPVA1UjRu1Y/IsB/dQEsp2V1pm44Of6+LWvbLc9SDk1c2KhhDRDBUkQCYVWe6f26uJb3fOK8saWMgtX8IrMk3g== + +"@unrs/resolver-binding-darwin-x64@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@unrs/resolver-binding-darwin-x64/-/resolver-binding-darwin-x64-1.11.1.tgz#fd4d81257b13f4d1a083890a6a17c00de571f0dc" + integrity sha512-cFzP7rWKd3lZaCsDze07QX1SC24lO8mPty9vdP+YVa3MGdVgPmFc59317b2ioXtgCMKGiCLxJ4HQs62oz6GfRQ== + +"@unrs/resolver-binding-freebsd-x64@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@unrs/resolver-binding-freebsd-x64/-/resolver-binding-freebsd-x64-1.11.1.tgz#d2513084d0f37c407757e22f32bd924a78cfd99b" + integrity sha512-fqtGgak3zX4DCB6PFpsH5+Kmt/8CIi4Bry4rb1ho6Av2QHTREM+47y282Uqiu3ZRF5IQioJQ5qWRV6jduA+iGw== + +"@unrs/resolver-binding-linux-arm-gnueabihf@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@unrs/resolver-binding-linux-arm-gnueabihf/-/resolver-binding-linux-arm-gnueabihf-1.11.1.tgz#844d2605d057488d77fab09705f2866b86164e0a" + integrity sha512-u92mvlcYtp9MRKmP+ZvMmtPN34+/3lMHlyMj7wXJDeXxuM0Vgzz0+PPJNsro1m3IZPYChIkn944wW8TYgGKFHw== + +"@unrs/resolver-binding-linux-arm-musleabihf@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@unrs/resolver-binding-linux-arm-musleabihf/-/resolver-binding-linux-arm-musleabihf-1.11.1.tgz#204892995cefb6bd1d017d52d097193bc61ddad3" + integrity sha512-cINaoY2z7LVCrfHkIcmvj7osTOtm6VVT16b5oQdS4beibX2SYBwgYLmqhBjA1t51CarSaBuX5YNsWLjsqfW5Cw== + +"@unrs/resolver-binding-linux-arm64-gnu@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@unrs/resolver-binding-linux-arm64-gnu/-/resolver-binding-linux-arm64-gnu-1.11.1.tgz#023eb0c3aac46066a10be7a3f362e7b34f3bdf9d" + integrity sha512-34gw7PjDGB9JgePJEmhEqBhWvCiiWCuXsL9hYphDF7crW7UgI05gyBAi6MF58uGcMOiOqSJ2ybEeCvHcq0BCmQ== + +"@unrs/resolver-binding-linux-arm64-musl@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@unrs/resolver-binding-linux-arm64-musl/-/resolver-binding-linux-arm64-musl-1.11.1.tgz#9e6f9abb06424e3140a60ac996139786f5d99be0" + integrity sha512-RyMIx6Uf53hhOtJDIamSbTskA99sPHS96wxVE/bJtePJJtpdKGXO1wY90oRdXuYOGOTuqjT8ACccMc4K6QmT3w== + +"@unrs/resolver-binding-linux-ppc64-gnu@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@unrs/resolver-binding-linux-ppc64-gnu/-/resolver-binding-linux-ppc64-gnu-1.11.1.tgz#b111417f17c9d1b02efbec8e08398f0c5527bb44" + integrity sha512-D8Vae74A4/a+mZH0FbOkFJL9DSK2R6TFPC9M+jCWYia/q2einCubX10pecpDiTmkJVUH+y8K3BZClycD8nCShA== + +"@unrs/resolver-binding-linux-riscv64-gnu@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@unrs/resolver-binding-linux-riscv64-gnu/-/resolver-binding-linux-riscv64-gnu-1.11.1.tgz#92ffbf02748af3e99873945c9a8a5ead01d508a9" + integrity sha512-frxL4OrzOWVVsOc96+V3aqTIQl1O2TjgExV4EKgRY09AJ9leZpEg8Ak9phadbuX0BA4k8U5qtvMSQQGGmaJqcQ== + +"@unrs/resolver-binding-linux-riscv64-musl@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@unrs/resolver-binding-linux-riscv64-musl/-/resolver-binding-linux-riscv64-musl-1.11.1.tgz#0bec6f1258fc390e6b305e9ff44256cb207de165" + integrity sha512-mJ5vuDaIZ+l/acv01sHoXfpnyrNKOk/3aDoEdLO/Xtn9HuZlDD6jKxHlkN8ZhWyLJsRBxfv9GYM2utQ1SChKew== + +"@unrs/resolver-binding-linux-s390x-gnu@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@unrs/resolver-binding-linux-s390x-gnu/-/resolver-binding-linux-s390x-gnu-1.11.1.tgz#577843a084c5952f5906770633ccfb89dac9bc94" + integrity sha512-kELo8ebBVtb9sA7rMe1Cph4QHreByhaZ2QEADd9NzIQsYNQpt9UkM9iqr2lhGr5afh885d/cB5QeTXSbZHTYPg== + +"@unrs/resolver-binding-linux-x64-gnu@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@unrs/resolver-binding-linux-x64-gnu/-/resolver-binding-linux-x64-gnu-1.11.1.tgz#36fb318eebdd690f6da32ac5e0499a76fa881935" + integrity sha512-C3ZAHugKgovV5YvAMsxhq0gtXuwESUKc5MhEtjBpLoHPLYM+iuwSj3lflFwK3DPm68660rZ7G8BMcwSro7hD5w== + +"@unrs/resolver-binding-linux-x64-musl@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@unrs/resolver-binding-linux-x64-musl/-/resolver-binding-linux-x64-musl-1.11.1.tgz#bfb9af75f783f98f6a22c4244214efe4df1853d6" + integrity sha512-rV0YSoyhK2nZ4vEswT/QwqzqQXw5I6CjoaYMOX0TqBlWhojUf8P94mvI7nuJTeaCkkds3QE4+zS8Ko+GdXuZtA== + +"@unrs/resolver-binding-wasm32-wasi@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@unrs/resolver-binding-wasm32-wasi/-/resolver-binding-wasm32-wasi-1.11.1.tgz#752c359dd875684b27429500d88226d7cc72f71d" + integrity sha512-5u4RkfxJm+Ng7IWgkzi3qrFOvLvQYnPBmjmZQ8+szTK/b31fQCnleNl1GgEt7nIsZRIf5PLhPwT0WM+q45x/UQ== + dependencies: + "@napi-rs/wasm-runtime" "^0.2.11" + +"@unrs/resolver-binding-win32-arm64-msvc@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@unrs/resolver-binding-win32-arm64-msvc/-/resolver-binding-win32-arm64-msvc-1.11.1.tgz#ce5735e600e4c2fbb409cd051b3b7da4a399af35" + integrity sha512-nRcz5Il4ln0kMhfL8S3hLkxI85BXs3o8EYoattsJNdsX4YUU89iOkVn7g0VHSRxFuVMdM4Q1jEpIId1Ihim/Uw== + +"@unrs/resolver-binding-win32-ia32-msvc@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@unrs/resolver-binding-win32-ia32-msvc/-/resolver-binding-win32-ia32-msvc-1.11.1.tgz#72fc57bc7c64ec5c3de0d64ee0d1810317bc60a6" + integrity sha512-DCEI6t5i1NmAZp6pFonpD5m7i6aFrpofcp4LA2i8IIq60Jyo28hamKBxNrZcyOwVOZkgsRp9O2sXWBWP8MnvIQ== + +"@unrs/resolver-binding-win32-x64-msvc@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@unrs/resolver-binding-win32-x64-msvc/-/resolver-binding-win32-x64-msvc-1.11.1.tgz#538b1e103bf8d9864e7b85cc96fa8d6fb6c40777" + integrity sha512-lrW200hZdbfRtztbygyaq/6jP6AKE8qQN2KvPcJ+x7wiD038YtnYtZ82IMNJ69GJibV7bwL3y9FgK+5w/pYt6g== "@yarnpkg/lockfile@^1.1.0": version "1.1.0" @@ -3339,10 +3456,10 @@ acorn-walk@^8.1.1: dependencies: acorn "^8.11.0" -acorn@^8.11.0, acorn@^8.14.0, acorn@^8.4.1: - version "8.14.1" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.14.1.tgz#721d5dc10f7d5b5609a891773d47731796935dfb" - integrity sha512-OvQ/2pUDKmgfCg++xsTX1wGxfTaszcHVcTctW4UJB4hibJx2HXxxO5UmVgyjMa+ZDsiaf5wWLXYpRWMmBI0QHg== +acorn@^8.11.0, acorn@^8.14.0, acorn@^8.15.0, acorn@^8.4.1: + version "8.15.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.15.0.tgz#a360898bc415edaac46c8241f6383975b930b816" + integrity sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg== aes-js@3.0.0: version "3.0.0" @@ -3401,9 +3518,9 @@ ansi-regex@^5.0.1: integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== ansi-regex@^6.0.1: - version "6.1.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-6.1.0.tgz#95ec409c69619d6cb1b8b34f14b660ef28ebd654" - integrity sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA== + version "6.2.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-6.2.0.tgz#2f302e7550431b1b7762705fffb52cf1ffa20447" + integrity sha512-TKY5pyBkHyADOPYlRT9Lx6F544mPl0vS5Ew7BJ45hA08Q+t3GjbueLliBWN3sMICk6+y7HdyxSzC4bWS8baBdg== ansi-styles@^4.0.0, ansi-styles@^4.1.0: version "4.3.0" @@ -3431,9 +3548,9 @@ anymatch@^3.0.3, anymatch@~3.1.2: picomatch "^2.0.4" "aproba@^1.0.3 || ^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/aproba/-/aproba-2.0.0.tgz#52520b8ae5b569215b354efc0caa3fe1e45a8adc" - integrity sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ== + version "2.1.0" + resolved "https://registry.yarnpkg.com/aproba/-/aproba-2.1.0.tgz#75500a190313d95c64e871e7e4284c6ac219f0b1" + integrity sha512-tLIEcj5GuR2RSTnxNKdkK0dJ/GrC7P38sUkiDmDuHfsHmbagTFAxDVIBltoklXEVIQ/f14IL8IMJ5pn9Hez1Ew== are-we-there-yet@^2.0.0: version "2.0.0" @@ -3473,17 +3590,19 @@ array-flatten@1.1.1: resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" integrity sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg== -array-includes@^3.1.8: - version "3.1.8" - resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.1.8.tgz#5e370cbe172fdd5dd6530c1d4aadda25281ba97d" - integrity sha512-itaWrbYbqpGXkGhZPGUulwnhVf5Hpy1xiCFsGqyIGglbBxmG5vSjxQen3/WGOjPpNEv1RtBLKxbmVXm8HpJStQ== +array-includes@^3.1.9: + version "3.1.9" + resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.1.9.tgz#1f0ccaa08e90cdbc3eb433210f903ad0f17c3f3a" + integrity sha512-FmeCCAenzH0KH381SPT5FZmiA/TmpndpcaShhfgEN9eCVjnFBqq3l1xrI42y8+PPLI6hypzou4GXw00WHmPBLQ== dependencies: - call-bind "^1.0.7" + call-bind "^1.0.8" + call-bound "^1.0.4" define-properties "^1.2.1" - es-abstract "^1.23.2" - es-object-atoms "^1.0.0" - get-intrinsic "^1.2.4" - is-string "^1.0.7" + es-abstract "^1.24.0" + es-object-atoms "^1.1.1" + get-intrinsic "^1.3.0" + is-string "^1.1.1" + math-intrinsics "^1.1.0" array-index@^1.0.0: version "1.0.0" @@ -3493,7 +3612,7 @@ array-index@^1.0.0: debug "^2.2.0" es6-symbol "^3.0.2" -array.prototype.findlastindex@^1.2.5: +array.prototype.findlastindex@^1.2.6: version "1.2.6" resolved "https://registry.yarnpkg.com/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.6.tgz#cfa1065c81dcb64e34557c9b81d012f6a421c564" integrity sha512-F/TKATkzseUExPlfvmwQKGITM3DGTK+vkAsCZoDc5daVygbJBnjEUCbgkAvVFsgfXfX4YIqZ/27G3k3tdXrTxQ== @@ -3506,7 +3625,7 @@ array.prototype.findlastindex@^1.2.5: es-object-atoms "^1.1.1" es-shim-unscopables "^1.1.0" -array.prototype.flat@^1.3.2: +array.prototype.flat@^1.3.3: version "1.3.3" resolved "https://registry.yarnpkg.com/array.prototype.flat/-/array.prototype.flat-1.3.3.tgz#534aaf9e6e8dd79fb6b9a9917f839ef1ec63afe5" integrity sha512-rwG/ja1neyLqCuGZ5YYrznA62D4mZXg0i1cIskIUKSiqF3Cje9/wXAls9B9s1Wa2fomMsIv8czB8jZcPmxCXFg== @@ -3516,7 +3635,7 @@ array.prototype.flat@^1.3.2: es-abstract "^1.23.5" es-shim-unscopables "^1.0.2" -array.prototype.flatmap@^1.3.2: +array.prototype.flatmap@^1.3.3: version "1.3.3" resolved "https://registry.yarnpkg.com/array.prototype.flatmap/-/array.prototype.flatmap-1.3.3.tgz#712cc792ae70370ae40586264629e33aab5dd38b" integrity sha512-Y7Wt51eKJSyi80hFrJCePGGNo5ktJCslFuboqJsbf57CCPcm5zztluPlc4/aD8sWsKvlwatezpV4U1efk8kpjg== @@ -3549,7 +3668,7 @@ asmcrypto.js@^0.22.0: resolved "https://registry.yarnpkg.com/asmcrypto.js/-/asmcrypto.js-0.22.0.tgz#38fc1440884d802c7bd37d1d23c2b26a5cd5d2d2" integrity sha512-usgMoyXjMbx/ZPdzTSXExhMPur2FTdz/Vo5PVx2gIaBcdAAJNOFlsdgqveM8Cff7W0v+xrf9BwjOV26JSAF9qA== -asn1js@^3.0.5: +asn1js@^3.0.5, asn1js@^3.0.6: version "3.0.6" resolved "https://registry.yarnpkg.com/asn1js/-/asn1js-3.0.6.tgz#53e002ebe00c5f7fd77c1c047c3557d7c04dce25" integrity sha512-UOCGPYbl0tv8+006qks/dTgV9ajs97X2p0FAbyS2iyCRrmLSRolDaHdp+v/CLgnzHc3fVB+CwYiUmei7ndFcgA== @@ -3575,11 +3694,6 @@ async-mutex@^0.4.0: dependencies: tslib "^2.4.0" -async@^3.2.3: - version "3.2.6" - resolved "https://registry.yarnpkg.com/async/-/async-3.2.6.tgz#1b0728e14929d51b85b449b7f06e27c1145e38ce" - integrity sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA== - asynckit@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" @@ -3598,12 +3712,12 @@ available-typed-arrays@^1.0.7: possible-typed-array-names "^1.0.0" axios@^1.6.3, axios@^1.9.0: - version "1.9.0" - resolved "https://registry.yarnpkg.com/axios/-/axios-1.9.0.tgz#25534e3b72b54540077d33046f77e3b8d7081901" - integrity sha512-re4CqKTJaURpzbLHtIi6XpDv20/CnpXOtjRY5/CU32L8gU8ek9UIivcfvSWvmKEngmVbrUtPpdDwWDWL7DNHvg== + version "1.11.0" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.11.0.tgz#c2ec219e35e414c025b2095e8b8280278478fdb6" + integrity sha512-1Lx3WLFQWm3ooKDYZD1eXmoGO9fxYQjrycfHFC8P0sCfQVXyROp0p9PFWBehewBOdCwHc+f/b8I0fMto5eSfwA== dependencies: follow-redirects "^1.15.6" - form-data "^4.0.0" + form-data "^4.0.4" proxy-from-env "^1.1.0" b64-lite@^1.3.1, b64-lite@^1.4.0: @@ -3655,9 +3769,9 @@ babel-plugin-jest-hoist@^29.6.3: "@types/babel__traverse" "^7.0.6" babel-preset-current-node-syntax@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.1.0.tgz#9a929eafece419612ef4ae4f60b1862ebad8ef30" - integrity sha512-ldYss8SbBlWva1bs28q78Ju5Zq1F+8BrqBZZ0VFhLBvhh6lCpC2o3gDJi/5DRLs9FgYZCnmPYIVFU4lRXCkyUw== + version "1.2.0" + resolved "https://registry.yarnpkg.com/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.2.0.tgz#20730d6cdc7dda5d89401cab10ac6a32067acde6" + integrity sha512-E/VlAEzRrsLEb2+dv8yp3bo4scof3l9nR4lrld+Iy5NyVqgVYUJnDAmunkhPMisRI32Qc4iRiz425d8vM++2fg== dependencies: "@babel/plugin-syntax-async-generators" "^7.8.4" "@babel/plugin-syntax-bigint" "^7.8.3" @@ -3722,15 +3836,10 @@ bech32@1.1.4: resolved "https://registry.yarnpkg.com/bech32/-/bech32-1.1.4.tgz#e38c9f37bf179b8eb16ae3a772b40c356d4832e9" integrity sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ== -big-integer@^1.6.51: - version "1.6.52" - resolved "https://registry.yarnpkg.com/big-integer/-/big-integer-1.6.52.tgz#60a887f3047614a8e1bffe5d7173490a97dc8c85" - integrity sha512-QxD8cf2eVqJOOz63z6JIN9BzvVs/dlySa5HGSBH5xtR8dPteIRQnBxxKqkNTiT6jbDTF6jAfrd4oMcND9RGbQg== - bignumber.js@^9.0.0: - version "9.3.0" - resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-9.3.0.tgz#bdba7e2a4c1a2eba08290e8dcad4f36393c92acd" - integrity sha512-EM7aMFTXbptt/wZdMlBv2t8IViwQL+h6SLHosp8Yf0dqJMTnY6iL32opnAB6kAdL0SZPuvcAzFr31o0c/R3/RA== + version "9.3.1" + resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-9.3.1.tgz#759c5aaddf2ffdc4f154f7b493e1c8770f88c4d7" + integrity sha512-Ko0uX15oIUS7wJ3Rb30Fs6SkVbLmPBAKdlm7q9+ak9bbIeFf0MwuBsQV6z7+X768/cHsfg+WlysDWJcmthjsjQ== binary-extensions@^2.0.0: version "2.3.0" @@ -3821,12 +3930,12 @@ brorand@^1.1.0: integrity sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w== browserslist@^4.24.0: - version "4.25.0" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.25.0.tgz#986aa9c6d87916885da2b50d8eb577ac8d133b2c" - integrity sha512-PJ8gYKeS5e/whHBh8xrwYK+dAvEj7JXtz6uTucnMRB8OiGTsKccFekoRrjajPBHV8oOY+2tI4uxeceSimKwMFA== + version "4.25.3" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.25.3.tgz#9167c9cbb40473f15f75f85189290678b99b16c5" + integrity sha512-cDGv1kkDI4/0e5yON9yM5G/0A5u8sf5TnmdX5C9qHzI9PPu++sQ9zjm1k9NiOrf3riY4OkK0zSGqfvJyJsgCBQ== dependencies: - caniuse-lite "^1.0.30001718" - electron-to-chromium "^1.5.160" + caniuse-lite "^1.0.30001735" + electron-to-chromium "^1.5.204" node-releases "^2.0.19" update-browserslist-db "^1.1.3" @@ -3931,10 +4040,10 @@ camelcase@^6.2.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== -caniuse-lite@^1.0.30001718: - version "1.0.30001720" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001720.tgz#c138cb6026d362be9d8d7b0e4bcd0183a850edfd" - integrity sha512-Ec/2yV2nNPwb4DnTANEV99ZWwm3ZWfdlfkQbWSDDt+PsXEVYwlhPH8tdMaPunYTKKmz7AnHi2oNEi1GcmKCD8g== +caniuse-lite@^1.0.30001735: + version "1.0.30001735" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001735.tgz#ba658fd3fd24a4106fd68d5ce472a2c251494dbe" + integrity sha512-EV/laoX7Wq2J9TQlyIXRxTJqIw4sxfXS4OYgudGxBYRuTv0q7AM6yMEpU/Vo1I94thg9U6EZ2NfZx9GJq83u7w== canonicalize@^1.0.1: version "1.0.8" @@ -3948,7 +4057,7 @@ cbor@^8.1.0: dependencies: nofilter "^3.1.0" -chalk@^4.0.0, chalk@^4.0.2, chalk@^4.1.0, chalk@^4.1.2: +chalk@^4.0.0, chalk@^4.1.0, chalk@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== @@ -3996,7 +4105,7 @@ cjs-module-lexer@^1.0.0, cjs-module-lexer@^1.2.2: resolved "https://registry.yarnpkg.com/cjs-module-lexer/-/cjs-module-lexer-1.4.3.tgz#0f79731eb8cfe1ec72acd4066efac9d61991b00d" integrity sha512-9z8TZaGM1pfswYeXrUpzPrkx8UnWYdhJclsiYMm6x/w5+nN+8Tf/LnAgfLGQCm59qAOxU8WwHEq2vNwF6i4j+Q== -class-transformer@0.5.1: +class-transformer@0.5.1, class-transformer@^0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/class-transformer/-/class-transformer-0.5.1.tgz#24147d5dffd2a6cea930a3250a677addf96ab336" integrity sha512-SQa1Ws6hUbfC98vKGxZH3KFY0Y1lm5Zm0SY8XX9zbK7FJCyVEac3ATW0RIpwzW+oOfmHE5PMPufDG9hCfoEOMw== @@ -4080,7 +4189,7 @@ compare-versions@^6.1.1: resolved "https://registry.yarnpkg.com/compare-versions/-/compare-versions-6.1.1.tgz#7af3cc1099ba37d244b3145a9af5201b629148a9" integrity sha512-4hm4VPpIecmlg59CHXnRDnqGplJFrbLG4aFEl5vl6cK1u76ws3LLvX7ikFnTDl5vo39sjWD6AaDPYodJp/NNHg== -component-emitter@^1.3.0: +component-emitter@^1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.1.tgz#ef1d5796f7d93f135ee6fb684340b26403c97d17" integrity sha512-T0+barUSQRTUQASh8bx02dl+DhF54GtIDY13Y3m9oWTklKbb3Wv974meRpeZ3lp1JpLVECWWNHC4vaG2XHXouQ== @@ -4241,6 +4350,13 @@ data-view-byte-offset@^1.0.1: es-errors "^1.3.0" is-data-view "^1.0.1" +dcql@^0.2.20: + version "0.2.22" + resolved "https://registry.yarnpkg.com/dcql/-/dcql-0.2.22.tgz#aeae2f7f47b8bce5fe2c4a8857df8406feb91230" + integrity sha512-4CfuUoJ1/dfj4aOMwCGF3HEHsPpRUyALbst5Dx3qcNkIXNFpVqebKVYd58X9/ZlKN/wWJxPS34S7uQ0fcbzS5A== + dependencies: + valibot "1.0.0-beta.8" + debug@2.6.9, debug@^2.2.0: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" @@ -4248,7 +4364,7 @@ debug@2.6.9, debug@^2.2.0: dependencies: ms "2.0.0" -debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.4, debug@^4.3.5, debug@^4.4.0, debug@^4.4.1: +debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.4, debug@^4.3.5, debug@^4.3.7, debug@^4.4.0, debug@^4.4.1: version "4.4.1" resolved "https://registry.yarnpkg.com/debug/-/debug-4.4.1.tgz#e5a8bc6cbc4c6cd3e64308b0693a3d4fa550189b" integrity sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ== @@ -4373,9 +4489,9 @@ doctrine@^2.1.0: esutils "^2.0.2" dotenv@^16.5.0: - version "16.5.0" - resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.5.0.tgz#092b49f25f808f020050051d1ff258e404c78692" - integrity sha512-m/C+AwOAr9/W1UOIZUo232ejMNnJAJtYQjUbHoNTBNTJSvqzzDh7vnrei3o3r3m9blf6ZoDkvcw0VmozNRFJxg== + version "16.6.1" + resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.6.1.tgz#773f0e69527a8315c7285d5ee73c4459d20a8020" + integrity sha512-uBq4egWHTcTt33a72vpSG0z3HnPuIl6NqYcTrKEg2azoEyl2hpW0zqlxysq2pK9HlDIHyHyakeYaYnSAwd8bow== dunder-proto@^1.0.0, dunder-proto@^1.0.1: version "1.0.1" @@ -4398,6 +4514,11 @@ eastasianwidth@^0.2.0: resolved "https://registry.yarnpkg.com/eastasianwidth/-/eastasianwidth-0.2.0.tgz#696ce2ec0aa0e6ea93a397ffcf24aa7840c827cb" integrity sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA== +ec-compression@0.0.1-alpha.11: + version "0.0.1-alpha.11" + resolved "https://registry.yarnpkg.com/ec-compression/-/ec-compression-0.0.1-alpha.11.tgz#1dddcebd664c786c5b3459e012d382abded81b63" + integrity sha512-ppznPCx1m/TrjlThndIOZdJPSI9/PGqU1+RTDSHQGaMS66ZWdLM8bTQw8QbdBcseDS+5UV7ZZz8GwqpQhjsZYw== + ecdsa-sig-formatter@1.0.11: version "1.0.11" resolved "https://registry.yarnpkg.com/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz#ae0f0fa2d85045ef14a817daa3ce9acd0489e5bf" @@ -4420,17 +4541,10 @@ ee-first@1.1.1: resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" integrity sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow== -ejs@^3.1.10: - version "3.1.10" - resolved "https://registry.yarnpkg.com/ejs/-/ejs-3.1.10.tgz#69ab8358b14e896f80cc39e62087b88500c3ac3b" - integrity sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA== - dependencies: - jake "^10.8.5" - -electron-to-chromium@^1.5.160: - version "1.5.161" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.161.tgz#650376bd3be7ff8e581031409fc2d4f150620b12" - integrity sha512-hwtetwfKNZo/UlwHIVBlKZVdy7o8bIZxxKs0Mv/ROPiQQQmDgdm5a+KvKtBsxM8ZjFzTaCeLoodZ8jiBE3o9rA== +electron-to-chromium@^1.5.204: + version "1.5.205" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.205.tgz#02b538ce3d0e6ef2016458b49309fd1f5be2a2a7" + integrity sha512-gBtbT7IgOHu7CwdtIiXwbNRD1l6oG6GAyanmwMCLVqaoGy92Jfe1dSHLiSj8xUEZNxOTIVlXuaAalMMD+S4y0w== elliptic@6.6.1: version "6.6.1" @@ -4484,7 +4598,7 @@ error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" -es-abstract@^1.23.2, es-abstract@^1.23.5, es-abstract@^1.23.9: +es-abstract@^1.23.2, es-abstract@^1.23.5, es-abstract@^1.23.9, es-abstract@^1.24.0: version "1.24.0" resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.24.0.tgz#c44732d2beb0acc1ed60df840869e3106e7af328" integrity sha512-WSzPgsdLtTcQwm4CROfS5ju2Wa1QQcVeT37jFjYzdFz1r9ahadC8B8/a4qxJxM+09F18iumCdRmlr96ZYkQvEg== @@ -4647,17 +4761,17 @@ escodegen@^1.8.1: source-map "~0.6.1" eslint-config-prettier@^10.1.5: - version "10.1.5" - resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-10.1.5.tgz#00c18d7225043b6fbce6a665697377998d453782" - integrity sha512-zc1UmCpNltmVY34vuLRV61r1K27sWuX39E+uyUnY8xS2Bex88VV9cugG+UZbRSRGtGyFboj+D8JODyme1plMpw== + version "10.1.8" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-10.1.8.tgz#15734ce4af8c2778cc32f0b01b37b0b5cd1ecb97" + integrity sha512-82GZUjRS0p/jganf6q1rEO25VSoHH0hKPCTrgillPjdI/3bgBhAE1QzHrHTizjpRvy6pGAvKjDJtk2pF9NDq8w== -eslint-import-context@^0.1.5: - version "0.1.6" - resolved "https://registry.yarnpkg.com/eslint-import-context/-/eslint-import-context-0.1.6.tgz#42dcd6718beea6279a78015e347d82a1c75f0dfa" - integrity sha512-/e2ZNPDLCrU8niIy0pddcvXuoO2YrKjf3NAIX+60mHJBT4yv7mqCqvVdyCW2E720e25e4S/1OSVef4U6efGLFg== +eslint-import-context@^0.1.8: + version "0.1.9" + resolved "https://registry.yarnpkg.com/eslint-import-context/-/eslint-import-context-0.1.9.tgz#967b0b2f0a90ef4b689125e088f790f0b7756dbe" + integrity sha512-K9Hb+yRaGAGUbwjhFNHvSmmkZs9+zbuoe3kFQ4V1wYjrepUFYM2dZAfNtjbbj3qsPfUfsA68Bx/ICWQMi+C8Eg== dependencies: get-tsconfig "^4.10.1" - stable-hash "^0.0.5" + stable-hash-x "^0.2.0" eslint-import-resolver-node@^0.3.9: version "0.3.9" @@ -4669,62 +4783,62 @@ eslint-import-resolver-node@^0.3.9: resolve "^1.22.4" eslint-import-resolver-typescript@^4.4.1: - version "4.4.1" - resolved "https://registry.yarnpkg.com/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-4.4.1.tgz#3da41dcaa17ddfc520ad2d2d1e30b8ac4e137e8e" - integrity sha512-KHQnjMAn/Hbs1AcMs2YfJTeNoWsaOoMRvJUKr77Y2dv7jNOaT8/IJYlvfN/ZIwTxUsv2B6amwv7u9bt2Vl9lZg== + version "4.4.4" + resolved "https://registry.yarnpkg.com/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-4.4.4.tgz#3e83a9c25f4a053fe20e1b07b47e04e8519a8720" + integrity sha512-1iM2zeBvrYmUNTj2vSC/90JTHDth+dfOfiNKkxApWRsTJYNrc8rOdxxIf5vazX+BiAXTeOT0UvWpGI/7qIWQOw== dependencies: debug "^4.4.1" - eslint-import-context "^0.1.5" + eslint-import-context "^0.1.8" get-tsconfig "^4.10.1" is-bun-module "^2.0.0" - stable-hash "^0.0.5" + stable-hash-x "^0.2.0" tinyglobby "^0.2.14" - unrs-resolver "^1.7.2" + unrs-resolver "^1.7.11" -eslint-module-utils@^2.12.0: - version "2.12.0" - resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.12.0.tgz#fe4cfb948d61f49203d7b08871982b65b9af0b0b" - integrity sha512-wALZ0HFoytlyh/1+4wuZ9FJCD/leWHQzzrxJ8+rebyReSLk7LApMyd3WJaLVoN+D5+WIdJyDK1c6JnE65V4Zyg== +eslint-module-utils@^2.12.1: + version "2.12.1" + resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.12.1.tgz#f76d3220bfb83c057651359295ab5854eaad75ff" + integrity sha512-L8jSWTze7K2mTg0vos/RuLRS5soomksDPoJLXIslC7c8Wmut3bx7CPpJijDcBZtxQ5lrbUdM+s0OlNbz0DCDNw== dependencies: debug "^3.2.7" eslint-plugin-import@^2.31.0: - version "2.31.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.31.0.tgz#310ce7e720ca1d9c0bb3f69adfd1c6bdd7d9e0e7" - integrity sha512-ixmkI62Rbc2/w8Vfxyh1jQRTdRTF52VxwRVHl/ykPAmqG+Nb7/kNn+byLP0LxPgI7zWA16Jt82SybJInmMia3A== + version "2.32.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.32.0.tgz#602b55faa6e4caeaa5e970c198b5c00a37708980" + integrity sha512-whOE1HFo/qJDyX4SnXzP4N6zOWn79WhnCUY/iDR0mPfQZO8wcYE4JClzI2oZrhBnnMUCBCHZhO6VQyoBU95mZA== dependencies: "@rtsao/scc" "^1.1.0" - array-includes "^3.1.8" - array.prototype.findlastindex "^1.2.5" - array.prototype.flat "^1.3.2" - array.prototype.flatmap "^1.3.2" + array-includes "^3.1.9" + array.prototype.findlastindex "^1.2.6" + array.prototype.flat "^1.3.3" + array.prototype.flatmap "^1.3.3" debug "^3.2.7" doctrine "^2.1.0" eslint-import-resolver-node "^0.3.9" - eslint-module-utils "^2.12.0" + eslint-module-utils "^2.12.1" hasown "^2.0.2" - is-core-module "^2.15.1" + is-core-module "^2.16.1" is-glob "^4.0.3" minimatch "^3.1.2" object.fromentries "^2.0.8" object.groupby "^1.0.3" - object.values "^1.2.0" + object.values "^1.2.1" semver "^6.3.1" - string.prototype.trimend "^1.0.8" + string.prototype.trimend "^1.0.9" tsconfig-paths "^3.15.0" eslint-plugin-prettier@^5.4.0: - version "5.4.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-5.4.0.tgz#54d4748904e58eaf1ffe26c4bffa4986ca7f952b" - integrity sha512-BvQOvUhkVQM1i63iMETK9Hjud9QhqBnbtT1Zc642p9ynzBuCe5pybkOnvqZIBypXmMlsGcnU4HZ8sCTPfpAexA== + version "5.5.4" + resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-5.5.4.tgz#9d61c4ea11de5af704d4edf108c82ccfa7f2e61c" + integrity sha512-swNtI95SToIz05YINMA6Ox5R057IMAmWZ26GqPxusAp1TZzj+IdY9tXNWWD3vkF/wEqydCONcwjTFpxybBqZsg== dependencies: prettier-linter-helpers "^1.0.0" - synckit "^0.11.0" + synckit "^0.11.7" -eslint-scope@^8.3.0: - version "8.3.0" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-8.3.0.tgz#10cd3a918ffdd722f5f3f7b5b83db9b23c87340d" - integrity sha512-pUNxi75F8MJ/GdeKtVLSbYg4ZI34J6C0C7sbL4YOp2exGwen7ZsuBqKzUhXd0qMQ362yET3z+uPwKeg/0C2XCQ== +eslint-scope@^8.4.0: + version "8.4.0" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-8.4.0.tgz#88e646a207fad61436ffa39eb505147200655c82" + integrity sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg== dependencies: esrecurse "^4.3.0" estraverse "^5.2.0" @@ -4734,24 +4848,24 @@ eslint-visitor-keys@^3.4.3: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz#0cd72fe8550e3c2eae156a96a4dddcd1c8ac5800" integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag== -eslint-visitor-keys@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz#687bacb2af884fcdda8a6e7d65c606f46a14cd45" - integrity sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw== +eslint-visitor-keys@^4.2.1: + version "4.2.1" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz#4cfea60fe7dd0ad8e816e1ed026c1d5251b512c1" + integrity sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ== eslint@^9.27.0: - version "9.27.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-9.27.0.tgz#a587d3cd5b844b68df7898944323a702afe38979" - integrity sha512-ixRawFQuMB9DZ7fjU3iGGganFDp3+45bPOdaRurcFHSXO1e/sYwUX/FtQZpLZJR6SjMoJH8hR2pPEAfDyCoU2Q== + version "9.33.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-9.33.0.tgz#cc186b3d9eb0e914539953d6a178a5b413997b73" + integrity sha512-TS9bTNIryDzStCpJN93aC5VRSW3uTx9sClUn4B87pwiCaJh220otoI0X8mJKr+VcPtniMdN8GKjlwgWGUv5ZKA== dependencies: "@eslint-community/eslint-utils" "^4.2.0" "@eslint-community/regexpp" "^4.12.1" - "@eslint/config-array" "^0.20.0" - "@eslint/config-helpers" "^0.2.1" - "@eslint/core" "^0.14.0" + "@eslint/config-array" "^0.21.0" + "@eslint/config-helpers" "^0.3.1" + "@eslint/core" "^0.15.2" "@eslint/eslintrc" "^3.3.1" - "@eslint/js" "9.27.0" - "@eslint/plugin-kit" "^0.3.1" + "@eslint/js" "9.33.0" + "@eslint/plugin-kit" "^0.3.5" "@humanfs/node" "^0.16.6" "@humanwhocodes/module-importer" "^1.0.1" "@humanwhocodes/retry" "^0.4.2" @@ -4762,9 +4876,9 @@ eslint@^9.27.0: cross-spawn "^7.0.6" debug "^4.3.2" escape-string-regexp "^4.0.0" - eslint-scope "^8.3.0" - eslint-visitor-keys "^4.2.0" - espree "^10.3.0" + eslint-scope "^8.4.0" + eslint-visitor-keys "^4.2.1" + espree "^10.4.0" esquery "^1.5.0" esutils "^2.0.2" fast-deep-equal "^3.1.3" @@ -4790,14 +4904,14 @@ esniff@^2.0.1: event-emitter "^0.3.5" type "^2.7.2" -espree@^10.0.1, espree@^10.3.0: - version "10.3.0" - resolved "https://registry.yarnpkg.com/espree/-/espree-10.3.0.tgz#29267cf5b0cb98735b65e64ba07e0ed49d1eed8a" - integrity sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg== +espree@^10.0.1, espree@^10.4.0: + version "10.4.0" + resolved "https://registry.yarnpkg.com/espree/-/espree-10.4.0.tgz#d54f4949d4629005a1fa168d937c3ff1f7e2a837" + integrity sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ== dependencies: - acorn "^8.14.0" + acorn "^8.15.0" acorn-jsx "^5.3.2" - eslint-visitor-keys "^4.2.0" + eslint-visitor-keys "^4.2.1" esprima@^4.0.0, esprima@^4.0.1: version "4.0.1" @@ -4875,9 +4989,9 @@ ethers@^5.1.0: "@ethersproject/wordlists" "5.8.0" ethers@^6.9.0: - version "6.14.3" - resolved "https://registry.yarnpkg.com/ethers/-/ethers-6.14.3.tgz#7c4443c165ee59b2964e691600fd4586004b2000" - integrity sha512-qq7ft/oCJohoTcsNPFaXSQUm457MA5iWqkf1Mb11ujONdg7jBI6sAOrHaTi3j0CBqIGFSCeR/RMc+qwRRub7IA== + version "6.15.0" + resolved "https://registry.yarnpkg.com/ethers/-/ethers-6.15.0.tgz#2980f2a3baf0509749b7e21f8692fa8a8349c0e3" + integrity sha512-Kf/3ZW54L4UT0pZtsY/rf+EkBU7Qi5nnhonjUb8yTXcxH3cdcWrV2cRyk0Xk/4jK6OoHhxxZHriyhje20If2hQ== dependencies: "@adraffy/ens-normalize" "1.10.1" "@noble/curves" "1.2.0" @@ -4955,11 +5069,11 @@ expo-random@*: base64-js "^1.3.0" express-rate-limit@^7.5.0: - version "7.5.0" - resolved "https://registry.yarnpkg.com/express-rate-limit/-/express-rate-limit-7.5.0.tgz#6a67990a724b4fbbc69119419feef50c51e8b28f" - integrity sha512-eB5zbQh5h+VenMPM3fh+nw1YExi5nMr6HUCR62ELSP11huvxm/Uir1H1QEyTkk5QX6A58pX6NmaTMceKZ0Eodg== + version "7.5.1" + resolved "https://registry.yarnpkg.com/express-rate-limit/-/express-rate-limit-7.5.1.tgz#8c3a42f69209a3a1c969890070ece9e20a879dec" + integrity sha512-7iN8iPMDzOMHPUYllBEsQdWVB6fPDMPqwjBaFrgr4Jgr/+okjvzAy+UHlYYL/Vs0OsOrMkwS6PJDkFlJwoxUnw== -express@^4.17.1, express@^4.21.2: +express@^4.21.2: version "4.21.2" resolved "https://registry.yarnpkg.com/express/-/express-4.21.2.tgz#cf250e48362174ead6cea4a566abef0162c1ec32" integrity sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA== @@ -5115,9 +5229,9 @@ fd-slicer@~1.1.0: pend "~1.2.0" fdir@^6.4.4: - version "6.4.5" - resolved "https://registry.yarnpkg.com/fdir/-/fdir-6.4.5.tgz#328e280f3a23699362f95f2e82acf978a0c0cb49" - integrity sha512-4BG7puHpVsIYxZUbiUE3RqGloLaSSwzYie5jvasC4LWuBWzZawynvYouhjbQKw2JuIGYdm0DzIxl8iVidKlUEw== + version "6.5.0" + resolved "https://registry.yarnpkg.com/fdir/-/fdir-6.5.0.tgz#ed2ab967a331ade62f18d077dae192684d50d350" + integrity sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg== fetch-blob@^2.1.1: version "2.1.2" @@ -5139,13 +5253,6 @@ file-entry-cache@^8.0.0: dependencies: flat-cache "^4.0.0" -filelist@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/filelist/-/filelist-1.0.4.tgz#f78978a1e944775ff9e62e744424f215e58352b5" - integrity sha512-w1cEuf3S+DrLCQL7ET6kz+gmlJdbq9J7yXCSjK/OZCPA+qEN1WyF4ZAf0YYJa4/shHJra2t/d/r8SV4Ji+x+8Q== - dependencies: - minimatch "^5.0.1" - fill-range@^7.1.1: version "7.1.1" resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.1.1.tgz#44265d3cac07e3ea7dc247516380643754a05292" @@ -5229,9 +5336,9 @@ flatted@^3.2.9: integrity sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg== follow-redirects@^1.15.6: - version "1.15.9" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.9.tgz#a604fa10e443bf98ca94228d9eebcc2e8a2c8ee1" - integrity sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ== + version "1.15.11" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.11.tgz#777d73d72a92f8ec4d2e410eb47352a56b8e8340" + integrity sha512-deG2P0JfjrTxl50XGCDyfI97ZGVCxIpfKYmfyrQ54n5FO/0gfIES8C/Psl6kWVDolizcaaxZJnTS0QSMxvnsBQ== for-each@^0.3.3, for-each@^0.3.5: version "0.3.5" @@ -5248,14 +5355,15 @@ foreground-child@^3.1.0: cross-spawn "^7.0.6" signal-exit "^4.0.1" -form-data@^4.0.0: - version "4.0.2" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.2.tgz#35cabbdd30c3ce73deb2c42d3c8d3ed9ca51794c" - integrity sha512-hGfm/slu0ZabnNt4oaRZ6uREyfCj6P4fT/n6A1rGV+Z0VdGXjfOhVUpkn6qVQONHGIFwmveGXyDs75+nr6FM8w== +form-data@^4.0.0, form-data@^4.0.4: + version "4.0.4" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.4.tgz#784cdcce0669a9d68e94d11ac4eea98088edd2c4" + integrity sha512-KrGhL9Q4zjj0kiUt5OO4Mr/A/jlI2jDYs5eHBpYHPcBEVSiipAvn2Ko2HnPe20rmcuuvMHNdZFp+4IlGTMF0Ow== dependencies: asynckit "^0.4.0" combined-stream "^1.0.8" es-set-tostringtag "^2.1.0" + hasown "^2.0.2" mime-types "^2.1.12" format-util@^1.0.5: @@ -5300,9 +5408,9 @@ fresh@^2.0.0: integrity sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A== fs-extra@^11.2.0: - version "11.3.0" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-11.3.0.tgz#0daced136bbaf65a555a326719af931adc7a314d" - integrity sha512-Z4XaCL6dUDHfP/jT25jJKMmtxvuwbkrD1vNSMFlo9lNLY2c5FHYSQgHPRZUjAB26TpDEoW9HCOgplrdbaPV/ew== + version "11.3.1" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-11.3.1.tgz#ba7a1f97a85f94c6db2e52ff69570db3671d5a74" + integrity sha512-eXvGGwZ5CL17ZSwHWd3bbgk7UUpF6IFHtP57NYYakPvHOs8GDgDe5KJI36jIJzDkJ6eJjuzRA8eBQb6SkKue0g== dependencies: graceful-fs "^4.2.0" jsonfile "^6.0.1" @@ -5489,11 +5597,6 @@ glob@^7.1.3, glob@^7.1.4: once "^1.3.0" path-is-absolute "^1.0.0" -globals@^11.1.0: - version "11.12.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" - integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== - globals@^14.0.0: version "14.0.0" resolved "https://registry.yarnpkg.com/globals/-/globals-14.0.0.tgz#898d7413c29babcf6bafe56fcadded858ada724e" @@ -5688,9 +5791,9 @@ ignore@^5.2.0: integrity sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g== ignore@^7.0.0: - version "7.0.4" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-7.0.4.tgz#a12c70d0f2607c5bf508fb65a40c75f037d7a078" - integrity sha512-gJzzk+PQNznz8ysRrC0aOkBNVRBDtE1n53IqyqEf3PXrYwomFs5q4pGMizBMJF+ykh03insJ27hB8gSrD2Hn8A== + version "7.0.5" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-7.0.5.tgz#4cb5f6cd7d4c7ab0365738c7aea888baa6d7efd9" + integrity sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg== import-fresh@^3.2.1: version "3.3.1" @@ -5816,7 +5919,7 @@ is-callable@^1.2.7: resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.7.tgz#3bc2a85ea742d9e36205dcacdd72ca1fdc51b055" integrity sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA== -is-core-module@^2.13.0, is-core-module@^2.15.1, is-core-module@^2.16.0: +is-core-module@^2.13.0, is-core-module@^2.16.0, is-core-module@^2.16.1: version "2.16.1" resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.16.1.tgz#2a98801a849f43e2add644fbb6bc6229b19a4ef4" integrity sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w== @@ -5939,7 +6042,7 @@ is-stream@^2.0.0: resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.1.tgz#fac1e3d53b97ad5a9d0ae9cef2389f5810a5c077" integrity sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg== -is-string@^1.0.7, is-string@^1.1.1: +is-string@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.1.1.tgz#92ea3f3d5c5b6e039ca8677e5ac8d07ea773cbb9" integrity sha512-BtEeSsoaQjlSPBemMQIrY1MY0uM6vnS1g5fmufYOtnxLGUZM2178PKbhsk7Ffv58IX+ZtcvoGwccYsh0PglkAA== @@ -6074,9 +6177,9 @@ istanbul-lib-source-maps@^4.0.0: source-map "^0.6.1" istanbul-reports@^3.1.3: - version "3.1.7" - resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-3.1.7.tgz#daed12b9e1dca518e15c056e1e537e741280fa0b" - integrity sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g== + version "3.2.0" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-3.2.0.tgz#cb4535162b5784aa623cee21a7252cf2c807ac93" + integrity sha512-HGYWWS/ehqTV3xN10i23tkPkpH46MLCIMFNCaaKNavAXTF1RkqxawEPtnjnGZ6XKSInBKkiOA5BKS+aZiY3AvA== dependencies: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" @@ -6090,16 +6193,6 @@ jackspeak@^3.1.2: optionalDependencies: "@pkgjs/parseargs" "^0.11.0" -jake@^10.8.5: - version "10.9.2" - resolved "https://registry.yarnpkg.com/jake/-/jake-10.9.2.tgz#6ae487e6a69afec3a5e167628996b59f35ae2b7f" - integrity sha512-2P4SQ0HrLQ+fw6llpLnOaGAvN2Zu6778SJMrCUwns4fOoG9ayrTiZk3VV8sCPkVZF8ab0zksVpS8FDY5pRCNBA== - dependencies: - async "^3.2.3" - chalk "^4.0.2" - filelist "^1.0.4" - minimatch "^3.1.2" - jest-changed-files@^29.7.0: version "29.7.0" resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-29.7.0.tgz#1c06d07e77c78e1585d020424dedc10d6e17ac3a" @@ -6400,7 +6493,7 @@ jest-snapshot@^29.7.0: pretty-format "^29.7.0" semver "^7.5.3" -jest-util@^29.0.0, jest-util@^29.7.0: +jest-util@^29.7.0: version "29.7.0" resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.7.0.tgz#23c2b62bfb22be82b44de98055802ff3710fc0bc" integrity sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA== @@ -6470,9 +6563,9 @@ joi@^17.13.3: "@sideway/pinpoint" "^2.0.0" js-base64@^3.7.6: - version "3.7.7" - resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-3.7.7.tgz#e51b84bf78fbf5702b9541e2cb7bfcb893b43e79" - integrity sha512-7rCnleh0z2CkXhH67J8K1Ytz0b2Y+yxTPL+/KOJoa20hfnVQ/3/T6W/KflYI4bRHRagNeXeU2bkNGI3v1oS/lw== + version "3.7.8" + resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-3.7.8.tgz#af44496bc09fa178ed9c4adf67eb2b46f5c6d2a4" + integrity sha512-hNngCeKxIUQiEUN3GPJOkz4wF/YvdUdbNL9hsBcMQTkKzboD7T/q3OYOuuPZLUE6dBxSGpwhk5mwuDud7JVAow== js-sha3@0.8.0: version "0.8.0" @@ -6560,9 +6653,9 @@ json5@^2.2.3: integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== jsonfile@^6.0.1: - version "6.1.0" - resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-6.1.0.tgz#bc55b2634793c679ec6403094eb13698a6ec0aae" - integrity sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ== + version "6.2.0" + resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-6.2.0.tgz#7c265bd1b65de6977478300087c99f1c84383f62" + integrity sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg== dependencies: universalify "^2.0.0" optionalDependencies: @@ -6631,6 +6724,11 @@ jwt-decode@^3.1.2: resolved "https://registry.yarnpkg.com/jwt-decode/-/jwt-decode-3.1.2.tgz#3fb319f3675a2df0c2895c8f5e9fa4b67b04ed59" integrity sha512-UfpWE/VZn0iP50d8cz9NrZLM9lSWhcJ+0Gt/nm4by88UL+J1SiKN8/5dkjMmbEzwL2CAe+67GsegCbIKtbp75A== +jwt-decode@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/jwt-decode/-/jwt-decode-4.0.0.tgz#2270352425fd413785b2faf11f6e755c5151bd4b" + integrity sha512-+KJGIyHgkGuIq3IEBNftfhW/LfWhXUIY6OmyVWjliu5KH1y0fw7VQ8YndE2O4qZdMSd9SqbnC8GOcZEy0Om7sA== + keccak256@^1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/keccak256/-/keccak256-1.0.6.tgz#dd32fb771558fed51ce4e45a035ae7515573da58" @@ -6716,9 +6814,9 @@ levn@~0.3.0: type-check "~0.3.2" libphonenumber-js@^1.10.53: - version "1.12.8" - resolved "https://registry.yarnpkg.com/libphonenumber-js/-/libphonenumber-js-1.12.8.tgz#20e5b57f24e60359d795e2fa2ee185776331e34f" - integrity sha512-f1KakiQJa9tdc7w1phC2ST+DyxWimy9c3g3yeF+84QtEanJr2K77wAmBPP22riU05xldniHsvXuflnLZ4oysqA== + version "1.12.12" + resolved "https://registry.yarnpkg.com/libphonenumber-js/-/libphonenumber-js-1.12.12.tgz#4715488620178fc81b7082b074a640f95fdc5693" + integrity sha512-aWVR6xXYYRvnK0v/uIwkf5Lthq9Jpn0N8TISW/oDTWlYB2sOimuiLn9Q26aUw4KxkJoiT8ACdiw44Y8VwKFIfQ== lines-and-columns@^1.1.6: version "1.2.4" @@ -6841,9 +6939,9 @@ lru_map@^0.4.1: integrity sha512-I+lBvqMMFfqaV8CJCISjI3wbjmwVu/VyOoU7+qtu9d7ioW5klMgsTTiUOUp+DJvfTTzKXoPbyC6YfgkNcyPSOg== luxon@^3.5.0: - version "3.6.1" - resolved "https://registry.yarnpkg.com/luxon/-/luxon-3.6.1.tgz#d283ffc4c0076cb0db7885ec6da1c49ba97e47b0" - integrity sha512-tJLxrKJhO2ukZ5z0gyjY1zPh3Rh88Ej9P7jNrZiHMUXHae1yvI2imgOZtL1TO8TW6biMMKfTtAOoEJANgtWBMQ== + version "3.7.1" + resolved "https://registry.yarnpkg.com/luxon/-/luxon-3.7.1.tgz#9bd09aa84a56afb00c57ea78a8ec5bd16eb24ec0" + integrity sha512-RkRWjA926cTvz5rAb1BqyWkKbbjzCGchDUIKMCUvNi17j6f6j8uHGDV82Aqcqtzd+icoYpELmG3ksgGiFNNcNg== make-dir@^3.1.0: version "3.1.0" @@ -6992,13 +7090,6 @@ minimatch@^3.0.4, minimatch@^3.1.1, minimatch@^3.1.2: dependencies: brace-expansion "^1.1.7" -minimatch@^5.0.1: - version "5.1.6" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-5.1.6.tgz#1cfcb8cf5522ea69952cd2af95ae09477f122a96" - integrity sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g== - dependencies: - brace-expansion "^2.0.1" - minimatch@^9.0.1, minimatch@^9.0.4: version "9.0.5" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.5.tgz#d74f9dd6b57d83d8e98cfb82133b03978bc929e5" @@ -7083,10 +7174,10 @@ nanoid@^3.3.7: resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.11.tgz#4f4f112cefbe303202f2199838128936266d185b" integrity sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w== -napi-postinstall@^0.2.2: - version "0.2.4" - resolved "https://registry.yarnpkg.com/napi-postinstall/-/napi-postinstall-0.2.4.tgz#419697d0288cb524623e422f919624f22a5e4028" - integrity sha512-ZEzHJwBhZ8qQSbknHqYcdtQVr8zUgGyM/q6h6qAyhtyVMNrSgDhrC4disf03dYW0e+czXyLnZINnCTEkWy0eJg== +napi-postinstall@^0.3.0: + version "0.3.3" + resolved "https://registry.yarnpkg.com/napi-postinstall/-/napi-postinstall-0.3.3.tgz#93d045c6b576803ead126711d3093995198c6eb9" + integrity sha512-uTp172LLXSxuSYHv/kou+f6KW3SMppU9ivthaVTXian9sOt3XM/zHYHpRZiLgQoxeWfYUnslNWQHF1+G71xcow== natural-compare@^1.4.0: version "1.4.0" @@ -7266,7 +7357,7 @@ object.groupby@^1.0.3: define-properties "^1.2.1" es-abstract "^1.23.2" -object.values@^1.2.0: +object.values@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.2.1.tgz#deed520a50809ff7f75a7cfd4bc64c7a038c6216" integrity sha512-gXah6aZrcUxjWg2zR2MwouP2eHlCBzdV4pygudehaKXSGW4v2AsRQUK+lwwXhii6KFZcunEnmSUoYp5CXibxtA== @@ -7488,9 +7579,9 @@ picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.3, picomatch@^2.3.1: integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== picomatch@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-4.0.2.tgz#77c742931e8f3b8820946c76cd0c1f13730d1dab" - integrity sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg== + version "4.0.3" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-4.0.3.tgz#796c76136d1eead715db1e7bad785dedd695a042" + integrity sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q== pirates@^4.0.4: version "4.0.7" @@ -7527,9 +7618,9 @@ prettier-linter-helpers@^1.0.0: fast-diff "^1.1.2" prettier@^3.5.3: - version "3.5.3" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.5.3.tgz#4fc2ce0d657e7a02e602549f053b239cb7dfe1b5" - integrity sha512-QQtaxnoDJeAkDvDKWCLiwIXkTgRhwYDEQCghU9Z6q03iyek/rxRh/2lC3HB7P8sWT2xC/y5JDctPLBIGzHKbhw== + version "3.6.2" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.6.2.tgz#ccda02a1003ebbb2bfda6f83a074978f608b9393" + integrity sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ== pretty-format@^29.0.0, pretty-format@^29.7.0: version "29.7.0" @@ -7549,9 +7640,9 @@ prompts@^2.0.1: sisteransi "^1.0.5" protobufjs@^7.2.5, protobufjs@^7.3.0: - version "7.5.3" - resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-7.5.3.tgz#13f95a9e3c84669995ec3652db2ac2fb00b89363" - integrity sha512-sildjKwVqOI2kmFDiXQ6aEB0fjYTafpEvIBs8tOR8qI4spuL9OPROLVu2qZqi/xgCfsHIwVqlaF8JBjWFHnKbw== + version "7.5.4" + resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-7.5.4.tgz#885d31fe9c4b37f25d1bb600da30b1c5b37d286a" + integrity sha512-CvexbZtbov6jW2eXAvLukXjXUW1TzFaivC46BpWc/3BpcCysb5Vffu+B3XHMm8lVEuy2Mm4XGex8hBSg1yapPg== dependencies: "@protobufjs/aspromise" "^1.1.2" "@protobufjs/base64" "^1.1.2" @@ -7580,9 +7671,9 @@ proxy-from-env@^1.1.0: integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg== pump@^3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.2.tgz#836f3edd6bc2ee599256c924ffe0d88573ddcbf8" - integrity sha512-tUPXtzlGM8FE3P0ZL6DVs/3P58k9nk8/jZeQCurTJylQA8qFYzHFfhBJkuqyE0FifOsQ0uKWekiZ5g8wtr28cw== + version "3.0.3" + resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.3.tgz#151d979f1a29668dc0025ec589a455b53282268d" + integrity sha512-todwxLMY7/heScKmntwQG8CXVkWUOdYxIvY2s0VWAAMh/nd8SoYiRaKjlr7+iCs984f2P8zvrfWcDDYVb73NfA== dependencies: end-of-stream "^1.1.0" once "^1.3.1" @@ -7616,7 +7707,7 @@ qs@6.13.0: dependencies: side-channel "^1.0.6" -qs@^6.11.0, qs@^6.14.0: +qs@^6.11.2, qs@^6.14.0: version "6.14.0" resolved "https://registry.yarnpkg.com/qs/-/qs-6.14.0.tgz#c63fa40680d2c5c941412a0e899c89af60c0a930" integrity sha512-YWWTjgABSKcvs/nWBi9PycY/JiPJqOD4JA6o9Sej2AtvSGarXxKC3OQSk4pAarbdQlKAh5D4FCQkJNkW+GAn3w== @@ -7865,7 +7956,7 @@ run-parallel@^1.1.9: dependencies: queue-microtask "^1.2.2" -rxjs@^7.8.0: +rxjs@^7.8.0, rxjs@^7.8.2: version "7.8.2" resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.8.2.tgz#955bc473ed8af11a002a2be52071bf475638607b" integrity sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA== @@ -8151,10 +8242,10 @@ sprintf-js@~1.0.2: resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" integrity sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g== -stable-hash@^0.0.5: - version "0.0.5" - resolved "https://registry.yarnpkg.com/stable-hash/-/stable-hash-0.0.5.tgz#94e8837aaeac5b4d0f631d2972adef2924b40269" - integrity sha512-+L3ccpzibovGXFK+Ap/f8LOS0ahMrHTf3xu7mMLSpEGU0EO9ucaysSylKo9eRDFNhWve/y275iPmIZ4z39a9iA== +stable-hash-x@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/stable-hash-x/-/stable-hash-x-0.2.0.tgz#dfd76bfa5d839a7470125c6a6b3c8b22061793e9" + integrity sha512-o3yWv49B/o4QZk5ZcsALc6t0+eCelPc44zZsLtCQnZPDwFpDYSWcDnrv2TtMmMbQ7uKo3J0HTURCqckw23czNQ== stack-utils@^2.0.3: version "2.0.6" @@ -8170,11 +8261,16 @@ static-eval@2.0.2: dependencies: escodegen "^1.8.1" -statuses@2.0.1, statuses@^2.0.1: +statuses@2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/statuses/-/statuses-2.0.1.tgz#55cb000ccf1d48728bd23c685a063998cf1a1b63" integrity sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ== +statuses@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/statuses/-/statuses-2.0.2.tgz#8f75eecef765b5e1cfcdc080da59409ed424e382" + integrity sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw== + stop-iteration-iterator@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/stop-iteration-iterator/-/stop-iteration-iterator-1.1.0.tgz#f481ff70a548f6124d0312c3aa14cbfa7aa542ad" @@ -8241,7 +8337,7 @@ string.prototype.trim@^1.2.10: es-object-atoms "^1.0.0" has-property-descriptors "^1.0.2" -string.prototype.trimend@^1.0.8, string.prototype.trimend@^1.0.9: +string.prototype.trimend@^1.0.9: version "1.0.9" resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.9.tgz#62e2731272cd285041b36596054e9f66569b6942" integrity sha512-G7Ok5C6E/j4SGfyLCloXTrngQIQU3PWtXGst3yM7Bea9FRURf1S42ZHlZZtsNque2FN2PoUhfZXYLNWwEr4dLQ== @@ -8313,28 +8409,28 @@ strip-json-comments@^3.1.1: resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== -superagent@^10.2.1: - version "10.2.1" - resolved "https://registry.yarnpkg.com/superagent/-/superagent-10.2.1.tgz#3e39038fff125cbd1584fa4b384db2994bbffdcb" - integrity sha512-O+PCv11lgTNJUzy49teNAWLjBZfc+A1enOwTpLlH6/rsvKcTwcdTT8m9azGkVqM7HBl5jpyZ7KTPhHweokBcdg== +superagent@^10.2.3: + version "10.2.3" + resolved "https://registry.yarnpkg.com/superagent/-/superagent-10.2.3.tgz#d1e4986f2caac423c37e38077f9073ccfe73a59b" + integrity sha512-y/hkYGeXAj7wUMjxRbB21g/l6aAEituGXM9Rwl4o20+SX3e8YOSV6BxFXl+dL3Uk0mjSL3kCbNkwURm8/gEDig== dependencies: - component-emitter "^1.3.0" + component-emitter "^1.3.1" cookiejar "^2.1.4" - debug "^4.3.4" + debug "^4.3.7" fast-safe-stringify "^2.1.1" - form-data "^4.0.0" + form-data "^4.0.4" formidable "^3.5.4" methods "^1.1.2" mime "2.6.0" - qs "^6.11.0" + qs "^6.11.2" supertest@^7.1.1: - version "7.1.1" - resolved "https://registry.yarnpkg.com/supertest/-/supertest-7.1.1.tgz#c5e7e2d047fbbe4403b17b2622dc5323adc39f11" - integrity sha512-aI59HBTlG9e2wTjxGJV+DygfNLgnWbGdZxiA/sgrnNNikIW8lbDvCtF6RnhZoJ82nU7qv7ZLjrvWqCEm52fAmw== + version "7.1.4" + resolved "https://registry.yarnpkg.com/supertest/-/supertest-7.1.4.tgz#3175e2539f517ca72fdc7992ffff35b94aca7d34" + integrity sha512-tjLPs7dVyqgItVFirHYqe2T+MfWc2VOBQ8QFKKbWTA3PU7liZR8zoSpAi/C1k1ilm9RsXIKYf197oap9wXGVYg== dependencies: methods "^1.1.2" - superagent "^10.2.1" + superagent "^10.2.3" supports-color@^7.1.0: version "7.2.0" @@ -8356,9 +8452,9 @@ supports-preserve-symlinks-flag@^1.0.0: integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== swagger-ui-dist@>=4.11.0: - version "5.22.0" - resolved "https://registry.yarnpkg.com/swagger-ui-dist/-/swagger-ui-dist-5.22.0.tgz#8280cfa9659d90cf6f682c76f7e792b0da939946" - integrity sha512-8YlCSxiyb8uPFa7qoB1lRHYr1PBbT1NuV9RvQdFFPFPudRBTPf9coU5jl02KhzvrtmTEw4jXRgb0kg8pJvVuWQ== + version "5.27.1" + resolved "https://registry.yarnpkg.com/swagger-ui-dist/-/swagger-ui-dist-5.27.1.tgz#556e77c659752e99621ac61ad5ef6cb0832279e7" + integrity sha512-oGtpYO3lnoaqyGtlJalvryl7TwzgRuxpOVWqEHx8af0YXI+Kt+4jMpLdgMtMcmWmuQ0QTCHLKExwrBFMSxvAUA== dependencies: "@scarf/scarf" "=1.4.0" @@ -8369,12 +8465,12 @@ swagger-ui-express@^4.4.0: dependencies: swagger-ui-dist ">=4.11.0" -synckit@^0.11.0: - version "0.11.6" - resolved "https://registry.yarnpkg.com/synckit/-/synckit-0.11.6.tgz#e742a0c27bbc1fbc96f2010770521015cca7ed5c" - integrity sha512-2pR2ubZSV64f/vqm9eLPz/KOvR9Dm+Co/5ChLgeHl0yEDRc6h5hXHoxEQH8Y5Ljycozd3p1k5TTSVdzYGkPvLw== +synckit@^0.11.7: + version "0.11.11" + resolved "https://registry.yarnpkg.com/synckit/-/synckit-0.11.11.tgz#c0b619cf258a97faa209155d9cd1699b5c998cb0" + integrity sha512-MeQTA1r0litLUf0Rp/iisCaL8761lKAZHaimlbGK4j0HysC4PLfqygQj9srcs0m2RdtDYnF8UuYyKpbjHYp7Jw== dependencies: - "@pkgr/core" "^0.2.4" + "@pkgr/core" "^0.2.9" table@^6.8.0: version "6.9.0" @@ -8473,14 +8569,13 @@ ts-deepmerge@^7.0.2: integrity sha512-Du/ZW2RfwV/D4cmA5rXafYjBQVuvu4qGiEEla4EmEHVHgRdx68Gftx7i66jn2bzHPwSVZY36Ae6OuDn9el4ZKA== ts-jest@^29.3.4: - version "29.3.4" - resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-29.3.4.tgz#9354472aceae1d3867a80e8e02014ea5901aee41" - integrity sha512-Iqbrm8IXOmV+ggWHOTEbjwyCf2xZlUMv5npExksXohL+tk8va4Fjhb+X2+Rt9NBmgO7bJ8WpnMLOwih/DnMlFA== + version "29.4.1" + resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-29.4.1.tgz#42d33beb74657751d315efb9a871fe99e3b9b519" + integrity sha512-SaeUtjfpg9Uqu8IbeDKtdaS0g8lS6FT6OzM3ezrDfErPJPHNDo/Ey+VFGP1bQIDfagYDLyRpd7O15XpG1Es2Uw== dependencies: bs-logger "^0.2.6" - ejs "^3.1.10" fast-json-stable-stringify "^2.1.0" - jest-util "^29.0.0" + handlebars "^4.7.8" json5 "^2.2.3" lodash.memoize "^4.1.2" make-error "^1.3.6" @@ -8573,7 +8668,7 @@ tsoa@^6.0.1: "@tsoa/cli" "^6.6.0" "@tsoa/runtime" "^6.6.0" -tsyringe@^4.6.0, tsyringe@^4.8.0: +tsyringe@^4.10.0, tsyringe@^4.6.0, tsyringe@^4.8.0: version "4.10.0" resolved "https://registry.yarnpkg.com/tsyringe/-/tsyringe-4.10.0.tgz#d0c95815d584464214060285eaaadd94aa03299c" integrity sha512-axr3IdNuVIxnaK5XGEUFTu3YmAQ6lllgrvqfEoR16g/HGnYY/6We4oWENtAnzK6/LpJ2ur9PAb80RBt7/U4ugw== @@ -8682,16 +8777,16 @@ typed-array-length@^1.0.7: reflect.getprototypeof "^1.0.6" typescript@^5.7.2, typescript@^5.8.3: - version "5.8.3" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.8.3.tgz#92f8a3e5e3cf497356f4178c34cd65a7f5e8440e" - integrity sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ== + version "5.9.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.9.2.tgz#d93450cddec5154a2d5cabe3b8102b83316fb2a6" + integrity sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A== uglify-js@^3.1.4: version "3.19.3" resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.19.3.tgz#82315e9bbc6f2b25888858acd1fff8441035b77f" integrity sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ== -uint8arrays@^3.1.1: +uint8arrays@3.1.1, uint8arrays@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/uint8arrays/-/uint8arrays-3.1.1.tgz#2d8762acce159ccd9936057572dade9459f65ae0" integrity sha512-+QJa8QRnbdXVpHYjLoTpJIdCTiw9Ir62nocClWuXIq2JIh4Uta0cQsTSpFL678p2CN8B+XSApwcU+pQEqVpKWg== @@ -8718,10 +8813,10 @@ undici-types@~6.21.0: resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.21.0.tgz#691d00af3909be93a7faa13be61b3a5b50ef12cb" integrity sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ== -undici-types@~7.8.0: - version "7.8.0" - resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-7.8.0.tgz#de00b85b710c54122e44fbfd911f8d70174cd294" - integrity sha512-9UJ2xGDvQ43tYyVMpuHlsgApydB8ZKfVYTsLDhXkFL/6gfkp+U8xTGdh8pMJv1SpZna0zxG1DwsKZsreLbXBxw== +undici-types@~7.10.0: + version "7.10.0" + resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-7.10.0.tgz#4ac2e058ce56b462b056e629cc6a02393d3ff350" + integrity sha512-t5Fy/nfn+14LuOc2KNYg75vZqClpAiqscVvMygNnlsHBFpSXdJaYtXMcdNLpl/Qvc3P2cB3s6lOV51nqsFq4ag== undici@^5.14.0, undici@^5.21.2: version "5.29.0" @@ -8740,30 +8835,32 @@ unpipe@1.0.0, unpipe@~1.0.0: resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" integrity sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ== -unrs-resolver@^1.7.2: - version "1.7.8" - resolved "https://registry.yarnpkg.com/unrs-resolver/-/unrs-resolver-1.7.8.tgz#f76ca5592d7225f8fd12cd5f39fad9e86f0945c9" - integrity sha512-2zsXwyOXmCX9nGz4vhtZRYhe30V78heAv+KDc21A/KMdovGHbZcixeD5JHEF0DrFXzdytwuzYclcPbvp8A3Jlw== +unrs-resolver@^1.7.11: + version "1.11.1" + resolved "https://registry.yarnpkg.com/unrs-resolver/-/unrs-resolver-1.11.1.tgz#be9cd8686c99ef53ecb96df2a473c64d304048a9" + integrity sha512-bSjt9pjaEBnNiGgc9rUiHGKv5l4/TGzDmYw3RhnkJGtLhbnnA/5qJj7x3dNDCRx/PJxu774LlH8lCOlB4hEfKg== dependencies: - napi-postinstall "^0.2.2" + napi-postinstall "^0.3.0" optionalDependencies: - "@unrs/resolver-binding-darwin-arm64" "1.7.8" - "@unrs/resolver-binding-darwin-x64" "1.7.8" - "@unrs/resolver-binding-freebsd-x64" "1.7.8" - "@unrs/resolver-binding-linux-arm-gnueabihf" "1.7.8" - "@unrs/resolver-binding-linux-arm-musleabihf" "1.7.8" - "@unrs/resolver-binding-linux-arm64-gnu" "1.7.8" - "@unrs/resolver-binding-linux-arm64-musl" "1.7.8" - "@unrs/resolver-binding-linux-ppc64-gnu" "1.7.8" - "@unrs/resolver-binding-linux-riscv64-gnu" "1.7.8" - "@unrs/resolver-binding-linux-riscv64-musl" "1.7.8" - "@unrs/resolver-binding-linux-s390x-gnu" "1.7.8" - "@unrs/resolver-binding-linux-x64-gnu" "1.7.8" - "@unrs/resolver-binding-linux-x64-musl" "1.7.8" - "@unrs/resolver-binding-wasm32-wasi" "1.7.8" - "@unrs/resolver-binding-win32-arm64-msvc" "1.7.8" - "@unrs/resolver-binding-win32-ia32-msvc" "1.7.8" - "@unrs/resolver-binding-win32-x64-msvc" "1.7.8" + "@unrs/resolver-binding-android-arm-eabi" "1.11.1" + "@unrs/resolver-binding-android-arm64" "1.11.1" + "@unrs/resolver-binding-darwin-arm64" "1.11.1" + "@unrs/resolver-binding-darwin-x64" "1.11.1" + "@unrs/resolver-binding-freebsd-x64" "1.11.1" + "@unrs/resolver-binding-linux-arm-gnueabihf" "1.11.1" + "@unrs/resolver-binding-linux-arm-musleabihf" "1.11.1" + "@unrs/resolver-binding-linux-arm64-gnu" "1.11.1" + "@unrs/resolver-binding-linux-arm64-musl" "1.11.1" + "@unrs/resolver-binding-linux-ppc64-gnu" "1.11.1" + "@unrs/resolver-binding-linux-riscv64-gnu" "1.11.1" + "@unrs/resolver-binding-linux-riscv64-musl" "1.11.1" + "@unrs/resolver-binding-linux-s390x-gnu" "1.11.1" + "@unrs/resolver-binding-linux-x64-gnu" "1.11.1" + "@unrs/resolver-binding-linux-x64-musl" "1.11.1" + "@unrs/resolver-binding-wasm32-wasi" "1.11.1" + "@unrs/resolver-binding-win32-arm64-msvc" "1.11.1" + "@unrs/resolver-binding-win32-ia32-msvc" "1.11.1" + "@unrs/resolver-binding-win32-x64-msvc" "1.11.1" update-browserslist-db@^1.1.3: version "1.1.3" @@ -8814,6 +8911,11 @@ v8-to-istanbul@^9.0.1: "@types/istanbul-lib-coverage" "^2.0.1" convert-source-map "^2.0.0" +valibot@1.0.0-beta.8: + version "1.0.0-beta.8" + resolved "https://registry.yarnpkg.com/valibot/-/valibot-1.0.0-beta.8.tgz#670bbdef4affd58bb71a5e5bd2fe4d1ea535770f" + integrity sha512-OPAwJZtowb0j91b+bd77+ny7D1VVzsCzD7Jl9waLUlMprTsfI9Y3HHbW3hAQD7wKDKHsmGEesuiYWaYvcZL2wg== + validator@^13.12.0, validator@^13.9.0: version "13.15.15" resolved "https://registry.yarnpkg.com/validator/-/validator-13.15.15.tgz#246594be5671dc09daa35caec5689fcd18c6e7e4" @@ -9005,10 +9107,10 @@ ws@8.18.0: resolved "https://registry.yarnpkg.com/ws/-/ws-8.18.0.tgz#0d7505a6eafe2b0e712d232b42279f53bc289bbc" integrity sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw== -ws@^8.13.0, ws@^8.18.2: - version "8.18.2" - resolved "https://registry.yarnpkg.com/ws/-/ws-8.18.2.tgz#42738b2be57ced85f46154320aabb51ab003705a" - integrity sha512-DMricUmwGZUVr++AEAe2uiVM7UoO9MAVZMDu05UQOaUII0lp+zOzLLU4Xqh/JvTqklB1T4uELaaPBKyjE1r4fQ== +ws@^8.18.2: + version "8.18.3" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.18.3.tgz#b56b88abffde62791c639170400c93dcb0c95472" + integrity sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg== xtend@^4.0.0: version "4.0.2" @@ -9041,9 +9143,9 @@ yaml@^1.10.0: integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg== yaml@^2.2.2, yaml@^2.6.1: - version "2.8.0" - resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.8.0.tgz#15f8c9866211bdc2d3781a0890e44d4fa1a5fff6" - integrity sha512-4lLa/EcQCB0cJkyts+FpIRx5G/llPxfP6VQU5KByHEhLxY3IJCH0f0Hy1MHI8sClTvsIb8qwRJ6R/ZdlDJ/leQ== + version "2.8.1" + resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.8.1.tgz#1870aa02b631f7e8328b93f8bc574fac5d6c4d79" + integrity sha512-lcYcMxX2PO9XMGvAJkJ3OsNMw+/7FKes7/hgerGUYWIoWu5j/+YQqcZr5JnPZWzOsEBgMbSbiSTn/dv/69Mkpw== yargs-parser@^21.1.1: version "21.1.1" @@ -9080,3 +9182,8 @@ yocto-queue@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== + +zod@^3.23.8, zod@^3.24.1: + version "3.25.76" + resolved "https://registry.yarnpkg.com/zod/-/zod-3.25.76.tgz#26841c3f6fd22a6a2760e7ccb719179768471e34" + integrity sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ== From d4fbe30fb83a2f6323bd368994a1f9c2df7a9120 Mon Sep 17 00:00:00 2001 From: Tipu_Singh Date: Mon, 25 Aug 2025 10:39:41 +0530 Subject: [PATCH 002/152] feat: added updated patch file Signed-off-by: Tipu_Singh --- ...24513+002+fix: change version string type.patch | 13 +++++++++++++ ...dded-prettyVc-in-JsonCredential-interface.patch | 12 ++++++++++++ ...tionPresentation to avoid abandoned issue.patch | 14 ++++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 patches/@credo-ts+core+0.6.0-alpha-20250325224513+002+fix: change version string type.patch create mode 100644 patches/@credo-ts+didcomm+0.6.0-alpha-20250325224513+002+fix: added-prettyVc-in-JsonCredential-interface.patch create mode 100644 patches/@credo-ts+didcomm+0.6.0-alpha-20250325224513+003+fix: commenting validationPresentation to avoid abandoned issue.patch diff --git a/patches/@credo-ts+core+0.6.0-alpha-20250325224513+002+fix: change version string type.patch b/patches/@credo-ts+core+0.6.0-alpha-20250325224513+002+fix: change version string type.patch new file mode 100644 index 00000000..02a2d309 --- /dev/null +++ b/patches/@credo-ts+core+0.6.0-alpha-20250325224513+002+fix: change version string type.patch @@ -0,0 +1,13 @@ +diff --git a/node_modules/@credo-ts/core/build/utils/version.d.ts b/node_modules/@credo-ts/core/build/utils/version.d.ts +index 0ad7e14..e0588dc 100644 +--- a/node_modules/@credo-ts/core/build/utils/version.d.ts ++++ b/node_modules/@credo-ts/core/build/utils/version.d.ts +@@ -1,7 +1,7 @@ + export declare function parseVersionString(version: VersionString): Version; + export declare function isFirstVersionHigherThanSecond(first: Version, second: Version): boolean; + export declare function isFirstVersionEqualToSecond(first: Version, second: Version): boolean; +-export type VersionString = `${number}.${number}` | `${number}.${number}.${number}`; ++export type VersionString = string; + export type MajorVersion = number; + export type MinorVersion = number; + export type PatchVersion = number; diff --git a/patches/@credo-ts+didcomm+0.6.0-alpha-20250325224513+002+fix: added-prettyVc-in-JsonCredential-interface.patch b/patches/@credo-ts+didcomm+0.6.0-alpha-20250325224513+002+fix: added-prettyVc-in-JsonCredential-interface.patch new file mode 100644 index 00000000..60057d13 --- /dev/null +++ b/patches/@credo-ts+didcomm+0.6.0-alpha-20250325224513+002+fix: added-prettyVc-in-JsonCredential-interface.patch @@ -0,0 +1,12 @@ +diff --git a/node_modules/@credo-ts/didcomm/build/modules/credentials/formats/jsonld/JsonLdCredentialFormat.d.ts b/node_modules/@credo-ts/didcomm/build/modules/credentials/formats/jsonld/JsonLdCredentialFormat.d.ts +index c0a6140..c3d2c8b 100644 +--- a/node_modules/@credo-ts/didcomm/build/modules/credentials/formats/jsonld/JsonLdCredentialFormat.d.ts ++++ b/node_modules/@credo-ts/didcomm/build/modules/credentials/formats/jsonld/JsonLdCredentialFormat.d.ts +@@ -8,6 +8,7 @@ export interface JsonCredential { + issuanceDate: string; + expirationDate?: string; + credentialSubject: SingleOrArray; ++ prettyVc?: any; + [key: string]: unknown; + } + /** diff --git a/patches/@credo-ts+didcomm+0.6.0-alpha-20250325224513+003+fix: commenting validationPresentation to avoid abandoned issue.patch b/patches/@credo-ts+didcomm+0.6.0-alpha-20250325224513+003+fix: commenting validationPresentation to avoid abandoned issue.patch new file mode 100644 index 00000000..74e5d1ed --- /dev/null +++ b/patches/@credo-ts+didcomm+0.6.0-alpha-20250325224513+003+fix: commenting validationPresentation to avoid abandoned issue.patch @@ -0,0 +1,14 @@ +diff --git a/node_modules/@credo-ts/didcomm/build/modules/proofs/formats/dif-presentation-exchange/DifPresentationExchangeProofFormatService.js b/node_modules/@credo-ts/didcomm/build/modules/proofs/formats/dif-presentation-exchange/DifPresentationExchangeProofFormatService.js +index 202adff..1124458 100644 +--- a/node_modules/@credo-ts/didcomm/build/modules/proofs/formats/dif-presentation-exchange/DifPresentationExchangeProofFormatService.js ++++ b/node_modules/@credo-ts/didcomm/build/modules/proofs/formats/dif-presentation-exchange/DifPresentationExchangeProofFormatService.js +@@ -168,7 +168,8 @@ class DifPresentationExchangeProofFormatService { + try { + ps.validatePresentationDefinition(request.presentation_definition); + ps.validatePresentationSubmission(jsonPresentation.presentation_submission); +- ps.validatePresentation(request.presentation_definition, parsedPresentation); ++ // FIXME: Commenting validatePresentation() for now due to intermittent abandoned issue ++ // ps.validatePresentation(request.presentation_definition, parsedPresentation); + let verificationResult; + // FIXME: for some reason it won't accept the input if it doesn't know + // whether it's a JWT or JSON-LD VP even though the input is the same. From 8c90fbe61669f4690d52c9cf1feb9091eea09544 Mon Sep 17 00:00:00 2001 From: Tipu_Singh Date: Mon, 25 Aug 2025 17:16:40 +0530 Subject: [PATCH 003/152] feat: added logic for events Signed-off-by: Tipu_Singh Signed-off-by: RinkalBhojani --- .../issuance-sessions.Controller.ts | 1 - .../verification-sessions.Controller.ts | 20 +- .../verification-sessions.service.ts | 9 +- .../verifiers/verifier.Controller.ts | 29 +-- .../openid4vc/verifiers/verifier.service.ts | 27 +-- src/events/openId4VcIssuanceSessionEvents.ts | 31 +++ .../openId4VcVerificationSessionEvents.ts | 29 +++ src/routes/routes.ts | 15 ++ src/routes/swagger.json | 66 +++++- src/utils/oid4vc-agent.ts | 215 ++++++++++++++---- 10 files changed, 350 insertions(+), 92 deletions(-) create mode 100644 src/events/openId4VcIssuanceSessionEvents.ts create mode 100644 src/events/openId4VcVerificationSessionEvents.ts diff --git a/src/controllers/openid4vc/issuance-sessions/issuance-sessions.Controller.ts b/src/controllers/openid4vc/issuance-sessions/issuance-sessions.Controller.ts index 567ece1a..dc6be380 100644 --- a/src/controllers/openid4vc/issuance-sessions/issuance-sessions.Controller.ts +++ b/src/controllers/openid4vc/issuance-sessions/issuance-sessions.Controller.ts @@ -30,7 +30,6 @@ export class IssuanceSessionsController extends Controller { @Body() options: OpenId4VcIssuanceSessionsCreateOffer, ) { try { - // const agent = 'rootAgent' in request ? request.rootAgent : request.tenantAgent return await issuanceSessionService.createCredentialOffer(options, request) } catch (error) { throw ErrorHandlingService.handle(error) diff --git a/src/controllers/openid4vc/verifier-sessions/verification-sessions.Controller.ts b/src/controllers/openid4vc/verifier-sessions/verification-sessions.Controller.ts index 39e23518..7c9c1257 100644 --- a/src/controllers/openid4vc/verifier-sessions/verification-sessions.Controller.ts +++ b/src/controllers/openid4vc/verifier-sessions/verification-sessions.Controller.ts @@ -1,23 +1,18 @@ import { Agent } from '@credo-ts/core' import { OpenId4VcVerificationSessionState } from '@credo-ts/openid4vc' -import { Body, Controller, Get, Path, Post, Query, Route, Tags } from 'tsoa' +import { Controller, Get, Path, Query, Route, Request, Security, Tags } from 'tsoa' import { injectable } from 'tsyringe' - import ErrorHandlingService from '../../../errorHandlingService' -// import { CreateAuthorizationRequest } from '../types/verifier.types' import { verificationSessionService } from './verification-sessions.service' +import { SCOPES } from '../../../enums' +import { Request as Req } from 'express' @Tags('oid4vc verification sessions') @Route('/openid4vc/verification-sessions') +@Security('jwt', [SCOPES.TENANT_AGENT, SCOPES.DEDICATED_AGENT]) @injectable() export class VerificationSessionsController extends Controller { - private agent: Agent - - public constructor(agent: Agent) { - super() - this.agent = agent - } /** * Create an authorization request, acting as a Relying Party (RP) @@ -36,6 +31,7 @@ export class VerificationSessionsController extends Controller { */ @Get('/') public async getAllVerificationSessions( + @Request() request: Req, @Query('publicVerifierId') publicVerifierId?: string, @Query('payloadState') payloadState?: string, @Query('state') state?: OpenId4VcVerificationSessionState, @@ -44,7 +40,7 @@ export class VerificationSessionsController extends Controller { ) { try { return await verificationSessionService.findVerificationSessionsByQuery( - this.agent, + request, publicVerifierId, payloadState, state, @@ -60,9 +56,9 @@ export class VerificationSessionsController extends Controller { * Get verification session by ID */ @Get('/:verificationSessionId') - public async getVerificationSessionsById(@Path('verificationSessionId') verificationSessionId: string) { + public async getVerificationSessionsById(@Request() request: Req, @Path('verificationSessionId') verificationSessionId: string) { try { - return await verificationSessionService.getVerificationSessionsById(this.agent, verificationSessionId) + return await verificationSessionService.getVerificationSessionsById(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 bce34b82..e890e7c9 100644 --- a/src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts +++ b/src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts @@ -10,6 +10,7 @@ import { } from '@credo-ts/core' import { OpenId4VcVerificationSessionState } from '@credo-ts/openid4vc' import { injectable } from 'tsyringe' +import { Request as Req } from 'express' // import { CreateAuthorizationRequest } from '../types/verifier.types' @@ -40,14 +41,14 @@ class VerificationSessionsService { // } public async findVerificationSessionsByQuery( - verifierAgent: Agent | Agent, + agentReq: Req, publicVerifierId?: string, payloadState?: string, state?: OpenId4VcVerificationSessionState, authorizationRequestUri?: string, nonce?: string, ) { - return await verifierAgent.modules.openId4VcVerifier.findVerificationSessionsByQuery({ + return await agentReq.agent.modules.openId4VcVerifier.findVerificationSessionsByQuery({ verifierId: publicVerifierId, payloadState, state, @@ -57,10 +58,10 @@ class VerificationSessionsService { } public async getVerificationSessionsById( - verifierAgent: Agent | Agent, + agentReq: Req, verificationSessionId: string, ) { - return await verifierAgent.modules.openId4VcVerifier.getVerificationSessionById(verificationSessionId) + return await agentReq.agent.modules.openId4VcVerifier.getVerificationSessionById(verificationSessionId) } public async getVerifiedAuthorizationResponse( diff --git a/src/controllers/openid4vc/verifiers/verifier.Controller.ts b/src/controllers/openid4vc/verifiers/verifier.Controller.ts index 43f53897..af8e7dbc 100644 --- a/src/controllers/openid4vc/verifiers/verifier.Controller.ts +++ b/src/controllers/openid4vc/verifiers/verifier.Controller.ts @@ -1,17 +1,17 @@ -import { Agent } from '@credo-ts/core' -import { Body, Delete, Get, Path, Post, Put, Query, Route, Tags } from 'tsoa' +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' @Tags('oid4vc verifiers') +@Security('jwt', [SCOPES.TENANT_AGENT, SCOPES.DEDICATED_AGENT]) @Route('openid4vc/verifier') export class VerifierController { - private agent: Agent private verifierService: VerifierService - public constructor(agent: Agent) { - this.agent = agent + public constructor() { this.verifierService = new VerifierService() } @@ -19,8 +19,8 @@ export class VerifierController { * Create a new verifier and store the verifier record */ @Post('/') - public async createVerifier(@Body() options: any) { - return await this.verifierService.createVerifier(this.agent, options) + public async createVerifier(@Request() request: Req, @Body() options: any) { + return await this.verifierService.createVerifier(request, options) } /** @@ -28,10 +28,11 @@ export class VerifierController { */ @Put('{publicVerifierId}') public async updateVerifierMetadata( + @Request() request: Req, @Path('publicVerifierId') publicVerifierId: string, @Body() verifierRecordOptions: any, ) { - return await this.verifierService.updateVerifierMetadata(this.agent, { + return await this.verifierService.updateVerifierMetadata(request, { verifierId: publicVerifierId, clientMetadata: verifierRecordOptions.clientMetadata, }) @@ -41,23 +42,23 @@ export class VerifierController { * Get verifiers by query */ @Get('/') - public async getVerifiersByQuery(@Query() publicVerifierId?: string) { - return await this.verifierService.getVerifiersByQuery(this.agent, publicVerifierId) + 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(@Path('publicVerifierId') publicVerifierId: string) { - return await this.verifierService.getVerifier(this.agent, 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(@Path('verifierId') verifierId: string): Promise { - await this.verifierService.deleteVerifier(this.agent, 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 56b5aaa0..3a4d696c 100644 --- a/src/controllers/openid4vc/verifiers/verifier.service.ts +++ b/src/controllers/openid4vc/verifiers/verifier.service.ts @@ -4,33 +4,34 @@ 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( - agent: Agent | Agent, + agentReq: Req, options: OpenId4VcSiopCreateVerifierOptions, ) { - const verifierRecord = await agent.modules.openId4VcVerifier.createVerifier(options) + const verifierRecord = await agentReq.agent.modules.openId4VcVerifier.createVerifier(options) return verifierRecord } public async updateVerifierMetadata( - agent: Agent | Agent, + agentReq: Req, options: OpenId4VcUpdateVerifierRecordOptions, ) { // console.log(`Updating verifier ${options.verifierId}`) - await agent.modules.openId4VcVerifier.updateVerifierMetadata(options) - const verifierRecord = await this.getVerifier(agent, options.verifierId) + await agentReq.agent.modules.openId4VcVerifier.updateVerifierMetadata(options) + const verifierRecord = await this.getVerifier(agentReq, options.verifierId) return verifierRecord } public async getVerifiersByQuery( - agent: Agent | Agent, + agentReq: Req, publicVerifierId?: string, ) { - const verifierRepository = agent.dependencyManager.resolve(OpenId4VcVerifierRepository) - const verifiers = await verifierRepository.findByQuery(agent.context, { + const verifierRepository = agentReq.agent.dependencyManager.resolve(OpenId4VcVerifierRepository) + const verifiers = await verifierRepository.findByQuery(agentReq.agent.context, { verifierId: publicVerifierId, }) @@ -38,18 +39,18 @@ export class VerifierService { } public async getVerifier( - agent: Agent | Agent, + agentReq: Req, publicVerifierId: string, ) { - return await agent.modules.openId4VcVerifier.getVerifierByVerifierId(publicVerifierId) + return await agentReq.agent.modules.openId4VcVerifier.getVerifierByVerifierId(publicVerifierId) } public async deleteVerifier( - agent: Agent | Agent, + agentReq: Req, publicVerifierId: string, ) { - const verifierRepository = agent.dependencyManager.resolve(OpenId4VcVerifierRepository) - await verifierRepository.deleteById(agent.context, publicVerifierId) + const verifierRepository = agentReq.agent.dependencyManager.resolve(OpenId4VcVerifierRepository) + await verifierRepository.deleteById(agentReq.agent.context, publicVerifierId) } } diff --git a/src/events/openId4VcIssuanceSessionEvents.ts b/src/events/openId4VcIssuanceSessionEvents.ts new file mode 100644 index 00000000..5e639ffb --- /dev/null +++ b/src/events/openId4VcIssuanceSessionEvents.ts @@ -0,0 +1,31 @@ +import type { ServerConfig } from '../utils/ServerConfig' +import type { Agent } from '@credo-ts/core' + +import { CredentialEventTypes, CredentialStateChangedEvent } from '@credo-ts/didcomm' + +import { sendWebSocketEvent } from './WebSocketEvents' +import { sendWebhookEvent } from './WebhookEvent' +import { OpenId4VcIssuerEvents } from '@credo-ts/openid4vc' +import type { OpenId4VcIssuanceSessionStateChangedEvent } from '@credo-ts/openid4vc' + +export const openId4VcIssuanceSessionEvents = async (agent: Agent, config: ServerConfig) => { + agent.events.on(OpenId4VcIssuerEvents.IssuanceSessionStateChanged, async (event: OpenId4VcIssuanceSessionStateChangedEvent) => { + const record = event.payload.issuanceSession + + const body = { ...record.toJSON(), ...event.metadata } + + if (config.webhookUrl) { + await sendWebhookEvent(config.webhookUrl + '/openid4vc-issuance', body, agent.config.logger) + } + + if (config.socketServer) { + sendWebSocketEvent(config.socketServer, { + ...event, + payload: { + ...event.payload, + issuanceRecord: body, + }, + }) + } + }) +} diff --git a/src/events/openId4VcVerificationSessionEvents.ts b/src/events/openId4VcVerificationSessionEvents.ts new file mode 100644 index 00000000..617ab0cb --- /dev/null +++ b/src/events/openId4VcVerificationSessionEvents.ts @@ -0,0 +1,29 @@ +import type { ServerConfig } from '../utils/ServerConfig' +import type { Agent } from '@credo-ts/core' + +import { CredentialEventTypes, CredentialStateChangedEvent } from '@credo-ts/didcomm' + +import { sendWebSocketEvent } from './WebSocketEvents' +import { sendWebhookEvent } from './WebhookEvent' +import { OpenId4VcVerificationSessionStateChangedEvent, OpenId4VcVerifierEvents } from '@credo-ts/openid4vc' + +export const openId4VcVerificationSessionEvents = async (agent: Agent, config: ServerConfig) => { + agent.events.on(OpenId4VcVerifierEvents.VerificationSessionStateChanged, async (event: OpenId4VcVerificationSessionStateChangedEvent) => { + const record = event.payload.verificationSession + const body = { ...record.toJSON(), ...event.metadata } + + if (config.webhookUrl) { + await sendWebhookEvent(config.webhookUrl + '/openid4vc-verification', body, agent.config.logger) + } + + if (config.socketServer) { + sendWebSocketEvent(config.socketServer, { + ...event, + payload: { + ...event.payload, + verificationRecord: body, + }, + }) + } + }) +} diff --git a/src/routes/routes.ts b/src/routes/routes.ts index 4f5292c3..02b08bd2 100644 --- a/src/routes/routes.ts +++ b/src/routes/routes.ts @@ -1149,6 +1149,7 @@ const models: TsoaRoute.Models = { "issuanceDate": {"dataType":"string","required":true}, "expirationDate": {"dataType":"string"}, "credentialSubject": {"ref":"SingleOrArray_JsonObject_","required":true}, + "prettyVc": {"dataType":"any"}, }, "additionalProperties": {"dataType":"any"}, }, @@ -4761,6 +4762,7 @@ export function RegisterRoutes(app: Router) { }); // WARNING: This 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"}, @@ -4768,6 +4770,7 @@ export function RegisterRoutes(app: Router) { nonce: {"in":"query","name":"nonce","dataType":"string"}, }; app.get('/openid4vc/verification-sessions', + authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), ...(fetchMiddlewares(VerificationSessionsController)), ...(fetchMiddlewares(VerificationSessionsController.prototype.getAllVerificationSessions)), @@ -4800,9 +4803,11 @@ export function RegisterRoutes(app: Router) { }); // WARNING: This 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)), @@ -4835,9 +4840,11 @@ export function RegisterRoutes(app: Router) { }); // WARNING: This 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,"dataType":"any"}, }; app.post('/openid4vc/verifier', + authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), ...(fetchMiddlewares(VerifierController)), ...(fetchMiddlewares(VerifierController.prototype.createVerifier)), @@ -4870,10 +4877,12 @@ export function RegisterRoutes(app: Router) { }); // WARNING: This 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,"dataType":"any"}, }; app.put('/openid4vc/verifier/:publicVerifierId', + authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), ...(fetchMiddlewares(VerifierController)), ...(fetchMiddlewares(VerifierController.prototype.updateVerifierMetadata)), @@ -4906,9 +4915,11 @@ export function RegisterRoutes(app: Router) { }); // WARNING: This 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)), @@ -4941,9 +4952,11 @@ export function RegisterRoutes(app: Router) { }); // WARNING: This 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)), @@ -4976,9 +4989,11 @@ export function RegisterRoutes(app: Router) { }); // WARNING: This 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)), diff --git a/src/routes/swagger.json b/src/routes/swagger.json index cc78611c..245ac59b 100644 --- a/src/routes/swagger.json +++ b/src/routes/swagger.json @@ -2609,7 +2609,8 @@ }, "credentialSubject": { "$ref": "#/components/schemas/SingleOrArray_JsonObject_" - } + }, + "prettyVc": {} }, "required": [ "@context", @@ -8655,7 +8656,14 @@ "tags": [ "oid4vc verification sessions" ], - "security": [], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } + ], "parameters": [ { "in": "query", @@ -8719,7 +8727,14 @@ "tags": [ "oid4vc verification sessions" ], - "security": [], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } + ], "parameters": [ { "in": "path", @@ -8751,7 +8766,14 @@ "tags": [ "oid4vc verifiers" ], - "security": [], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } + ], "parameters": [], "requestBody": { "required": true, @@ -8783,7 +8805,14 @@ "tags": [ "oid4vc verifiers" ], - "security": [], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } + ], "parameters": [ { "in": "query", @@ -8815,7 +8844,14 @@ "tags": [ "oid4vc verifiers" ], - "security": [], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } + ], "parameters": [ { "in": "path", @@ -8853,7 +8889,14 @@ "tags": [ "oid4vc verifiers" ], - "security": [], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } + ], "parameters": [ { "in": "path", @@ -8878,7 +8921,14 @@ "tags": [ "oid4vc verifiers" ], - "security": [], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } + ], "parameters": [ { "in": "path", diff --git a/src/utils/oid4vc-agent.ts b/src/utils/oid4vc-agent.ts index a3392891..6be2eae9 100644 --- a/src/utils/oid4vc-agent.ts +++ b/src/utils/oid4vc-agent.ts @@ -21,6 +21,7 @@ import { w3cDate, } from '@credo-ts/core' import { OpenId4VciCredentialFormatProfile } from '@credo-ts/openid4vc' +import { SignerMethod } from '../enums/enum' export function getCredentialRequestToCredentialMapper(): OpenId4VciCredentialRequestToCredentialMapper { return async ({ @@ -136,7 +137,6 @@ export function getCredentialRequestToCredentialMapper(): OpenId4VciCredentialRe }), verificationMethod, } - // console.log(`Final ClaimFormat.JwtVc ---> ${JSON.stringify(finalVC)}`) return finalVC }), } satisfies OpenId4VciSignW3cCredentials @@ -155,61 +155,196 @@ export function getCredentialRequestToCredentialMapper(): OpenId4VciCredentialRe credentialConfigurationId, format: ClaimFormat.SdJwtVc, credentials: holderBindings.map((holderBinding) => ({ - // payload: { - // vct: credentialConfiguration.vct, - // university: 'innsbruck', - // degree: 'bachelor', - // authorized_user: authorization.accessToken.payload.sub, - // }, payload: credentialPayload[0].payload, holder: holderBinding, issuer: issuerDidUrl ? { method: 'did', didUrl: issuerDidUrl, - //didUrl: `${issuerDidKey.did}#${issuerDidKey.key.fingerprint}`, } : { method: 'x5c', x5c: issuerx509certificate ?? [], //[issuerx509certificate??""], issuer: process.env.AGENT_HOST ?? 'http://localhost:4001', }, - disclosureFrame: disclosureFramePayload, - //disclosureFrame: { _sd: ['university', 'degree', 'authorized_user'] }, + 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; + const issuerx509certificate = issuanceMetadata?.["issuerx509certificate"] as string[] | undefined; + + 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 = ''; + + 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"); + } + } + } + + 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 mot 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, + namespaces: { + [namespace]: { + ...credential.payload + } + }, + // TODO - add validity info + /*validityInfo: { + expectedUpdate: true, + validFrom: '', + validUntil: '' + },*/ + 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, + } + console.log(`Final ClaimFormat.JwtVc ---> ${JSON.stringify(finalVC)}`) + return finalVC; + }), + } satisfies OpenId4VciSignW3cCredentials + } + + if (credentialConfiguration.format === OpenId4VciCredentialFormatProfile.SdJwtVc) { + const disclosureFramePayload = { + _sd: credential.disclosureFrame ? + Array.isArray(credential.disclosureFrame._sd) ? credential.disclosureFrame._sd : [] + : [] + } - // if (credentialConfiguration.format === OpenId4VciCredentialFormatProfile.MsoMdoc) { - // if (!issuerx509certificate) - // throw new Error( - // `issuerx509certificate is mot 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 - // let namespace = credentialConfiguration.doctype - - // return { - // credentialConfigurationId, - // format: ClaimFormat.MsoMdoc, - // credentials: holderBindings.map((holderBinding) => ({ - // issuerCertificate: issuerx509certificate[0], - // holderKey: holderBinding.key, - // namespaces: { - // [namespace]: { - // ...credentialPayload[0].payload, - // }, - // }, - // docType: credentialConfiguration.doctype, - // })), - // } satisfies OpenId4VciSignMdocCredentials - // } + return { + credentialConfigurationId, + format: ClaimFormat.SdJwtVc, + credentials: holderBindings.map((holderBinding) => ({ + payload: credential.payload, + holder: holderBinding, + issuer: issuerDidVerificationMethod ? { + method: 'did', + didUrl: issuerDidVerificationMethod + } + : { + method: 'x5c', + x5c: issuerx509certificate ?? [],//[issuerx509certificate??""], + issuer: `${process.env.AGENT_HTTP_URL}`, + }, + disclosureFrame: disclosureFramePayload + })), + } satisfies OpenId4VciSignSdJwtCredentials + } throw new Error('Invalid request') } From 65614415a93ca7060f67b54c2359dd1ac9d39613 Mon Sep 17 00:00:00 2001 From: Tipu_Singh Date: Thu, 4 Sep 2025 15:19:10 +0530 Subject: [PATCH 004/152] feat: added issuer example Signed-off-by: Tipu_Singh --- .../openid4vc/examples/issuer.examples.ts | 111 +++++ .../openid4vc/issuers/issuer.Controller.ts | 12 +- .../openid4vc/types/issuer.types.ts | 8 +- src/routes/routes.ts | 41 +- src/routes/swagger.json | 400 +++++++++++++++++- 5 files changed, 554 insertions(+), 18 deletions(-) create mode 100644 src/controllers/openid4vc/examples/issuer.examples.ts diff --git a/src/controllers/openid4vc/examples/issuer.examples.ts b/src/controllers/openid4vc/examples/issuer.examples.ts new file mode 100644 index 00000000..1d5885da --- /dev/null +++ b/src/controllers/openid4vc/examples/issuer.examples.ts @@ -0,0 +1,111 @@ +export const OpenId4VcUpdateIssuerRecordOptionsExample = { + withScope: { + 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" + } + ] + }, + "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"], + cryptographic_binding_methods_supported: ["did:key"], + display: [ + { + name: "University Degree Credential", + description: "Issued by a recognized educational institution", + locale: "en" + } + ] + }, + "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" + } + ] + } + } + } + } +}; diff --git a/src/controllers/openid4vc/issuers/issuer.Controller.ts b/src/controllers/openid4vc/issuers/issuer.Controller.ts index acf230ed..cfd49d6b 100644 --- a/src/controllers/openid4vc/issuers/issuer.Controller.ts +++ b/src/controllers/openid4vc/issuers/issuer.Controller.ts @@ -1,4 +1,3 @@ -import { Agent } from '@credo-ts/core' import { Controller, Delete, @@ -11,16 +10,18 @@ import { Query, Body, Security, - Request + Request, + Example } from 'tsoa' import { injectable } from 'tsyringe' import ErrorHandlingService from '../../../errorHandlingService' -import { UpdateIssuerRecordOptions } from '../types/issuer.types' +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]) @@ -30,7 +31,10 @@ export class IssuerController extends Controller { * Creates an issuer with issuer metadata. */ @Post() - public async createIssuer(@Request() request: Req, @Body() createIssuerOptions: any) { + @Example( + OpenId4VcUpdateIssuerRecordOptionsExample.withScope.value + ) + public async createIssuer(@Request() request: Req, @Body() createIssuerOptions: CreateIssuerOptions) { try { return await issuerService.createIssuerAgent(request, createIssuerOptions) } catch (error) { diff --git a/src/controllers/openid4vc/types/issuer.types.ts b/src/controllers/openid4vc/types/issuer.types.ts index 97977fc2..72aa366d 100644 --- a/src/controllers/openid4vc/types/issuer.types.ts +++ b/src/controllers/openid4vc/types/issuer.types.ts @@ -95,15 +95,17 @@ export interface CredentialDefinition { } export interface CredentialConfigurationSupportedWithFormats { - format: 'jwt_vc_json' + format: 'vc+sd-jwt' | 'mso_mdoc' | 'jwt_vc_json' | string, + vct?: string, + doctype?: string, scope?: string + claims?: Record cryptographic_binding_methods_supported?: string[] credential_signing_alg_values_supported?: string[] proof_types_supported?: Record - credential_definition: CredentialDefinition + credential_definition?: CredentialDefinition display?: CredentialConfigurationDisplay[] } - export interface CreateIssuerOptions { issuerId?: string accessTokenSignerKeyType?: string diff --git a/src/routes/routes.ts b/src/routes/routes.ts index 02b08bd2..b87adbfb 100644 --- a/src/routes/routes.ts +++ b/src/routes/routes.ts @@ -1568,6 +1568,24 @@ const models: TsoaRoute.Models = { "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": { @@ -1606,12 +1624,15 @@ const models: TsoaRoute.Models = { "CredentialConfigurationSupportedWithFormats": { "dataType": "refObject", "properties": { - "format": {"dataType":"enum","enums":["jwt_vc_json"],"required":true}, + "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": {"ref":"Record_string.unknown_"}, "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","required":true}, + "credential_definition": {"ref":"CredentialDefinition"}, "display": {"dataType":"array","array":{"dataType":"refObject","ref":"CredentialConfigurationDisplay"}}, }, "additionalProperties": false, @@ -1630,6 +1651,20 @@ const models: TsoaRoute.Models = { "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": { @@ -4540,7 +4575,7 @@ export function RegisterRoutes(app: Router) { // WARNING: This 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,"dataType":"any"}, + createIssuerOptions: {"in":"body","name":"createIssuerOptions","required":true,"ref":"CreateIssuerOptions"}, }; app.post('/openid4vc/issuer', authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), diff --git a/src/routes/swagger.json b/src/routes/swagger.json index 245ac59b..ee9a847b 100644 --- a/src/routes/swagger.json +++ b/src/routes/swagger.json @@ -3522,6 +3522,37 @@ "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": { @@ -3593,15 +3624,32 @@ "CredentialConfigurationSupportedWithFormats": { "properties": { "format": { - "type": "string", - "enum": [ - "jwt_vc_json" - ], - "nullable": false + "anyOf": [ + { + "type": "string" + }, + { + "type": "string", + "enum": [ + "vc+sd-jwt", + "mso_mdoc", + "jwt_vc_json" + ] + } + ] + }, + "vct": { + "type": "string" + }, + "doctype": { + "type": "string" }, "scope": { "type": "string" }, + "claims": { + "$ref": "#/components/schemas/Record_string.unknown_" + }, "cryptographic_binding_methods_supported": { "items": { "type": "string" @@ -3628,8 +3676,7 @@ } }, "required": [ - "format", - "credential_definition" + "format" ], "type": "object", "additionalProperties": false @@ -3655,6 +3702,45 @@ "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": { @@ -8408,6 +8494,302 @@ "application/json": { "schema": { "$ref": "#/components/schemas/OpenId4VcIssuerRecord" + }, + "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" + } + ] + }, + "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" + ], + "cryptographic_binding_methods_supported": [ + "did:key" + ], + "display": [ + { + "name": "University Degree Credential", + "description": "Issued by a recognized educational institution", + "locale": "en" + } + ] + }, + "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" + } + ] + } + } + } + } } } } @@ -8430,7 +8812,9 @@ "required": true, "content": { "application/json": { - "schema": {} + "schema": { + "$ref": "#/components/schemas/CreateIssuerOptions" + } } } } From 40b113b118c2b2a0f50359709600a8a72a7a935b Mon Sep 17 00:00:00 2001 From: Tipu_Singh Date: Fri, 12 Sep 2025 10:57:10 +0530 Subject: [PATCH 005/152] refactor: changed discloser frame Signed-off-by: Tipu_Singh --- src/cliAgent.ts | 1 + src/routes/routes.ts | 4 ++-- src/routes/swagger.json | 10 +++++++-- src/utils/oid4vc-agent.ts | 46 +++++++++++++++++++-------------------- 4 files changed, 33 insertions(+), 28 deletions(-) diff --git a/src/cliAgent.ts b/src/cliAgent.ts index 8e876a28..af65b824 100644 --- a/src/cliAgent.ts +++ b/src/cliAgent.ts @@ -337,6 +337,7 @@ export async function runRestAgent(restConfig: AriesRestConfig) { // 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 + allowInsecureHttpUrls: true } async function fetchLedgerData(ledgerConfig: { diff --git a/src/routes/routes.ts b/src/routes/routes.ts index b87adbfb..0f05210e 100644 --- a/src/routes/routes.ts +++ b/src/routes/routes.ts @@ -2373,7 +2373,7 @@ export function RegisterRoutes(app: Router) { 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"}]}, + 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"]}]), @@ -2410,7 +2410,7 @@ export function RegisterRoutes(app: Router) { // WARNING: This 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,"ref":"SafeW3cJsonLdVerifyCredentialOptions"}, + credentialToVerify: {"in":"body","name":"credentialToVerify","required":true,"dataType":"union","subSchemas":[{"ref":"SafeW3cJsonLdVerifyCredentialOptions"},{"dataType":"any"}]}, }; app.post('/agent/credential/verify', authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), diff --git a/src/routes/swagger.json b/src/routes/swagger.json index ee9a847b..6932c208 100644 --- a/src/routes/swagger.json +++ b/src/routes/swagger.json @@ -4830,7 +4830,8 @@ }, { "$ref": "#/components/schemas/SignDataOptions" - } + }, + {} ] } } @@ -4870,7 +4871,12 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SafeW3cJsonLdVerifyCredentialOptions" + "anyOf": [ + { + "$ref": "#/components/schemas/SafeW3cJsonLdVerifyCredentialOptions" + }, + {} + ] } } } diff --git a/src/utils/oid4vc-agent.ts b/src/utils/oid4vc-agent.ts index 6be2eae9..7a1c9679 100644 --- a/src/utils/oid4vc-agent.ts +++ b/src/utils/oid4vc-agent.ts @@ -94,9 +94,9 @@ export function getCredentialRequestToCredentialMapper(): OpenId4VciCredentialRe issuer: holderBindings[0].method === 'did' ? { - method: 'did', - didUrl: issuerDidUrl ?? '', - } + method: 'did', + didUrl: issuerDidUrl ?? '', + } : { method: 'x5c', x5c: trustedCertificates, issuer: 'ISSUER_HOST ' }, })), } satisfies OpenId4VciSignSdJwtCredentials @@ -143,13 +143,11 @@ export function getCredentialRequestToCredentialMapper(): OpenId4VciCredentialRe } if (credentialConfiguration.format === OpenId4VciCredentialFormatProfile.SdJwtVc) { - const disclosureFramePayload = { - _sd: credentialPayload[0].disclosureFrame - ? Array.isArray(credentialPayload[0].disclosureFrame._sd) - ? credentialPayload[0].disclosureFrame._sd - : [] - : [], - } + const disclosureFramePayload = + credentialPayload[0].disclosureFrame && + Object.keys(credentialPayload[0].disclosureFrame).length > 0 + ? credentialPayload[0].disclosureFrame + : {}; return { credentialConfigurationId, @@ -159,14 +157,14 @@ export function getCredentialRequestToCredentialMapper(): OpenId4VciCredentialRe holder: holderBinding, issuer: issuerDidUrl ? { - method: 'did', - didUrl: issuerDidUrl, - } + method: 'did', + didUrl: issuerDidUrl, + } : { - method: 'x5c', - x5c: issuerx509certificate ?? [], //[issuerx509certificate??""], - issuer: process.env.AGENT_HOST ?? 'http://localhost:4001', - }, + method: 'x5c', + x5c: issuerx509certificate ?? [], //[issuerx509certificate??""], + issuer: process.env.AGENT_HOST ?? 'http://localhost:4001', + }, disclosureFrame: disclosureFramePayload })), } satisfies OpenId4VciSignSdJwtCredentials @@ -185,7 +183,7 @@ export function getMixedCredentialRequestToCredentialMapper(): OpenId4VciCredent agentContext, authorization, }) => { - + const issuanceMetadata = issuanceSession.issuanceMetadata; const issuerx509certificate = issuanceMetadata?.["issuerx509certificate"] as string[] | undefined; @@ -212,7 +210,7 @@ export function getMixedCredentialRequestToCredentialMapper(): OpenId4VciCredent 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; @@ -336,11 +334,11 @@ export function getMixedCredentialRequestToCredentialMapper(): OpenId4VciCredent method: 'did', didUrl: issuerDidVerificationMethod } - : { - method: 'x5c', - x5c: issuerx509certificate ?? [],//[issuerx509certificate??""], - issuer: `${process.env.AGENT_HTTP_URL}`, - }, + : { + method: 'x5c', + x5c: issuerx509certificate ?? [],//[issuerx509certificate??""], + issuer: `${process.env.AGENT_HTTP_URL}`, + }, disclosureFrame: disclosureFramePayload })), } satisfies OpenId4VciSignSdJwtCredentials From a2aa5a091d7f3bc45b78129105988f53c638d048 Mon Sep 17 00:00:00 2001 From: RinkalBhojani Date: Wed, 17 Sep 2025 10:48:00 +0530 Subject: [PATCH 006/152] added x509 APIs Signed-off-by: RinkalBhojani --- .env.demo | 154 +++------------------ .env.sample | 154 ++------------------- src/cliAgent.ts | 16 ++- src/controllers/types.ts | 24 ++++ src/controllers/x509/crypto-util.ts | 62 +++++++++ src/controllers/x509/x509.Controller.ts | 81 +++++++++++ src/controllers/x509/x509.service.ts | 170 ++++++++++++++++++++++++ src/utils/agent.ts | 1 + src/utils/helpers.ts | 42 ++++++ 9 files changed, 419 insertions(+), 285 deletions(-) create mode 100644 src/controllers/x509/crypto-util.ts create mode 100644 src/controllers/x509/x509.Controller.ts create mode 100644 src/controllers/x509/x509.service.ts diff --git a/.env.demo b/.env.demo index a2ebfa60..c7328b45 100644 --- a/.env.demo +++ b/.env.demo @@ -47,143 +47,19 @@ INDICIO_TEST_GENESIS='{"reqSignature":{},"txn":{"data":{"data":{"alias":"OpsNode {"reqSignature":{},"txn":{"data":{"data":{"alias":"lorica-identity-node1","blskey":"wUh24sVCQ8PHDgSb343g2eLxjD5vwxsrETfuV2sbwMNnYon9nhbaK5jcWTekvXtyiwxHxuiCCoZwKS97MQEAeC2oLbbMeKjYm212QwSnm7aKLEqTStXht35VqZvZLT7Q3mPQRYLjMGixdn4ocNHrBTMwPUQYycEqwaHWgE1ncDueXY","blskey_pop":"R2sMwF7UW6AaD4ALa1uB1YVPuP6JsdJ7LsUoViM9oySFqFt34C1x1tdHDysS9wwruzaaEFui6xNPqJ8eu3UBqcFKkoWhdsMqCALwe63ytxPwvtLtCffJLhHAcgrPC7DorXYdqhdG2cevdqc5oqFEAaKoFDBf12p5SsbbM4PYWCmVCb","client_ip":"35.225.220.151","client_port":"9702","node_ip":"35.224.26.110","node_port":"9701","services":["VALIDATOR"]},"dest":"k74ZsZuUaJEcB8RRxMwkCwdE5g1r9yzA3nx41qvYqYf"},"metadata":{"from":"Ex6hzsJFYzNJ7kzbfncNeU"},"type":"0"},"txnMetadata":{"seqNo":6,"txnId":"6880673ce4ae4a2352f103d2a6ae20469dd070f2027283a1da5e62a64a59d688"},"ver":"1"} {"reqSignature":{},"txn":{"data":{"data":{"alias":"cysecure-itn","blskey":"GdCvMLkkBYevRFi93b6qaj9G2u1W6Vnbg8QhRD1chhrWR8vRE8x9x7KXVeUBPFf6yW5qq2JCfA2frc8SGni2RwjtTagezfwAwnorLhVJqS5ZxTi4pgcw6smebnt4zWVhTkh6ugDHEypHwNQBcw5WhBZcEJKgNbyVLnHok9ob6cfr3u","blskey_pop":"RbH9mY7M5p3UB3oj4sT1skYwMkxjoUnja8eTYfcm83VcNbxC9zR9pCiRhk4q1dJT3wkDBPGNKnk2p83vaJYLcgMuJtzoWoJAWAxjb3Mcq8Agf6cgQpBuzBq2uCzFPuQCAhDS4Kv9iwA6FsRnfvoeFTs1hhgSJVxQzDWMVTVAD9uCqu","client_ip":"35.169.19.171","client_port":"9702","node_ip":"54.225.56.21","node_port":"9701","services":["VALIDATOR"]},"dest":"4ETBDmHzx8iDQB6Xygmo9nNXtMgq9f6hxGArNhQ6Hh3u"},"metadata":{"from":"uSXXXEdBicPHMMhr3ddNF"},"type":"0"},"txnMetadata":{"seqNo":7,"txnId":"3c21718b07806b2f193b35953dda5b68b288efd551dce4467ce890703d5ba549"},"ver":"1"}' -CREDEBL_TEST_GENESIS='{"reqSignature": {}, "txn": {"data": {"data": {"alias": "Node1", "blskey": "4N8aUNHSgjQVgkpm8nhNEfDf6txHznoYREg9kirmJrkivgL4oSEimFF6nsQ6M41QvhM2Z33nves5vfSn9n1UwNFJBYtWVnHYMATn76vLuL3zU88KyeAYcHfsih3He6UHcXDxcaecHVz6jhCYz1P2UZn2bDVruL5wXpehgBfBaLKm3Ba", "blskey_pop": "RahHYiCvoNCtPTrVtP7nMC5eTYrsUA8WjXbdhNc8debh1agE9bGiJxWBXYNFbnJXoXhWFMvyqhqhRoq737YQemH5ik9oL7R4NTTCz2LEZhkgLJzB3QRQqJyBNyv7acbdHrAT8nQ9UkLbaVL9NBpnWXBTw4LEMePaSHEw66RzPNdAX1", "client_ip": "192.168.1.74", "client_port": 9702, "node_ip": "192.168.1.74", "node_port": 9701, "services": ["VALIDATOR"]}, "dest": "Gw6pDLhcBcoQesN72qfotTgFa7cbuqZpkX3Xo6pLhPhv"}, "metadata": {"from": "Th7MpTaRZVRYnPiabds81Y"}, "type": "0"}, "txnMetadata": {"seqNo": 1, "txnId": "fea82e10e894419fe2bea7d96296a6d46f50f93f9eeda954ec461b2ed2950b62"}, "ver": "1"} -{"reqSignature": {}, "txn": {"data": {"data": {"alias": "Node2", "blskey": "37rAPpXVoxzKhz7d9gkUe52XuXryuLXoM6P6LbWDB7LSbG62Lsb33sfG7zqS8TK1MXwuCHj1FKNzVpsnafmqLG1vXN88rt38mNFs9TENzm4QHdBzsvCuoBnPH7rpYYDo9DZNJePaDvRvqJKByCabubJz3XXKbEeshzpz4Ma5QYpJqjk", "blskey_pop": "Qr658mWZ2YC8JXGXwMDQTzuZCWF7NK9EwxphGmcBvCh6ybUuLxbG65nsX4JvD4SPNtkJ2w9ug1yLTj6fgmuDg41TgECXjLCij3RMsV8CwewBVgVN67wsA45DFWvqvLtu4rjNnE9JbdFTc1Z4WCPA3Xan44K1HoHAq9EVeaRYs8zoF5", "client_ip": "192.168.1.74", "client_port": 9704, "node_ip": "192.168.1.74", "node_port": 9703, "services": ["VALIDATOR"]}, "dest": "8ECVSk179mjsjKRLWiQtssMLgp6EPhWXtaYyStWPSGAb"}, "metadata": {"from": "EbP4aYNeTHL6q385GuVpRV"}, "type": "0"}, "txnMetadata": {"seqNo": 2, "txnId": "1ac8aece2a18ced660fef8694b61aac3af08ba875ce3026a160acbc3a3af35fc"}, "ver": "1"} -{"reqSignature": {}, "txn": {"data": {"data": {"alias": "Node3", "blskey": "3WFpdbg7C5cnLYZwFZevJqhubkFALBfCBBok15GdrKMUhUjGsk3jV6QKj6MZgEubF7oqCafxNdkm7eswgA4sdKTRc82tLGzZBd6vNqU8dupzup6uYUf32KTHTPQbuUM8Yk4QFXjEf2Usu2TJcNkdgpyeUSX42u5LqdDDpNSWUK5deC5", "blskey_pop": "QwDeb2CkNSx6r8QC8vGQK3GRv7Yndn84TGNijX8YXHPiagXajyfTjoR87rXUu4G4QLk2cF8NNyqWiYMus1623dELWwx57rLCFqGh7N4ZRbGDRP4fnVcaKg1BcUxQ866Ven4gw8y4N56S5HzxXNBZtLYmhGHvDtk6PFkFwCvxYrNYjh", "client_ip": "192.168.1.74", "client_port": 9706, "node_ip": "192.168.1.74", "node_port": 9705, "services": ["VALIDATOR"]}, "dest": "DKVxG2fXXTU8yT5N7hGEbXB3dfdAnYv1JczDUHpmDxya"}, "metadata": {"from": "4cU41vWW82ArfxJxHkzXPG"}, "type": "0"}, "txnMetadata": {"seqNo": 3, "txnId": "7e9f355dffa78ed24668f0e0e369fd8c224076571c51e2ea8be5f26479edebe4"}, "ver": "1"} -{"reqSignature": {}, "txn": {"data": {"data": {"alias": "Node4", "blskey": "2zN3bHM1m4rLz54MJHYSwvqzPchYp8jkHswveCLAEJVcX6Mm1wHQD1SkPYMzUDTZvWvhuE6VNAkK3KxVeEmsanSmvjVkReDeBEMxeDaayjcZjFGPydyey1qxBHmTvAnBKoPydvuTAqx5f7YNNRAdeLmUi99gERUU7TD8KfAa6MpQ9bw", "blskey_pop": "RPLagxaR5xdimFzwmzYnz4ZhWtYQEj8iR5ZU53T2gitPCyCHQneUn2Huc4oeLd2B2HzkGnjAff4hWTJT6C7qHYB1Mv2wU5iHHGFWkhnTX9WsEAbunJCV2qcaXScKj4tTfvdDKfLiVuU2av6hbsMztirRze7LvYBkRHV3tGwyCptsrP", "client_ip": "192.168.1.74", "client_port": 9708, "node_ip": "192.168.1.74", "node_port": 9707, "services": ["VALIDATOR"]}, "dest": "4PS3EDQ3dW1tci1Bp6543CfuuebjFrg36kLAUcskGfaA"}, "metadata": {"from": "TWwCRQRZ2ZHMJFn9TzLp7W"}, "type": "0"}, "txnMetadata": {"seqNo": 4, "txnId": "aa5e817d7cc626170eca175822029339a444eb0ee8f0bd20d3b0b76e566fb008"}, "ver": "1"}' -SOVRIN_STAGING_NET='{"reqSignature":{},"txn":{"data":{"data":{"alias":"australia","client_ip":"52.64.96.160","client_port":"9702","node_ip":"52.64.96.160","node_port":"9701","services":["VALIDATOR"]},"dest":"UZH61eLH3JokEwjMWQoCMwB3PMD6zRBvG6NCv5yVwXz"},"metadata":{"from":"3U8HUen8WcgpbnEz1etnai"},"type":"0"},"txnMetadata":{"seqNo":1,"txnId":"c585f1decb986f7ff19b8d03deba346ab8a0494cc1e4d69ad9b8acb0dfbeab6f"},"ver":"1"} -{"reqSignature":{},"txn":{"data":{"data":{"alias":"brazil","client_ip":"54.233.203.241","client_port":"9702","node_ip":"54.233.203.241","node_port":"9701","services":["VALIDATOR"]},"dest":"2MHGDD2XpRJohQzsXu4FAANcmdypfNdpcqRbqnhkQsCq"},"metadata":{"from":"G3knUCmDrWd1FJrRryuKTw"},"type":"0"},"txnMetadata":{"seqNo":2,"txnId":"5c8f52ca28966103ff0aad98160bc8e978c9ca0285a2043a521481d11ed17506"},"ver":"1"} -{"reqSignature":{},"txn":{"data":{"data":{"alias":"canada","client_ip":"52.60.207.225","client_port":"9702","node_ip":"52.60.207.225","node_port":"9701","services":["VALIDATOR"]},"dest":"8NZ6tbcPN2NVvf2fVhZWqU11XModNudhbe15JSctCXab"},"metadata":{"from":"22QmMyTEAbaF4VfL7LameE"},"type":"0"},"txnMetadata":{"seqNo":3,"txnId":"408c7c5887a0f3905767754f424989b0089c14ac502d7f851d11b31ea2d1baa6"},"ver":"1"} -{"reqSignature":{},"txn":{"data":{"data":{"alias":"england","client_ip":"52.56.191.9","client_port":"9702","node_ip":"52.56.191.9","node_port":"9701","services":["VALIDATOR"]},"dest":"DNuLANU7f1QvW1esN3Sv9Eap9j14QuLiPeYzf28Nub4W"},"metadata":{"from":"NYh3bcUeSsJJcxBE6TTmEr"},"type":"0"},"txnMetadata":{"seqNo":4,"txnId":"d56d0ff69b62792a00a361fbf6e02e2a634a7a8da1c3e49d59e71e0f19c27875"},"ver":"1"} -{"reqSignature":{},"txn":{"data":{"data":{"alias":"korea","client_ip":"52.79.115.223","client_port":"9702","node_ip":"52.79.115.223","node_port":"9701","services":["VALIDATOR"]},"dest":"HCNuqUoXuK9GXGd2EULPaiMso2pJnxR6fCZpmRYbc7vM"},"metadata":{"from":"U38UHML5A1BQ1mYh7tYXeu"},"type":"0"},"txnMetadata":{"seqNo":5,"txnId":"76201e78aca720dbaf516d86d9342ad5b5d46f5badecf828eb9edfee8ab48a50"},"ver":"1"} -{"reqSignature":{},"txn":{"data":{"data":{"alias":"singapore","client_ip":"13.228.62.7","client_port":"9702","node_ip":"13.228.62.7","node_port":"9701","services":["VALIDATOR"]},"dest":"Dh99uW8jSNRBiRQ4JEMpGmJYvzmF35E6ibnmAAf7tbk8"},"metadata":{"from":"HfXThVwhJB4o1Q1Fjr4yrC"},"type":"0"},"txnMetadata":{"seqNo":6,"txnId":"51e2a46721d104d9148d85b617833e7745fdbd6795cb0b502a5b6ea31d33378e"},"ver":"1"} -{"reqSignature":{},"txn":{"data":{"data":{"alias":"virginia","client_ip":"34.225.215.131","client_port":"9702","node_ip":"34.225.215.131","node_port":"9701","services":["VALIDATOR"]},"dest":"EoGRm7eRADtHJRThMCrBXMUM2FpPRML19tNxDAG8YTP8"},"metadata":{"from":"SPdfHq6rGcySFVjDX4iyCo"},"type":"0"},"txnMetadata":{"seqNo":7,"txnId":"0a4992ea442b53e3dca861deac09a8d4987004a8483079b12861080ea4aa1b52"},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"3U8HUen8WcgpbnEz1etnai","value":"NXjsBfaDijk6P6W6fg1EKrzPYhDvkNHbDcSMaYdja4URdiEdaPFcqXQttgwytcKZL79BsV3i8ShWbDS5L9Um5Pj"}]},"txn":{"data":{"data":{"alias":"australia","blskey":"31My1Ya9D1v5edgkGfYb96k4HWN1GwWWUeEnzzgw3NpiVmjpyjKgPmTYvPWZAYt8CLJLWzoQrEcBYhKRedsx8JMEB4LyPVx5vgbcjKsiUK2985t9Pkpn45UAYjDvVmGSbF2y99mMjQxpt7nCwGZ9yKcEm1cLpyHxvbnceZGkf8e9HYs"},"dest":"UZH61eLH3JokEwjMWQoCMwB3PMD6zRBvG6NCv5yVwXz"},"metadata":{"digest":"f8297516300f34624d25bf38b558f8ac9df2830a4e7fe8ccdf6816ec597da4cc","from":"3U8HUen8WcgpbnEz1etnai","reqId":1518718611795589},"type":"0"},"txnMetadata":{"seqNo":8,"txnTime":1518718611},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"3U8HUen8WcgpbnEz1etnai","value":"4wiCViKevghYdtcdJXdAmS4Cwy9dAsc5eDUqHnjZXcnBbVpc71iHdyWj83U4teK65Yq2g2no8ddzJscEVTZn1ueC"}]},"txn":{"data":{"data":{"alias":"australia","blskey":"KMbkBaLigL6wUbYZmh3d41EeCRVrW1hWkpGRcy2CXZ6ugZF1Zb7ZeL3RPRasaARYkuWmjYAuLE8WiVC1dL5ZQuJczAJfDsk73hxivHxqeBaXDQwEBN2dESLZHdK3oMU79ZhqBqnEgvvAvmVyyneW661if5c45AFJgGYPtpenxS49MB"},"dest":"UZH61eLH3JokEwjMWQoCMwB3PMD6zRBvG6NCv5yVwXz"},"metadata":{"digest":"77ab856e84ef72f87a6e99ecd447da338d1eddf332b9cd33a1399aba98d39ef4","from":"3U8HUen8WcgpbnEz1etnai","reqId":1518718754041702},"type":"0"},"txnMetadata":{"seqNo":9,"txnTime":1518718754},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"G3knUCmDrWd1FJrRryuKTw","value":"5owgEB8jgYUaGsH3pV6DyFMSiwXPqMgM4u9NzgCyJpnENTzyF1BmeVaNomRunbL9R4EhfbrDNHW9RJFd5GT5pAPs"}]},"txn":{"data":{"data":{"alias":"brazil","blskey":"2G1tp8pjdRSiZnpsWpN5c4tnGGTCPbqEkf8MyaVnfSxBun7pdtRqq83E7XnY4uzNmzpBF5PZcPBonfZXzCT2qWjRAB7PaDUWU5zWfLKhNoRmEzaeFp2dVkd9XrcefSfynStWsiPmv4tG8CHX153kL9Le7LMBk9qCRjeXn77wCUXqyvB"},"dest":"2MHGDD2XpRJohQzsXu4FAANcmdypfNdpcqRbqnhkQsCq"},"metadata":{"digest":"999bb3eecd2807ebf31c619518775f6219a1a6e51234f3a1f3b1021dd900dd97","from":"G3knUCmDrWd1FJrRryuKTw","reqId":1518719363728031},"type":"0"},"txnMetadata":{"seqNo":10,"txnTime":1518719363},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"22QmMyTEAbaF4VfL7LameE","value":"5yVCBN5z8ehtM14FdGcRPDEc3asUrEH83PdbEBpfyrvHprn8iUZMBSCo4kkirvS1HirLLxU4mHssGvm4baGfTXfc"}]},"txn":{"data":{"data":{"alias":"canada","blskey":"q6nBf5jDDQN23yKEvVsxYjMkS843yspF44867S9Fhht2uUogbAed4cXLfxdTJMLYvsNT2fhA2jmnNSQwUyWfXjBFUSZqNhvJdC3d5XvcW8aqCGnV1BY9fR1kvrQXoLjaYgr1Je33NJxLNpJLumGF6WvuW6SuZYJPbfWxo7F1Vhy8oV"},"dest":"8NZ6tbcPN2NVvf2fVhZWqU11XModNudhbe15JSctCXab"},"metadata":{"digest":"306bb20ca4c46e485e0c93abd6ee9960d8954928d5603d79ade75c7ef22c4288","from":"22QmMyTEAbaF4VfL7LameE","reqId":1518719479176817},"type":"0"},"txnMetadata":{"seqNo":11,"txnTime":1518719479},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"NYh3bcUeSsJJcxBE6TTmEr","value":"G99xrEafV1BhUtgLb8jugDQvu4JLp5R2s5T4ZqSuy5pPNnDRZyhWn6iW89Uwe476uxxdugx7TzEXY61wZXCsUNs"}]},"txn":{"data":{"data":{"alias":"england","blskey":"3TXrLKV5Yn2BE47NBEvM9u6J2DUsn414sUhQQQN1X2mRKhsPvWnixqo1AbFC5kRVjpHDhRPzvenm7cApfGcCGMDME1mSwESxiYgkgpahc9DuGD5hvFieryk3yJ96jcumWA7NUUDYmiHhZfCThXvGS9agXK4Kt3sgxBYQ17yN7wj3cRN"},"dest":"DNuLANU7f1QvW1esN3Sv9Eap9j14QuLiPeYzf28Nub4W"},"metadata":{"digest":"fb5062d61960bd6f742519c6df9ca5463e6c83689cad58a7c84783a7d013c3fb","from":"NYh3bcUeSsJJcxBE6TTmEr","reqId":1518719555172082},"type":"0"},"txnMetadata":{"seqNo":12,"txnTime":1518719555},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"U38UHML5A1BQ1mYh7tYXeu","value":"4ns8r24bUMZqs2AVrBUpK66gGBA3pp2h98BM8XC2nHghbyrmWA6KpSjnmEfLKBgDZcFaoSX4Wu2d6TJzeRsVQQ8Q"}]},"txn":{"data":{"data":{"alias":"korea","blskey":"2b51xiHs4afNBiTUenKJ2XHmPMfYcNFHAwB2x39z953y1YawDTKnUW9Q2gPCQvRR5esvF235PHfv9b5GYFnXPo41wzotm7LiYsYimAarVh2PFo3CAz5DSo9xA6Xo9EhP2JnDSvi2APqGn2UpoYtpRtz2bMFurqrnw6UPz4vq91x23hJ"},"dest":"HCNuqUoXuK9GXGd2EULPaiMso2pJnxR6fCZpmRYbc7vM"},"metadata":{"digest":"4943fc79d796067841ad0aeb0e44c54bb88a1e152e2bc482925ebe3df9e5d032","from":"U38UHML5A1BQ1mYh7tYXeu","reqId":1518719649363976},"type":"0"},"txnMetadata":{"seqNo":13,"txnTime":1518719649},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"HfXThVwhJB4o1Q1Fjr4yrC","value":"2pC8hkN3MxyJeUZmkqhvvUEi3uCwTbKd14Yjc4uVJjNqx2Hj6oXvwaZPvmJn3VJMkKKE7tpFrtwyFXx8CJ5WwArf"}]},"txn":{"data":{"data":{"alias":"singapore","blskey":"CT7HsX8MAcAnWZ8CFF1ttdYG91hNc7K9dGfpcp4QprLRYVR2XSr2ywHuNT5zLPvTkGDjrjyF2HdMbLkdNGgRa5LH1Am3D619yycJjP8t51c2XygEjoa6J1TmUjYkuC44Q6Aq1BriX5hJ2oxJL3bvnM2g7QRzRPyFdM771zNutV72W3"},"dest":"Dh99uW8jSNRBiRQ4JEMpGmJYvzmF35E6ibnmAAf7tbk8"},"metadata":{"digest":"2dce61e98838e65cd7c303adc248c8fabeab4ecc0492f16572521b2f1939c975","from":"HfXThVwhJB4o1Q1Fjr4yrC","reqId":1518719769599617},"type":"0"},"txnMetadata":{"seqNo":14,"txnTime":1518719769},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"SPdfHq6rGcySFVjDX4iyCo","value":"2xLQwrn2jvg6XZcXGuW6AQ3PKiSHPNAdaHM6CVb8iwDA15HHoPUSi2PGkFvUyFya82QiCA22Y11NDX4Yh4Kx7DqR"}]},"txn":{"data":{"data":{"alias":"virginia","blskey":"372y1y4t9JdTtkyA4C5ANi88YGGaBtSpWd1FL6TJawxn1gnkebpztpsiN5AjTkwARMsTZWX8VyBZ3UGhPd7grmVgoBogTBf1LyvpnmVJR2p9TC26fDFz9GFhynAcPfHQ3xLvVjSyAYH8JjEHRS2yMXxhq8gZCTy494shNXP1wKCD8Ny"},"dest":"EoGRm7eRADtHJRThMCrBXMUM2FpPRML19tNxDAG8YTP8"},"metadata":{"digest":"113c1a81394cbadc48d57aef9d9eb93722f318d01261ed3dc162d8e0f527e37a","from":"SPdfHq6rGcySFVjDX4iyCo","reqId":1518719862981841},"type":"0"},"txnMetadata":{"seqNo":15,"txnTime":1518719863},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"A3h7JbvErKPCfaJx3VNRJ9","value":"4jzEdvJYAKB4vMNMU2VVe4dvGwT2fy28WPuvZipVEqf6R7qkuDWBXLYLBSzGAkUErtRKUnb7KH2eSrZSEgHRozTx"}]},"txn":{"data":{"data":{"alias":"ibm","blskey":"Wv1XfnPWngRPQNQnnaMsewidNtc6Rc2mx842q5ApKTgUdUs2YBZZFgSw4TdWa8HVMZvptiukdooXhTimEwxw9dFQRK5faYb2LBdeRZ6RR2kXz39a6vjyG71arL7Q6FnetH6N2NMFBACdu1PBUYKWAyBn5K8ZUUGgt2YhmZJ9DnieLa","client_ip":"169.60.5.114","client_port":9702,"node_ip":"169.60.5.114","node_port":9701,"services":["VALIDATOR"]},"dest":"Eq7m7GMFKPeq5Ek3HH1PkHxzZ46R9VL1Eube3U9wfjp5"},"metadata":{"digest":"a1dfd555da4085210b53245a199a7d431f4a6328e8936050ec3dc794fe5a2b07","from":"A3h7JbvErKPCfaJx3VNRJ9","reqId":1518798036389445},"type":"0"},"txnMetadata":{"seqNo":16,"txnTime":1518798036},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"TnxHS11bsfWrzzi612R2X8","value":"5tHfCPQfV2XAqo7V42akRqmtDqmbX4HUMAZSy9xKz6vERMSDFHmraW4ZEK9hUacjiRthn7P5KuLmopu1mCLwWXhq"}]},"txn":{"data":{"data":{"alias":"RFCU","blskey":"3FuY8wqmBi2XxL4EtJDo3Lhad48QN5ZbhH4kEV3Kfkeb53x94qmWfRndZQJo91M3aWtYpZaZqDaqrQMpuEcAvh8g9hLmb9BWbhK6BVvACSJ2RUiDhBRp4NPkg93tNmQjkdzWoUznFZvbPTTBPBcsmngTake7Sm4YLf1tbd8vuF7Nqkd","client_ip":"207.108.62.234","client_port":9702,"node_ip":"207.108.62.234","node_port":9701,"services":["VALIDATOR"]},"dest":"2B8bkZX3SvcBq3amP7aeATsSPz82RyyCJQbEjZpLgZLh"},"metadata":{"digest":"54d0fb8b9ebc2167d16f9d2027b49917fb484ec6e33caad48bf1516ba27460af","from":"TnxHS11bsfWrzzi612R2X8","reqId":1518798718080714},"type":"0"},"txnMetadata":{"seqNo":17,"txnTime":1518798718},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"ApndPYajjcdTnpvopThGwh","value":"5eyGhLmKmJx5SzkqmS5LD4s4rkQHDAeGh7PmZKhTNJ8MxdbSaZEGjVj4XYD37GeGTepfLwmivJDJjfYaDQGV7aoi"}]},"txn":{"data":{"data":{"alias":"pcValidator01","blskey":"3NU2sWYG7eeJY66W1FGpLgLaDS9fDQfKMNgPGMCk9iTcatMd4XdmAF5UqULkLUpGWABftNTrRsgm82DpfJ1cTu7CTB84KYoW4SYf7Rq4a2wi6rVbmU6k76ZYgmny6h8vqBbdRwozxVTjkPyzV6Z5MSA3vrDdf31iiiPEcXTTT3oFhKC","client_ip":"52.175.254.49","client_port":9799,"node_ip":"52.175.254.49","node_port":9701,"services":["VALIDATOR"]},"dest":"5fKwygs8KEGoUPGa65qz1oCm7h6Fb7HrML9r4jmZ9cic"},"metadata":{"digest":"9dd9cd0dc1ee21694c798c41e80922afd44e70b4e067b2c9c3582c929248ee74","from":"ApndPYajjcdTnpvopThGwh","reqId":1518809271040696},"type":"0"},"txnMetadata":{"seqNo":18,"txnTime":1518809270},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"G4zXq8L7L8n73WKSVv2HxY","value":"Yyd84xQCFWTQovZjUFohaXp3UhXdHX4wj25CGnpvcQs9LKE37DRj4DWvh2RkJALeBLtPZJsXwzKyuivPxLA8QVj"}]},"txn":{"data":{"data":{"alias":"NewtonD","blskey":"36fw9Bz4tLCkzZhUQdA2N51AZWCF6sdyiDuAX7WuNsqeq3C2dCzvS9GeSxt9t1BWxtHWc2GJDVBcqZKGh7Tg2eoQa1KTPhPFRdShBhYPDfP85gKKshHa5aEdLBvTsUkADaDoyFv4rhqTLDFbdcu4WsQE59pxyj3QTSAURgRhxkcm2oJ","client_ip":"52.165.40.82","client_port":9701,"node_ip":"40.69.165.222","node_port":9777,"services":["VALIDATOR"]},"dest":"HU8AkmtsqvcfEtvdWAZgZZFfvKYH8vu2YdgkkHrmNDGP"},"metadata":{"digest":"e0afed7d71f511362c2b21cb90c0b68fc1cb176e233d147a267375350133a6b6","from":"G4zXq8L7L8n73WKSVv2HxY","reqId":1519949508036643},"type":"0"},"txnMetadata":{"seqNo":19,"txnTime":1519949508},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"EKvw1VdXwS2pWKLLyBLCDs","value":"DqCfNstgx5q8gaM57b6qUooHCuhFFqqs7H995UDSBARoD7LWn6gaqJAmcz56NMUmtiWSqpqreBFxwPMr66xPj2Z"}]},"txn":{"data":{"data":{"alias":"Aalto","blskey":"emFqQUM4yqEWdhbk8KzLry6okMk5MsQUoR922BdBS8KBFxNAofPPDzDSR6pwu8ytZVVrfWGbVBs3D6WDt8dZAQY1xYJoAax7pt9Bkgen5Tc2BM5dLhuHpDwRLAmXFFxQbTxArAKidQeeB9wBJbScbbVnWjNNiYPreaZjgFXUGoWjSS","client_ip":"130.233.224.231","client_port":9702,"node_ip":"130.233.224.231","node_port":9701,"services":["VALIDATOR"]},"dest":"7JYQmTE6mBxa5RAZwXAj4bxqetAy64tcEUShqzJjLRrE"},"metadata":{"digest":"5c717908d4b75e92767cca818ac7530789c765c08207eec38cd18eff93b76502","from":"EKvw1VdXwS2pWKLLyBLCDs","reqId":1520418048198552},"type":"0"},"txnMetadata":{"seqNo":20,"txnTime":1520418048},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"Qm7Ugni6jFRpfbPkzhXzXH","value":"jAGG7yFmyLXRGUS2yqoNikvCGWhWeS9eFRyb5vfzu9ZjuAqbiyL4SfNv8NpMAs9Bsda5Y9kZfg9wrW8GufX8NNN"}]},"txn":{"data":{"data":{"alias":"Stuard","blskey":"4Yry2Z17vf1Hf24HvRrduj3Zi5LBJ1x7PbDqNWX19RxHcYJVjpy2f9qriZk7Fx812Xip6LEhsEXWRB1qKujBwdLNbCvMFYnJK2kS2B9HNgDgbVwDbpw16QNuJMtUnvQv1B6vCmci96gypYWMvZmJ6p9qsPXA7CZ2ZSjRuLg3RqvD7y4","client_ip":"10.0.0.10","client_port":9702,"node_ip":"10.0.0.10","node_port":9701,"services":["VALIDATOR"]},"dest":"C4e4rEwPZ4bM341VEL9ysnAgBiMW42RH3UmbriPuzoCb"},"metadata":{"digest":"70d1ed111dd5fec2e46378152f0e8ed5a99728e06288f721fad337b8ba9bae3c","from":"Qm7Ugni6jFRpfbPkzhXzXH","reqId":1521022519350930},"type":"0"},"txnMetadata":{"seqNo":21,"txnTime":1521022519},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"Qm7Ugni6jFRpfbPkzhXzXH","value":"5yKYfGouHn494CtFhEMLYYuWHC9rPhsUWBpXLneJT8jt869rjVxeab9iABYS2Uq55Avjwtd25Xfvyru57HwQMfZb"}]},"txn":{"data":{"data":{"alias":"Stuard","blskey":"4Yry2Z17vf1Hf24HvRrduj3Zi5LBJ1x7PbDqNWX19RxHcYJVjpy2f9qriZk7Fx812Xip6LEhsEXWRB1qKujBwdLNbCvMFYnJK2kS2B9HNgDgbVwDbpw16QNuJMtUnvQv1B6vCmci96gypYWMvZmJ6p9qsPXA7CZ2ZSjRuLg3RqvD7y4","client_ip":"185.27.183.66","client_port":9702,"node_ip":"185.27.183.66","node_port":9701,"services":["VALIDATOR"]},"dest":"C4e4rEwPZ4bM341VEL9ysnAgBiMW42RH3UmbriPuzoCb"},"metadata":{"digest":"0c7f5c756b286dcf1c769cec7a3d5cfeaf57c38ac25e4a83e9d37b417b20774c","from":"Qm7Ugni6jFRpfbPkzhXzXH","reqId":1521070797707610},"type":"0"},"txnMetadata":{"seqNo":22,"txnTime":1521070797},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"FzUUYiVKCDnSWd77NHfhpZ","value":"3Q3ijuEPihRyGsZFvmb414AWWQ7iMskCHoP7bC14FgPesNdPNY3pdfddEfPf5FrCg4wzdvdAFjKaBunHHwXCG4V3"}]},"txn":{"data":{"data":{"alias":"TNO","blskey":"37d7DmcwGWM7yfnpwLGzwVy6zZwoc6cAgeeSJFBWbVh6jq5tP8dPf7s2XDxxtWafmr1JdyzycBcNztEsE8Uf9qX2jRoXzhCnjEEYJCAByEn5hWC2VQ9EqkuKzq28Vob7Piof7rEJeUPxuBZtrXL1khyTN2waQtix6CYtv9QejNPZVJ2","client_ip":"134.221.127.143","client_port":9702,"node_ip":"134.221.127.143","node_port":9701,"services":["VALIDATOR"]},"dest":"TZxmZoXwNk1X5o48pXqbDFz6mTJT5QkiRme9z5p86KQ"},"metadata":{"digest":"0f3b44855c6f562b17321efe51f00edab1cdbe8608c667669e8085430fa32cc5","from":"FzUUYiVKCDnSWd77NHfhpZ","reqId":1521195244613677},"type":"0"},"txnMetadata":{"seqNo":23,"txnTime":1521195244},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"3jN1g2dAPKx5giEKnc5k9GiYHBw5yFZD8D8GiuFBL7wuHUDabobCeCCDezboxqkCpHSLsVE5hDzq6RQWUKwHXwv1"}]},"txn":{"data":{"data":{"alias":"Stuard","services":[]},"dest":"C4e4rEwPZ4bM341VEL9ysnAgBiMW42RH3UmbriPuzoCb"},"metadata":{"digest":"f24b5dda0fe64addafbbdd67aa2be5731064d6c6215d56e883e67009df0ce0d8","from":"6feBTywcmJUriqqnGc1zSJ","reqId":1521760233710703},"type":"0"},"txnMetadata":{"seqNo":24,"txnTime":1521761250},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"5omTkQAe1LmYQfY4PdYf3YEjVM1jBs2Qr8x8LAhghD3ymeudEvm1dyk3nQtEtNzFvAeGhnajWMA862DWM4Hg51vv"}]},"txn":{"data":{"data":{"alias":"Aalto","services":[]},"dest":"7JYQmTE6mBxa5RAZwXAj4bxqetAy64tcEUShqzJjLRrE"},"metadata":{"digest":"f526af4c7569c941f69f1fb2dc3ad6ef98bdef2aa2aceca33d43dc92900d65bb","from":"6feBTywcmJUriqqnGc1zSJ","reqId":1521822633807532},"type":"0"},"txnMetadata":{"seqNo":25,"txnTime":1521822633},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"4YtbkvnTMfMA6d9FjkjBcueFGq5PnLoHFKn8HAGiLKxcob2QM6KsdwLRapQcbtn9N33NimyeFzrHCerzAcbS8fVq"}]},"txn":{"data":{"data":{"alias":"pcValidator01","services":[]},"dest":"5fKwygs8KEGoUPGa65qz1oCm7h6Fb7HrML9r4jmZ9cic"},"metadata":{"digest":"f0986bab87b08031cfaeb58a06e27e8c1214f4c20af0e26c709c1c3970c0b241","from":"6feBTywcmJUriqqnGc1zSJ","reqId":1521825598199425},"type":"0"},"txnMetadata":{"seqNo":26,"txnTime":1521825598},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"G4zXq8L7L8n73WKSVv2HxY","value":"5kkkxWBUmYYcrFSKQcgaAEhcsiwJft74Js5VpwBzL1ssfFJRJgDdjhW27hZRCao994DW5b17Xgw6UqSyBLP7UmyD"}]},"txn":{"data":{"data":{"alias":"NewtonD","services":[]},"dest":"HU8AkmtsqvcfEtvdWAZgZZFfvKYH8vu2YdgkkHrmNDGP"},"metadata":{"digest":"e2d73bb8154e3372fa0c8d57c1383c2b4710308198a76580f15ce2c3ffd5f204","from":"G4zXq8L7L8n73WKSVv2HxY","reqId":1521831913747645},"type":"0"},"txnMetadata":{"seqNo":27,"txnTime":1521831913},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"G4zXq8L7L8n73WKSVv2HxY","value":"4L9AFEy3gdV1KNHsuG4gWSuETzTmJ2aD5TzSdWiQCm13o6GfNAY8YoemyiTiwnX8mzxdghgc38CLhEBm3DwfC3Dv"}]},"txn":{"data":{"data":{"alias":"NewtonD","services":["VALIDATOR"]},"dest":"HU8AkmtsqvcfEtvdWAZgZZFfvKYH8vu2YdgkkHrmNDGP"},"metadata":{"digest":"d83f3622a59d8fe15448389a185752add786de3eaf0cabfc17cea86dc503c2a5","from":"G4zXq8L7L8n73WKSVv2HxY","reqId":1521833231516195},"type":"0"},"txnMetadata":{"seqNo":28,"txnTime":1521833231},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"xzjjfKfJJJeQxZb5WhMYyHDcDG5dZCAvsYmBh6FtP9J1ckQUazaJ7AC2ksHzjARW9kkcFBS4B1M4R7y5Bc3BN5S"}]},"txn":{"data":{"data":{"alias":"TNO","services":[]},"dest":"TZxmZoXwNk1X5o48pXqbDFz6mTJT5QkiRme9z5p86KQ"},"metadata":{"digest":"03c5763b3be5b2c53be3f2af041071bdb2f2aa08754adbdcebbcbbe055036cd6","from":"6feBTywcmJUriqqnGc1zSJ","reqId":1522073964061797},"type":"0"},"txnMetadata":{"seqNo":29,"txnTime":1522073964},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"nm4hZxHEb86rDjHddyuFgnuy7hS7bf1Biifnje3c75Kgn1eQ5frc9xwVWFUzZNFntfVckXQK3U97wRiiP7MrijK"}]},"txn":{"data":{"data":{"alias":"NewtonD","services":[]},"dest":"HU8AkmtsqvcfEtvdWAZgZZFfvKYH8vu2YdgkkHrmNDGP"},"metadata":{"digest":"a81744dd61919ea58d75904a8d6921be18362cecb174e3d5f318384c99d912c2","from":"6feBTywcmJUriqqnGc1zSJ","reqId":1523554207793968},"type":"0"},"txnMetadata":{"seqNo":30,"txnTime":1523554207},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"LKjUWXR3QpGsMkgB2XFyzt","value":"671v9pVTeRwN4XybdY5tjGyJZCNhGPFq3bcBxymCGJ18EQbBdDa6LXGh3brvWQ53yncspYbywrgC7eGknnqYR2GB"}]},"txn":{"data":{"data":{"alias":"VeridiumIDC","blskey":"2HhwAzNXb6qrptphzJKiAYqGtE6dNNcK8Q33EJU8hNnAhvjC4X1Bk65MbgvPMpn4rP9HZAH78StG12HfU6VyLd6JBbp6gkgwvtXUK1QefTEGcRipj3XnVJ7tjU8KzxWqaZQW5exJQQQhmedCKZphKvvnb2wuVcoBVS3Ad3ZLm2d4apo","client_ip":"18.197.183.58","client_port":9702,"node_ip":"18.197.183.58","node_port":9701,"services":["VALIDATOR"]},"dest":"58uCeMaEiMHSi8MdEdcgVbpmzMKmiLSYCEz1vxPGJND6"},"metadata":{"digest":"64a71eb01fc9becdbea811aa449d9a588c22b47e7d7434b4dae437bf8153303f","from":"LKjUWXR3QpGsMkgB2XFyzt","reqId":1524737343827561},"type":"0"},"txnMetadata":{"seqNo":31,"txnTime":1524737343},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"RtMtkBrkHCEDtGXXqRfGoV","value":"3ontWhK6hYCpGx8DgirvihSqDarZUTQ3NacwtC4okP2BNpF1xp6tzjnx6iigt8kgaRSGPacXL93AHVXeS6fvQ41t"}]},"txn":{"data":{"data":{"alias":"oregon","blskey":"2bQaqiLhyAEJh6t1xhC3jKk5PRc7v8AsEH9dxSjgVvBqwrmoiDKfSmJKBXA9kCT1uQkpaGeYyP4bkb3RA1ABYebqcswkjdVUGRZYqyxasdBD2phUbNm6WNaGtyRkhJ265KZ7YP8QaDS3NCwTXT7b8vMNmaTL8Kd1Buvaq7gS3ZLJXU6","client_ip":"18.236.138.206","client_port":9702,"node_ip":"18.236.138.206","node_port":9701,"services":["VALIDATOR"]},"dest":"4wdqCSyPeiqCbQhjsbP9Xjasm7vuU7ithawkpuoBXCBM"},"metadata":{"digest":"add1f55e950e2411deecd700285802fd154fc68668e2020df9e97cad47d79491","from":"RtMtkBrkHCEDtGXXqRfGoV","reqId":1524852414943816},"type":"0"},"txnMetadata":{"seqNo":32,"txnTime":1524852415},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"2XCnRcUZJH2JEzotFHTqin","value":"5g4zsXjPumLMTVb8rCYoALeERtgue7qq6uda1vxA2wywZc5VDLBmrJbguwMztdXLCJQKg3qbu8bcYdJUERNdX1Bq"}]},"txn":{"data":{"data":{"alias":"findentity","blskey":"4jBpQMFjEabdTHArLHAbidwcaR5o7p4fAuYbfxrtypZtDbsDACj5mZRFVvkXy5F84g7ni6yNMfL5JV1E3qXYsg3fw33Jd3MTRyAGrZZmN3zNEq6WDNT8XQsaDasDUebJaTEmRWVKMZc8BbeipCPBjym2NvfAQyib1ywZZ5B8d7m5XXH","client_ip":"172.31.28.111","client_port":9799,"node_ip":"172.31.46.137","node_port":9700,"services":["VALIDATOR"]},"dest":"5bQhBNkoFKCFAtCxe1vcXBoq6FsnJ3nWKYwUfyVS3129"},"metadata":{"digest":"dcdd47c5bcffd8aeee8b281ed78b57eef5e3ba617f905885c0c7b356f07ab00a","from":"2XCnRcUZJH2JEzotFHTqin","reqId":1525741289118866},"type":"0"},"txnMetadata":{"seqNo":33,"txnTime":1525741289},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"2XCnRcUZJH2JEzotFHTqin","value":"4wTCrfhT5wzBLpEkadt2UP21kPxiPJPWoKUKs3VSGAsi2427aJbTzPMFokSpPukfEHqMikGCeXP95kPZ5eRKazBy"}]},"txn":{"data":{"data":{"alias":"findentity","blskey":"4jBpQMFjEabdTHArLHAbidwcaR5o7p4fAuYbfxrtypZtDbsDACj5mZRFVvkXy5F84g7ni6yNMfL5JV1E3qXYsg3fw33Jd3MTRyAGrZZmN3zNEq6WDNT8XQsaDasDUebJaTEmRWVKMZc8BbeipCPBjym2NvfAQyib1ywZZ5B8d7m5XXH","client_ip":"34.211.203.16","client_port":9799,"node_ip":"34.218.164.50","node_port":9700,"services":["VALIDATOR"]},"dest":"5bQhBNkoFKCFAtCxe1vcXBoq6FsnJ3nWKYwUfyVS3129"},"metadata":{"digest":"0581a913d81b117dc6f5eb67e6faf734f838a9d6dd2f2a550edb620940ed522c","from":"2XCnRcUZJH2JEzotFHTqin","reqId":1525799946176362},"type":"0"},"txnMetadata":{"seqNo":34,"txnTime":1525799946},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"RtMtkBrkHCEDtGXXqRfGoV","value":"2EQyW1W3EVq9Qkr6Dnk1baDeE8vPcDxgPoZdKkxnKYWLdi27NLvzjziUZ2Ckeuw4MqhDdBeafW36DMQo4fDzkjBT"}]},"txn":{"data":{"data":{"alias":"oregon","services":[]},"dest":"4wdqCSyPeiqCbQhjsbP9Xjasm7vuU7ithawkpuoBXCBM"},"metadata":{"digest":"cb346aa8a0234819aa63b5c63cf7928fbbc171f1b3c00e345c24fa3f4f1e9636","from":"RtMtkBrkHCEDtGXXqRfGoV","reqId":1526508235374190101},"type":"0"},"txnMetadata":{"seqNo":35,"txnTime":1526508235},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"YHTFcv8P93i35osabNm99n","value":"2X7YznzieZ1Kc6nzWawdQHG5Z8jV8vNiwHq5BBLn8rY6SGXQCSZhichDp5V7n9he64BKoYxU6YLHuNM2DLSsEvmG"}]},"txn":{"data":{"data":{"alias":"amihan-sovrin","blskey":"14Kn3VBKja9pDCUgoVpMzf4c9rXJpvDsaHrnXkB9WtvNMHPihinjiXUNNuKdVuYiai3iTDe7mjH5o2UjfoKyApdjEgGCKqgDKpH6uzH4ZcUekR5pfe4wC172X5tiBQFScm8Ti1VmqTnUdfvGi4rV4NpBGytPMkZE1qhL1WSDCoi8riW","client_ip":"35.187.226.254","client_port":9702,"node_ip":"35.197.150.130","node_port":9701,"services":["VALIDATOR"]},"dest":"2FZAgVmRC87ZbJXSh6seFi6n7AMfBo9HaCh8HseHi37U"},"metadata":{"digest":"2986a38eaa64cee8ebfa7e5184bc98949a57555bef663ab125f83603371d6591","from":"YHTFcv8P93i35osabNm99n","reqId":1528165772663287},"type":"0"},"txnMetadata":{"seqNo":36,"txnTime":1528165772},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"5kJFNauix1UPNtii8g8ahpfmEyJaoAPnFXdeSpJ9Ge3GaaLhWM3Hmr9N8ACdf6Wrs8Yg1pkXLRwmBTuDSvJDe3A"}]},"txn":{"data":{"data":{"alias":"ibm","services":[]},"dest":"Eq7m7GMFKPeq5Ek3HH1PkHxzZ46R9VL1Eube3U9wfjp5"},"metadata":{"digest":"ecd93c53a03d0da0e011973c7c4312e4b5426390930247aa48aca2b70550c2be","from":"6feBTywcmJUriqqnGc1zSJ","reqId":1528236888174137},"type":"0"},"txnMetadata":{"seqNo":37,"txnTime":1528236888},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"PRCWCTWYwGJB7rczzTqBBB","value":"5nJ3vmmFxC1qHjvSWFHLvhqyRtEmxo4Z2SMpuS2U5snEShd1ZMP22eDyd1nDgPJUHRAMuYM519eMoLw4Kj4CqZgf"}]},"txn":{"data":{"data":{"alias":"valNode01","blskey":"24cgjd77KER8uzhxb1c3DbecvrSMQd3nYxBjaJTqLkgBPuAizzoFdXQkdb8LNjgnP27hTHCpLSuatQSE2YYexNXqZDtAUqPMNfsZwAU151kYFfCc6ZWLRzsm4irf4PrS5ZpnSmhT3Ta4c3m12zoTmu3FDxUkJwEBC3ubdNdA8EHcVDz","client_ip":"52.43.138.62","client_port":9702,"node_ip":"52.43.138.62","node_port":9701,"services":["VALIDATOR"]},"dest":"AYQcyJvowniMsxU9P93yzyAPCFUxg7hm1xsXitFoBr6z"},"metadata":{"digest":"5b05dceab82e7288a1003793f0b4ff642284a021b3c5746b5d799b116068428e","from":"PRCWCTWYwGJB7rczzTqBBB","reqId":1528316277953334},"type":"0"},"txnMetadata":{"seqNo":38,"txnTime":1528316278},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"PRCWCTWYwGJB7rczzTqBBB","value":"4FHNA9VCJHMNUssRyaQYFsn6SVQdSddSg2BxRDFp1aurDAMY4o925WCGmoYLeNwMkf34w6nF5NrNHVhXSmPBZUs3"}]},"txn":{"data":{"data":{"alias":"valNode01","blskey":"24cgjd77KER8uzhxb1c3DbecvrSMQd3nYxBjaJTqLkgBPuAizzoFdXQkdb8LNjgnP27hTHCpLSuatQSE2YYexNXqZDtAUqPMNfsZwAU151kYFfCc6ZWLRzsm4irf4PrS5ZpnSmhT3Ta4c3m12zoTmu3FDxUkJwEBC3ubdNdA8EHcVDz","client_ip":"54.214.176.123","client_port":9702,"node_ip":"54.214.176.123","node_port":9701,"services":["VALIDATOR"]},"dest":"AYQcyJvowniMsxU9P93yzyAPCFUxg7hm1xsXitFoBr6z"},"metadata":{"digest":"b2a209bb10c902c01167e24e7f876ea2359356d43772f37cddefe42f5adf8c58","from":"PRCWCTWYwGJB7rczzTqBBB","reqId":1532033264248749},"type":"0"},"txnMetadata":{"seqNo":39,"txnTime":1532033227},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"tkPNgpHinWAPXvkbvnphC54pauknphTCMF5gzG5AHT1EUHJGS3bQnDi7UKNEYKAjujExWYJAHtM5iydk26yatBK"}]},"txn":{"data":{"data":{"alias":"valNode01","services":[]},"dest":"AYQcyJvowniMsxU9P93yzyAPCFUxg7hm1xsXitFoBr6z"},"metadata":{"digest":"a8eebd86b4cc9aa422f1fc3e6950def9498e7f51b1d9a720ba68413e53ccfbe9","from":"6feBTywcmJUriqqnGc1zSJ","reqId":1532035631471362345},"type":"0"},"txnMetadata":{"seqNo":40,"txnTime":1532035631},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"Psfx4mLS23gBvZDoWz336H","value":"5VVAPQH1LaZmJ4XG1kKxnmUXawg9nTVc1kwULndbFR9yk19mT3vaM9DES342cBYmrpXuY8zQwsXHk4kSoBqZvezi"}]},"txn":{"data":{"data":{"alias":"trustscience-validator01","blskey":"2ToF3Pfb78JQ3pFs6mYxtofDnHLTBLP2RKCDfn6eVngN4zh4UiHvz9DuUS2dfTpAeZLqBDkKuU9pYRazeDN9fqWgzk6kgZYf8jeWgra7rk33ZbZjHFz1zQjNMk3eju5n9JNY4AFbUcXCTWCdFoSXF9fEySKuNANPqtFNz92H2VjrySF","client_ip":"54.214.176.123","client_port":9702,"node_ip":"54.214.176.123","node_port":9701,"services":["VALIDATOR"]},"dest":"8Tqj57DbizpjWQCHvybtKNqKFgfw2bjJbPZrhHDoRoND"},"metadata":{"digest":"d2612092e47da9a0bfb8c9367d0149927abe50aca98ed127b8cfd9b5975b290b","from":"Psfx4mLS23gBvZDoWz336H","reqId":1532121668250427244},"type":"0"},"txnMetadata":{"seqNo":41,"txnTime":1532121629},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"5gVt2TSEFpJHWN3BwMn1YgcURpxtGfijmXjGu6Cf5CXkwTmTp4dhUN5Ue6WFZU7PcKSrKfu8PvroWPHCiP7AsMvL"}]},"txn":{"data":{"data":{"alias":"amihan-sovrin","services":[]},"dest":"2FZAgVmRC87ZbJXSh6seFi6n7AMfBo9HaCh8HseHi37U"},"metadata":{"digest":"4141b470e5def16f7fde7c3ee5efc02f712bc0e5260a59709385417047516736","from":"6feBTywcmJUriqqnGc1zSJ","reqId":1532979260947795461},"type":"0"},"txnMetadata":{"seqNo":42,"txnTime":1532979261},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"4A2vM1MT3vxNdASCpxgYfzNajpYScAipcRoSyUaRkH9dZ4CmfhHjWogS7VF7WLRNXKUssQVG2DdLrUzuFEckaM6e"}]},"txn":{"data":{"data":{"alias":"findentity","services":[]},"dest":"5bQhBNkoFKCFAtCxe1vcXBoq6FsnJ3nWKYwUfyVS3129"},"metadata":{"digest":"06ee3b89112f96f93df9f91554b5f4ada39ef34dbc4dd198ab7bc60e0d2f0c57","from":"6feBTywcmJUriqqnGc1zSJ","reqId":1532979375523513444},"type":"0"},"txnMetadata":{"seqNo":43,"txnTime":1532979375},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"5tqAZojtpBxCaTkLvX6Why6MYyofYTUEt8taHxyXRBPrDugsCZjM5aRxEwXak7qNuUJGt2x9LMfVLdB81rk8yR2e"}]},"txn":{"data":{"data":{"alias":"VeridiumIDC","services":[]},"dest":"58uCeMaEiMHSi8MdEdcgVbpmzMKmiLSYCEz1vxPGJND6"},"metadata":{"digest":"aca82cab749e9d722134d46f0891269fcae59b7fd065fb3155dd632e2f740322","from":"6feBTywcmJUriqqnGc1zSJ","reqId":1532979478035983569},"type":"0"},"txnMetadata":{"seqNo":44,"txnTime":1532979478},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"BD95LAmfVrD3JEwaereykM","value":"5wXZxmiE9PJaidic57FXGfTWjJCuEidh3FBRWMBjhg47JsBxJvoCVuGi7LMYYd7Wj5AdqLqLUC6oL7hKbEPmKr3b"}]},"txn":{"data":{"data":{"alias":"ibmTest","blskey":"232Z7DQcjp5NPVZyzR6WWH9w9829F4NPBz87sx2LHZBnv2xntpaixyUc7J5hUtwnYgL7HyEZsf3Wgtdr5sGua7jhpJzixxtR2p4KoRZ48i62wA9Y5mJ4FmXBg3GxMwbegc2Nmqg33CGjB8cDGUZwR1jBERdZdsi3Y4CL9e9NsBqUu5C","client_ip":"169.61.131.234","client_port":9702,"node_ip":"169.61.131.234","node_port":9701,"services":["VALIDATOR"]},"dest":"7mcctKwaBjyzAbNPS8ix1LTNxex4JchkyLvjYfw2XexR"},"metadata":{"digest":"ef3b5b33492990611a2d443d579681be95f504f1f82b4e9b6015418a72b5620d","from":"BD95LAmfVrD3JEwaereykM","reqId":1535389152858873},"type":"0"},"txnMetadata":{"seqNo":45,"txnTime":1535389153},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"PRCWCTWYwGJB7rczzTqBBB","value":"2PrAKjgg1itZrkaaa5YipCgtTKyeczeSrm8HfHUfu6n5raMPmHLCkzoYWcaHUYjMpL2LHrnhPhdG6HhCJgRbQgoj"}]},"txn":{"data":{"data":{"alias":"valNode01","blskey":"24cgjd77KER8uzhxb1c3DbecvrSMQd3nYxBjaJTqLkgBPuAizzoFdXQkdb8LNjgnP27hTHCpLSuatQSE2YYexNXqZDtAUqPMNfsZwAU151kYFfCc6ZWLRzsm4irf4PrS5ZpnSmhT3Ta4c3m12zoTmu3FDxUkJwEBC3ubdNdA8EHcVDz","client_ip":"127.0.0.1","client_port":9702,"node_ip":"127.0.0.1","node_port":9701,"services":[]},"dest":"AYQcyJvowniMsxU9P93yzyAPCFUxg7hm1xsXitFoBr6z"},"metadata":{"digest":"7f244345a273550cf1cbeee4a41a5917fe17947c355917c9c2c235de63d3a2e4","from":"PRCWCTWYwGJB7rczzTqBBB","reqId":1537808479067559676},"type":"0"},"txnMetadata":{"seqNo":46,"txnTime":1537808338},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"Psfx4mLS23gBvZDoWz336H","value":"3rywzxRvJAiFsuFmEayMxKxxsJDeLAWYM5t1Jxw4vNt9RAuh5WwcAUmcD1Un6urHMMBadpkxGVMyTHFca4jBAZTc"}]},"txn":{"data":{"data":{"alias":"trustscience-validator01","blskey":"2ToF3Pfb78JQ3pFs6mYxtofDnHLTBLP2RKCDfn6eVngN4zh4UiHvz9DuUS2dfTpAeZLqBDkKuU9pYRazeDN9fqWgzk6kgZYf8jeWgra7rk33ZbZjHFz1zQjNMk3eju5n9JNY4AFbUcXCTWCdFoSXF9fEySKuNANPqtFNz92H2VjrySF","client_ip":"127.0.0.2","client_port":9702,"node_ip":"127.0.0.2","node_port":9701,"services":[]},"dest":"8Tqj57DbizpjWQCHvybtKNqKFgfw2bjJbPZrhHDoRoND"},"metadata":{"digest":"01bea8a952895652f4ff5fed121fbab75fc5bea0cf4a5b905324efa944a5ba97","from":"Psfx4mLS23gBvZDoWz336H","reqId":1537818353199012189},"type":"0"},"txnMetadata":{"seqNo":47,"txnTime":1537818211},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"MHrp2wUhk1quHK9kGCcQtX","value":"4meKCAvuw588qWkDMy1pXvMtt4X6YK4hiQArsxEJ7wrY84JL9ZAN1efBby4BLZvQcE2Lx7kP9mrhsrAdBGXM8hCK"}]},"txn":{"data":{"data":{"alias":"trustscience-validator02","blskey":"2f8SF5UdftJkr19X7TQxtcy7EiP1MLLxnT4sppJuFfuprEKxdtRq2BbkyRF24Xbdd5tfWkf9MsPBs7aWqrNcoCjbL5hsawUmPy7tjWtZLhLgKYtKxfFtPFJETtTLaaUhyrnjNwYa7GoTBYKMdv72ZL1fjZjo3EK6jx3H6fohvSVK98P","client_ip":"54.214.176.123","client_port":9702,"node_ip":"54.214.176.123","node_port":9701,"services":["VALIDATOR"]},"dest":"2p77huA99n3pmj5hxYapzXMrEgATHAoQX2CkxS4TNya7"},"metadata":{"digest":"30ef842e8ccb04aa4051d12d3a565d921892a7f79254398eb9ab3b8ced265ece","from":"MHrp2wUhk1quHK9kGCcQtX","reqId":1537821923451170792},"type":"0"},"txnMetadata":{"seqNo":48,"txnTime":1537821782},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"2Tk12rX3eU93zqCGe5oeAH7WvudtqwLA9cK2Cg2UbirMhEh2YL7oR68SqMZDhvKDyeRtViLwbhNcfoSARGucm7yo"}]},"txn":{"data":{"data":{"alias":"trustscience-validator02","services":[]},"dest":"2p77huA99n3pmj5hxYapzXMrEgATHAoQX2CkxS4TNya7"},"metadata":{"digest":"8cf0e8b8db40d79a7019f1642de1f85764532b5ee7f6cd3a40872d7317632f3d","from":"6feBTywcmJUriqqnGc1zSJ","reqId":1538150155109252223},"type":"0"},"txnMetadata":{"seqNo":49,"txnTime":1538150957},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"QuCBjYx4CbGCiMcoqQg1y","value":"SkAWnEADFvzxgtnWiEYrdZQivjX587hu1rBq1HgzVBubQAS8NaNcj8FEFYWLgtcYj91wdcNnSrx5aCC8nHRpfAH"}]},"txn":{"data":{"data":{"alias":"xsvalidatorec2irl","blskey":"4ge1yEvjdcV6sDSqbevqPRWq72SgkZqLqfavBXC4LxnYh4QHFpHkrwzMNjpVefvhn1cgejHayXTfTE2Fhpu1grZreUajV36T6sT4BiewAisdEw59mjMxkp9teYDYLQqwPUFPgaGKDbFCUBEaNdAP4E8Q4UFiF13Qo5842pAY13mKC23","blskey_pop":"R5PoEfWvni5BKvy7EbUbwFMQrsgcuzuU1ksxfvySH6FC5jpmisvcHMdVNik6LMvAeSdt6K4sTLrqnaaQCf5aCHkeTcQRgDVR7oFYgyZCkF953m4kSwUM9QHzqWZP89C6GkBx6VPuL1RgPahuBHDJHHiK73xLaEJzzFZtZZxwoWYABH","client_ip":"52.50.114.133","client_port":9702,"node_ip":"52.209.6.196","node_port":9701,"services":["VALIDATOR"]},"dest":"DXn8PUYKZZkq8gC7CZ2PqwECzUs2bpxYiA5TWgoYARa7"},"metadata":{"digest":"c1633443684eed4d621235388d23e6adf0264658bed09e26fd9ac41026fa4dde","from":"QuCBjYx4CbGCiMcoqQg1y","reqId":1540910673107959938},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":50,"txnTime":1540910673},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"FzAaV9Waa1DccDa72qwg13","value":"3q94ydPoBiKq7oBjAt5gTrdLDWagXn2GMGBXa1Shpd8FFqg25tXrkYBDvn1a81rN6E3bc9e9gUJwXNg3CZUBNYG6"}]},"txn":{"data":{"data":{"alias":"vnode1","blskey":"t5jtREu8au2dwFwtH6QWopmTGxu6qmJ3iSnk321yLgeu7mHQRXf2ZCBuez8KCAQvFZGqqAoy2FcYvDGCqQxRCz9qXKgiBtykzxjDjYu87JECwwddnktz5UabPfZmfu6EoDn4rFxvd4myPu2hksb5Z9GT6UeoEYi7Ub3yLFQ3xxaQXc","blskey_pop":"QuHB7tiuFBPQ6zPkwHfMtjzWqXJBLACtfggm7zCRHHgdva18VN4tNg7LUU2FfKGQSLZz1M7oRxhhgJkZLL19aGvaHB2MPtnBWK9Hr8LMiwi95UjX3TVXJri4EvPjQ6UUvHrjZGUFvKQphPyVTMZBJwfkpGAGhpbTQuQpEH7f56m1X5","client_ip":"159.89.118.181","client_port":9797,"node_ip":"206.189.143.34","node_port":9797,"services":["VALIDATOR"]},"dest":"9Aj2LjQ2fwszJRSdZqg53q5e6ayScmtpeZyPGgKDswT8"},"metadata":{"digest":"6815d516eead933d1163295ac5a1b34ef14fc842d5779a4de23847f5d3652f22","from":"FzAaV9Waa1DccDa72qwg13","reqId":1541014309248416875},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":51,"txnTime":1541014309},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"bPTNiLzWPFHKr7mJGaump","value":"2Vq2bzfip9c3Zo1b5f9ZEffw1bD3jfWtphJd52Gov6opBcewVQWHcS912J251LTmx1YfNydAYWtL2EYQKuS4EXXm"}]},"txn":{"data":{"data":{"alias":"sovrin.sicpa.com","blskey":"2j7jqdynFph7cbSwYgKYfzHKsVcQRfYxCU9AdhTAN8gUV8oFrnuPz348zLX8AMiEt85pKGw97FcACcDTJAGABvwCcXFNXNFGTN2U14JkRcg7yNuHFSWWgmdc1aBQJcJA5ZEtPgq2n47W14L3Y23LUv9E2CLViKUKv6nZqfrEeJi7zUE","blskey_pop":"RHxpCSQFv6Xso4JiEyt9jdTm6J3XUCh1SWy4g6hDsVWYqgrJEeLoXaYBBayB7fi6bDbUPuJVbVYPMA4HNA5eRwagc34gr8JhddgJupLxgzowkKkJa1WEm5vDNwqUfH7JihwwEzUPcmNTjnhGiovhRH4v8Mf1uPyzyS5AHsH8qNbrfZ","client_ip":"194.209.53.115","client_port":9777,"node_ip":"194.209.53.116","node_port":9778,"services":["VALIDATOR"]},"dest":"AcaN2zJ1vkQyEvmi2EyUMLzvzczQRvarNPjR2CbtNFAX"},"metadata":{"digest":"c94bdafaea83c5668ac61ee754f7de174d90015049a539ddc969a165f6abf871","from":"bPTNiLzWPFHKr7mJGaump","reqId":1541412365363342035},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":52,"txnTime":1541412365},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"bPTNiLzWPFHKr7mJGaump","value":"NUDC81qrSL5kkiwh4ZmUZ4NepE8sNPLtb3Qii41yiBu1kkudhEBct3Y3TtxJetyfhDmJPiSyWBmBUNxisP4L15t"}]},"txn":{"data":{"data":{"alias":"sovrin.sicpa.com","blskey":"2j7jqdynFph7cbSwYgKYfzHKsVcQRfYxCU9AdhTAN8gUV8oFrnuPz348zLX8AMiEt85pKGw97FcACcDTJAGABvwCcXFNXNFGTN2U14JkRcg7yNuHFSWWgmdc1aBQJcJA5ZEtPgq2n47W14L3Y23LUv9E2CLViKUKv6nZqfrEeJi7zUE","blskey_pop":"RHxpCSQFv6Xso4JiEyt9jdTm6J3XUCh1SWy4g6hDsVWYqgrJEeLoXaYBBayB7fi6bDbUPuJVbVYPMA4HNA5eRwagc34gr8JhddgJupLxgzowkKkJa1WEm5vDNwqUfH7JihwwEzUPcmNTjnhGiovhRH4v8Mf1uPyzyS5AHsH8qNbrfZ","client_ip":"194.209.53.116","client_port":9778,"node_ip":"194.209.53.115","node_port":9777,"services":["VALIDATOR"]},"dest":"AcaN2zJ1vkQyEvmi2EyUMLzvzczQRvarNPjR2CbtNFAX"},"metadata":{"digest":"f7e6c28166e69edb0468869fed131fbca344db0943f020cfb8e0137703401922","from":"bPTNiLzWPFHKr7mJGaump","reqId":1541432813752945620},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":53,"txnTime":1541432814},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"5UzHhjZMh4N3w6zSK22RTzb6qFpLijjRgDkCT4XxnJYPYrW7erByfJf2FLkmR4LcdSDrSw4hkFuoH5dkPXpfFZzo"}]},"txn":{"data":{"data":{"alias":"xsvalidatorec2irl","services":[]},"dest":"DXn8PUYKZZkq8gC7CZ2PqwECzUs2bpxYiA5TWgoYARa7"},"metadata":{"digest":"ecdfec24f95a4ef3590f9024f1ce46fa4d8ef2288048c89f18d16822d34f517a","from":"6feBTywcmJUriqqnGc1zSJ","reqId":1541451340102642933},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":54,"txnTime":1541451340},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"3Ygb9RCqsT3SwxpMx2WWrCk9W9pKCpg9qjQkERhKhZuCeEjc1C2YEnf3KtrkCxEVg1xti4gh5kCW97apU53jXBRa"}]},"txn":{"data":{"data":{"alias":"vnode1","services":[]},"dest":"9Aj2LjQ2fwszJRSdZqg53q5e6ayScmtpeZyPGgKDswT8"},"metadata":{"digest":"e7190621d62f017add97a35214ffe39c2820600e91eb7738ac1b6be14be7f7d2","from":"6feBTywcmJUriqqnGc1zSJ","reqId":1541451384934782442},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":55,"txnTime":1541451385},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"34p6FetGiBaiF9rste9tU4bxjDa6jMhPr8drGFfWMfcDBeHrwu4mMdZBGq3RPpaD7G3E74EkgVNA65mPvTG7s7om"}]},"txn":{"data":{"data":{"alias":"sovrin.sicpa.com","services":[]},"dest":"AcaN2zJ1vkQyEvmi2EyUMLzvzczQRvarNPjR2CbtNFAX"},"metadata":{"digest":"c3ec6df9998e376a2b31a4e8bf2f951eaa9779cbfa5b6eed166501f0c0fff6c7","from":"6feBTywcmJUriqqnGc1zSJ","reqId":1541451415119667684},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":56,"txnTime":1541451415},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"FzAaV9Waa1DccDa72qwg13","value":"2GDovjbZyz2rh3rzFpmgqM9TycCxNhbW5esiYXgnkqj43QWz9dwCY5Jv7fSKdmEKK2EiJBuFKt7W8PZZFKyrMuqZ"}]},"txn":{"data":{"data":{"alias":"vnode1","blskey":"t5jtREu8au2dwFwtH6QWopmTGxu6qmJ3iSnk321yLgeu7mHQRXf2ZCBuez8KCAQvFZGqqAoy2FcYvDGCqQxRCz9qXKgiBtykzxjDjYu87JECwwddnktz5UabPfZmfu6EoDn4rFxvd4myPu2hksb5Z9GT6UeoEYi7Ub3yLFQ3xxaQXc","blskey_pop":"QuHB7tiuFBPQ6zPkwHfMtjzWqXJBLACtfggm7zCRHHgdva18VN4tNg7LUU2FfKGQSLZz1M7oRxhhgJkZLL19aGvaHB2MPtnBWK9Hr8LMiwi95UjX3TVXJri4EvPjQ6UUvHrjZGUFvKQphPyVTMZBJwfkpGAGhpbTQuQpEH7f56m1X5","client_ip":"206.189.143.34","client_port":9796,"node_ip":"206.189.143.34","node_port":9797,"services":["VALIDATOR"]},"dest":"9Aj2LjQ2fwszJRSdZqg53q5e6ayScmtpeZyPGgKDswT8"},"metadata":{"digest":"bf0cdbb6b134fc10fd7797fa24f4354a9e9d70dbc92570d23267e151299b24b4","from":"FzAaV9Waa1DccDa72qwg13","reqId":1541618294089244398},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":57,"txnTime":1541618294},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"Bt44zXEB8HkNHJ8mSGq8Hap4xq6QBo1YECwDscH8aoKocmE8LpDKs9nAwUxu5qrtRNHfj9n1bSeTAq593BT43T6"}]},"txn":{"data":{"data":{"alias":"xsvalidatorec2irl","services":["VALIDATOR"]},"dest":"DXn8PUYKZZkq8gC7CZ2PqwECzUs2bpxYiA5TWgoYARa7"},"metadata":{"digest":"59a07975ea03cca3db85c06f0e12a7095df449c56326f470aab9a5f473c4b41d","from":"6feBTywcmJUriqqnGc1zSJ","reqId":1541715283104974168},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":58,"txnTime":1541715283},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"TK4JebQqeqq5t6x2bCwnD7","value":"MC5fG4DowNdB23vHXydtT4f7n1k6wcyZyPA7m3aVZWYfKVT7bwGKWqzmKWGAr1QNm3dkcL2MLVE11ALQsCcFpEt"}]},"txn":{"data":{"data":{"alias":"NodeTwinPeek","blskey":"Jrbf7k1xgkbhfKAmVXqfLLmFieGrxL1f1H6WRBZVB4Rvh8uCHGVoVzMppygH2XPLK4n1cnaBKe7zYxftgMaYXka1HLaScfsVCGqpkSa7d2hzerpcvPQMvo9TCCTP3jWb6uC9kVUHZkVqVvecMDtRkVqr3ZChUAoTM2e4UGmgqvE3Zk","blskey_pop":"RY3ZXV5WoHWMM631ov7ZMWoTX41Cnah4CrwQnXFrPHt49ajB8b5AjnrSDxCb9JEhC8WLVveuQMH7p6FJfoQHRaG2tR9pQLgLCXvbDozYPin4LwVzV3Wh2LNMorAtJgr3PfqxzUmFNEkbiGAbzMdBS1EXbDya9exgrLkrMLuLG1crLw","client_ip":"178.32.102.66","client_port":9782,"node_ip":"87.98.136.246","node_port":9781,"services":["VALIDATOR"]},"dest":"2bDviHYdDiTjyXYXEW92zQHEf1C1QsbFatJ6uSYuYrHh"},"metadata":{"digest":"0d187610d42d46fc90ab873fa1a43132c35d349083dcbf744cf81191ae4a4760","from":"TK4JebQqeqq5t6x2bCwnD7","reqId":1542035094044574100},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":59,"txnTime":1542035094},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6mTar6XRRgYdhswcnq3ybf","value":"UfJqCMUzcX5CfqGouLMSivJ5qm5SqBdsJwKkV9aZHTsmHS3GwcBAur4aUP9VG43praqiqToCQ1jZiMyUYj7wKEw"}]},"txn":{"data":{"data":{"alias":"lab10","blskey":"2Yf73vj1CJBqibWHZTdL4Seygd53dSb4PKJugpeokVx8HdXwqhuEnk2nFBCYmXmFp4RxGprQuKDfGuxYDhKuBysHSCbbYwvoWaXXHYtxvD67Ytw37fQo9Stvgu5nCDwDWD3M8p7fkUF4UQRMqfa8W1tddWXgFr5NPSB13GrjJFcPgAn","blskey_pop":"RBGAkA3X7w1ADtQeYiVZW76uWdwRTdCwamappXLb3sD2iNvVBaSF1jPANo9K99QBe42kEAbJtbwsi4AoDWrjex6tVTQqiSxeAt2kRJpCZTGHfthHzLEnFtZqqksWeXQPRNzeeRagFRyZAQhPuL7wYMiz3a6CNnbgQL7dbMvNBaQsUs","client_ip":"5.9.17.149","client_port":9702,"node_ip":"5.9.17.149","node_port":9701,"services":["VALIDATOR"]},"dest":"7vruXjaKFp2t1WrsMTcVZuNQtmn35yimDrN7THYwcPof"},"metadata":{"digest":"515a3de1e3b1166208d6e2d5c7c020b9d9b56f5fbfb01e9ac1e2da96a8ebacb1","from":"6mTar6XRRgYdhswcnq3ybf","reqId":1542135182121048577},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":60,"txnTime":1542135183},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"bPTNiLzWPFHKr7mJGaump","value":"2HaQjM7gQXQi4nL2CHLDAM6PaHXUsgQ6SoyHkncrNHQua5WWbcd6DjsB5gagvTAsyD9728xA3npf6c82GNCFqrd3"}]},"txn":{"data":{"data":{"alias":"sovrin.sicpa.com","services":["VALIDATOR"]},"dest":"AcaN2zJ1vkQyEvmi2EyUMLzvzczQRvarNPjR2CbtNFAX"},"metadata":{"digest":"0e549b9dee11241b4b9605b540b7162a84c8fe0a466e30fc029929debb9f6f5f","from":"bPTNiLzWPFHKr7mJGaump","reqId":1542298164808052701},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":61,"txnTime":1542298165},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"bPTNiLzWPFHKr7mJGaump","value":"wKcykStr9Mj6jbjHUjzjkQXnkz7K3S9GmjgB2kZ7KrWpNDrS3hWWydguhUzFcjHoxBDazdEBKgnu3WH15ytNrxx"}]},"txn":{"data":{"data":{"alias":"sovrin.sicpa.com","services":[]},"dest":"AcaN2zJ1vkQyEvmi2EyUMLzvzczQRvarNPjR2CbtNFAX"},"metadata":{"digest":"93b91ab90788049d62246a754432eb2d5f47c8b20e6f7174d57fd42537749c14","from":"bPTNiLzWPFHKr7mJGaump","reqId":1542299088770647926},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":62,"txnTime":1542299089},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"KvGE2tKSDuBXEkRc86dL4T","value":"5dwYyoYZu4LRnhdyRFXt7xEFFw2yT8QE7zVKRkD2XswxgsSY1gdnbPDnqBwoUTyUK7MjzeRjuGDJpeBBcHSmH7Wz"}]},"txn":{"data":{"data":{"alias":"trusted_you","blskey":"4Hf3okFu15E52JuH62AD4gNVyBdqg8mP4xzg6bViuYzA3ujCJpC5xCv2afiAgWq5w6ooxhNo4w88jny5je83HvJXUqc1jQNWApzcRr9Zqfz9ipqP3qJv6j8BZJU5VQPfLLfrGRrNG4UFPwHHqXLxcBfFJFqKuBMr9FeQc5LMP6LKhQr","blskey_pop":"RLK3VsTPH8BvpqjBUD1mn21jffYkZdAzEkxt397HcbpHd6zfXE6DbziXrWgVDdofZkuqUhrd7ecwY7yX3rYL182VxfWhvKTDx8VwrPyand6M2DWtR3c3rUwwqBkLJW5dXP2ZrPMnUrukJ88SXVrf4J23jiy9xFTZLAVZnt2Go582aB","client_ip":"51.140.243.125","client_port":9700,"node_ip":"51.140.220.111","node_port":9750,"services":["VALIDATOR"]},"dest":"7wetNy5AJpHfXvhTx4okZokSw5mcrgWgVZ8jJ3WHgrmd"},"metadata":{"digest":"1e72a8499fe7372eb9b3f7876a4bb965801c9ee611d79611afad3355f9133c9b","from":"KvGE2tKSDuBXEkRc86dL4T","reqId":1542323966510001027},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":63,"txnTime":1542323966},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"bPTNiLzWPFHKr7mJGaump","value":"2LpmtWWx2ykmxYQ9QZ13PoXrtn77ETbjTrBRDmZULykruGVyDWp6Xn3EyrrNuEZVDxjFGKG1tdbcQKhUHKJn6LHA"}]},"txn":{"data":{"data":{"alias":"sovrin.sicpa.com","services":[]},"dest":"AcaN2zJ1vkQyEvmi2EyUMLzvzczQRvarNPjR2CbtNFAX"},"metadata":{"digest":"e6a5bb4cd4189ecc6ae0858a32c7df509e81c181bab5cf4f43e72d480ea0f7a0","from":"bPTNiLzWPFHKr7mJGaump","reqId":1542361064125639673},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":64,"txnTime":1542361064},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"uV9yMB5sfwYNRjXfvbD8eajsW16SEfAxE62QVyX2f9YBkr2BBLed9WHE79Ww5v5ycV5mrduAr7rrYZnCNyNvgvv"}]},"txn":{"data":{"data":{"alias":"trusted_you","services":[]},"dest":"7wetNy5AJpHfXvhTx4okZokSw5mcrgWgVZ8jJ3WHgrmd"},"metadata":{"digest":"a915255c0490bd661652aae007d55c88736a9556a283e9087862db948fc01ab0","from":"6feBTywcmJUriqqnGc1zSJ","reqId":1542394857400361543},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":65,"txnTime":1542394857},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"bPTNiLzWPFHKr7mJGaump","value":"hywDqQdRthvVDSiUXgMueRW621soWAWgZeRFjyzxpvTMBDhxnc36P8PaWYnHsxXzVds57XAcQ3LKfEjZ1UyqvHJ"}]},"txn":{"data":{"data":{"alias":"sovrin.sicpa.com","services":["VALIDATOR"]},"dest":"AcaN2zJ1vkQyEvmi2EyUMLzvzczQRvarNPjR2CbtNFAX"},"metadata":{"digest":"056b23376851dc03079a1c3fea1ec6a37d60d976cef577cb1534bfa5f37509db","from":"bPTNiLzWPFHKr7mJGaump","reqId":1542638324609009633},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":66,"txnTime":1542638324},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"TN7Sx7qF9RSmaDcTiFKWzd","value":"4E1w4F5QcM5PxBYYrbJkTDPNwqNnfE9X1nLPVfbfBwFurF2F74GA6BRcPxVoiWsTRMCeWtgZWzHjYcictzv7B7nk"}]},"txn":{"data":{"data":{"alias":"dativa_validator","blskey":"3bYtYhVodD49a3bTK2bZzTAZqt284tKQ2vgXG2arqUyYJRhYnDouhAaQAM7fctC84NvQRG2p1UwVdcdUZPkau5wdJ6fKWwpGo1mM2firHhYtiSZcCAfAbPQhTSSKnsaMnUzacuPC1e81ytr3cXjPobaAg4jJA637N2MGwUWv665o7ae","blskey_pop":"Qm7nQt5HjnaLSpCobPxAH8JG67J6bstaKop2XCsnBELR8tJNm1BYkqTTsj5HVRwXBkMg2vexNQ51B29cp9tSK3zK7ddbhWh8C4cDHoDQgaCHNz61hQxxYMx37yraFLggPF9WCaUckAn4fFxEvLBMV3EdcBZoTecwGPt2g1WhBDjB3M","client_ip":"52.91.89.252","client_port":9799,"node_ip":"35.174.181.186","node_port":9700,"services":["VALIDATOR"]},"dest":"F15n4nPZcnzDJJMNSZK8yNaeodi1PjZyDs83r4KC75hy"},"metadata":{"digest":"58a1d4e0b24778694973e2ff21eca5b9bba33ffb6d918836e1f76b75d1eab56d","from":"TN7Sx7qF9RSmaDcTiFKWzd","reqId":1542652100358243716},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":67,"txnTime":1542652100},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"sYtD5iKjZF1A9rkkY8E2AeHk4B5y81jWiY2BZEsLYy3s4HNQo9YKy5K6X9k1LbscodpMhC4VL4gZ4L7Y9YgvFBs"}]},"txn":{"data":{"data":{"alias":"sovrin.sicpa.com","services":[]},"dest":"AcaN2zJ1vkQyEvmi2EyUMLzvzczQRvarNPjR2CbtNFAX"},"metadata":{"digest":"afa88dd032669c15cf2fb1d7f5d921c2325d2d721b6adffc20df7c8e094d4b91","from":"6feBTywcmJUriqqnGc1zSJ","reqId":1542679993748339893},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":68,"txnTime":1542679994},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"TN7Sx7qF9RSmaDcTiFKWzd","value":"CRk8NSxyvawVi7LUhDdLgN22L5ZEqMpW5yUqVd9ri623VujthBNW6RWaQEagEJqzj9LtwWG3cRYMZzZ8tW8PFpf"}]},"txn":{"data":{"data":{"alias":"dativa_validator","blskey":"3bYtYhVodD49a3bTK2bZzTAZqt284tKQ2vgXG2arqUyYJRhYnDouhAaQAM7fctC84NvQRG2p1UwVdcdUZPkau5wdJ6fKWwpGo1mM2firHhYtiSZcCAfAbPQhTSSKnsaMnUzacuPC1e81ytr3cXjPobaAg4jJA637N2MGwUWv665o7ae","blskey_pop":"Qm7nQt5HjnaLSpCobPxAH8JG67J6bstaKop2XCsnBELR8tJNm1BYkqTTsj5HVRwXBkMg2vexNQ51B29cp9tSK3zK7ddbhWh8C4cDHoDQgaCHNz61hQxxYMx37yraFLggPF9WCaUckAn4fFxEvLBMV3EdcBZoTecwGPt2g1WhBDjB3M","client_ip":"35.174.181.186","client_port":9799,"node_ip":"35.174.181.186","node_port":9700,"services":["VALIDATOR"]},"dest":"F15n4nPZcnzDJJMNSZK8yNaeodi1PjZyDs83r4KC75hy"},"metadata":{"digest":"c52795b715a91b80167eecf727e15be08c7ea405b32be84ebded577f2bca7dd3","from":"TN7Sx7qF9RSmaDcTiFKWzd","reqId":1542737602414121779},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":69,"txnTime":1542737602},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"KvGE2tKSDuBXEkRc86dL4T","value":"57mY4UHLprb4EdgPpnNBiermToDVqkLzJxso2bbsfo4GXomLHssQqjZrZvS1vgDjLgGGKLFpGZJeaKvXyLk1JUNy"}]},"txn":{"data":{"data":{"alias":"trusted_you","services":["VALIDATOR"]},"dest":"7wetNy5AJpHfXvhTx4okZokSw5mcrgWgVZ8jJ3WHgrmd"},"metadata":{"digest":"00477bfb2052242abbb95063d98b5acd1d3ab76e7d1519734e54b07aad6b9e99","from":"KvGE2tKSDuBXEkRc86dL4T","reqId":1542751929819744539},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":70,"txnTime":1542751929},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"KvGE2tKSDuBXEkRc86dL4T","value":"td4qZQbCgAxg5jWNUEj5ySAvjN2W2cdywcpYhwrAcyu5H5EbyuyNXDJXLzgCRuTLoNUcKJY1z6GbrFa1rb3c9yU"}]},"txn":{"data":{"data":{"alias":"trusted_you","services":["VALIDATOR"]},"dest":"7wetNy5AJpHfXvhTx4okZokSw5mcrgWgVZ8jJ3WHgrmd"},"metadata":{"digest":"74436d978077d1b2a7325604b305ba71776432f078ae4f0685cd29780466fccd","from":"KvGE2tKSDuBXEkRc86dL4T","reqId":1542754098893802328},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":71,"txnTime":1542754099},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"2odhsxVn68qbBkYcaUWzFpk4KNtrUSh3QM6duqfGwBWN3CPbBYRFfvcYFiQqYZUazipKsWvqHvDsh27iycAadosq"}]},"txn":{"data":{"data":{"alias":"sovrin.sicpa.com","services":["VALIDATOR"]},"dest":"AcaN2zJ1vkQyEvmi2EyUMLzvzczQRvarNPjR2CbtNFAX"},"metadata":{"digest":"a06031660b32d4a6dff612a466d0dad7f0563ac58ca06b2bd11c0f767e0ea25e","from":"6feBTywcmJUriqqnGc1zSJ","reqId":1542820256271098712},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":72,"txnTime":1542820256},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"TN7Sx7qF9RSmaDcTiFKWzd","value":"8ubefkYZGbM2F9KeYYhGowKLi27dhss6S8bp8MiirdicFdCZ4PA5qGejbkQhuDfbbRkfxS8ZzreRAg56rkVE5vK"}]},"txn":{"data":{"data":{"alias":"dativa_validator","blskey":"3bYtYhVodD49a3bTK2bZzTAZqt284tKQ2vgXG2arqUyYJRhYnDouhAaQAM7fctC84NvQRG2p1UwVdcdUZPkau5wdJ6fKWwpGo1mM2firHhYtiSZcCAfAbPQhTSSKnsaMnUzacuPC1e81ytr3cXjPobaAg4jJA637N2MGwUWv665o7ae","blskey_pop":"Qm7nQt5HjnaLSpCobPxAH8JG67J6bstaKop2XCsnBELR8tJNm1BYkqTTsj5HVRwXBkMg2vexNQ51B29cp9tSK3zK7ddbhWh8C4cDHoDQgaCHNz61hQxxYMx37yraFLggPF9WCaUckAn4fFxEvLBMV3EdcBZoTecwGPt2g1WhBDjB3M","client_ip":"52.91.89.252","client_port":9799,"node_ip":"35.174.181.186","node_port":9700,"services":["VALIDATOR"]},"dest":"F15n4nPZcnzDJJMNSZK8yNaeodi1PjZyDs83r4KC75hy"},"metadata":{"digest":"62a7363b27f1e10c215c8ac44b0a6d737fd60ad14c4357c6c954d90283f21aab","from":"TN7Sx7qF9RSmaDcTiFKWzd","reqId":1542651103246022659},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":73,"txnTime":1542820263},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"5UWP2RqYa8zdejirm5hA7myhrr59jzik9koEjyosJ6U3uHU1ySrKnRsogkXb91sFb6t9Rs9XS7yF6r9wLgW2tQLR"}]},"txn":{"data":{"data":{"alias":"dativa_validator","services":[]},"dest":"F15n4nPZcnzDJJMNSZK8yNaeodi1PjZyDs83r4KC75hy"},"metadata":{"digest":"a6c82dd6a170a73014ce079ce53bcf505bfbee47363a3ea88097cd58f1d38030","from":"6feBTywcmJUriqqnGc1zSJ","reqId":1543358290828986263},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":74,"txnTime":1543359213},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"SYQLd1z2fd6BCcSHsraFbU","value":"5ohoJwSwPD3pGuXhMdvEcYUK3rPPa3HT5SyAgbd4SmHmA1Tgf5zdHef9mNDwR7AKEEgEkUGKNzjAKGTots5oeanF"}]},"txn":{"data":{"data":{"alias":"SovrinNode","blskey":"4ATbikmEcsPinBFgzWk3zKr1HPBg2Qyh4B6dEkR3U8oSauZGJakaHZMDx9LhrmajC5MdSURcLHJig8jqAAvJSkjk2kbpW9m97oWo8jPNw6cDv3bLxmhnkteCrfVvPokbeL4WyFbGZx5VLLrmtzsxodHrEhm6jkZcAhxcA29EzFPKm31","blskey_pop":"RYPJaQyeF6Xjk8jVDbF4gpKdRajTyhDG6VjZeWg93QEMDsWKmTu6CMFQ9SSf4Ao58jySP2Z1LSgKjvW6uJuVm5ZA29Rsdpv7i5y9XktMw14Pa4XH2YJWbpqvZZgteYBbUsFReF3FiSmaHX3JBo7WGWoVmLATxvSxBtPfKKTB2f3KtT","client_ip":"3.16.198.41","client_port":9702,"node_ip":"3.17.50.10","node_port":9701,"services":["VALIDATOR"]},"dest":"GfczFDBo6wCK7bwZA2dtTmEf5xGzZEDeELMP34bS9y1B"},"metadata":{"digest":"2d22f985e30f12bbd0af7dc89be3b82d7254762a212ea865a570063be3a9190c","from":"SYQLd1z2fd6BCcSHsraFbU","reqId":1543447274763531000},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":75,"txnTime":1543447275},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"4NFboPNaWijRoMcgQkQFivTjjXaBeDzhQAa93MbAfHp8myBJ1fGnnrnLfyoBMQA1wZhSiAXyeuMiiG8rRhVjbNam"}]},"txn":{"data":{"data":{"alias":"dativa_validator","services":["VALIDATOR"]},"dest":"F15n4nPZcnzDJJMNSZK8yNaeodi1PjZyDs83r4KC75hy"},"metadata":{"digest":"71434b20259474ab9aee98e999a0818e8ac2872043cf5ae9945b307431ce6fbc","from":"6feBTywcmJUriqqnGc1zSJ","reqId":1543513967433499896},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":76,"txnTime":1543513967},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"TN7Sx7qF9RSmaDcTiFKWzd","value":"qJLHVvfJiNEexfo7rwxXuNGqhhas1CFY5hxQBrh21dn6oEybkFy41pNVvhU2Qb4eW3j5VyBE65nnFqYi8k6JRRZ"}]},"txn":{"data":{"data":{"alias":"dativa_validator","blskey":"3bYtYhVodD49a3bTK2bZzTAZqt284tKQ2vgXG2arqUyYJRhYnDouhAaQAM7fctC84NvQRG2p1UwVdcdUZPkau5wdJ6fKWwpGo1mM2firHhYtiSZcCAfAbPQhTSSKnsaMnUzacuPC1e81ytr3cXjPobaAg4jJA637N2MGwUWv665o7ae","blskey_pop":"Qm7nQt5HjnaLSpCobPxAH8JG67J6bstaKop2XCsnBELR8tJNm1BYkqTTsj5HVRwXBkMg2vexNQ51B29cp9tSK3zK7ddbhWh8C4cDHoDQgaCHNz61hQxxYMx37yraFLggPF9WCaUckAn4fFxEvLBMV3EdcBZoTecwGPt2g1WhBDjB3M","client_ip":"100.24.186.243","client_port":9799,"node_ip":"35.174.181.186","node_port":9700,"services":["VALIDATOR"]},"dest":"F15n4nPZcnzDJJMNSZK8yNaeodi1PjZyDs83r4KC75hy"},"metadata":{"digest":"47ef7d8fa8fe23a6609710042b27ed83e8ee4520e7c51698ee04419c7b7b0daa","from":"TN7Sx7qF9RSmaDcTiFKWzd","reqId":1543514771626991925},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":77,"txnTime":1543514771},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"BD95LAmfVrD3JEwaereykM","value":"326qebvjJFB9dBhhM26n6nqRm1DrjDATdY8JR8r6Wr4snfrmBpasSZATrUarQzAzu3AdZia67zwQsmoepwfRRo7y"}]},"txn":{"data":{"data":{"alias":"ibmTest","blskey":"232Z7DQcjp5NPVZyzR6WWH9w9829F4NPBz87sx2LHZBnv2xntpaixyUc7J5hUtwnYgL7HyEZsf3Wgtdr5sGua7jhpJzixxtR2p4KoRZ48i62wA9Y5mJ4FmXBg3GxMwbegc2Nmqg33CGjB8cDGUZwR1jBERdZdsi3Y4CL9e9NsBqUu5C","blskey_pop":"RKL3Tji4ZKCsfBLaSAsnvDBn2TvmkkSSEKy2zDk467aXZFG4fpEV8t89w2FXGeU2vLHV1ppYpfefDoi1Qjgm7vxEPdEzys3ZxGJea9FXG78sQPurLF1XZtK1g6DV5L2YAyV3qC1pyGGibJvc5RNS6kdbihSwkpZnVRDwCr3Pk5DPiX","client_ip":"169.60.4.138","client_port":9702,"node_ip":"169.60.4.138","node_port":9701,"services":["VALIDATOR"]},"dest":"7mcctKwaBjyzAbNPS8ix1LTNxex4JchkyLvjYfw2XexR"},"metadata":{"digest":"45bf4a0c9d8267ed8cfb37933cdf50ed3eaf23f7bcad6681a65cf55fd0120de0","from":"BD95LAmfVrD3JEwaereykM","reqId":1543518036999212000},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":78,"txnTime":1543518052},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"BD95LAmfVrD3JEwaereykM","value":"2kHqvEXmgiRcPghcNdGGphFZJdBj4g5CXNsDQkFx15FAprGvmt5DbDC1N4FZQCd7Gi4LzSAn4cQ5eoKsnBmn5UnL"}]},"txn":{"data":{"data":{"alias":"ibmTest","blskey":"232Z7DQcjp5NPVZyzR6WWH9w9829F4NPBz87sx2LHZBnv2xntpaixyUc7J5hUtwnYgL7HyEZsf3Wgtdr5sGua7jhpJzixxtR2p4KoRZ48i62wA9Y5mJ4FmXBg3GxMwbegc2Nmqg33CGjB8cDGUZwR1jBERdZdsi3Y4CL9e9NsBqUu5C","blskey_pop":"RKL3Tji4ZKCsfBLaSAsnvDBn2TvmkkSSEKy2zDk467aXZFG4fpEV8t89w2FXGeU2vLHV1ppYpfefDoi1Qjgm7vxEPdEzys3ZxGJea9FXG78sQPurLF1XZtK1g6DV5L2YAyV3qC1pyGGibJvc5RNS6kdbihSwkpZnVRDwCr3Pk5DPiX","client_ip":"169.60.4.138","client_port":9702,"node_ip":"169.60.4.139","node_port":9701,"services":["VALIDATOR"]},"dest":"7mcctKwaBjyzAbNPS8ix1LTNxex4JchkyLvjYfw2XexR"},"metadata":{"digest":"933101316c883ce1ade5c0fd93e226448fc88f38d858788be4986596f7b9be38","from":"BD95LAmfVrD3JEwaereykM","reqId":1543519064797689800},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":79,"txnTime":1543519080},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"BD95LAmfVrD3JEwaereykM","value":"zPAr7xh7rcMYkAh3Vd73TFAoX45mtU3eaP57Ke6JPcv6ppMr4iYpafyB1X2DAB5sQsBRn2MVC1BJrfcwdCrDG1U"}]},"txn":{"data":{"data":{"alias":"ibmTest","blskey":"232Z7DQcjp5NPVZyzR6WWH9w9829F4NPBz87sx2LHZBnv2xntpaixyUc7J5hUtwnYgL7HyEZsf3Wgtdr5sGua7jhpJzixxtR2p4KoRZ48i62wA9Y5mJ4FmXBg3GxMwbegc2Nmqg33CGjB8cDGUZwR1jBERdZdsi3Y4CL9e9NsBqUu5C","blskey_pop":"RKL3Tji4ZKCsfBLaSAsnvDBn2TvmkkSSEKy2zDk467aXZFG4fpEV8t89w2FXGeU2vLHV1ppYpfefDoi1Qjgm7vxEPdEzys3ZxGJea9FXG78sQPurLF1XZtK1g6DV5L2YAyV3qC1pyGGibJvc5RNS6kdbihSwkpZnVRDwCr3Pk5DPiX","client_ip":"169.60.4.138","client_port":9702,"node_ip":"169.60.4.138","node_port":9701,"services":["VALIDATOR"]},"dest":"7mcctKwaBjyzAbNPS8ix1LTNxex4JchkyLvjYfw2XexR"},"metadata":{"digest":"2dcd0cac5e059298e5cdfa8cf0081c95b33a6d9a09086909eff9d7b91f05e23a","from":"BD95LAmfVrD3JEwaereykM","reqId":1543519131380345700},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":80,"txnTime":1543519147},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"AWZpBgGbFFCobzuzsqdeZg","value":"35aYZ3mw5UyEZWjKRB6ciL1d3JqZaMmbWCdAp3TtoV5i1YkDN4nRV98bzPqdSeh5sX1atEifuNKSfEWkBVg4qMhW"}]},"txn":{"data":{"data":{"alias":"sparknz","blskey":"34cHakLPF7ZZtRjysMoXT2SFmaqWinh19y2orQ4BPncYsA2J5fkfhtd34jruhjbRWWLpTw92XgCsTrQPPSdUheyqqs2AFZ7QDwKESAxuukV7N6NwWQBEf7i8GTfJaL5vBqqJxDwDNH3j9oLdeMvtTjU8vrnWZLWb6TKjmzD8NrtwF6o","blskey_pop":"Qp3N5anCNnktZFVWpWJQHexcT18j66dXM5cSd6SAsn9uwMAxU8VxVLjDJrRmutVwbR81EzduJfVojMgPfDdHEPxEDFQKjG2EP6qTk7o7HRyts7kaSfkL1f8Dwk8f8tbU5gkaaLrAYGRkXSjnmMPJHXaj6zeeNQRatZJGeRMAG8o8fh","client_ip":"146.171.248.185","client_port":9701,"node_ip":"146.171.248.186","node_port":9701,"services":["VALIDATOR"]},"dest":"DdAqLDrkEW96hcVLsEtf8SrQnUGFK7uMLyHi775kYFVw"},"metadata":{"digest":"5d1e7deda854cda687afab5defd30a1e940eed638dbe7d3c57cb4e326891bd3c","from":"AWZpBgGbFFCobzuzsqdeZg","reqId":1543870622701863717},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":81,"txnTime":1543870623},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"31oppTng8a1BtbZDEo4LNQhF58AMjSvAznR94KxjQkA6BFJg2sgSwzVXWVbEhVL1H4RzaDPjfnHNPWztjDGTUYVX"}]},"txn":{"data":{"data":{"alias":"sovrin.sicpa.com","services":[]},"dest":"AcaN2zJ1vkQyEvmi2EyUMLzvzczQRvarNPjR2CbtNFAX"},"metadata":{"digest":"2eb2a01dea5d319f834d1e7a06b8a07258e41f22d4f05422b12f9d5986bc34d5","from":"6feBTywcmJUriqqnGc1zSJ","reqId":1544074481553187626},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":82,"txnTime":1544074482},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"41YVszp9VT9djZsVqswxQTnSRX7BEpv2M7QLvPn6rPUGStbDipB2rxwWxLCzFZRGyNQKRvUi42R2KHrHPfU7Wic7"}]},"txn":{"data":{"data":{"alias":"vnode1","services":[]},"dest":"9Aj2LjQ2fwszJRSdZqg53q5e6ayScmtpeZyPGgKDswT8"},"metadata":{"digest":"a4f609e0cbf8747f759a746909dbf1e3c9248db7552685ead0405ac72c9e8927","from":"6feBTywcmJUriqqnGc1zSJ","reqId":1544074647137451532},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":83,"txnTime":1544074647},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"2KoQ12pS6MZA3ibexjZ2UqiTS4NiYvT79bwaxzS22cetgwDfqsmvsR7wWLuyXwkSU8HyX8X7NNK6xgfYPBN4mwMt"}]},"txn":{"data":{"data":{"alias":"vnode1","services":["VALIDATOR"]},"dest":"9Aj2LjQ2fwszJRSdZqg53q5e6ayScmtpeZyPGgKDswT8"},"metadata":{"digest":"92582f39703e76731d5698e5b73e19a8c1ba76f992f91932366607d707bb6a5f","from":"6feBTywcmJUriqqnGc1zSJ","reqId":1544075270586069533},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":84,"txnTime":1544075271},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"bPTNiLzWPFHKr7mJGaump","value":"32q6n5cXWTbbSafBxY1bS9yXopVjkL6esnq9RNPoWbGgNFRPntZFzZkZRpGf8g9WxJANYgHX5eWRcxtuAjVjuGMY"}]},"txn":{"data":{"data":{"alias":"sovrin.sicpa.com","services":["VALIDATOR"]},"dest":"AcaN2zJ1vkQyEvmi2EyUMLzvzczQRvarNPjR2CbtNFAX"},"metadata":{"digest":"0ba8cb01d0926a2bc950883a1fe1994ac6f1ec3ceded488e0d00fc95f494bfc0","from":"bPTNiLzWPFHKr7mJGaump","reqId":1544110495269165919},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":85,"txnTime":1544110495},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"KpBWkKc8yn3iWzjHDDmqBL","value":"5ZWLPJckDRWJc5TJrkpzyBxmsQQBEHfQhSvTKW6NSY2qVroijPMqVByf3tTAUXPfdQ4jGdTSWzS3E4YvvyqTaGf"}]},"txn":{"data":{"data":{"alias":"EBPI-validation-node","blskey":"4XiKTE8hX4d2WVxd85epKmN91wEz9knWXTrEu6Ug9RUb32zaQ4EC6KPmkVzPmE6QAigDaD9soYcKkUVxhzpTFSQuJbSCLUJuNpvDbdMznGw9YoX8n3bBM6bGgPxQzYfRtJGJ1JtWmhViHEF1FhyZxPYqHX1pUbUDd4yKzxJeEabMYDt","blskey_pop":"QkALSfgxL3p3fpswcYJhhaqzi6sYGQNErBSYjqVEuYkuYWPBvnFjNpCrw2GprHS8XcBzss2qeyTXpTRn4PPo3y4MFU61Jwbkbb4Du81Dwh7XUqjiWiV6HvHSdafaeX6P7cGdtcZZAFKsiUWxuosiaeXjk1y9T47ch1hEFSdoh6fBSo","client_ip":"185.242.244.69","client_port":9750,"node_ip":"185.242.244.69","node_port":9700,"services":["VALIDATOR"]},"dest":"j2JLXyTCAMuHSRqZ7eB2JCXSpPniDFUsyT5MJcGAjUG"},"metadata":{"digest":"7ac78f73c3c397596765d3a2b5afbf01096a051c7702d7e29e53573757912d3d","from":"KpBWkKc8yn3iWzjHDDmqBL","reqId":1544725436218772828},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":86,"txnTime":1544725436},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"3TmLPiQF71J954XuFXyPtFKpiECWTL52mCE9AABTCwsFMcx6rforPwsxVKvRjveEuJLv3uucY9ybPnoFfFxGgrKh"}]},"txn":{"data":{"data":{"alias":"EBPI-validation-node","services":[]},"dest":"j2JLXyTCAMuHSRqZ7eB2JCXSpPniDFUsyT5MJcGAjUG"},"metadata":{"digest":"c08be5f00f5976cd163f503430751494dad23d97b16a9c0835e717183039f081","from":"6feBTywcmJUriqqnGc1zSJ","reqId":1544726215993081431},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":87,"txnTime":1544727345},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"5M3i1PbpvEQmTk25EmAY6N","value":"2RTUVnKLx3FGwBQofPD86z4KvgCpN4dbw6Xjvz7Ka9RYdZnydJZ3oE7pZr2Q6V1mZzGqPfAmnW2YEDqozk52THDt"}]},"txn":{"data":{"data":{"alias":"EBPI-validation-node","services":["VALIDATOR"]},"dest":"j2JLXyTCAMuHSRqZ7eB2JCXSpPniDFUsyT5MJcGAjUG"},"metadata":{"digest":"7f6a8dd88af17b623f0f8f28bff0f2188805f9f940b390d9b24b9c0f24956cb2","from":"5M3i1PbpvEQmTk25EmAY6N","reqId":1544733913396713000},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":88,"txnTime":1544733914},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"5M3i1PbpvEQmTk25EmAY6N","value":"5hb9wbwvgaYCdwRYUAQvgHkUPzX6F6BhirapR2ni3BAYMGqT9irnJWVMciEdTGZj3rKY2ThAfVtNaMbSJnW6HCyc"}]},"txn":{"data":{"data":{"alias":"EBPI-validation-node","services":[]},"dest":"j2JLXyTCAMuHSRqZ7eB2JCXSpPniDFUsyT5MJcGAjUG"},"metadata":{"digest":"0f52e5c1d547772efd54bfd01d8ec1caa9ba6dce8ca9234ce977008835e4aa85","from":"5M3i1PbpvEQmTk25EmAY6N","reqId":1544734167152848000},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":89,"txnTime":1544734168},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"bPTNiLzWPFHKr7mJGaump","value":"5SwN2QC6rG7iuQpwwgNccDRhfNBG3rbu8trV5UFnQwHAw8FG4UfhEMkMSk1XUouAqrzY8xZVxThTFgHBxUYyPURx"}]},"txn":{"data":{"data":{"alias":"sovrin.sicpa.com","services":["VALIDATOR"]},"dest":"AcaN2zJ1vkQyEvmi2EyUMLzvzczQRvarNPjR2CbtNFAX"},"metadata":{"digest":"796c9b3f2b9f78bdd482763e0685e8d6b7f2764d4a3374c30b113a026dec6509","from":"bPTNiLzWPFHKr7mJGaump","reqId":1544781409602174729},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":90,"txnTime":1544781409},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"558b9TUNBbNFeGd7S5qW14uUYdx8tZzQP26UCMBuMbR1KXowJUPSebASQ5yMQWwTu3AoWwRUEH74en9wpMSLKo7P"}]},"txn":{"data":{"data":{"alias":"sovrin.sicpa.com","services":[]},"dest":"AcaN2zJ1vkQyEvmi2EyUMLzvzczQRvarNPjR2CbtNFAX"},"metadata":{"digest":"61352cdff0ee3db0e06ddd2675b04a977efc2ff24ab099e6be4ea37c431f80b4","from":"6feBTywcmJUriqqnGc1zSJ","reqId":1544812283315027137},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":91,"txnTime":1544812284},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"4xgBtM4FFMyfndQgbEb7wz","value":"3vBhqo64dvx2r86WuJKZuVfCtLD64FmWo3K1WY2wY1NYTZ7GZivqHjKi5ALCDyxmorD6U5yeMgFPgQCxCei69Ncx"}]},"txn":{"data":{"data":{"alias":"anonyome","blskey":"497qEgWR2PZx1ZUeCQBq2hTva16CkQZpVPtdG4o3tBFYRzXLQkvrEX7vyRrbov9LQQQriJfRdYZ41C8ju4BjPH77zF34diUeLxrtK1kMGoTdTHinLK1116XUW5GZpj7y7i3Aekxh69rDqZZbbd65JFrD2ZEJoNsHj8HydbVaAjm6wSa","blskey_pop":"QuNLxWz9jWEoFq3gh2DUbNZHBFiK26gQ66URFGGNNbd8WtKY9u8D94k2zL3P4K74Uzp6MmJPMJewAWuzVD7CQJCguzDPYMUtd57J1PX5VoJXp4ynmbDZhJQq4v393fU2YSLkhd6Fhci3nRovvyz3gPW4JbbtipzZGwp3VZPL1qZpf9","client_ip":"13.54.236.56","client_port":9744,"node_ip":"54.66.208.40","node_port":9733,"services":["VALIDATOR"]},"dest":"AM8oxRuxRyKvJoLRtAEBBPMXzpMqTtm9yQDenMkS76JQ"},"metadata":{"digest":"77ab8c07c8a525367353aae971bace52932b713b772dd57e9f6c6688942867d1","from":"4xgBtM4FFMyfndQgbEb7wz","reqId":1545088395580554723},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":92,"txnTime":1545088396},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"4xgBtM4FFMyfndQgbEb7wz","value":"5XCS6eP9z4jmSxCS4h3ai6vPJTaeNMNXttC2UyPFBinMEFQUtiZJFtCCPtY9Dx48wzN8JWuKPv8xnBqZhHb928Ey"}]},"txn":{"data":{"data":{"alias":"anonyome","blskey":"497qEgWR2PZx1ZUeCQBq2hTva16CkQZpVPtdG4o3tBFYRzXLQkvrEX7vyRrbov9LQQQriJfRdYZ41C8ju4BjPH77zF34diUeLxrtK1kMGoTdTHinLK1116XUW5GZpj7y7i3Aekxh69rDqZZbbd65JFrD2ZEJoNsHj8HydbVaAjm6wSa","blskey_pop":"QuNLxWz9jWEoFq3gh2DUbNZHBFiK26gQ66URFGGNNbd8WtKY9u8D94k2zL3P4K74Uzp6MmJPMJewAWuzVD7CQJCguzDPYMUtd57J1PX5VoJXp4ynmbDZhJQq4v393fU2YSLkhd6Fhci3nRovvyz3gPW4JbbtipzZGwp3VZPL1qZpf9","client_ip":"13.54.95.226","client_port":9744,"node_ip":"54.66.208.40","node_port":9733,"services":["VALIDATOR"]},"dest":"AM8oxRuxRyKvJoLRtAEBBPMXzpMqTtm9yQDenMkS76JQ"},"metadata":{"digest":"09742193d02bfd0a16e1a18f71e0cba235cd6872f018398f12945274f3117e65","from":"4xgBtM4FFMyfndQgbEb7wz","reqId":1545089703401067519},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":93,"txnTime":1545089703},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"e3SjQWaGqcQsq8EkBrCm7RTZUq6oB6LFF88w2gZ9h3xPES9AMioygTTYiRuLkgTtjLocHiYV1UjosX6ybGH7Y9F"}]},"txn":{"data":{"data":{"alias":"sovrin.sicpa.com","services":["VALIDATOR"]},"dest":"AcaN2zJ1vkQyEvmi2EyUMLzvzczQRvarNPjR2CbtNFAX"},"metadata":{"digest":"f9d4f83b612a218f58cb2aa50face3f7cb0ce488e6b37775d14f1ac85b68e6ce","from":"6feBTywcmJUriqqnGc1zSJ","reqId":1545149889900994815},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":94,"txnTime":1545149890},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"5M3i1PbpvEQmTk25EmAY6N","value":"4ijAWFcxfZHB2M169arvZMudfZtwUEjpfhHVKsFDx9TzAVhEU8jwgj8ZXmVU2bFa3rLzBPTW3MrT43KyTCj6Y6Pu"}]},"txn":{"data":{"data":{"alias":"NodeTwinPeek","services":[]},"dest":"2bDviHYdDiTjyXYXEW92zQHEf1C1QsbFatJ6uSYuYrHh"},"metadata":{"digest":"b5f9a593b5368b30899793f12e4cec879b232c49746da332a53fe4c83cc94b41","from":"5M3i1PbpvEQmTk25EmAY6N","reqId":1546646026772409000},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":95,"txnTime":1546646036},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"TK4JebQqeqq5t6x2bCwnD7","value":"2v25oRF7GET3wQZ7Q9TZqdMNVdaJAyR5rmsw3DGkyQkHw9HtyNHkq57EUV9K4Uf75gnyHhRQ9hxau2XJC6SNPa2C"}]},"txn":{"data":{"data":{"alias":"NodeTwinPeek","services":["VALIDATOR"]},"dest":"2bDviHYdDiTjyXYXEW92zQHEf1C1QsbFatJ6uSYuYrHh"},"metadata":{"digest":"f1402734f5bbc90db2dfa3db65d6cdc3ab839eadf13c1a7e16d769507e436696","from":"TK4JebQqeqq5t6x2bCwnD7","reqId":1546880167291826800},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":96,"txnTime":1546880167},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"4RvNoSPKWa1whZRGjpGEq5UDKQUVd3h1m5aRr4xThoFyCR7D2HiszbPGRJH9hhD8V4Sh2cERksU85fyHpW1BUZDz"}]},"txn":{"data":{"data":{"alias":"ibmTest","services":[]},"dest":"7mcctKwaBjyzAbNPS8ix1LTNxex4JchkyLvjYfw2XexR"},"metadata":{"digest":"d847f4140dbc101029081cd2abecc0f32465e310180917e12736d9f102dd2c6b","from":"6feBTywcmJUriqqnGc1zSJ","reqId":1547489538349798313},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":97,"txnTime":1547489539},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"5gCEwT2NHiUcuD53F6xW6vp6CnFabbk2kXoLLxfrUHqnjqMQDNwuSU6fm32aYFC2Z7KMjfs9jKfqPLEtwPFWASqi"}]},"txn":{"data":{"data":{"alias":"ibmTest","services":["VALIDATOR"]},"dest":"7mcctKwaBjyzAbNPS8ix1LTNxex4JchkyLvjYfw2XexR"},"metadata":{"digest":"e92c1fecf19b469d484bad7b3b2115b5e88df9c695afca551c5e1f3422f253f7","from":"6feBTywcmJUriqqnGc1zSJ","reqId":1547497859538640883},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":98,"txnTime":1547497859},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"BD95LAmfVrD3JEwaereykM","value":"3Pcohi5dAcVz9k8hryvXn8x6ddGob5hWYzmHoeZdDi628Asc4Au1rmsMjZasvLPqj69MN1VfbE4kTC9oESUPbAeC"}]},"txn":{"data":{"data":{"alias":"ibmTest","client_ip":"169.60.4.139","client_port":9702,"node_ip":"169.60.4.139","node_port":9701,"services":["VALIDATOR"]},"dest":"7mcctKwaBjyzAbNPS8ix1LTNxex4JchkyLvjYfw2XexR"},"metadata":{"digest":"56af49cfcb420ab39ecee2912fe3acaa2c0e9fcf4bc6dfdf783210cda55495eb","from":"BD95LAmfVrD3JEwaereykM","reqId":1547498794878924300},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":99,"txnTime":1547498795},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"BD95LAmfVrD3JEwaereykM","value":"46AVXqBesadhJLZvoRmcyPDDePE9Hi5DahjPC82fhw7irQnVXbvwNhqB7HXfCxtu8w8VifPhEcfihZcuNKBg995B"}]},"txn":{"data":{"data":{"alias":"ibmTest","blskey":"232Z7DQcjp5NPVZyzR6WWH9w9829F4NPBz87sx2LHZBnv2xntpaixyUc7J5hUtwnYgL7HyEZsf3Wgtdr5sGua7jhpJzixxtR2p4KoRZ48i62wA9Y5mJ4FmXBg3GxMwbegc2Nmqg33CGjB8cDGUZwR1jBERdZdsi3Y4CL9e9NsBqUu5C","blskey_pop":"RKL3Tji4ZKCsfBLaSAsnvDBn2TvmkkSSEKy2zDk467aXZFG4fpEV8t89w2FXGeU2vLHV1ppYpfefDoi1Qjgm7vxEPdEzys3ZxGJea9FXG78sQPurLF1XZtK1g6DV5L2YAyV3qC1pyGGibJvc5RNS6kdbihSwkpZnVRDwCr3Pk5DPiX","client_ip":"169.60.4.139","client_port":9702,"node_ip":"169.60.4.139","node_port":9701,"services":[]},"dest":"7mcctKwaBjyzAbNPS8ix1LTNxex4JchkyLvjYfw2XexR"},"metadata":{"digest":"a1412abace57327ba53e022db6a977e198a6134fec1dc4a17050de981f165845","from":"BD95LAmfVrD3JEwaereykM","reqId":1547500122390156800},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":100,"txnTime":1547500123},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"BD95LAmfVrD3JEwaereykM","value":"3yv5pLUCBnbC95FRb2qVrCtxRVBWB9ySRKkTxJ1M4pdTsXZPd3BHkDYTDqms9e3zPNtK5r8RQcg2ws6c5W4Nmy95"}]},"txn":{"data":{"data":{"alias":"ibmTest","blskey":"232Z7DQcjp5NPVZyzR6WWH9w9829F4NPBz87sx2LHZBnv2xntpaixyUc7J5hUtwnYgL7HyEZsf3Wgtdr5sGua7jhpJzixxtR2p4KoRZ48i62wA9Y5mJ4FmXBg3GxMwbegc2Nmqg33CGjB8cDGUZwR1jBERdZdsi3Y4CL9e9NsBqUu5C","blskey_pop":"RKL3Tji4ZKCsfBLaSAsnvDBn2TvmkkSSEKy2zDk467aXZFG4fpEV8t89w2FXGeU2vLHV1ppYpfefDoi1Qjgm7vxEPdEzys3ZxGJea9FXG78sQPurLF1XZtK1g6DV5L2YAyV3qC1pyGGibJvc5RNS6kdbihSwkpZnVRDwCr3Pk5DPiX","client_ip":"169.60.4.139","client_port":9702,"node_ip":"169.60.4.139","node_port":9701,"services":["VALIDATOR"]},"dest":"7mcctKwaBjyzAbNPS8ix1LTNxex4JchkyLvjYfw2XexR"},"metadata":{"digest":"1f584ac4cc88cb57ad5d9005e4f5f17156b70aad80f302b642289e4840076f74","from":"BD95LAmfVrD3JEwaereykM","reqId":1547500156383195400},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":101,"txnTime":1547500157},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"3f1sTShBSY8s7axeGypUxfY8a4V19kYkkFPyGygGGveJ2KDNVSEtKJHbLQNkaxk1nJnKudWQGKzCS2AdjBG766rw"}]},"txn":{"data":{"data":{"alias":"ibmTest","services":[]},"dest":"7mcctKwaBjyzAbNPS8ix1LTNxex4JchkyLvjYfw2XexR"},"metadata":{"digest":"03f65d7a7bc664f38199f4d34f6c8dd3fbeb5ad8744753b6a3f92def6d148ace","from":"6feBTywcmJUriqqnGc1zSJ","reqId":1547500445740297593},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":102,"txnTime":1547500446},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"BD95LAmfVrD3JEwaereykM","value":"5zo62TywH6pZij5L3QU9zmjEmAf7czZDJnyF3zFHXhqcGfGYLWCeUuFqJ7bVMc8Bnfx2XxkYY4UtwZ6oz3HwrqdL"}]},"txn":{"data":{"data":{"alias":"ibmTest","blskey":"232Z7DQcjp5NPVZyzR6WWH9w9829F4NPBz87sx2LHZBnv2xntpaixyUc7J5hUtwnYgL7HyEZsf3Wgtdr5sGua7jhpJzixxtR2p4KoRZ48i62wA9Y5mJ4FmXBg3GxMwbegc2Nmqg33CGjB8cDGUZwR1jBERdZdsi3Y4CL9e9NsBqUu5C","blskey_pop":"RKL3Tji4ZKCsfBLaSAsnvDBn2TvmkkSSEKy2zDk467aXZFG4fpEV8t89w2FXGeU2vLHV1ppYpfefDoi1Qjgm7vxEPdEzys3ZxGJea9FXG78sQPurLF1XZtK1g6DV5L2YAyV3qC1pyGGibJvc5RNS6kdbihSwkpZnVRDwCr3Pk5DPiX","client_ip":"169.60.4.139","client_port":9702,"node_ip":"169.60.4.139","node_port":9701,"services":["VALIDATOR"]},"dest":"7mcctKwaBjyzAbNPS8ix1LTNxex4JchkyLvjYfw2XexR"},"metadata":{"digest":"da6a5f92b960682e1c372ac18d3287e8a9db6e64cd5c07855a2cd95d5c13263b","from":"BD95LAmfVrD3JEwaereykM","reqId":1547500485921720200},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":103,"txnTime":1547500486},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"BD95LAmfVrD3JEwaereykM","value":"ftEtDcapN4TLHkeMDzvf4iQcrtAJvZx1VvvHnhDxqPxTcRVXWXLrQxNZWEjnjFet7ZNtsAQT6MmYHhZGztqrAVY"}]},"txn":{"data":{"data":{"alias":"ibmTest","blskey":"232Z7DQcjp5NPVZyzR6WWH9w9829F4NPBz87sx2LHZBnv2xntpaixyUc7J5hUtwnYgL7HyEZsf3Wgtdr5sGua7jhpJzixxtR2p4KoRZ48i62wA9Y5mJ4FmXBg3GxMwbegc2Nmqg33CGjB8cDGUZwR1jBERdZdsi3Y4CL9e9NsBqUu5C","blskey_pop":"RKL3Tji4ZKCsfBLaSAsnvDBn2TvmkkSSEKy2zDk467aXZFG4fpEV8t89w2FXGeU2vLHV1ppYpfefDoi1Qjgm7vxEPdEzys3ZxGJea9FXG78sQPurLF1XZtK1g6DV5L2YAyV3qC1pyGGibJvc5RNS6kdbihSwkpZnVRDwCr3Pk5DPiX","client_ip":"169.60.4.139","client_port":9702,"node_ip":"169.60.4.138","node_port":9701,"services":["VALIDATOR"]},"dest":"7mcctKwaBjyzAbNPS8ix1LTNxex4JchkyLvjYfw2XexR"},"metadata":{"digest":"15e71658452369fb383b2887eb9c4bf3833a3df8e6c48138de55730e086c0e6e","from":"BD95LAmfVrD3JEwaereykM","reqId":1547501596782347800},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":104,"txnTime":1547501597},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"7sTtbnHKD3zyosb1dFQAex","value":"23WRyTk9B2hPHXTMzFnjxJZZUhfsn9DLBbep5fEQqm6eTqYHiGrriTP9PbPLpVF1BHWsygVsVyr1jSQjr3VE6pKy"}]},"txn":{"data":{"data":{"alias":"regioit01","blskey":"RVjJZ8FJDMjFS6hTNVSXMx7S4BfQeX49CLTXvkHWvVQ4LRNBCsWAjwWFcDUzmdA2JA7hMRi9qvjh8vmPDahLeogJyWEByQFdJ4LnFo2NkDAfQwExHjLGXdawHPQjTduRrWYERpjwS9jFs3FXih6FcQRZb9mKrSW1tguSF7qGSdiNmV","blskey_pop":"R2v3TpVYmWpifxideMdW4EQo36w36VsppcDB44JNDxxCREiUZqrBj9RChgu6RRmHjj6SLchea5L515iadvA6STeQYh8tjMF87KH8s6RE5JAQagzX67X2fbpzai6A5Vq6w5wxLPJTKV4P9rkjxnH5Y6R1ReaVcKzZYk6j583WSUJZdZ","client_ip":"91.102.136.180","client_port":9700,"node_ip":"91.102.136.179","node_port":9701,"services":["VALIDATOR"]},"dest":"AQoViW7aucuvi8SC9QWur6u14ppmVvtMvduigy51NeCv"},"metadata":{"digest":"acd16644af0c402f1cce381e9dffcdd138d3d5098c54ac5c7d126be8b2923e50","from":"7sTtbnHKD3zyosb1dFQAex","reqId":1547571055916476853},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":105,"txnTime":1547571053},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"HS2VPUmJ1vJQHCjfH1w42H","value":"5htNrJWGu15CpxU7ocHYRkGQUygcaV41jcRmK9a1rvGoG59qWMJYpc4GvZeh2FttfobbxMZJfB57sggLhFS95y9S"}]},"txn":{"data":{"data":{"alias":"Absa","blskey":"31k6SUK7otXf9MXDgfGRb9N37z8xcZbdRmegNiK5k97sdfNvTSfKeEqSTxBqe7qqNa4ueYKDjW2MYgWBwYF1ohh5GzjUndykwttpffbkDGCrQAaUTJoBi9rJvrwCkkQeLKpoWTMkV6gYp1AiJkhKYiGhtCCAA3R5grGUpcMzDXqzt8R","blskey_pop":"QngATEwvD1MHDL4odeiMqg9AYp9emVmRDSQMeKwFXdtthR9x5tDvKrWFT1gZPECuaRWtEmQBQDzSxebiy5jZJ6DwNbP4EfLtKvHrmHUAVfXKvrzHJiwbeg56oXdyi84xsNLKKZrhhr8hEgpNN1F1FXHfJUDWNyMU3w81peiLLAkYrb","client_ip":"63.33.176.61","client_port":9702,"node_ip":"63.33.176.61","node_port":9701,"services":["VALIDATOR"]},"dest":"BUKQ26j7hqkW2bdQsoxHACyS1n7gCrHeYxLR4yaoWCr"},"metadata":{"digest":"31b150874511509e4ac355e37c9ce7f649fb12bc48a2cf9c591b0f390b076b67","from":"HS2VPUmJ1vJQHCjfH1w42H","reqId":1547574103955392127},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":106,"txnTime":1547574106},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"YTsBtQz1PgjHNNPsGa7i7i","value":"JJD9qYZF7z8nNqP2sAf1ER3HB9rH7FQBhPeVUjyaf3G9TsBUQCv3XVTgV9eGXke5tA7nmDHaQwhFhVDMfpZVq1E"}]},"txn":{"data":{"data":{"alias":"VALIDATOR1","blskey":"uSpMXhzYzgkShiEeWoSrKar8g2iCsg8KL9XaSSs9HNJt5MSCXKjPZtyHNN7KtuLi1ThxKZc8ZUUtjh9uz2ApXZU41PHLX4RsMEGdfMJf3FsPRP8RkodRtqXuxmTzKEvJJ4XihrgHCL85QBpBkmp2u7YioLqwhAxyDmFRLjFnHx4cwr","blskey_pop":"RHFFZHGBUFAkfYQr9nzn2FX2ZQn6u4FmRyfUTMC6DnVfBF7ogJz2oSS4vpi2MitFTwWCofZsB3g58wSPZA4PGAPR8KXjHQvEkB5MS3NDnAgjje1E8fX9XC41qhEJ1kdC68GtgTgJSJRfkmH9c3jjb8rhQskod6N8swtTpqwV4CGgoq","client_ip":"54.180.62.29","client_port":9798,"node_ip":"54.180.16.51","node_port":9799,"services":["VALIDATOR"]},"dest":"99UgWzvjVvhDHfd16V62VFdQEKn8Vk5fuMP2t1d6xx4w"},"metadata":{"digest":"d28d9fab163bd72cf7fbc254ca6b7b495101439870a064ceefd2b18f1d4417ad","from":"YTsBtQz1PgjHNNPsGa7i7i","reqId":1547599663946425568},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":107,"txnTime":1547599664},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"KSZhtVyy7yQGxHLq8pxQwX","value":"2tHAgZ2A32YBJzLBWbXcCCfEYjRAfUeswRQQkrfttwk8Av1zvwHyfqQUfQKHKtTaQc1UeUjd7Z1axgEQf9LQqTCS"}]},"txn":{"data":{"data":{"alias":"swisscom","blskey":"2Y6bbfnx22jRKT6vDFq6kJayzqrU3N6hBGvqaepepgQHrC8KyfjwsnbAxr6NAySdFq81SopX5is2nc33d2Kei2jXGjktA7VgT3JPaSQxi6cb1UVKA3taVaqPXdbQvedkkGrgdGuHJgz2Tz5yZQertL2YiqUmKjPn78vSJWF3b6BXQ4B","blskey_pop":"QqARZRNUxwb9DWJW66DAifJNMCeWo2r3Mxy2HPrDEEiFvhba7FiSxQ8czJoVa2r58GwvT9Srvh2tifKUjMsnwt2o1GioMDpTS42MyENa6tvZuGnnsErVHekH5xccnGRe4zVLd3MAmzha8RDL5pMZeLzRw5rDpQLSnJQJKrQzqLho2X","client_ip":"164.128.162.43","client_port":9702,"node_ip":"164.128.162.42","node_port":9701,"services":["VALIDATOR"]},"dest":"58b3Fy45qjcBfVtEt2Zi1MgiRzX9PPmj68FwD143SuWQ"},"metadata":{"digest":"b582d138c5f92a84059eccae5c624392fc89899e02b559dfe5521b25230b10f6","from":"KSZhtVyy7yQGxHLq8pxQwX","reqId":1547651916293792395},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":108,"txnTime":1547651916},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"KSZhtVyy7yQGxHLq8pxQwX","value":"2eF3euLofexGmoBY8BQutqNkPEGhWvomVQZK1PFs9iKRzUEkZPXAStxG8wuh59DRUcGTX3piZUQYPk6Cb7Dc3cCY"}]},"txn":{"data":{"data":{"alias":"swisscom","blskey":"2Y6bbfnx22jRKT6vDFq6kJayzqrU3N6hBGvqaepepgQHrC8KyfjwsnbAxr6NAySdFq81SopX5is2nc33d2Kei2jXGjktA7VgT3JPaSQxi6cb1UVKA3taVaqPXdbQvedkkGrgdGuHJgz2Tz5yZQertL2YiqUmKjPn78vSJWF3b6BXQ4B","blskey_pop":"QqARZRNUxwb9DWJW66DAifJNMCeWo2r3Mxy2HPrDEEiFvhba7FiSxQ8czJoVa2r58GwvT9Srvh2tifKUjMsnwt2o1GioMDpTS42MyENa6tvZuGnnsErVHekH5xccnGRe4zVLd3MAmzha8RDL5pMZeLzRw5rDpQLSnJQJKrQzqLho2X","client_ip":"164.128.162.42","client_port":9702,"node_ip":"164.128.162.43","node_port":9701,"services":["VALIDATOR"]},"dest":"58b3Fy45qjcBfVtEt2Zi1MgiRzX9PPmj68FwD143SuWQ"},"metadata":{"digest":"23c08c4db5ad3ca27e2fd38b3015525d3a76b41ba63c2fb82e2a15f67ca717fb","from":"KSZhtVyy7yQGxHLq8pxQwX","reqId":1547653252643574766},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":109,"txnTime":1547653252},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"KSZhtVyy7yQGxHLq8pxQwX","value":"mUhTwVA6XGHF82XJj4eEa5xpaK6qCFF2bwLHsVt4pnfxdVxTMYHJBVHaQfbYALSuDQfdrgktLKv6Goo8PRzvANc"}]},"txn":{"data":{"data":{"alias":"swisscom","services":[]},"dest":"58b3Fy45qjcBfVtEt2Zi1MgiRzX9PPmj68FwD143SuWQ"},"metadata":{"digest":"60ac2ccf34f393880b544c5fab223e5daf36a5fd92565556d22d589be6d2d9d1","from":"KSZhtVyy7yQGxHLq8pxQwX","reqId":1547656208364157351},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":110,"txnTime":1547656208},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"BD95LAmfVrD3JEwaereykM","value":"24goM7gvgMmhYs7VSd4TJtmUinGTySwYiB59ViLvpbQ9WV4TJZr4R9q36wX7nKRwu9aPBXiJSiEU33ozREQd3SUt"}]},"txn":{"data":{"data":{"alias":"ibmTest","blskey":"232Z7DQcjp5NPVZyzR6WWH9w9829F4NPBz87sx2LHZBnv2xntpaixyUc7J5hUtwnYgL7HyEZsf3Wgtdr5sGua7jhpJzixxtR2p4KoRZ48i62wA9Y5mJ4FmXBg3GxMwbegc2Nmqg33CGjB8cDGUZwR1jBERdZdsi3Y4CL9e9NsBqUu5C","blskey_pop":"RKL3Tji4ZKCsfBLaSAsnvDBn2TvmkkSSEKy2zDk467aXZFG4fpEV8t89w2FXGeU2vLHV1ppYpfefDoi1Qjgm7vxEPdEzys3ZxGJea9FXG78sQPurLF1XZtK1g6DV5L2YAyV3qC1pyGGibJvc5RNS6kdbihSwkpZnVRDwCr3Pk5DPiX","client_ip":"169.60.4.139","client_port":9702,"node_ip":"169.60.4.139","node_port":9701,"services":["VALIDATOR"]},"dest":"7mcctKwaBjyzAbNPS8ix1LTNxex4JchkyLvjYfw2XexR"},"metadata":{"digest":"2df2c048ffd27254d4abe5face1ca7984d058a819d791d15a11dfe6dc0885cb3","from":"BD95LAmfVrD3JEwaereykM","reqId":1547499944042787200},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":111,"txnTime":1547762408},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"KSZhtVyy7yQGxHLq8pxQwX","value":"3dz2LU41uRHr4jByQMQPN8UNbTixsMWnRkCLFBGFLH91NsFkC4hYvTmS1fSqAZWmabMwNyXGWTgCVce2axC6R52M"}]},"txn":{"data":{"data":{"alias":"swisscom","blskey":"2Y6bbfnx22jRKT6vDFq6kJayzqrU3N6hBGvqaepepgQHrC8KyfjwsnbAxr6NAySdFq81SopX5is2nc33d2Kei2jXGjktA7VgT3JPaSQxi6cb1UVKA3taVaqPXdbQvedkkGrgdGuHJgz2Tz5yZQertL2YiqUmKjPn78vSJWF3b6BXQ4B","blskey_pop":"QqARZRNUxwb9DWJW66DAifJNMCeWo2r3Mxy2HPrDEEiFvhba7FiSxQ8czJoVa2r58GwvT9Srvh2tifKUjMsnwt2o1GioMDpTS42MyENa6tvZuGnnsErVHekH5xccnGRe4zVLd3MAmzha8RDL5pMZeLzRw5rDpQLSnJQJKrQzqLho2X","client_ip":"164.128.162.43","client_port":9702,"node_ip":"164.128.162.42","node_port":9701,"services":["VALIDATOR"]},"dest":"58b3Fy45qjcBfVtEt2Zi1MgiRzX9PPmj68FwD143SuWQ"},"metadata":{"digest":"a81375c6b2e43e5ed4d44d565901e33066d77785798ddd93ed2726bea6930c4f","from":"KSZhtVyy7yQGxHLq8pxQwX","reqId":1547652168940154534},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":112,"txnTime":1547762409},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"554joew9xsZWAuwzfgK5CvAgw3hapNcET6Z7qEnVXBNBe23c9TCeAWeRoM9GYDpEypkZcQFwiQcV3jRJXq3wiFPF"}]},"txn":{"data":{"data":{"alias":"swisscom","services":[]},"dest":"58b3Fy45qjcBfVtEt2Zi1MgiRzX9PPmj68FwD143SuWQ"},"metadata":{"digest":"0a4a47a4080c3899997cc6e71e78d1e3ffd675e13d95908c9a0b122f2dd0dc8d","from":"6feBTywcmJUriqqnGc1zSJ","reqId":1548175587215323240},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":113,"txnTime":1548175587},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"nLE6kCvr6FwEBvZ8p6aw58DMwFSf7Q5CcEEyA17b4HHQMpZuYdwbpz5w2kuiSac4w9qRnPGB8ouLndmzMggFHi1"}]},"txn":{"data":{"data":{"alias":"EBPI-validation-node","services":["VALIDATOR"]},"dest":"j2JLXyTCAMuHSRqZ7eB2JCXSpPniDFUsyT5MJcGAjUG"},"metadata":{"digest":"03c6e7bb56d6a2870bc9cc7a8e3e4c226864faf1db51368047e9e92d38697138","from":"6feBTywcmJUriqqnGc1zSJ","reqId":1548184180516141458},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":114,"txnTime":1548184181},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"BD95LAmfVrD3JEwaereykM","value":"3pAYVxsFgE9u41tsucPUW4Jmy2LFQLKeNNiYcVi4MTm57GyheA5cVzbzLKq2wA4NABSd4EqLf2cCwmzZwUF2iAkE"}]},"txn":{"data":{"data":{"alias":"ibmTest","blskey":"232Z7DQcjp5NPVZyzR6WWH9w9829F4NPBz87sx2LHZBnv2xntpaixyUc7J5hUtwnYgL7HyEZsf3Wgtdr5sGua7jhpJzixxtR2p4KoRZ48i62wA9Y5mJ4FmXBg3GxMwbegc2Nmqg33CGjB8cDGUZwR1jBERdZdsi3Y4CL9e9NsBqUu5C","blskey_pop":"RKL3Tji4ZKCsfBLaSAsnvDBn2TvmkkSSEKy2zDk467aXZFG4fpEV8t89w2FXGeU2vLHV1ppYpfefDoi1Qjgm7vxEPdEzys3ZxGJea9FXG78sQPurLF1XZtK1g6DV5L2YAyV3qC1pyGGibJvc5RNS6kdbihSwkpZnVRDwCr3Pk5DPiX","client_ip":"169.60.4.138","client_port":9702,"node_ip":"169.60.4.138","node_port":9701,"services":["VALIDATOR"]},"dest":"7mcctKwaBjyzAbNPS8ix1LTNxex4JchkyLvjYfw2XexR"},"metadata":{"digest":"be3db7c6f4526eaafece89054a366726ff34fb6d93943b847222fe5660454323","from":"BD95LAmfVrD3JEwaereykM","reqId":1548190805953640600},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":115,"txnTime":1548190806},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"BD95LAmfVrD3JEwaereykM","value":"2rn9DmGEeqU4V41MbGThxEuvdZ6qLHsVDeYqJDnpDayCWVhdxXERAfKokcxrXVHPA1Q2gyekZ3jMSuLaFua1jCwD"}]},"txn":{"data":{"data":{"alias":"ibmTest","blskey":"232Z7DQcjp5NPVZyzR6WWH9w9829F4NPBz87sx2LHZBnv2xntpaixyUc7J5hUtwnYgL7HyEZsf3Wgtdr5sGua7jhpJzixxtR2p4KoRZ48i62wA9Y5mJ4FmXBg3GxMwbegc2Nmqg33CGjB8cDGUZwR1jBERdZdsi3Y4CL9e9NsBqUu5C","blskey_pop":"RKL3Tji4ZKCsfBLaSAsnvDBn2TvmkkSSEKy2zDk467aXZFG4fpEV8t89w2FXGeU2vLHV1ppYpfefDoi1Qjgm7vxEPdEzys3ZxGJea9FXG78sQPurLF1XZtK1g6DV5L2YAyV3qC1pyGGibJvc5RNS6kdbihSwkpZnVRDwCr3Pk5DPiX","client_ip":"169.60.4.139","client_port":9702,"node_ip":"169.60.4.138","node_port":9701,"services":["VALIDATOR"]},"dest":"7mcctKwaBjyzAbNPS8ix1LTNxex4JchkyLvjYfw2XexR"},"metadata":{"digest":"16bcd5c9ea536ed306bd414a3797076156c7e143ddcef630e95ee5b2a7d236d5","from":"BD95LAmfVrD3JEwaereykM","reqId":1548191738654080100},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":116,"txnTime":1548191739},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"KSZhtVyy7yQGxHLq8pxQwX","value":"2SedyJRXPkF7yyCHkvEhGeyZ34W9MXrH5AVcFFgQJ4tbsWpF9gKvYL6gawbuvAE8W2FqkKoufWFf8kgxouaZV89v"}]},"txn":{"data":{"data":{"alias":"swisscom","client_ip":"127.0.0.3","client_port":9702,"node_ip":"127.0.0.3","node_port":9701},"dest":"58b3Fy45qjcBfVtEt2Zi1MgiRzX9PPmj68FwD143SuWQ"},"metadata":{"digest":"92c8ec4f3f0aaf806b18b74afb1e8e52d06d5096b9e0c3b3996af0dfc4bf627b","from":"KSZhtVyy7yQGxHLq8pxQwX","reqId":1548781193697645899},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":117,"txnTime":1548781193},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"HMT5rCkqvjcjZZHQFvQtsX","value":"5QNoTkHzevZ328EMXUTzWWveowZE1v4bfdhxaKfNGUvuUk4ympwnkzCPRFnz57xrvouC4A2rtd2T3vj4opCgQbMB"}]},"txn":{"data":{"data":{"alias":"Swisscom","blskey":"2Dys6A6wihGsazQLKe2hN8kHQ17u9Hix9pZ2uTBtuvMSLMaaWZrMnbXYoHcv7iDc58mGBnGEA335gXN8Y1Dntjd3YgeDYS7ffpxGHDuvMzuRpD2iktMCzUCRmsSMim32vURLkPTHs8Pg2fgg4vGcsmAeGk4tFVaCVC6gASgNU9JqDKX","blskey_pop":"RZ31hdcUW3zcD2XMTqvazNcX2YxwY4HSWah9tDzTW6A7G2uhzVoy9UTqzdrGHgZ183VoNKw1EeZvB6kRZYFLckwnW8pKT7r1GS4gUPPcnQxAtogy2bMnQQ8S4ZY5e7WYn2URJ2GF1TSGnzUzqu4iQZWiMeFsBc1CVH98A9PGmYQ3z7","client_ip":"164.128.162.43","client_port":9702,"node_ip":"164.128.162.42","node_port":9701,"services":["VALIDATOR"]},"dest":"B3x2KTn46sZmajraNm9oh6EUWnZWC5yQTrJAUifwDWRV"},"metadata":{"digest":"0ad6663c3841906ffafd51a467d7c43480d912551fbd98e9cd415e1571344455","from":"HMT5rCkqvjcjZZHQFvQtsX","reqId":1548781315218601114},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":118,"txnTime":1548781315},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"G4tfohtFDtmQJAEg6Pwgg6","value":"3oR6cXp4AbetwhgHacWjnF7LhnS8q8kVzA4nqvsvvxKzDEbiFSEF4UEU5BFiiAxtXg9nm6xk5X496v6JHETYdYjU"}]},"txn":{"data":{"data":{"alias":"NECValidator","blskey":"4UVe2Ryi4oPiECy8jxEHrXbNKbyjBjADotdD7ibRfpkfHjkD7UnBVcJKq8NFFf3rmGb8G3i7hGvZw8dUyQvcx67uAKNvYA3QMc3AL77aFNXHjiU5HdEBhwvq9qjs3BWZGoPyRfxun7EjMohiHvGTiZUxAzZD3R8qpaYaJ7DUdC3k24Y","blskey_pop":"QkN8FyGfub1yoMMzHhDBdrRyfKyrqX8kuiA6dXfAM3ghMGq1wWGbA8VuuCf4eWtxZvaD8iz9shC5zJn2C6pzo3BpmmP2bufsAGVWcNhTqxKPfXHds2JC4DagX7BV5mDfTriv4mF4EJD8PbwVgGvHzGFj4FuGTx3BnA9oay3rGxf1m9","client_ip":"52.69.239.67","client_port":9702,"node_ip":"13.230.94.222","node_port":9701,"services":["VALIDATOR"]},"dest":"BLu5t8JVbpHrRrocSx1HtMqJC8xruDLisaYZMZverkBs"},"metadata":{"digest":"3e03ca15f515f8fce2287600d02ef5dee412bc2874b836b8a5831ef9cb526701","from":"G4tfohtFDtmQJAEg6Pwgg6","reqId":1548808410060957151},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":119,"txnTime":1548808410},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"Kv2YdE5KGgdruMGW6p5w4b","value":"2Fm6QXXRYDhh34H7xRYFxHJQyHymyimPBJotwKzGUWJBGEcWPdYUhUFk2VDp9JyYhkapDchyhtS7VxjvQnHc6yR1"}]},"txn":{"data":{"data":{"alias":"xsvalidatorec2irl","services":[]},"dest":"DXn8PUYKZZkq8gC7CZ2PqwECzUs2bpxYiA5TWgoYARa7"},"metadata":{"digest":"e5b3e73768c7698aafa3a9679d2b91b58be5b6a4f7e5b9669c27838b94e3cd27","from":"Kv2YdE5KGgdruMGW6p5w4b","reqId":1551902688751838000},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":120,"txnTime":1551902689},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"5M3i1PbpvEQmTk25EmAY6N","value":"5Rkz1NJxoU8rjaSeXHb77XrjD1Gedqm6ZxqN89YEtnajxztxcw5iKEBLnFg34in2ta2mkAdkLSBPEQbArPKFyG5f"}]},"txn":{"data":{"data":{"alias":"sparknz","services":[]},"dest":"DdAqLDrkEW96hcVLsEtf8SrQnUGFK7uMLyHi775kYFVw"},"metadata":{"digest":"34c208f6f214e973d926473b807e1220dd5f4167685101baa0fdde25da577054","from":"5M3i1PbpvEQmTk25EmAY6N","reqId":1551981105839004000},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":121,"txnTime":1551981106},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"5M3i1PbpvEQmTk25EmAY6N","value":"29EBhTyCNsXJ9rruhPUfY5DLoXW5JiyZy7eGNxZ649sYefMZmJdpf8dnd2LxkCNswD9oGWPXbiRZbGfCEXc35Zkf"}]},"txn":{"data":{"data":{"alias":"vnode1","services":[]},"dest":"9Aj2LjQ2fwszJRSdZqg53q5e6ayScmtpeZyPGgKDswT8"},"metadata":{"digest":"df690f4b4bd3897bbd321563ef5fbf4fdaba2b095546b19d5cc7840f309871a4","from":"5M3i1PbpvEQmTk25EmAY6N","reqId":1552398621045487000},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":122,"txnTime":1552398621},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"HS2VPUmJ1vJQHCjfH1w42H","value":"58FmzCHRRYsiyFE1NQht7Y6n5LLNMmxdVQkBnfBrpmmWHjgLWWjxSK3BwsJW1e2BHhoajGRBZdCSpMHPvwKDuXtU"}]},"txn":{"data":{"data":{"alias":"Absa","client_ip":"99.80.22.248","client_port":9702,"node_ip":"63.33.176.61","node_port":9701,"services":["VALIDATOR"]},"dest":"BUKQ26j7hqkW2bdQsoxHACyS1n7gCrHeYxLR4yaoWCr"},"metadata":{"digest":"96a1552ad574113e94baac125f9032c97e0a60abb5498ac43d2a12a85c0460fb","from":"HS2VPUmJ1vJQHCjfH1w42H","reqId":1552408626878108613},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":123,"txnTime":1552476998},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"BD95LAmfVrD3JEwaereykM","value":"4GCt8VdmfVFJtufoKD6HJBiiQTR6ujiK4bLn2NmdcQucKQNKD3Jr3McMAkwqnjDcduDdQW6AURLeSDyFBDqzZTfv"}]},"txn":{"data":{"data":{"alias":"ibmTest","services":[]},"dest":"7mcctKwaBjyzAbNPS8ix1LTNxex4JchkyLvjYfw2XexR"},"metadata":{"digest":"29a7d65b74832fc91178e60089521bf0212b48a05d7fc35be8841eeda8dc8f88","from":"BD95LAmfVrD3JEwaereykM","reqId":1552662332849012735},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":124,"txnTime":1552662333},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"c5GFhSHNMdaqjSyzQeaMa","value":"2ZSByqsx5w6rpQm6FbKt1scnUUu1VSbbwXBMoKcDCkyrdsm9yrgAKsR8myTW1z4EFt91zAFUJPoUaHnAd6oyBgin"}]},"txn":{"data":{"data":{"alias":"cynjanode","blskey":"4oMnfEbqH5fuLGQQSWLZA7L1y8D4zL232t6QiJhspA5GsKJAextNa3oyr1MK46byzax4EmyoyS74YkLD5ri6dJmRXFnKPZ9E4q8UTWFBRdmpwGiZXni9HXL8twBHhfnNE8vXirQLvzQ2gcSBRzdGHanPBwKnvqjoeNGfDfM1kT22pks","blskey_pop":"RFvdDmi1a8b1VYA8eRtTs9cC2dmhK8b2P7k9VWcPpPKwupyTQr2amdbq4GcbASyML6RXxAvZRuj2EJH3KabkT3hVPM8g1Wn1VYY2761pwCjcHfN1E2G2Nwe5sdwRqxvV965aYi9595SBVWWabx6bcJ9S5EDqKevrUnZ9nsG7xfoWEB","client_ip":"3.17.103.221","client_port":9702,"node_ip":"3.17.215.226","node_port":9701,"services":["VALIDATOR"]},"dest":"C8H9SzkM6NrfYB1jD6dMCmdBKXvcCgGZpvwD47xGdJFQ"},"metadata":{"digest":"eac8e6015ba1eb3f1b294f9c53e54bc79d27b0a690ab358bd826668999f9cc4a","from":"c5GFhSHNMdaqjSyzQeaMa","reqId":1552676534057365965},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":125,"txnTime":1552676534},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6aAJEoijPh3yqeDe9JCqRg","value":"2QzZSa4ComF5hNzGYp2KxtrAu57tstBk7jZrhv6CK95C36KL3Naif5hPJ2egD4ANjAo7VDyaSFks8fANFjFYTowH"}]},"txn":{"data":{"data":{"alias":"DigiCert-Node","blskey":"34ZnAnof88aahn2jShZqUPyvWXjM4pdjBukbH44BXAyZGcY2rivuMLHwCPZGGRf7JAVx6zGdnQiFziqwj8ndtGghht67H2DqHhoxxeCvgxv5aMAVW57z8ekGyMQXq1UWYEYgjFqY2Fi9bCTkGb4ywn4JEFvnfk3aEhVS92CpG5eYQHs","blskey_pop":"R5ksJ4cADE265315njhARQJS3eEqC4bBFjz6sW49Lc7cF814pMdKk4AjjHLCvKeViU6EP8YvhvpiuMhEYzmabsMnj7oesJGp6eqxkjSabFZ7LWk5wzfBW53fSAtBrK4KSGzAfU9zsmsNqBMuK1fiC7J1emxjaZfeXWkBV63dD36i95","client_ip":"63.33.233.212","client_port":9702,"node_ip":"34.250.128.221","node_port":9701,"services":["VALIDATOR"]},"dest":"5mYsynpwzx3muLWYP5ZmqWK8oZtP5k7xj5w85NDKJSM6"},"metadata":{"digest":"c4b76246a7000c018f70776f56accb4667a00eaab83933246b218f5cf4234fb2","from":"6aAJEoijPh3yqeDe9JCqRg","reqId":1553027997718160009},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":126,"txnTime":1553027997},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6aAJEoijPh3yqeDe9JCqRg","value":"2KPdokKdhFMouCFG2xFUmPpwhUSUzte5CdjykDd4YE1BdjZ8UuHsW7d7CLiLrcUkLxyFfKKZNHPZaLhTHjoSqTvF"}]},"txn":{"data":{"data":{"alias":"DigiCert-Node","blskey":"34ZnAnof88aahn2jShZqUPyvWXjM4pdjBukbH44BXAyZGcY2rivuMLHwCPZGGRf7JAVx6zGdnQiFziqwj8ndtGghht67H2DqHhoxxeCvgxv5aMAVW57z8ekGyMQXq1UWYEYgjFqY2Fi9bCTkGb4ywn4JEFvnfk3aEhVS92CpG5eYQHs","blskey_pop":"R5ksJ4cADE265315njhARQJS3eEqC4bBFjz6sW49Lc7cF814pMdKk4AjjHLCvKeViU6EP8YvhvpiuMhEYzmabsMnj7oesJGp6eqxkjSabFZ7LWk5wzfBW53fSAtBrK4KSGzAfU9zsmsNqBMuK1fiC7J1emxjaZfeXWkBV63dD36i95","client_ip":"34.250.128.221","client_port":9702,"node_ip":"34.250.128.221","node_port":9701,"services":["VALIDATOR"]},"dest":"5mYsynpwzx3muLWYP5ZmqWK8oZtP5k7xj5w85NDKJSM6"},"metadata":{"digest":"f5597be009afc3b9decda1e09c8f8d74bd039ac6d6cb890051c88ebeffaa16e9","from":"6aAJEoijPh3yqeDe9JCqRg","reqId":1553030138803227716},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":127,"txnTime":1553030138},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"2v7MzY14jwoMvakDWybDyf3o977GWDT1rQMd5eCEnmTjXy5kvoH99zZJVWXJibDYLU137JbsxQkh59T1HD4kNBbS"}]},"txn":{"data":{"data":{"alias":"brazil","services":[]},"dest":"2MHGDD2XpRJohQzsXu4FAANcmdypfNdpcqRbqnhkQsCq"},"metadata":{"digest":"8bca858f90639c68074c2bb5cdec23a1763e3f58ad38d82c8ebcc0c229c72daa","from":"6feBTywcmJUriqqnGc1zSJ","payloadDigest":"a89394bc38773f420ee0fa62a7e4be466a668c996b1a956e173c8c62ad4ec8ff","reqId":1558034106037397876},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":128,"txnTime":1558034106},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"QVvkFcetzE4g22g4px1iHqEonHimSsFBh7XkCTmEeBqK7oaN4j3TCDB7BjTxZmGhovc2GWVxRswN65nvFygYn7E"}]},"txn":{"data":{"data":{"alias":"canada","services":[]},"dest":"8NZ6tbcPN2NVvf2fVhZWqU11XModNudhbe15JSctCXab"},"metadata":{"digest":"59a7f83dc11a5fbb89f21738665dde7818425cade9b27ff2c944879d48aa2890","from":"6feBTywcmJUriqqnGc1zSJ","payloadDigest":"b9597e20b484f700011436a6c8b768918519980f808928de56b24225165e86e1","reqId":1558034149584193019},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":129,"txnTime":1558034149},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"gc57GehP57PUUN59tGadDjdE7LAmrfseFCqb1DgYenmFF73cUAF25gkPJxuLiFpPV5CiFPjSoAa1JQhAGUz5MDk"}]},"txn":{"data":{"data":{"alias":"england","services":[]},"dest":"DNuLANU7f1QvW1esN3Sv9Eap9j14QuLiPeYzf28Nub4W"},"metadata":{"digest":"f59bb98e1be7576c6575a5abc4ac38edd28148d84605a62437aaf3151c962f69","from":"6feBTywcmJUriqqnGc1zSJ","payloadDigest":"fe0b9e5440ac37828d86daa77be8a55c2b52c89274763673db58d9317c2d1925","reqId":1558034190209122296},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":130,"txnTime":1558034190},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"kU4vKskb9iZEy7YfUQWt9cVrYpmXcqTpctKCLnZ4JsQ9DCEL9ESZ9waC8Jw6qFAW7gQfDgqkehmkFbD9jZSgsyf"}]},"txn":{"data":{"data":{"alias":"korea","services":[]},"dest":"HCNuqUoXuK9GXGd2EULPaiMso2pJnxR6fCZpmRYbc7vM"},"metadata":{"digest":"45a6090bbffa535b34b103f0f4209b039e66c05fad50013d30e8cb139510d627","from":"6feBTywcmJUriqqnGc1zSJ","payloadDigest":"5724525adf9d82d113b1f785c39c6a3a6f6ea92e06e9dbdb57740f4e1e8a3654","reqId":1558034231813907676},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":131,"txnTime":1558034232},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"5VB9ELm2QkWug8s29obUiSxq5tWi588wnYX5nXJEmm5ewoVR5NSTHQcg9q2nm1rcy2aesVsB77e5LLWpae7uqjkb"}]},"txn":{"data":{"data":{"alias":"singapore","services":[]},"dest":"Dh99uW8jSNRBiRQ4JEMpGmJYvzmF35E6ibnmAAf7tbk8"},"metadata":{"digest":"0fb35dbf7589f7acfa487aa1eed473299d1405ed2c656b50b15175e5487f4aa9","from":"6feBTywcmJUriqqnGc1zSJ","payloadDigest":"0359d686d0935df89d4b8fbad5b7264104f2eef898a93cc388e67188d71980e4","reqId":1558034282845794593},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":132,"txnTime":1558034283},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"2wMAYGVoSt3ZtU3CzcvhzMAQ2EFhZvPwBsGKqpNmWvKVWbFeyC6yMZxHCVdtj2fqfj36FJkvPKkh3gwmvvrt6eeW"}]},"txn":{"data":{"data":{"alias":"virginia","services":[]},"dest":"EoGRm7eRADtHJRThMCrBXMUM2FpPRML19tNxDAG8YTP8"},"metadata":{"digest":"4ee79b267e7a5aa9ca96ee667f75dadfafdf1238c2841d2d5fa28accf542331c","from":"6feBTywcmJUriqqnGc1zSJ","payloadDigest":"1b4afb24a5d19cf90eb41bb9c265610a6922c6e0aa59386dc3af2016988f4dc6","reqId":1558034311268528084},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":133,"txnTime":1558034311},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"3QyhWLE53fg8wsNRFJijV6QKax2deCAzhUa1g152KYJ7exk1iqv6mLsHtY5KXNiXLg1a8vxQiFj8Hp8iRb7CXrCA"}]},"txn":{"data":{"data":{"alias":"RFCU","services":[]},"dest":"2B8bkZX3SvcBq3amP7aeATsSPz82RyyCJQbEjZpLgZLh"},"metadata":{"digest":"58c132bc0b8c96fb7628e8b7af9a9086ff2b2c894091090f88eb328ee945fe28","from":"6feBTywcmJUriqqnGc1zSJ","payloadDigest":"64b6882e3cbf71154369d91f9da431d069b465116dada6ba685928cd11c7b9e3","reqId":1558034435821210238},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":134,"txnTime":1558034436},"ver":"1"} -' \ No newline at end of file +APP_URL=localhost:4002 +AGENT_HTTP_URL=http://localhost:4002 +HOLDER_REDIRECT=http://localhost:4002/redirect + +HOLDER_CLIENT_ID=wallet + +ALLOW_INSECURE_HTTP_URLS=true + +ROOT_CA_VALIDITY_YEARS=3 +DCS_VALIDITY_YEARS=3 + +ROOT_CA_START_FROM_CURRENT_MONTH=true +DCS_START_FROM_CURRENT_MONTH=true + +NODE_ENV=DEV \ No newline at end of file diff --git a/.env.sample b/.env.sample index 9c6ae29c..0e726ab9 100644 --- a/.env.sample +++ b/.env.sample @@ -47,145 +47,17 @@ INDICIO_TEST_GENESIS=`{"reqSignature":{},"txn":{"data":{"data":{"alias":"OpsNode {"reqSignature":{},"txn":{"data":{"data":{"alias":"lorica-identity-node1","blskey":"wUh24sVCQ8PHDgSb343g2eLxjD5vwxsrETfuV2sbwMNnYon9nhbaK5jcWTekvXtyiwxHxuiCCoZwKS97MQEAeC2oLbbMeKjYm212QwSnm7aKLEqTStXht35VqZvZLT7Q3mPQRYLjMGixdn4ocNHrBTMwPUQYycEqwaHWgE1ncDueXY","blskey_pop":"R2sMwF7UW6AaD4ALa1uB1YVPuP6JsdJ7LsUoViM9oySFqFt34C1x1tdHDysS9wwruzaaEFui6xNPqJ8eu3UBqcFKkoWhdsMqCALwe63ytxPwvtLtCffJLhHAcgrPC7DorXYdqhdG2cevdqc5oqFEAaKoFDBf12p5SsbbM4PYWCmVCb","client_ip":"35.225.220.151","client_port":"9702","node_ip":"35.224.26.110","node_port":"9701","services":["VALIDATOR"]},"dest":"k74ZsZuUaJEcB8RRxMwkCwdE5g1r9yzA3nx41qvYqYf"},"metadata":{"from":"Ex6hzsJFYzNJ7kzbfncNeU"},"type":"0"},"txnMetadata":{"seqNo":6,"txnId":"6880673ce4ae4a2352f103d2a6ae20469dd070f2027283a1da5e62a64a59d688"},"ver":"1"} {"reqSignature":{},"txn":{"data":{"data":{"alias":"cysecure-itn","blskey":"GdCvMLkkBYevRFi93b6qaj9G2u1W6Vnbg8QhRD1chhrWR8vRE8x9x7KXVeUBPFf6yW5qq2JCfA2frc8SGni2RwjtTagezfwAwnorLhVJqS5ZxTi4pgcw6smebnt4zWVhTkh6ugDHEypHwNQBcw5WhBZcEJKgNbyVLnHok9ob6cfr3u","blskey_pop":"RbH9mY7M5p3UB3oj4sT1skYwMkxjoUnja8eTYfcm83VcNbxC9zR9pCiRhk4q1dJT3wkDBPGNKnk2p83vaJYLcgMuJtzoWoJAWAxjb3Mcq8Agf6cgQpBuzBq2uCzFPuQCAhDS4Kv9iwA6FsRnfvoeFTs1hhgSJVxQzDWMVTVAD9uCqu","client_ip":"35.169.19.171","client_port":"9702","node_ip":"54.225.56.21","node_port":"9701","services":["VALIDATOR"]},"dest":"4ETBDmHzx8iDQB6Xygmo9nNXtMgq9f6hxGArNhQ6Hh3u"},"metadata":{"from":"uSXXXEdBicPHMMhr3ddNF"},"type":"0"},"txnMetadata":{"seqNo":7,"txnId":"3c21718b07806b2f193b35953dda5b68b288efd551dce4467ce890703d5ba549"},"ver":"1"}` -# Specify Credebl test genesis -CREDEBL_TEST_GENESIS=`{"reqSignature": {}, "txn": {"data": {"data": {"alias": "Node1", "blskey": "4N8aUNHSgjQVgkpm8nhNEfDf6txHznoYREg9kirmJrkivgL4oSEimFF6nsQ6M41QvhM2Z33nves5vfSn9n1UwNFJBYtWVnHYMATn76vLuL3zU88KyeAYcHfsih3He6UHcXDxcaecHVz6jhCYz1P2UZn2bDVruL5wXpehgBfBaLKm3Ba", "blskey_pop": "RahHYiCvoNCtPTrVtP7nMC5eTYrsUA8WjXbdhNc8debh1agE9bGiJxWBXYNFbnJXoXhWFMvyqhqhRoq737YQemH5ik9oL7R4NTTCz2LEZhkgLJzB3QRQqJyBNyv7acbdHrAT8nQ9UkLbaVL9NBpnWXBTw4LEMePaSHEw66RzPNdAX1", "client_ip": "192.168.1.74", "client_port": 9702, "node_ip": "192.168.1.74", "node_port": 9701, "services": ["VALIDATOR"]}, "dest": "Gw6pDLhcBcoQesN72qfotTgFa7cbuqZpkX3Xo6pLhPhv"}, "metadata": {"from": "Th7MpTaRZVRYnPiabds81Y"}, "type": "0"}, "txnMetadata": {"seqNo": 1, "txnId": "fea82e10e894419fe2bea7d96296a6d46f50f93f9eeda954ec461b2ed2950b62"}, "ver": "1"} -{"reqSignature": {}, "txn": {"data": {"data": {"alias": "Node2", "blskey": "37rAPpXVoxzKhz7d9gkUe52XuXryuLXoM6P6LbWDB7LSbG62Lsb33sfG7zqS8TK1MXwuCHj1FKNzVpsnafmqLG1vXN88rt38mNFs9TENzm4QHdBzsvCuoBnPH7rpYYDo9DZNJePaDvRvqJKByCabubJz3XXKbEeshzpz4Ma5QYpJqjk", "blskey_pop": "Qr658mWZ2YC8JXGXwMDQTzuZCWF7NK9EwxphGmcBvCh6ybUuLxbG65nsX4JvD4SPNtkJ2w9ug1yLTj6fgmuDg41TgECXjLCij3RMsV8CwewBVgVN67wsA45DFWvqvLtu4rjNnE9JbdFTc1Z4WCPA3Xan44K1HoHAq9EVeaRYs8zoF5", "client_ip": "192.168.1.74", "client_port": 9704, "node_ip": "192.168.1.74", "node_port": 9703, "services": ["VALIDATOR"]}, "dest": "8ECVSk179mjsjKRLWiQtssMLgp6EPhWXtaYyStWPSGAb"}, "metadata": {"from": "EbP4aYNeTHL6q385GuVpRV"}, "type": "0"}, "txnMetadata": {"seqNo": 2, "txnId": "1ac8aece2a18ced660fef8694b61aac3af08ba875ce3026a160acbc3a3af35fc"}, "ver": "1"} -{"reqSignature": {}, "txn": {"data": {"data": {"alias": "Node3", "blskey": "3WFpdbg7C5cnLYZwFZevJqhubkFALBfCBBok15GdrKMUhUjGsk3jV6QKj6MZgEubF7oqCafxNdkm7eswgA4sdKTRc82tLGzZBd6vNqU8dupzup6uYUf32KTHTPQbuUM8Yk4QFXjEf2Usu2TJcNkdgpyeUSX42u5LqdDDpNSWUK5deC5", "blskey_pop": "QwDeb2CkNSx6r8QC8vGQK3GRv7Yndn84TGNijX8YXHPiagXajyfTjoR87rXUu4G4QLk2cF8NNyqWiYMus1623dELWwx57rLCFqGh7N4ZRbGDRP4fnVcaKg1BcUxQ866Ven4gw8y4N56S5HzxXNBZtLYmhGHvDtk6PFkFwCvxYrNYjh", "client_ip": "192.168.1.74", "client_port": 9706, "node_ip": "192.168.1.74", "node_port": 9705, "services": ["VALIDATOR"]}, "dest": "DKVxG2fXXTU8yT5N7hGEbXB3dfdAnYv1JczDUHpmDxya"}, "metadata": {"from": "4cU41vWW82ArfxJxHkzXPG"}, "type": "0"}, "txnMetadata": {"seqNo": 3, "txnId": "7e9f355dffa78ed24668f0e0e369fd8c224076571c51e2ea8be5f26479edebe4"}, "ver": "1"} -{"reqSignature": {}, "txn": {"data": {"data": {"alias": "Node4", "blskey": "2zN3bHM1m4rLz54MJHYSwvqzPchYp8jkHswveCLAEJVcX6Mm1wHQD1SkPYMzUDTZvWvhuE6VNAkK3KxVeEmsanSmvjVkReDeBEMxeDaayjcZjFGPydyey1qxBHmTvAnBKoPydvuTAqx5f7YNNRAdeLmUi99gERUU7TD8KfAa6MpQ9bw", "blskey_pop": "RPLagxaR5xdimFzwmzYnz4ZhWtYQEj8iR5ZU53T2gitPCyCHQneUn2Huc4oeLd2B2HzkGnjAff4hWTJT6C7qHYB1Mv2wU5iHHGFWkhnTX9WsEAbunJCV2qcaXScKj4tTfvdDKfLiVuU2av6hbsMztirRze7LvYBkRHV3tGwyCptsrP", "client_ip": "192.168.1.74", "client_port": 9708, "node_ip": "192.168.1.74", "node_port": 9707, "services": ["VALIDATOR"]}, "dest": "4PS3EDQ3dW1tci1Bp6543CfuuebjFrg36kLAUcskGfaA"}, "metadata": {"from": "TWwCRQRZ2ZHMJFn9TzLp7W"}, "type": "0"}, "txnMetadata": {"seqNo": 4, "txnId": "aa5e817d7cc626170eca175822029339a444eb0ee8f0bd20d3b0b76e566fb008"}, "ver": "1"}` +APP_URL= +AGENT_HTTP_URL= +HOLDER_REDIRECT= +HOLDER_CLIENT_ID= -# Specify SOVRIN Staging genesis -SOVRIN_STAGING_NET=`{"reqSignature":{},"txn":{"data":{"data":{"alias":"australia","client_ip":"52.64.96.160","client_port":"9702","node_ip":"52.64.96.160","node_port":"9701","services":["VALIDATOR"]},"dest":"UZH61eLH3JokEwjMWQoCMwB3PMD6zRBvG6NCv5yVwXz"},"metadata":{"from":"3U8HUen8WcgpbnEz1etnai"},"type":"0"},"txnMetadata":{"seqNo":1,"txnId":"c585f1decb986f7ff19b8d03deba346ab8a0494cc1e4d69ad9b8acb0dfbeab6f"},"ver":"1"} -{"reqSignature":{},"txn":{"data":{"data":{"alias":"brazil","client_ip":"54.233.203.241","client_port":"9702","node_ip":"54.233.203.241","node_port":"9701","services":["VALIDATOR"]},"dest":"2MHGDD2XpRJohQzsXu4FAANcmdypfNdpcqRbqnhkQsCq"},"metadata":{"from":"G3knUCmDrWd1FJrRryuKTw"},"type":"0"},"txnMetadata":{"seqNo":2,"txnId":"5c8f52ca28966103ff0aad98160bc8e978c9ca0285a2043a521481d11ed17506"},"ver":"1"} -{"reqSignature":{},"txn":{"data":{"data":{"alias":"canada","client_ip":"52.60.207.225","client_port":"9702","node_ip":"52.60.207.225","node_port":"9701","services":["VALIDATOR"]},"dest":"8NZ6tbcPN2NVvf2fVhZWqU11XModNudhbe15JSctCXab"},"metadata":{"from":"22QmMyTEAbaF4VfL7LameE"},"type":"0"},"txnMetadata":{"seqNo":3,"txnId":"408c7c5887a0f3905767754f424989b0089c14ac502d7f851d11b31ea2d1baa6"},"ver":"1"} -{"reqSignature":{},"txn":{"data":{"data":{"alias":"england","client_ip":"52.56.191.9","client_port":"9702","node_ip":"52.56.191.9","node_port":"9701","services":["VALIDATOR"]},"dest":"DNuLANU7f1QvW1esN3Sv9Eap9j14QuLiPeYzf28Nub4W"},"metadata":{"from":"NYh3bcUeSsJJcxBE6TTmEr"},"type":"0"},"txnMetadata":{"seqNo":4,"txnId":"d56d0ff69b62792a00a361fbf6e02e2a634a7a8da1c3e49d59e71e0f19c27875"},"ver":"1"} -{"reqSignature":{},"txn":{"data":{"data":{"alias":"korea","client_ip":"52.79.115.223","client_port":"9702","node_ip":"52.79.115.223","node_port":"9701","services":["VALIDATOR"]},"dest":"HCNuqUoXuK9GXGd2EULPaiMso2pJnxR6fCZpmRYbc7vM"},"metadata":{"from":"U38UHML5A1BQ1mYh7tYXeu"},"type":"0"},"txnMetadata":{"seqNo":5,"txnId":"76201e78aca720dbaf516d86d9342ad5b5d46f5badecf828eb9edfee8ab48a50"},"ver":"1"} -{"reqSignature":{},"txn":{"data":{"data":{"alias":"singapore","client_ip":"13.228.62.7","client_port":"9702","node_ip":"13.228.62.7","node_port":"9701","services":["VALIDATOR"]},"dest":"Dh99uW8jSNRBiRQ4JEMpGmJYvzmF35E6ibnmAAf7tbk8"},"metadata":{"from":"HfXThVwhJB4o1Q1Fjr4yrC"},"type":"0"},"txnMetadata":{"seqNo":6,"txnId":"51e2a46721d104d9148d85b617833e7745fdbd6795cb0b502a5b6ea31d33378e"},"ver":"1"} -{"reqSignature":{},"txn":{"data":{"data":{"alias":"virginia","client_ip":"34.225.215.131","client_port":"9702","node_ip":"34.225.215.131","node_port":"9701","services":["VALIDATOR"]},"dest":"EoGRm7eRADtHJRThMCrBXMUM2FpPRML19tNxDAG8YTP8"},"metadata":{"from":"SPdfHq6rGcySFVjDX4iyCo"},"type":"0"},"txnMetadata":{"seqNo":7,"txnId":"0a4992ea442b53e3dca861deac09a8d4987004a8483079b12861080ea4aa1b52"},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"3U8HUen8WcgpbnEz1etnai","value":"NXjsBfaDijk6P6W6fg1EKrzPYhDvkNHbDcSMaYdja4URdiEdaPFcqXQttgwytcKZL79BsV3i8ShWbDS5L9Um5Pj"}]},"txn":{"data":{"data":{"alias":"australia","blskey":"31My1Ya9D1v5edgkGfYb96k4HWN1GwWWUeEnzzgw3NpiVmjpyjKgPmTYvPWZAYt8CLJLWzoQrEcBYhKRedsx8JMEB4LyPVx5vgbcjKsiUK2985t9Pkpn45UAYjDvVmGSbF2y99mMjQxpt7nCwGZ9yKcEm1cLpyHxvbnceZGkf8e9HYs"},"dest":"UZH61eLH3JokEwjMWQoCMwB3PMD6zRBvG6NCv5yVwXz"},"metadata":{"digest":"f8297516300f34624d25bf38b558f8ac9df2830a4e7fe8ccdf6816ec597da4cc","from":"3U8HUen8WcgpbnEz1etnai","reqId":1518718611795589},"type":"0"},"txnMetadata":{"seqNo":8,"txnTime":1518718611},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"3U8HUen8WcgpbnEz1etnai","value":"4wiCViKevghYdtcdJXdAmS4Cwy9dAsc5eDUqHnjZXcnBbVpc71iHdyWj83U4teK65Yq2g2no8ddzJscEVTZn1ueC"}]},"txn":{"data":{"data":{"alias":"australia","blskey":"KMbkBaLigL6wUbYZmh3d41EeCRVrW1hWkpGRcy2CXZ6ugZF1Zb7ZeL3RPRasaARYkuWmjYAuLE8WiVC1dL5ZQuJczAJfDsk73hxivHxqeBaXDQwEBN2dESLZHdK3oMU79ZhqBqnEgvvAvmVyyneW661if5c45AFJgGYPtpenxS49MB"},"dest":"UZH61eLH3JokEwjMWQoCMwB3PMD6zRBvG6NCv5yVwXz"},"metadata":{"digest":"77ab856e84ef72f87a6e99ecd447da338d1eddf332b9cd33a1399aba98d39ef4","from":"3U8HUen8WcgpbnEz1etnai","reqId":1518718754041702},"type":"0"},"txnMetadata":{"seqNo":9,"txnTime":1518718754},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"G3knUCmDrWd1FJrRryuKTw","value":"5owgEB8jgYUaGsH3pV6DyFMSiwXPqMgM4u9NzgCyJpnENTzyF1BmeVaNomRunbL9R4EhfbrDNHW9RJFd5GT5pAPs"}]},"txn":{"data":{"data":{"alias":"brazil","blskey":"2G1tp8pjdRSiZnpsWpN5c4tnGGTCPbqEkf8MyaVnfSxBun7pdtRqq83E7XnY4uzNmzpBF5PZcPBonfZXzCT2qWjRAB7PaDUWU5zWfLKhNoRmEzaeFp2dVkd9XrcefSfynStWsiPmv4tG8CHX153kL9Le7LMBk9qCRjeXn77wCUXqyvB"},"dest":"2MHGDD2XpRJohQzsXu4FAANcmdypfNdpcqRbqnhkQsCq"},"metadata":{"digest":"999bb3eecd2807ebf31c619518775f6219a1a6e51234f3a1f3b1021dd900dd97","from":"G3knUCmDrWd1FJrRryuKTw","reqId":1518719363728031},"type":"0"},"txnMetadata":{"seqNo":10,"txnTime":1518719363},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"22QmMyTEAbaF4VfL7LameE","value":"5yVCBN5z8ehtM14FdGcRPDEc3asUrEH83PdbEBpfyrvHprn8iUZMBSCo4kkirvS1HirLLxU4mHssGvm4baGfTXfc"}]},"txn":{"data":{"data":{"alias":"canada","blskey":"q6nBf5jDDQN23yKEvVsxYjMkS843yspF44867S9Fhht2uUogbAed4cXLfxdTJMLYvsNT2fhA2jmnNSQwUyWfXjBFUSZqNhvJdC3d5XvcW8aqCGnV1BY9fR1kvrQXoLjaYgr1Je33NJxLNpJLumGF6WvuW6SuZYJPbfWxo7F1Vhy8oV"},"dest":"8NZ6tbcPN2NVvf2fVhZWqU11XModNudhbe15JSctCXab"},"metadata":{"digest":"306bb20ca4c46e485e0c93abd6ee9960d8954928d5603d79ade75c7ef22c4288","from":"22QmMyTEAbaF4VfL7LameE","reqId":1518719479176817},"type":"0"},"txnMetadata":{"seqNo":11,"txnTime":1518719479},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"NYh3bcUeSsJJcxBE6TTmEr","value":"G99xrEafV1BhUtgLb8jugDQvu4JLp5R2s5T4ZqSuy5pPNnDRZyhWn6iW89Uwe476uxxdugx7TzEXY61wZXCsUNs"}]},"txn":{"data":{"data":{"alias":"england","blskey":"3TXrLKV5Yn2BE47NBEvM9u6J2DUsn414sUhQQQN1X2mRKhsPvWnixqo1AbFC5kRVjpHDhRPzvenm7cApfGcCGMDME1mSwESxiYgkgpahc9DuGD5hvFieryk3yJ96jcumWA7NUUDYmiHhZfCThXvGS9agXK4Kt3sgxBYQ17yN7wj3cRN"},"dest":"DNuLANU7f1QvW1esN3Sv9Eap9j14QuLiPeYzf28Nub4W"},"metadata":{"digest":"fb5062d61960bd6f742519c6df9ca5463e6c83689cad58a7c84783a7d013c3fb","from":"NYh3bcUeSsJJcxBE6TTmEr","reqId":1518719555172082},"type":"0"},"txnMetadata":{"seqNo":12,"txnTime":1518719555},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"U38UHML5A1BQ1mYh7tYXeu","value":"4ns8r24bUMZqs2AVrBUpK66gGBA3pp2h98BM8XC2nHghbyrmWA6KpSjnmEfLKBgDZcFaoSX4Wu2d6TJzeRsVQQ8Q"}]},"txn":{"data":{"data":{"alias":"korea","blskey":"2b51xiHs4afNBiTUenKJ2XHmPMfYcNFHAwB2x39z953y1YawDTKnUW9Q2gPCQvRR5esvF235PHfv9b5GYFnXPo41wzotm7LiYsYimAarVh2PFo3CAz5DSo9xA6Xo9EhP2JnDSvi2APqGn2UpoYtpRtz2bMFurqrnw6UPz4vq91x23hJ"},"dest":"HCNuqUoXuK9GXGd2EULPaiMso2pJnxR6fCZpmRYbc7vM"},"metadata":{"digest":"4943fc79d796067841ad0aeb0e44c54bb88a1e152e2bc482925ebe3df9e5d032","from":"U38UHML5A1BQ1mYh7tYXeu","reqId":1518719649363976},"type":"0"},"txnMetadata":{"seqNo":13,"txnTime":1518719649},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"HfXThVwhJB4o1Q1Fjr4yrC","value":"2pC8hkN3MxyJeUZmkqhvvUEi3uCwTbKd14Yjc4uVJjNqx2Hj6oXvwaZPvmJn3VJMkKKE7tpFrtwyFXx8CJ5WwArf"}]},"txn":{"data":{"data":{"alias":"singapore","blskey":"CT7HsX8MAcAnWZ8CFF1ttdYG91hNc7K9dGfpcp4QprLRYVR2XSr2ywHuNT5zLPvTkGDjrjyF2HdMbLkdNGgRa5LH1Am3D619yycJjP8t51c2XygEjoa6J1TmUjYkuC44Q6Aq1BriX5hJ2oxJL3bvnM2g7QRzRPyFdM771zNutV72W3"},"dest":"Dh99uW8jSNRBiRQ4JEMpGmJYvzmF35E6ibnmAAf7tbk8"},"metadata":{"digest":"2dce61e98838e65cd7c303adc248c8fabeab4ecc0492f16572521b2f1939c975","from":"HfXThVwhJB4o1Q1Fjr4yrC","reqId":1518719769599617},"type":"0"},"txnMetadata":{"seqNo":14,"txnTime":1518719769},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"SPdfHq6rGcySFVjDX4iyCo","value":"2xLQwrn2jvg6XZcXGuW6AQ3PKiSHPNAdaHM6CVb8iwDA15HHoPUSi2PGkFvUyFya82QiCA22Y11NDX4Yh4Kx7DqR"}]},"txn":{"data":{"data":{"alias":"virginia","blskey":"372y1y4t9JdTtkyA4C5ANi88YGGaBtSpWd1FL6TJawxn1gnkebpztpsiN5AjTkwARMsTZWX8VyBZ3UGhPd7grmVgoBogTBf1LyvpnmVJR2p9TC26fDFz9GFhynAcPfHQ3xLvVjSyAYH8JjEHRS2yMXxhq8gZCTy494shNXP1wKCD8Ny"},"dest":"EoGRm7eRADtHJRThMCrBXMUM2FpPRML19tNxDAG8YTP8"},"metadata":{"digest":"113c1a81394cbadc48d57aef9d9eb93722f318d01261ed3dc162d8e0f527e37a","from":"SPdfHq6rGcySFVjDX4iyCo","reqId":1518719862981841},"type":"0"},"txnMetadata":{"seqNo":15,"txnTime":1518719863},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"A3h7JbvErKPCfaJx3VNRJ9","value":"4jzEdvJYAKB4vMNMU2VVe4dvGwT2fy28WPuvZipVEqf6R7qkuDWBXLYLBSzGAkUErtRKUnb7KH2eSrZSEgHRozTx"}]},"txn":{"data":{"data":{"alias":"ibm","blskey":"Wv1XfnPWngRPQNQnnaMsewidNtc6Rc2mx842q5ApKTgUdUs2YBZZFgSw4TdWa8HVMZvptiukdooXhTimEwxw9dFQRK5faYb2LBdeRZ6RR2kXz39a6vjyG71arL7Q6FnetH6N2NMFBACdu1PBUYKWAyBn5K8ZUUGgt2YhmZJ9DnieLa","client_ip":"169.60.5.114","client_port":9702,"node_ip":"169.60.5.114","node_port":9701,"services":["VALIDATOR"]},"dest":"Eq7m7GMFKPeq5Ek3HH1PkHxzZ46R9VL1Eube3U9wfjp5"},"metadata":{"digest":"a1dfd555da4085210b53245a199a7d431f4a6328e8936050ec3dc794fe5a2b07","from":"A3h7JbvErKPCfaJx3VNRJ9","reqId":1518798036389445},"type":"0"},"txnMetadata":{"seqNo":16,"txnTime":1518798036},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"TnxHS11bsfWrzzi612R2X8","value":"5tHfCPQfV2XAqo7V42akRqmtDqmbX4HUMAZSy9xKz6vERMSDFHmraW4ZEK9hUacjiRthn7P5KuLmopu1mCLwWXhq"}]},"txn":{"data":{"data":{"alias":"RFCU","blskey":"3FuY8wqmBi2XxL4EtJDo3Lhad48QN5ZbhH4kEV3Kfkeb53x94qmWfRndZQJo91M3aWtYpZaZqDaqrQMpuEcAvh8g9hLmb9BWbhK6BVvACSJ2RUiDhBRp4NPkg93tNmQjkdzWoUznFZvbPTTBPBcsmngTake7Sm4YLf1tbd8vuF7Nqkd","client_ip":"207.108.62.234","client_port":9702,"node_ip":"207.108.62.234","node_port":9701,"services":["VALIDATOR"]},"dest":"2B8bkZX3SvcBq3amP7aeATsSPz82RyyCJQbEjZpLgZLh"},"metadata":{"digest":"54d0fb8b9ebc2167d16f9d2027b49917fb484ec6e33caad48bf1516ba27460af","from":"TnxHS11bsfWrzzi612R2X8","reqId":1518798718080714},"type":"0"},"txnMetadata":{"seqNo":17,"txnTime":1518798718},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"ApndPYajjcdTnpvopThGwh","value":"5eyGhLmKmJx5SzkqmS5LD4s4rkQHDAeGh7PmZKhTNJ8MxdbSaZEGjVj4XYD37GeGTepfLwmivJDJjfYaDQGV7aoi"}]},"txn":{"data":{"data":{"alias":"pcValidator01","blskey":"3NU2sWYG7eeJY66W1FGpLgLaDS9fDQfKMNgPGMCk9iTcatMd4XdmAF5UqULkLUpGWABftNTrRsgm82DpfJ1cTu7CTB84KYoW4SYf7Rq4a2wi6rVbmU6k76ZYgmny6h8vqBbdRwozxVTjkPyzV6Z5MSA3vrDdf31iiiPEcXTTT3oFhKC","client_ip":"52.175.254.49","client_port":9799,"node_ip":"52.175.254.49","node_port":9701,"services":["VALIDATOR"]},"dest":"5fKwygs8KEGoUPGa65qz1oCm7h6Fb7HrML9r4jmZ9cic"},"metadata":{"digest":"9dd9cd0dc1ee21694c798c41e80922afd44e70b4e067b2c9c3582c929248ee74","from":"ApndPYajjcdTnpvopThGwh","reqId":1518809271040696},"type":"0"},"txnMetadata":{"seqNo":18,"txnTime":1518809270},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"G4zXq8L7L8n73WKSVv2HxY","value":"Yyd84xQCFWTQovZjUFohaXp3UhXdHX4wj25CGnpvcQs9LKE37DRj4DWvh2RkJALeBLtPZJsXwzKyuivPxLA8QVj"}]},"txn":{"data":{"data":{"alias":"NewtonD","blskey":"36fw9Bz4tLCkzZhUQdA2N51AZWCF6sdyiDuAX7WuNsqeq3C2dCzvS9GeSxt9t1BWxtHWc2GJDVBcqZKGh7Tg2eoQa1KTPhPFRdShBhYPDfP85gKKshHa5aEdLBvTsUkADaDoyFv4rhqTLDFbdcu4WsQE59pxyj3QTSAURgRhxkcm2oJ","client_ip":"52.165.40.82","client_port":9701,"node_ip":"40.69.165.222","node_port":9777,"services":["VALIDATOR"]},"dest":"HU8AkmtsqvcfEtvdWAZgZZFfvKYH8vu2YdgkkHrmNDGP"},"metadata":{"digest":"e0afed7d71f511362c2b21cb90c0b68fc1cb176e233d147a267375350133a6b6","from":"G4zXq8L7L8n73WKSVv2HxY","reqId":1519949508036643},"type":"0"},"txnMetadata":{"seqNo":19,"txnTime":1519949508},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"EKvw1VdXwS2pWKLLyBLCDs","value":"DqCfNstgx5q8gaM57b6qUooHCuhFFqqs7H995UDSBARoD7LWn6gaqJAmcz56NMUmtiWSqpqreBFxwPMr66xPj2Z"}]},"txn":{"data":{"data":{"alias":"Aalto","blskey":"emFqQUM4yqEWdhbk8KzLry6okMk5MsQUoR922BdBS8KBFxNAofPPDzDSR6pwu8ytZVVrfWGbVBs3D6WDt8dZAQY1xYJoAax7pt9Bkgen5Tc2BM5dLhuHpDwRLAmXFFxQbTxArAKidQeeB9wBJbScbbVnWjNNiYPreaZjgFXUGoWjSS","client_ip":"130.233.224.231","client_port":9702,"node_ip":"130.233.224.231","node_port":9701,"services":["VALIDATOR"]},"dest":"7JYQmTE6mBxa5RAZwXAj4bxqetAy64tcEUShqzJjLRrE"},"metadata":{"digest":"5c717908d4b75e92767cca818ac7530789c765c08207eec38cd18eff93b76502","from":"EKvw1VdXwS2pWKLLyBLCDs","reqId":1520418048198552},"type":"0"},"txnMetadata":{"seqNo":20,"txnTime":1520418048},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"Qm7Ugni6jFRpfbPkzhXzXH","value":"jAGG7yFmyLXRGUS2yqoNikvCGWhWeS9eFRyb5vfzu9ZjuAqbiyL4SfNv8NpMAs9Bsda5Y9kZfg9wrW8GufX8NNN"}]},"txn":{"data":{"data":{"alias":"Stuard","blskey":"4Yry2Z17vf1Hf24HvRrduj3Zi5LBJ1x7PbDqNWX19RxHcYJVjpy2f9qriZk7Fx812Xip6LEhsEXWRB1qKujBwdLNbCvMFYnJK2kS2B9HNgDgbVwDbpw16QNuJMtUnvQv1B6vCmci96gypYWMvZmJ6p9qsPXA7CZ2ZSjRuLg3RqvD7y4","client_ip":"10.0.0.10","client_port":9702,"node_ip":"10.0.0.10","node_port":9701,"services":["VALIDATOR"]},"dest":"C4e4rEwPZ4bM341VEL9ysnAgBiMW42RH3UmbriPuzoCb"},"metadata":{"digest":"70d1ed111dd5fec2e46378152f0e8ed5a99728e06288f721fad337b8ba9bae3c","from":"Qm7Ugni6jFRpfbPkzhXzXH","reqId":1521022519350930},"type":"0"},"txnMetadata":{"seqNo":21,"txnTime":1521022519},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"Qm7Ugni6jFRpfbPkzhXzXH","value":"5yKYfGouHn494CtFhEMLYYuWHC9rPhsUWBpXLneJT8jt869rjVxeab9iABYS2Uq55Avjwtd25Xfvyru57HwQMfZb"}]},"txn":{"data":{"data":{"alias":"Stuard","blskey":"4Yry2Z17vf1Hf24HvRrduj3Zi5LBJ1x7PbDqNWX19RxHcYJVjpy2f9qriZk7Fx812Xip6LEhsEXWRB1qKujBwdLNbCvMFYnJK2kS2B9HNgDgbVwDbpw16QNuJMtUnvQv1B6vCmci96gypYWMvZmJ6p9qsPXA7CZ2ZSjRuLg3RqvD7y4","client_ip":"185.27.183.66","client_port":9702,"node_ip":"185.27.183.66","node_port":9701,"services":["VALIDATOR"]},"dest":"C4e4rEwPZ4bM341VEL9ysnAgBiMW42RH3UmbriPuzoCb"},"metadata":{"digest":"0c7f5c756b286dcf1c769cec7a3d5cfeaf57c38ac25e4a83e9d37b417b20774c","from":"Qm7Ugni6jFRpfbPkzhXzXH","reqId":1521070797707610},"type":"0"},"txnMetadata":{"seqNo":22,"txnTime":1521070797},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"FzUUYiVKCDnSWd77NHfhpZ","value":"3Q3ijuEPihRyGsZFvmb414AWWQ7iMskCHoP7bC14FgPesNdPNY3pdfddEfPf5FrCg4wzdvdAFjKaBunHHwXCG4V3"}]},"txn":{"data":{"data":{"alias":"TNO","blskey":"37d7DmcwGWM7yfnpwLGzwVy6zZwoc6cAgeeSJFBWbVh6jq5tP8dPf7s2XDxxtWafmr1JdyzycBcNztEsE8Uf9qX2jRoXzhCnjEEYJCAByEn5hWC2VQ9EqkuKzq28Vob7Piof7rEJeUPxuBZtrXL1khyTN2waQtix6CYtv9QejNPZVJ2","client_ip":"134.221.127.143","client_port":9702,"node_ip":"134.221.127.143","node_port":9701,"services":["VALIDATOR"]},"dest":"TZxmZoXwNk1X5o48pXqbDFz6mTJT5QkiRme9z5p86KQ"},"metadata":{"digest":"0f3b44855c6f562b17321efe51f00edab1cdbe8608c667669e8085430fa32cc5","from":"FzUUYiVKCDnSWd77NHfhpZ","reqId":1521195244613677},"type":"0"},"txnMetadata":{"seqNo":23,"txnTime":1521195244},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"3jN1g2dAPKx5giEKnc5k9GiYHBw5yFZD8D8GiuFBL7wuHUDabobCeCCDezboxqkCpHSLsVE5hDzq6RQWUKwHXwv1"}]},"txn":{"data":{"data":{"alias":"Stuard","services":[]},"dest":"C4e4rEwPZ4bM341VEL9ysnAgBiMW42RH3UmbriPuzoCb"},"metadata":{"digest":"f24b5dda0fe64addafbbdd67aa2be5731064d6c6215d56e883e67009df0ce0d8","from":"6feBTywcmJUriqqnGc1zSJ","reqId":1521760233710703},"type":"0"},"txnMetadata":{"seqNo":24,"txnTime":1521761250},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"5omTkQAe1LmYQfY4PdYf3YEjVM1jBs2Qr8x8LAhghD3ymeudEvm1dyk3nQtEtNzFvAeGhnajWMA862DWM4Hg51vv"}]},"txn":{"data":{"data":{"alias":"Aalto","services":[]},"dest":"7JYQmTE6mBxa5RAZwXAj4bxqetAy64tcEUShqzJjLRrE"},"metadata":{"digest":"f526af4c7569c941f69f1fb2dc3ad6ef98bdef2aa2aceca33d43dc92900d65bb","from":"6feBTywcmJUriqqnGc1zSJ","reqId":1521822633807532},"type":"0"},"txnMetadata":{"seqNo":25,"txnTime":1521822633},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"4YtbkvnTMfMA6d9FjkjBcueFGq5PnLoHFKn8HAGiLKxcob2QM6KsdwLRapQcbtn9N33NimyeFzrHCerzAcbS8fVq"}]},"txn":{"data":{"data":{"alias":"pcValidator01","services":[]},"dest":"5fKwygs8KEGoUPGa65qz1oCm7h6Fb7HrML9r4jmZ9cic"},"metadata":{"digest":"f0986bab87b08031cfaeb58a06e27e8c1214f4c20af0e26c709c1c3970c0b241","from":"6feBTywcmJUriqqnGc1zSJ","reqId":1521825598199425},"type":"0"},"txnMetadata":{"seqNo":26,"txnTime":1521825598},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"G4zXq8L7L8n73WKSVv2HxY","value":"5kkkxWBUmYYcrFSKQcgaAEhcsiwJft74Js5VpwBzL1ssfFJRJgDdjhW27hZRCao994DW5b17Xgw6UqSyBLP7UmyD"}]},"txn":{"data":{"data":{"alias":"NewtonD","services":[]},"dest":"HU8AkmtsqvcfEtvdWAZgZZFfvKYH8vu2YdgkkHrmNDGP"},"metadata":{"digest":"e2d73bb8154e3372fa0c8d57c1383c2b4710308198a76580f15ce2c3ffd5f204","from":"G4zXq8L7L8n73WKSVv2HxY","reqId":1521831913747645},"type":"0"},"txnMetadata":{"seqNo":27,"txnTime":1521831913},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"G4zXq8L7L8n73WKSVv2HxY","value":"4L9AFEy3gdV1KNHsuG4gWSuETzTmJ2aD5TzSdWiQCm13o6GfNAY8YoemyiTiwnX8mzxdghgc38CLhEBm3DwfC3Dv"}]},"txn":{"data":{"data":{"alias":"NewtonD","services":["VALIDATOR"]},"dest":"HU8AkmtsqvcfEtvdWAZgZZFfvKYH8vu2YdgkkHrmNDGP"},"metadata":{"digest":"d83f3622a59d8fe15448389a185752add786de3eaf0cabfc17cea86dc503c2a5","from":"G4zXq8L7L8n73WKSVv2HxY","reqId":1521833231516195},"type":"0"},"txnMetadata":{"seqNo":28,"txnTime":1521833231},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"xzjjfKfJJJeQxZb5WhMYyHDcDG5dZCAvsYmBh6FtP9J1ckQUazaJ7AC2ksHzjARW9kkcFBS4B1M4R7y5Bc3BN5S"}]},"txn":{"data":{"data":{"alias":"TNO","services":[]},"dest":"TZxmZoXwNk1X5o48pXqbDFz6mTJT5QkiRme9z5p86KQ"},"metadata":{"digest":"03c5763b3be5b2c53be3f2af041071bdb2f2aa08754adbdcebbcbbe055036cd6","from":"6feBTywcmJUriqqnGc1zSJ","reqId":1522073964061797},"type":"0"},"txnMetadata":{"seqNo":29,"txnTime":1522073964},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"nm4hZxHEb86rDjHddyuFgnuy7hS7bf1Biifnje3c75Kgn1eQ5frc9xwVWFUzZNFntfVckXQK3U97wRiiP7MrijK"}]},"txn":{"data":{"data":{"alias":"NewtonD","services":[]},"dest":"HU8AkmtsqvcfEtvdWAZgZZFfvKYH8vu2YdgkkHrmNDGP"},"metadata":{"digest":"a81744dd61919ea58d75904a8d6921be18362cecb174e3d5f318384c99d912c2","from":"6feBTywcmJUriqqnGc1zSJ","reqId":1523554207793968},"type":"0"},"txnMetadata":{"seqNo":30,"txnTime":1523554207},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"LKjUWXR3QpGsMkgB2XFyzt","value":"671v9pVTeRwN4XybdY5tjGyJZCNhGPFq3bcBxymCGJ18EQbBdDa6LXGh3brvWQ53yncspYbywrgC7eGknnqYR2GB"}]},"txn":{"data":{"data":{"alias":"VeridiumIDC","blskey":"2HhwAzNXb6qrptphzJKiAYqGtE6dNNcK8Q33EJU8hNnAhvjC4X1Bk65MbgvPMpn4rP9HZAH78StG12HfU6VyLd6JBbp6gkgwvtXUK1QefTEGcRipj3XnVJ7tjU8KzxWqaZQW5exJQQQhmedCKZphKvvnb2wuVcoBVS3Ad3ZLm2d4apo","client_ip":"18.197.183.58","client_port":9702,"node_ip":"18.197.183.58","node_port":9701,"services":["VALIDATOR"]},"dest":"58uCeMaEiMHSi8MdEdcgVbpmzMKmiLSYCEz1vxPGJND6"},"metadata":{"digest":"64a71eb01fc9becdbea811aa449d9a588c22b47e7d7434b4dae437bf8153303f","from":"LKjUWXR3QpGsMkgB2XFyzt","reqId":1524737343827561},"type":"0"},"txnMetadata":{"seqNo":31,"txnTime":1524737343},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"RtMtkBrkHCEDtGXXqRfGoV","value":"3ontWhK6hYCpGx8DgirvihSqDarZUTQ3NacwtC4okP2BNpF1xp6tzjnx6iigt8kgaRSGPacXL93AHVXeS6fvQ41t"}]},"txn":{"data":{"data":{"alias":"oregon","blskey":"2bQaqiLhyAEJh6t1xhC3jKk5PRc7v8AsEH9dxSjgVvBqwrmoiDKfSmJKBXA9kCT1uQkpaGeYyP4bkb3RA1ABYebqcswkjdVUGRZYqyxasdBD2phUbNm6WNaGtyRkhJ265KZ7YP8QaDS3NCwTXT7b8vMNmaTL8Kd1Buvaq7gS3ZLJXU6","client_ip":"18.236.138.206","client_port":9702,"node_ip":"18.236.138.206","node_port":9701,"services":["VALIDATOR"]},"dest":"4wdqCSyPeiqCbQhjsbP9Xjasm7vuU7ithawkpuoBXCBM"},"metadata":{"digest":"add1f55e950e2411deecd700285802fd154fc68668e2020df9e97cad47d79491","from":"RtMtkBrkHCEDtGXXqRfGoV","reqId":1524852414943816},"type":"0"},"txnMetadata":{"seqNo":32,"txnTime":1524852415},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"2XCnRcUZJH2JEzotFHTqin","value":"5g4zsXjPumLMTVb8rCYoALeERtgue7qq6uda1vxA2wywZc5VDLBmrJbguwMztdXLCJQKg3qbu8bcYdJUERNdX1Bq"}]},"txn":{"data":{"data":{"alias":"findentity","blskey":"4jBpQMFjEabdTHArLHAbidwcaR5o7p4fAuYbfxrtypZtDbsDACj5mZRFVvkXy5F84g7ni6yNMfL5JV1E3qXYsg3fw33Jd3MTRyAGrZZmN3zNEq6WDNT8XQsaDasDUebJaTEmRWVKMZc8BbeipCPBjym2NvfAQyib1ywZZ5B8d7m5XXH","client_ip":"172.31.28.111","client_port":9799,"node_ip":"172.31.46.137","node_port":9700,"services":["VALIDATOR"]},"dest":"5bQhBNkoFKCFAtCxe1vcXBoq6FsnJ3nWKYwUfyVS3129"},"metadata":{"digest":"dcdd47c5bcffd8aeee8b281ed78b57eef5e3ba617f905885c0c7b356f07ab00a","from":"2XCnRcUZJH2JEzotFHTqin","reqId":1525741289118866},"type":"0"},"txnMetadata":{"seqNo":33,"txnTime":1525741289},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"2XCnRcUZJH2JEzotFHTqin","value":"4wTCrfhT5wzBLpEkadt2UP21kPxiPJPWoKUKs3VSGAsi2427aJbTzPMFokSpPukfEHqMikGCeXP95kPZ5eRKazBy"}]},"txn":{"data":{"data":{"alias":"findentity","blskey":"4jBpQMFjEabdTHArLHAbidwcaR5o7p4fAuYbfxrtypZtDbsDACj5mZRFVvkXy5F84g7ni6yNMfL5JV1E3qXYsg3fw33Jd3MTRyAGrZZmN3zNEq6WDNT8XQsaDasDUebJaTEmRWVKMZc8BbeipCPBjym2NvfAQyib1ywZZ5B8d7m5XXH","client_ip":"34.211.203.16","client_port":9799,"node_ip":"34.218.164.50","node_port":9700,"services":["VALIDATOR"]},"dest":"5bQhBNkoFKCFAtCxe1vcXBoq6FsnJ3nWKYwUfyVS3129"},"metadata":{"digest":"0581a913d81b117dc6f5eb67e6faf734f838a9d6dd2f2a550edb620940ed522c","from":"2XCnRcUZJH2JEzotFHTqin","reqId":1525799946176362},"type":"0"},"txnMetadata":{"seqNo":34,"txnTime":1525799946},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"RtMtkBrkHCEDtGXXqRfGoV","value":"2EQyW1W3EVq9Qkr6Dnk1baDeE8vPcDxgPoZdKkxnKYWLdi27NLvzjziUZ2Ckeuw4MqhDdBeafW36DMQo4fDzkjBT"}]},"txn":{"data":{"data":{"alias":"oregon","services":[]},"dest":"4wdqCSyPeiqCbQhjsbP9Xjasm7vuU7ithawkpuoBXCBM"},"metadata":{"digest":"cb346aa8a0234819aa63b5c63cf7928fbbc171f1b3c00e345c24fa3f4f1e9636","from":"RtMtkBrkHCEDtGXXqRfGoV","reqId":1526508235374190101},"type":"0"},"txnMetadata":{"seqNo":35,"txnTime":1526508235},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"YHTFcv8P93i35osabNm99n","value":"2X7YznzieZ1Kc6nzWawdQHG5Z8jV8vNiwHq5BBLn8rY6SGXQCSZhichDp5V7n9he64BKoYxU6YLHuNM2DLSsEvmG"}]},"txn":{"data":{"data":{"alias":"amihan-sovrin","blskey":"14Kn3VBKja9pDCUgoVpMzf4c9rXJpvDsaHrnXkB9WtvNMHPihinjiXUNNuKdVuYiai3iTDe7mjH5o2UjfoKyApdjEgGCKqgDKpH6uzH4ZcUekR5pfe4wC172X5tiBQFScm8Ti1VmqTnUdfvGi4rV4NpBGytPMkZE1qhL1WSDCoi8riW","client_ip":"35.187.226.254","client_port":9702,"node_ip":"35.197.150.130","node_port":9701,"services":["VALIDATOR"]},"dest":"2FZAgVmRC87ZbJXSh6seFi6n7AMfBo9HaCh8HseHi37U"},"metadata":{"digest":"2986a38eaa64cee8ebfa7e5184bc98949a57555bef663ab125f83603371d6591","from":"YHTFcv8P93i35osabNm99n","reqId":1528165772663287},"type":"0"},"txnMetadata":{"seqNo":36,"txnTime":1528165772},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"5kJFNauix1UPNtii8g8ahpfmEyJaoAPnFXdeSpJ9Ge3GaaLhWM3Hmr9N8ACdf6Wrs8Yg1pkXLRwmBTuDSvJDe3A"}]},"txn":{"data":{"data":{"alias":"ibm","services":[]},"dest":"Eq7m7GMFKPeq5Ek3HH1PkHxzZ46R9VL1Eube3U9wfjp5"},"metadata":{"digest":"ecd93c53a03d0da0e011973c7c4312e4b5426390930247aa48aca2b70550c2be","from":"6feBTywcmJUriqqnGc1zSJ","reqId":1528236888174137},"type":"0"},"txnMetadata":{"seqNo":37,"txnTime":1528236888},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"PRCWCTWYwGJB7rczzTqBBB","value":"5nJ3vmmFxC1qHjvSWFHLvhqyRtEmxo4Z2SMpuS2U5snEShd1ZMP22eDyd1nDgPJUHRAMuYM519eMoLw4Kj4CqZgf"}]},"txn":{"data":{"data":{"alias":"valNode01","blskey":"24cgjd77KER8uzhxb1c3DbecvrSMQd3nYxBjaJTqLkgBPuAizzoFdXQkdb8LNjgnP27hTHCpLSuatQSE2YYexNXqZDtAUqPMNfsZwAU151kYFfCc6ZWLRzsm4irf4PrS5ZpnSmhT3Ta4c3m12zoTmu3FDxUkJwEBC3ubdNdA8EHcVDz","client_ip":"52.43.138.62","client_port":9702,"node_ip":"52.43.138.62","node_port":9701,"services":["VALIDATOR"]},"dest":"AYQcyJvowniMsxU9P93yzyAPCFUxg7hm1xsXitFoBr6z"},"metadata":{"digest":"5b05dceab82e7288a1003793f0b4ff642284a021b3c5746b5d799b116068428e","from":"PRCWCTWYwGJB7rczzTqBBB","reqId":1528316277953334},"type":"0"},"txnMetadata":{"seqNo":38,"txnTime":1528316278},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"PRCWCTWYwGJB7rczzTqBBB","value":"4FHNA9VCJHMNUssRyaQYFsn6SVQdSddSg2BxRDFp1aurDAMY4o925WCGmoYLeNwMkf34w6nF5NrNHVhXSmPBZUs3"}]},"txn":{"data":{"data":{"alias":"valNode01","blskey":"24cgjd77KER8uzhxb1c3DbecvrSMQd3nYxBjaJTqLkgBPuAizzoFdXQkdb8LNjgnP27hTHCpLSuatQSE2YYexNXqZDtAUqPMNfsZwAU151kYFfCc6ZWLRzsm4irf4PrS5ZpnSmhT3Ta4c3m12zoTmu3FDxUkJwEBC3ubdNdA8EHcVDz","client_ip":"54.214.176.123","client_port":9702,"node_ip":"54.214.176.123","node_port":9701,"services":["VALIDATOR"]},"dest":"AYQcyJvowniMsxU9P93yzyAPCFUxg7hm1xsXitFoBr6z"},"metadata":{"digest":"b2a209bb10c902c01167e24e7f876ea2359356d43772f37cddefe42f5adf8c58","from":"PRCWCTWYwGJB7rczzTqBBB","reqId":1532033264248749},"type":"0"},"txnMetadata":{"seqNo":39,"txnTime":1532033227},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"tkPNgpHinWAPXvkbvnphC54pauknphTCMF5gzG5AHT1EUHJGS3bQnDi7UKNEYKAjujExWYJAHtM5iydk26yatBK"}]},"txn":{"data":{"data":{"alias":"valNode01","services":[]},"dest":"AYQcyJvowniMsxU9P93yzyAPCFUxg7hm1xsXitFoBr6z"},"metadata":{"digest":"a8eebd86b4cc9aa422f1fc3e6950def9498e7f51b1d9a720ba68413e53ccfbe9","from":"6feBTywcmJUriqqnGc1zSJ","reqId":1532035631471362345},"type":"0"},"txnMetadata":{"seqNo":40,"txnTime":1532035631},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"Psfx4mLS23gBvZDoWz336H","value":"5VVAPQH1LaZmJ4XG1kKxnmUXawg9nTVc1kwULndbFR9yk19mT3vaM9DES342cBYmrpXuY8zQwsXHk4kSoBqZvezi"}]},"txn":{"data":{"data":{"alias":"trustscience-validator01","blskey":"2ToF3Pfb78JQ3pFs6mYxtofDnHLTBLP2RKCDfn6eVngN4zh4UiHvz9DuUS2dfTpAeZLqBDkKuU9pYRazeDN9fqWgzk6kgZYf8jeWgra7rk33ZbZjHFz1zQjNMk3eju5n9JNY4AFbUcXCTWCdFoSXF9fEySKuNANPqtFNz92H2VjrySF","client_ip":"54.214.176.123","client_port":9702,"node_ip":"54.214.176.123","node_port":9701,"services":["VALIDATOR"]},"dest":"8Tqj57DbizpjWQCHvybtKNqKFgfw2bjJbPZrhHDoRoND"},"metadata":{"digest":"d2612092e47da9a0bfb8c9367d0149927abe50aca98ed127b8cfd9b5975b290b","from":"Psfx4mLS23gBvZDoWz336H","reqId":1532121668250427244},"type":"0"},"txnMetadata":{"seqNo":41,"txnTime":1532121629},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"5gVt2TSEFpJHWN3BwMn1YgcURpxtGfijmXjGu6Cf5CXkwTmTp4dhUN5Ue6WFZU7PcKSrKfu8PvroWPHCiP7AsMvL"}]},"txn":{"data":{"data":{"alias":"amihan-sovrin","services":[]},"dest":"2FZAgVmRC87ZbJXSh6seFi6n7AMfBo9HaCh8HseHi37U"},"metadata":{"digest":"4141b470e5def16f7fde7c3ee5efc02f712bc0e5260a59709385417047516736","from":"6feBTywcmJUriqqnGc1zSJ","reqId":1532979260947795461},"type":"0"},"txnMetadata":{"seqNo":42,"txnTime":1532979261},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"4A2vM1MT3vxNdASCpxgYfzNajpYScAipcRoSyUaRkH9dZ4CmfhHjWogS7VF7WLRNXKUssQVG2DdLrUzuFEckaM6e"}]},"txn":{"data":{"data":{"alias":"findentity","services":[]},"dest":"5bQhBNkoFKCFAtCxe1vcXBoq6FsnJ3nWKYwUfyVS3129"},"metadata":{"digest":"06ee3b89112f96f93df9f91554b5f4ada39ef34dbc4dd198ab7bc60e0d2f0c57","from":"6feBTywcmJUriqqnGc1zSJ","reqId":1532979375523513444},"type":"0"},"txnMetadata":{"seqNo":43,"txnTime":1532979375},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"5tqAZojtpBxCaTkLvX6Why6MYyofYTUEt8taHxyXRBPrDugsCZjM5aRxEwXak7qNuUJGt2x9LMfVLdB81rk8yR2e"}]},"txn":{"data":{"data":{"alias":"VeridiumIDC","services":[]},"dest":"58uCeMaEiMHSi8MdEdcgVbpmzMKmiLSYCEz1vxPGJND6"},"metadata":{"digest":"aca82cab749e9d722134d46f0891269fcae59b7fd065fb3155dd632e2f740322","from":"6feBTywcmJUriqqnGc1zSJ","reqId":1532979478035983569},"type":"0"},"txnMetadata":{"seqNo":44,"txnTime":1532979478},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"BD95LAmfVrD3JEwaereykM","value":"5wXZxmiE9PJaidic57FXGfTWjJCuEidh3FBRWMBjhg47JsBxJvoCVuGi7LMYYd7Wj5AdqLqLUC6oL7hKbEPmKr3b"}]},"txn":{"data":{"data":{"alias":"ibmTest","blskey":"232Z7DQcjp5NPVZyzR6WWH9w9829F4NPBz87sx2LHZBnv2xntpaixyUc7J5hUtwnYgL7HyEZsf3Wgtdr5sGua7jhpJzixxtR2p4KoRZ48i62wA9Y5mJ4FmXBg3GxMwbegc2Nmqg33CGjB8cDGUZwR1jBERdZdsi3Y4CL9e9NsBqUu5C","client_ip":"169.61.131.234","client_port":9702,"node_ip":"169.61.131.234","node_port":9701,"services":["VALIDATOR"]},"dest":"7mcctKwaBjyzAbNPS8ix1LTNxex4JchkyLvjYfw2XexR"},"metadata":{"digest":"ef3b5b33492990611a2d443d579681be95f504f1f82b4e9b6015418a72b5620d","from":"BD95LAmfVrD3JEwaereykM","reqId":1535389152858873},"type":"0"},"txnMetadata":{"seqNo":45,"txnTime":1535389153},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"PRCWCTWYwGJB7rczzTqBBB","value":"2PrAKjgg1itZrkaaa5YipCgtTKyeczeSrm8HfHUfu6n5raMPmHLCkzoYWcaHUYjMpL2LHrnhPhdG6HhCJgRbQgoj"}]},"txn":{"data":{"data":{"alias":"valNode01","blskey":"24cgjd77KER8uzhxb1c3DbecvrSMQd3nYxBjaJTqLkgBPuAizzoFdXQkdb8LNjgnP27hTHCpLSuatQSE2YYexNXqZDtAUqPMNfsZwAU151kYFfCc6ZWLRzsm4irf4PrS5ZpnSmhT3Ta4c3m12zoTmu3FDxUkJwEBC3ubdNdA8EHcVDz","client_ip":"127.0.0.1","client_port":9702,"node_ip":"127.0.0.1","node_port":9701,"services":[]},"dest":"AYQcyJvowniMsxU9P93yzyAPCFUxg7hm1xsXitFoBr6z"},"metadata":{"digest":"7f244345a273550cf1cbeee4a41a5917fe17947c355917c9c2c235de63d3a2e4","from":"PRCWCTWYwGJB7rczzTqBBB","reqId":1537808479067559676},"type":"0"},"txnMetadata":{"seqNo":46,"txnTime":1537808338},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"Psfx4mLS23gBvZDoWz336H","value":"3rywzxRvJAiFsuFmEayMxKxxsJDeLAWYM5t1Jxw4vNt9RAuh5WwcAUmcD1Un6urHMMBadpkxGVMyTHFca4jBAZTc"}]},"txn":{"data":{"data":{"alias":"trustscience-validator01","blskey":"2ToF3Pfb78JQ3pFs6mYxtofDnHLTBLP2RKCDfn6eVngN4zh4UiHvz9DuUS2dfTpAeZLqBDkKuU9pYRazeDN9fqWgzk6kgZYf8jeWgra7rk33ZbZjHFz1zQjNMk3eju5n9JNY4AFbUcXCTWCdFoSXF9fEySKuNANPqtFNz92H2VjrySF","client_ip":"127.0.0.2","client_port":9702,"node_ip":"127.0.0.2","node_port":9701,"services":[]},"dest":"8Tqj57DbizpjWQCHvybtKNqKFgfw2bjJbPZrhHDoRoND"},"metadata":{"digest":"01bea8a952895652f4ff5fed121fbab75fc5bea0cf4a5b905324efa944a5ba97","from":"Psfx4mLS23gBvZDoWz336H","reqId":1537818353199012189},"type":"0"},"txnMetadata":{"seqNo":47,"txnTime":1537818211},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"MHrp2wUhk1quHK9kGCcQtX","value":"4meKCAvuw588qWkDMy1pXvMtt4X6YK4hiQArsxEJ7wrY84JL9ZAN1efBby4BLZvQcE2Lx7kP9mrhsrAdBGXM8hCK"}]},"txn":{"data":{"data":{"alias":"trustscience-validator02","blskey":"2f8SF5UdftJkr19X7TQxtcy7EiP1MLLxnT4sppJuFfuprEKxdtRq2BbkyRF24Xbdd5tfWkf9MsPBs7aWqrNcoCjbL5hsawUmPy7tjWtZLhLgKYtKxfFtPFJETtTLaaUhyrnjNwYa7GoTBYKMdv72ZL1fjZjo3EK6jx3H6fohvSVK98P","client_ip":"54.214.176.123","client_port":9702,"node_ip":"54.214.176.123","node_port":9701,"services":["VALIDATOR"]},"dest":"2p77huA99n3pmj5hxYapzXMrEgATHAoQX2CkxS4TNya7"},"metadata":{"digest":"30ef842e8ccb04aa4051d12d3a565d921892a7f79254398eb9ab3b8ced265ece","from":"MHrp2wUhk1quHK9kGCcQtX","reqId":1537821923451170792},"type":"0"},"txnMetadata":{"seqNo":48,"txnTime":1537821782},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"2Tk12rX3eU93zqCGe5oeAH7WvudtqwLA9cK2Cg2UbirMhEh2YL7oR68SqMZDhvKDyeRtViLwbhNcfoSARGucm7yo"}]},"txn":{"data":{"data":{"alias":"trustscience-validator02","services":[]},"dest":"2p77huA99n3pmj5hxYapzXMrEgATHAoQX2CkxS4TNya7"},"metadata":{"digest":"8cf0e8b8db40d79a7019f1642de1f85764532b5ee7f6cd3a40872d7317632f3d","from":"6feBTywcmJUriqqnGc1zSJ","reqId":1538150155109252223},"type":"0"},"txnMetadata":{"seqNo":49,"txnTime":1538150957},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"QuCBjYx4CbGCiMcoqQg1y","value":"SkAWnEADFvzxgtnWiEYrdZQivjX587hu1rBq1HgzVBubQAS8NaNcj8FEFYWLgtcYj91wdcNnSrx5aCC8nHRpfAH"}]},"txn":{"data":{"data":{"alias":"xsvalidatorec2irl","blskey":"4ge1yEvjdcV6sDSqbevqPRWq72SgkZqLqfavBXC4LxnYh4QHFpHkrwzMNjpVefvhn1cgejHayXTfTE2Fhpu1grZreUajV36T6sT4BiewAisdEw59mjMxkp9teYDYLQqwPUFPgaGKDbFCUBEaNdAP4E8Q4UFiF13Qo5842pAY13mKC23","blskey_pop":"R5PoEfWvni5BKvy7EbUbwFMQrsgcuzuU1ksxfvySH6FC5jpmisvcHMdVNik6LMvAeSdt6K4sTLrqnaaQCf5aCHkeTcQRgDVR7oFYgyZCkF953m4kSwUM9QHzqWZP89C6GkBx6VPuL1RgPahuBHDJHHiK73xLaEJzzFZtZZxwoWYABH","client_ip":"52.50.114.133","client_port":9702,"node_ip":"52.209.6.196","node_port":9701,"services":["VALIDATOR"]},"dest":"DXn8PUYKZZkq8gC7CZ2PqwECzUs2bpxYiA5TWgoYARa7"},"metadata":{"digest":"c1633443684eed4d621235388d23e6adf0264658bed09e26fd9ac41026fa4dde","from":"QuCBjYx4CbGCiMcoqQg1y","reqId":1540910673107959938},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":50,"txnTime":1540910673},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"FzAaV9Waa1DccDa72qwg13","value":"3q94ydPoBiKq7oBjAt5gTrdLDWagXn2GMGBXa1Shpd8FFqg25tXrkYBDvn1a81rN6E3bc9e9gUJwXNg3CZUBNYG6"}]},"txn":{"data":{"data":{"alias":"vnode1","blskey":"t5jtREu8au2dwFwtH6QWopmTGxu6qmJ3iSnk321yLgeu7mHQRXf2ZCBuez8KCAQvFZGqqAoy2FcYvDGCqQxRCz9qXKgiBtykzxjDjYu87JECwwddnktz5UabPfZmfu6EoDn4rFxvd4myPu2hksb5Z9GT6UeoEYi7Ub3yLFQ3xxaQXc","blskey_pop":"QuHB7tiuFBPQ6zPkwHfMtjzWqXJBLACtfggm7zCRHHgdva18VN4tNg7LUU2FfKGQSLZz1M7oRxhhgJkZLL19aGvaHB2MPtnBWK9Hr8LMiwi95UjX3TVXJri4EvPjQ6UUvHrjZGUFvKQphPyVTMZBJwfkpGAGhpbTQuQpEH7f56m1X5","client_ip":"159.89.118.181","client_port":9797,"node_ip":"206.189.143.34","node_port":9797,"services":["VALIDATOR"]},"dest":"9Aj2LjQ2fwszJRSdZqg53q5e6ayScmtpeZyPGgKDswT8"},"metadata":{"digest":"6815d516eead933d1163295ac5a1b34ef14fc842d5779a4de23847f5d3652f22","from":"FzAaV9Waa1DccDa72qwg13","reqId":1541014309248416875},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":51,"txnTime":1541014309},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"bPTNiLzWPFHKr7mJGaump","value":"2Vq2bzfip9c3Zo1b5f9ZEffw1bD3jfWtphJd52Gov6opBcewVQWHcS912J251LTmx1YfNydAYWtL2EYQKuS4EXXm"}]},"txn":{"data":{"data":{"alias":"sovrin.sicpa.com","blskey":"2j7jqdynFph7cbSwYgKYfzHKsVcQRfYxCU9AdhTAN8gUV8oFrnuPz348zLX8AMiEt85pKGw97FcACcDTJAGABvwCcXFNXNFGTN2U14JkRcg7yNuHFSWWgmdc1aBQJcJA5ZEtPgq2n47W14L3Y23LUv9E2CLViKUKv6nZqfrEeJi7zUE","blskey_pop":"RHxpCSQFv6Xso4JiEyt9jdTm6J3XUCh1SWy4g6hDsVWYqgrJEeLoXaYBBayB7fi6bDbUPuJVbVYPMA4HNA5eRwagc34gr8JhddgJupLxgzowkKkJa1WEm5vDNwqUfH7JihwwEzUPcmNTjnhGiovhRH4v8Mf1uPyzyS5AHsH8qNbrfZ","client_ip":"194.209.53.115","client_port":9777,"node_ip":"194.209.53.116","node_port":9778,"services":["VALIDATOR"]},"dest":"AcaN2zJ1vkQyEvmi2EyUMLzvzczQRvarNPjR2CbtNFAX"},"metadata":{"digest":"c94bdafaea83c5668ac61ee754f7de174d90015049a539ddc969a165f6abf871","from":"bPTNiLzWPFHKr7mJGaump","reqId":1541412365363342035},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":52,"txnTime":1541412365},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"bPTNiLzWPFHKr7mJGaump","value":"NUDC81qrSL5kkiwh4ZmUZ4NepE8sNPLtb3Qii41yiBu1kkudhEBct3Y3TtxJetyfhDmJPiSyWBmBUNxisP4L15t"}]},"txn":{"data":{"data":{"alias":"sovrin.sicpa.com","blskey":"2j7jqdynFph7cbSwYgKYfzHKsVcQRfYxCU9AdhTAN8gUV8oFrnuPz348zLX8AMiEt85pKGw97FcACcDTJAGABvwCcXFNXNFGTN2U14JkRcg7yNuHFSWWgmdc1aBQJcJA5ZEtPgq2n47W14L3Y23LUv9E2CLViKUKv6nZqfrEeJi7zUE","blskey_pop":"RHxpCSQFv6Xso4JiEyt9jdTm6J3XUCh1SWy4g6hDsVWYqgrJEeLoXaYBBayB7fi6bDbUPuJVbVYPMA4HNA5eRwagc34gr8JhddgJupLxgzowkKkJa1WEm5vDNwqUfH7JihwwEzUPcmNTjnhGiovhRH4v8Mf1uPyzyS5AHsH8qNbrfZ","client_ip":"194.209.53.116","client_port":9778,"node_ip":"194.209.53.115","node_port":9777,"services":["VALIDATOR"]},"dest":"AcaN2zJ1vkQyEvmi2EyUMLzvzczQRvarNPjR2CbtNFAX"},"metadata":{"digest":"f7e6c28166e69edb0468869fed131fbca344db0943f020cfb8e0137703401922","from":"bPTNiLzWPFHKr7mJGaump","reqId":1541432813752945620},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":53,"txnTime":1541432814},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"5UzHhjZMh4N3w6zSK22RTzb6qFpLijjRgDkCT4XxnJYPYrW7erByfJf2FLkmR4LcdSDrSw4hkFuoH5dkPXpfFZzo"}]},"txn":{"data":{"data":{"alias":"xsvalidatorec2irl","services":[]},"dest":"DXn8PUYKZZkq8gC7CZ2PqwECzUs2bpxYiA5TWgoYARa7"},"metadata":{"digest":"ecdfec24f95a4ef3590f9024f1ce46fa4d8ef2288048c89f18d16822d34f517a","from":"6feBTywcmJUriqqnGc1zSJ","reqId":1541451340102642933},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":54,"txnTime":1541451340},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"3Ygb9RCqsT3SwxpMx2WWrCk9W9pKCpg9qjQkERhKhZuCeEjc1C2YEnf3KtrkCxEVg1xti4gh5kCW97apU53jXBRa"}]},"txn":{"data":{"data":{"alias":"vnode1","services":[]},"dest":"9Aj2LjQ2fwszJRSdZqg53q5e6ayScmtpeZyPGgKDswT8"},"metadata":{"digest":"e7190621d62f017add97a35214ffe39c2820600e91eb7738ac1b6be14be7f7d2","from":"6feBTywcmJUriqqnGc1zSJ","reqId":1541451384934782442},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":55,"txnTime":1541451385},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"34p6FetGiBaiF9rste9tU4bxjDa6jMhPr8drGFfWMfcDBeHrwu4mMdZBGq3RPpaD7G3E74EkgVNA65mPvTG7s7om"}]},"txn":{"data":{"data":{"alias":"sovrin.sicpa.com","services":[]},"dest":"AcaN2zJ1vkQyEvmi2EyUMLzvzczQRvarNPjR2CbtNFAX"},"metadata":{"digest":"c3ec6df9998e376a2b31a4e8bf2f951eaa9779cbfa5b6eed166501f0c0fff6c7","from":"6feBTywcmJUriqqnGc1zSJ","reqId":1541451415119667684},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":56,"txnTime":1541451415},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"FzAaV9Waa1DccDa72qwg13","value":"2GDovjbZyz2rh3rzFpmgqM9TycCxNhbW5esiYXgnkqj43QWz9dwCY5Jv7fSKdmEKK2EiJBuFKt7W8PZZFKyrMuqZ"}]},"txn":{"data":{"data":{"alias":"vnode1","blskey":"t5jtREu8au2dwFwtH6QWopmTGxu6qmJ3iSnk321yLgeu7mHQRXf2ZCBuez8KCAQvFZGqqAoy2FcYvDGCqQxRCz9qXKgiBtykzxjDjYu87JECwwddnktz5UabPfZmfu6EoDn4rFxvd4myPu2hksb5Z9GT6UeoEYi7Ub3yLFQ3xxaQXc","blskey_pop":"QuHB7tiuFBPQ6zPkwHfMtjzWqXJBLACtfggm7zCRHHgdva18VN4tNg7LUU2FfKGQSLZz1M7oRxhhgJkZLL19aGvaHB2MPtnBWK9Hr8LMiwi95UjX3TVXJri4EvPjQ6UUvHrjZGUFvKQphPyVTMZBJwfkpGAGhpbTQuQpEH7f56m1X5","client_ip":"206.189.143.34","client_port":9796,"node_ip":"206.189.143.34","node_port":9797,"services":["VALIDATOR"]},"dest":"9Aj2LjQ2fwszJRSdZqg53q5e6ayScmtpeZyPGgKDswT8"},"metadata":{"digest":"bf0cdbb6b134fc10fd7797fa24f4354a9e9d70dbc92570d23267e151299b24b4","from":"FzAaV9Waa1DccDa72qwg13","reqId":1541618294089244398},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":57,"txnTime":1541618294},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"Bt44zXEB8HkNHJ8mSGq8Hap4xq6QBo1YECwDscH8aoKocmE8LpDKs9nAwUxu5qrtRNHfj9n1bSeTAq593BT43T6"}]},"txn":{"data":{"data":{"alias":"xsvalidatorec2irl","services":["VALIDATOR"]},"dest":"DXn8PUYKZZkq8gC7CZ2PqwECzUs2bpxYiA5TWgoYARa7"},"metadata":{"digest":"59a07975ea03cca3db85c06f0e12a7095df449c56326f470aab9a5f473c4b41d","from":"6feBTywcmJUriqqnGc1zSJ","reqId":1541715283104974168},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":58,"txnTime":1541715283},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"TK4JebQqeqq5t6x2bCwnD7","value":"MC5fG4DowNdB23vHXydtT4f7n1k6wcyZyPA7m3aVZWYfKVT7bwGKWqzmKWGAr1QNm3dkcL2MLVE11ALQsCcFpEt"}]},"txn":{"data":{"data":{"alias":"NodeTwinPeek","blskey":"Jrbf7k1xgkbhfKAmVXqfLLmFieGrxL1f1H6WRBZVB4Rvh8uCHGVoVzMppygH2XPLK4n1cnaBKe7zYxftgMaYXka1HLaScfsVCGqpkSa7d2hzerpcvPQMvo9TCCTP3jWb6uC9kVUHZkVqVvecMDtRkVqr3ZChUAoTM2e4UGmgqvE3Zk","blskey_pop":"RY3ZXV5WoHWMM631ov7ZMWoTX41Cnah4CrwQnXFrPHt49ajB8b5AjnrSDxCb9JEhC8WLVveuQMH7p6FJfoQHRaG2tR9pQLgLCXvbDozYPin4LwVzV3Wh2LNMorAtJgr3PfqxzUmFNEkbiGAbzMdBS1EXbDya9exgrLkrMLuLG1crLw","client_ip":"178.32.102.66","client_port":9782,"node_ip":"87.98.136.246","node_port":9781,"services":["VALIDATOR"]},"dest":"2bDviHYdDiTjyXYXEW92zQHEf1C1QsbFatJ6uSYuYrHh"},"metadata":{"digest":"0d187610d42d46fc90ab873fa1a43132c35d349083dcbf744cf81191ae4a4760","from":"TK4JebQqeqq5t6x2bCwnD7","reqId":1542035094044574100},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":59,"txnTime":1542035094},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6mTar6XRRgYdhswcnq3ybf","value":"UfJqCMUzcX5CfqGouLMSivJ5qm5SqBdsJwKkV9aZHTsmHS3GwcBAur4aUP9VG43praqiqToCQ1jZiMyUYj7wKEw"}]},"txn":{"data":{"data":{"alias":"lab10","blskey":"2Yf73vj1CJBqibWHZTdL4Seygd53dSb4PKJugpeokVx8HdXwqhuEnk2nFBCYmXmFp4RxGprQuKDfGuxYDhKuBysHSCbbYwvoWaXXHYtxvD67Ytw37fQo9Stvgu5nCDwDWD3M8p7fkUF4UQRMqfa8W1tddWXgFr5NPSB13GrjJFcPgAn","blskey_pop":"RBGAkA3X7w1ADtQeYiVZW76uWdwRTdCwamappXLb3sD2iNvVBaSF1jPANo9K99QBe42kEAbJtbwsi4AoDWrjex6tVTQqiSxeAt2kRJpCZTGHfthHzLEnFtZqqksWeXQPRNzeeRagFRyZAQhPuL7wYMiz3a6CNnbgQL7dbMvNBaQsUs","client_ip":"5.9.17.149","client_port":9702,"node_ip":"5.9.17.149","node_port":9701,"services":["VALIDATOR"]},"dest":"7vruXjaKFp2t1WrsMTcVZuNQtmn35yimDrN7THYwcPof"},"metadata":{"digest":"515a3de1e3b1166208d6e2d5c7c020b9d9b56f5fbfb01e9ac1e2da96a8ebacb1","from":"6mTar6XRRgYdhswcnq3ybf","reqId":1542135182121048577},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":60,"txnTime":1542135183},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"bPTNiLzWPFHKr7mJGaump","value":"2HaQjM7gQXQi4nL2CHLDAM6PaHXUsgQ6SoyHkncrNHQua5WWbcd6DjsB5gagvTAsyD9728xA3npf6c82GNCFqrd3"}]},"txn":{"data":{"data":{"alias":"sovrin.sicpa.com","services":["VALIDATOR"]},"dest":"AcaN2zJ1vkQyEvmi2EyUMLzvzczQRvarNPjR2CbtNFAX"},"metadata":{"digest":"0e549b9dee11241b4b9605b540b7162a84c8fe0a466e30fc029929debb9f6f5f","from":"bPTNiLzWPFHKr7mJGaump","reqId":1542298164808052701},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":61,"txnTime":1542298165},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"bPTNiLzWPFHKr7mJGaump","value":"wKcykStr9Mj6jbjHUjzjkQXnkz7K3S9GmjgB2kZ7KrWpNDrS3hWWydguhUzFcjHoxBDazdEBKgnu3WH15ytNrxx"}]},"txn":{"data":{"data":{"alias":"sovrin.sicpa.com","services":[]},"dest":"AcaN2zJ1vkQyEvmi2EyUMLzvzczQRvarNPjR2CbtNFAX"},"metadata":{"digest":"93b91ab90788049d62246a754432eb2d5f47c8b20e6f7174d57fd42537749c14","from":"bPTNiLzWPFHKr7mJGaump","reqId":1542299088770647926},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":62,"txnTime":1542299089},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"KvGE2tKSDuBXEkRc86dL4T","value":"5dwYyoYZu4LRnhdyRFXt7xEFFw2yT8QE7zVKRkD2XswxgsSY1gdnbPDnqBwoUTyUK7MjzeRjuGDJpeBBcHSmH7Wz"}]},"txn":{"data":{"data":{"alias":"trusted_you","blskey":"4Hf3okFu15E52JuH62AD4gNVyBdqg8mP4xzg6bViuYzA3ujCJpC5xCv2afiAgWq5w6ooxhNo4w88jny5je83HvJXUqc1jQNWApzcRr9Zqfz9ipqP3qJv6j8BZJU5VQPfLLfrGRrNG4UFPwHHqXLxcBfFJFqKuBMr9FeQc5LMP6LKhQr","blskey_pop":"RLK3VsTPH8BvpqjBUD1mn21jffYkZdAzEkxt397HcbpHd6zfXE6DbziXrWgVDdofZkuqUhrd7ecwY7yX3rYL182VxfWhvKTDx8VwrPyand6M2DWtR3c3rUwwqBkLJW5dXP2ZrPMnUrukJ88SXVrf4J23jiy9xFTZLAVZnt2Go582aB","client_ip":"51.140.243.125","client_port":9700,"node_ip":"51.140.220.111","node_port":9750,"services":["VALIDATOR"]},"dest":"7wetNy5AJpHfXvhTx4okZokSw5mcrgWgVZ8jJ3WHgrmd"},"metadata":{"digest":"1e72a8499fe7372eb9b3f7876a4bb965801c9ee611d79611afad3355f9133c9b","from":"KvGE2tKSDuBXEkRc86dL4T","reqId":1542323966510001027},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":63,"txnTime":1542323966},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"bPTNiLzWPFHKr7mJGaump","value":"2LpmtWWx2ykmxYQ9QZ13PoXrtn77ETbjTrBRDmZULykruGVyDWp6Xn3EyrrNuEZVDxjFGKG1tdbcQKhUHKJn6LHA"}]},"txn":{"data":{"data":{"alias":"sovrin.sicpa.com","services":[]},"dest":"AcaN2zJ1vkQyEvmi2EyUMLzvzczQRvarNPjR2CbtNFAX"},"metadata":{"digest":"e6a5bb4cd4189ecc6ae0858a32c7df509e81c181bab5cf4f43e72d480ea0f7a0","from":"bPTNiLzWPFHKr7mJGaump","reqId":1542361064125639673},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":64,"txnTime":1542361064},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"uV9yMB5sfwYNRjXfvbD8eajsW16SEfAxE62QVyX2f9YBkr2BBLed9WHE79Ww5v5ycV5mrduAr7rrYZnCNyNvgvv"}]},"txn":{"data":{"data":{"alias":"trusted_you","services":[]},"dest":"7wetNy5AJpHfXvhTx4okZokSw5mcrgWgVZ8jJ3WHgrmd"},"metadata":{"digest":"a915255c0490bd661652aae007d55c88736a9556a283e9087862db948fc01ab0","from":"6feBTywcmJUriqqnGc1zSJ","reqId":1542394857400361543},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":65,"txnTime":1542394857},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"bPTNiLzWPFHKr7mJGaump","value":"hywDqQdRthvVDSiUXgMueRW621soWAWgZeRFjyzxpvTMBDhxnc36P8PaWYnHsxXzVds57XAcQ3LKfEjZ1UyqvHJ"}]},"txn":{"data":{"data":{"alias":"sovrin.sicpa.com","services":["VALIDATOR"]},"dest":"AcaN2zJ1vkQyEvmi2EyUMLzvzczQRvarNPjR2CbtNFAX"},"metadata":{"digest":"056b23376851dc03079a1c3fea1ec6a37d60d976cef577cb1534bfa5f37509db","from":"bPTNiLzWPFHKr7mJGaump","reqId":1542638324609009633},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":66,"txnTime":1542638324},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"TN7Sx7qF9RSmaDcTiFKWzd","value":"4E1w4F5QcM5PxBYYrbJkTDPNwqNnfE9X1nLPVfbfBwFurF2F74GA6BRcPxVoiWsTRMCeWtgZWzHjYcictzv7B7nk"}]},"txn":{"data":{"data":{"alias":"dativa_validator","blskey":"3bYtYhVodD49a3bTK2bZzTAZqt284tKQ2vgXG2arqUyYJRhYnDouhAaQAM7fctC84NvQRG2p1UwVdcdUZPkau5wdJ6fKWwpGo1mM2firHhYtiSZcCAfAbPQhTSSKnsaMnUzacuPC1e81ytr3cXjPobaAg4jJA637N2MGwUWv665o7ae","blskey_pop":"Qm7nQt5HjnaLSpCobPxAH8JG67J6bstaKop2XCsnBELR8tJNm1BYkqTTsj5HVRwXBkMg2vexNQ51B29cp9tSK3zK7ddbhWh8C4cDHoDQgaCHNz61hQxxYMx37yraFLggPF9WCaUckAn4fFxEvLBMV3EdcBZoTecwGPt2g1WhBDjB3M","client_ip":"52.91.89.252","client_port":9799,"node_ip":"35.174.181.186","node_port":9700,"services":["VALIDATOR"]},"dest":"F15n4nPZcnzDJJMNSZK8yNaeodi1PjZyDs83r4KC75hy"},"metadata":{"digest":"58a1d4e0b24778694973e2ff21eca5b9bba33ffb6d918836e1f76b75d1eab56d","from":"TN7Sx7qF9RSmaDcTiFKWzd","reqId":1542652100358243716},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":67,"txnTime":1542652100},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"sYtD5iKjZF1A9rkkY8E2AeHk4B5y81jWiY2BZEsLYy3s4HNQo9YKy5K6X9k1LbscodpMhC4VL4gZ4L7Y9YgvFBs"}]},"txn":{"data":{"data":{"alias":"sovrin.sicpa.com","services":[]},"dest":"AcaN2zJ1vkQyEvmi2EyUMLzvzczQRvarNPjR2CbtNFAX"},"metadata":{"digest":"afa88dd032669c15cf2fb1d7f5d921c2325d2d721b6adffc20df7c8e094d4b91","from":"6feBTywcmJUriqqnGc1zSJ","reqId":1542679993748339893},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":68,"txnTime":1542679994},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"TN7Sx7qF9RSmaDcTiFKWzd","value":"CRk8NSxyvawVi7LUhDdLgN22L5ZEqMpW5yUqVd9ri623VujthBNW6RWaQEagEJqzj9LtwWG3cRYMZzZ8tW8PFpf"}]},"txn":{"data":{"data":{"alias":"dativa_validator","blskey":"3bYtYhVodD49a3bTK2bZzTAZqt284tKQ2vgXG2arqUyYJRhYnDouhAaQAM7fctC84NvQRG2p1UwVdcdUZPkau5wdJ6fKWwpGo1mM2firHhYtiSZcCAfAbPQhTSSKnsaMnUzacuPC1e81ytr3cXjPobaAg4jJA637N2MGwUWv665o7ae","blskey_pop":"Qm7nQt5HjnaLSpCobPxAH8JG67J6bstaKop2XCsnBELR8tJNm1BYkqTTsj5HVRwXBkMg2vexNQ51B29cp9tSK3zK7ddbhWh8C4cDHoDQgaCHNz61hQxxYMx37yraFLggPF9WCaUckAn4fFxEvLBMV3EdcBZoTecwGPt2g1WhBDjB3M","client_ip":"35.174.181.186","client_port":9799,"node_ip":"35.174.181.186","node_port":9700,"services":["VALIDATOR"]},"dest":"F15n4nPZcnzDJJMNSZK8yNaeodi1PjZyDs83r4KC75hy"},"metadata":{"digest":"c52795b715a91b80167eecf727e15be08c7ea405b32be84ebded577f2bca7dd3","from":"TN7Sx7qF9RSmaDcTiFKWzd","reqId":1542737602414121779},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":69,"txnTime":1542737602},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"KvGE2tKSDuBXEkRc86dL4T","value":"57mY4UHLprb4EdgPpnNBiermToDVqkLzJxso2bbsfo4GXomLHssQqjZrZvS1vgDjLgGGKLFpGZJeaKvXyLk1JUNy"}]},"txn":{"data":{"data":{"alias":"trusted_you","services":["VALIDATOR"]},"dest":"7wetNy5AJpHfXvhTx4okZokSw5mcrgWgVZ8jJ3WHgrmd"},"metadata":{"digest":"00477bfb2052242abbb95063d98b5acd1d3ab76e7d1519734e54b07aad6b9e99","from":"KvGE2tKSDuBXEkRc86dL4T","reqId":1542751929819744539},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":70,"txnTime":1542751929},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"KvGE2tKSDuBXEkRc86dL4T","value":"td4qZQbCgAxg5jWNUEj5ySAvjN2W2cdywcpYhwrAcyu5H5EbyuyNXDJXLzgCRuTLoNUcKJY1z6GbrFa1rb3c9yU"}]},"txn":{"data":{"data":{"alias":"trusted_you","services":["VALIDATOR"]},"dest":"7wetNy5AJpHfXvhTx4okZokSw5mcrgWgVZ8jJ3WHgrmd"},"metadata":{"digest":"74436d978077d1b2a7325604b305ba71776432f078ae4f0685cd29780466fccd","from":"KvGE2tKSDuBXEkRc86dL4T","reqId":1542754098893802328},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":71,"txnTime":1542754099},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"2odhsxVn68qbBkYcaUWzFpk4KNtrUSh3QM6duqfGwBWN3CPbBYRFfvcYFiQqYZUazipKsWvqHvDsh27iycAadosq"}]},"txn":{"data":{"data":{"alias":"sovrin.sicpa.com","services":["VALIDATOR"]},"dest":"AcaN2zJ1vkQyEvmi2EyUMLzvzczQRvarNPjR2CbtNFAX"},"metadata":{"digest":"a06031660b32d4a6dff612a466d0dad7f0563ac58ca06b2bd11c0f767e0ea25e","from":"6feBTywcmJUriqqnGc1zSJ","reqId":1542820256271098712},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":72,"txnTime":1542820256},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"TN7Sx7qF9RSmaDcTiFKWzd","value":"8ubefkYZGbM2F9KeYYhGowKLi27dhss6S8bp8MiirdicFdCZ4PA5qGejbkQhuDfbbRkfxS8ZzreRAg56rkVE5vK"}]},"txn":{"data":{"data":{"alias":"dativa_validator","blskey":"3bYtYhVodD49a3bTK2bZzTAZqt284tKQ2vgXG2arqUyYJRhYnDouhAaQAM7fctC84NvQRG2p1UwVdcdUZPkau5wdJ6fKWwpGo1mM2firHhYtiSZcCAfAbPQhTSSKnsaMnUzacuPC1e81ytr3cXjPobaAg4jJA637N2MGwUWv665o7ae","blskey_pop":"Qm7nQt5HjnaLSpCobPxAH8JG67J6bstaKop2XCsnBELR8tJNm1BYkqTTsj5HVRwXBkMg2vexNQ51B29cp9tSK3zK7ddbhWh8C4cDHoDQgaCHNz61hQxxYMx37yraFLggPF9WCaUckAn4fFxEvLBMV3EdcBZoTecwGPt2g1WhBDjB3M","client_ip":"52.91.89.252","client_port":9799,"node_ip":"35.174.181.186","node_port":9700,"services":["VALIDATOR"]},"dest":"F15n4nPZcnzDJJMNSZK8yNaeodi1PjZyDs83r4KC75hy"},"metadata":{"digest":"62a7363b27f1e10c215c8ac44b0a6d737fd60ad14c4357c6c954d90283f21aab","from":"TN7Sx7qF9RSmaDcTiFKWzd","reqId":1542651103246022659},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":73,"txnTime":1542820263},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"5UWP2RqYa8zdejirm5hA7myhrr59jzik9koEjyosJ6U3uHU1ySrKnRsogkXb91sFb6t9Rs9XS7yF6r9wLgW2tQLR"}]},"txn":{"data":{"data":{"alias":"dativa_validator","services":[]},"dest":"F15n4nPZcnzDJJMNSZK8yNaeodi1PjZyDs83r4KC75hy"},"metadata":{"digest":"a6c82dd6a170a73014ce079ce53bcf505bfbee47363a3ea88097cd58f1d38030","from":"6feBTywcmJUriqqnGc1zSJ","reqId":1543358290828986263},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":74,"txnTime":1543359213},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"SYQLd1z2fd6BCcSHsraFbU","value":"5ohoJwSwPD3pGuXhMdvEcYUK3rPPa3HT5SyAgbd4SmHmA1Tgf5zdHef9mNDwR7AKEEgEkUGKNzjAKGTots5oeanF"}]},"txn":{"data":{"data":{"alias":"SovrinNode","blskey":"4ATbikmEcsPinBFgzWk3zKr1HPBg2Qyh4B6dEkR3U8oSauZGJakaHZMDx9LhrmajC5MdSURcLHJig8jqAAvJSkjk2kbpW9m97oWo8jPNw6cDv3bLxmhnkteCrfVvPokbeL4WyFbGZx5VLLrmtzsxodHrEhm6jkZcAhxcA29EzFPKm31","blskey_pop":"RYPJaQyeF6Xjk8jVDbF4gpKdRajTyhDG6VjZeWg93QEMDsWKmTu6CMFQ9SSf4Ao58jySP2Z1LSgKjvW6uJuVm5ZA29Rsdpv7i5y9XktMw14Pa4XH2YJWbpqvZZgteYBbUsFReF3FiSmaHX3JBo7WGWoVmLATxvSxBtPfKKTB2f3KtT","client_ip":"3.16.198.41","client_port":9702,"node_ip":"3.17.50.10","node_port":9701,"services":["VALIDATOR"]},"dest":"GfczFDBo6wCK7bwZA2dtTmEf5xGzZEDeELMP34bS9y1B"},"metadata":{"digest":"2d22f985e30f12bbd0af7dc89be3b82d7254762a212ea865a570063be3a9190c","from":"SYQLd1z2fd6BCcSHsraFbU","reqId":1543447274763531000},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":75,"txnTime":1543447275},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"4NFboPNaWijRoMcgQkQFivTjjXaBeDzhQAa93MbAfHp8myBJ1fGnnrnLfyoBMQA1wZhSiAXyeuMiiG8rRhVjbNam"}]},"txn":{"data":{"data":{"alias":"dativa_validator","services":["VALIDATOR"]},"dest":"F15n4nPZcnzDJJMNSZK8yNaeodi1PjZyDs83r4KC75hy"},"metadata":{"digest":"71434b20259474ab9aee98e999a0818e8ac2872043cf5ae9945b307431ce6fbc","from":"6feBTywcmJUriqqnGc1zSJ","reqId":1543513967433499896},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":76,"txnTime":1543513967},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"TN7Sx7qF9RSmaDcTiFKWzd","value":"qJLHVvfJiNEexfo7rwxXuNGqhhas1CFY5hxQBrh21dn6oEybkFy41pNVvhU2Qb4eW3j5VyBE65nnFqYi8k6JRRZ"}]},"txn":{"data":{"data":{"alias":"dativa_validator","blskey":"3bYtYhVodD49a3bTK2bZzTAZqt284tKQ2vgXG2arqUyYJRhYnDouhAaQAM7fctC84NvQRG2p1UwVdcdUZPkau5wdJ6fKWwpGo1mM2firHhYtiSZcCAfAbPQhTSSKnsaMnUzacuPC1e81ytr3cXjPobaAg4jJA637N2MGwUWv665o7ae","blskey_pop":"Qm7nQt5HjnaLSpCobPxAH8JG67J6bstaKop2XCsnBELR8tJNm1BYkqTTsj5HVRwXBkMg2vexNQ51B29cp9tSK3zK7ddbhWh8C4cDHoDQgaCHNz61hQxxYMx37yraFLggPF9WCaUckAn4fFxEvLBMV3EdcBZoTecwGPt2g1WhBDjB3M","client_ip":"100.24.186.243","client_port":9799,"node_ip":"35.174.181.186","node_port":9700,"services":["VALIDATOR"]},"dest":"F15n4nPZcnzDJJMNSZK8yNaeodi1PjZyDs83r4KC75hy"},"metadata":{"digest":"47ef7d8fa8fe23a6609710042b27ed83e8ee4520e7c51698ee04419c7b7b0daa","from":"TN7Sx7qF9RSmaDcTiFKWzd","reqId":1543514771626991925},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":77,"txnTime":1543514771},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"BD95LAmfVrD3JEwaereykM","value":"326qebvjJFB9dBhhM26n6nqRm1DrjDATdY8JR8r6Wr4snfrmBpasSZATrUarQzAzu3AdZia67zwQsmoepwfRRo7y"}]},"txn":{"data":{"data":{"alias":"ibmTest","blskey":"232Z7DQcjp5NPVZyzR6WWH9w9829F4NPBz87sx2LHZBnv2xntpaixyUc7J5hUtwnYgL7HyEZsf3Wgtdr5sGua7jhpJzixxtR2p4KoRZ48i62wA9Y5mJ4FmXBg3GxMwbegc2Nmqg33CGjB8cDGUZwR1jBERdZdsi3Y4CL9e9NsBqUu5C","blskey_pop":"RKL3Tji4ZKCsfBLaSAsnvDBn2TvmkkSSEKy2zDk467aXZFG4fpEV8t89w2FXGeU2vLHV1ppYpfefDoi1Qjgm7vxEPdEzys3ZxGJea9FXG78sQPurLF1XZtK1g6DV5L2YAyV3qC1pyGGibJvc5RNS6kdbihSwkpZnVRDwCr3Pk5DPiX","client_ip":"169.60.4.138","client_port":9702,"node_ip":"169.60.4.138","node_port":9701,"services":["VALIDATOR"]},"dest":"7mcctKwaBjyzAbNPS8ix1LTNxex4JchkyLvjYfw2XexR"},"metadata":{"digest":"45bf4a0c9d8267ed8cfb37933cdf50ed3eaf23f7bcad6681a65cf55fd0120de0","from":"BD95LAmfVrD3JEwaereykM","reqId":1543518036999212000},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":78,"txnTime":1543518052},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"BD95LAmfVrD3JEwaereykM","value":"2kHqvEXmgiRcPghcNdGGphFZJdBj4g5CXNsDQkFx15FAprGvmt5DbDC1N4FZQCd7Gi4LzSAn4cQ5eoKsnBmn5UnL"}]},"txn":{"data":{"data":{"alias":"ibmTest","blskey":"232Z7DQcjp5NPVZyzR6WWH9w9829F4NPBz87sx2LHZBnv2xntpaixyUc7J5hUtwnYgL7HyEZsf3Wgtdr5sGua7jhpJzixxtR2p4KoRZ48i62wA9Y5mJ4FmXBg3GxMwbegc2Nmqg33CGjB8cDGUZwR1jBERdZdsi3Y4CL9e9NsBqUu5C","blskey_pop":"RKL3Tji4ZKCsfBLaSAsnvDBn2TvmkkSSEKy2zDk467aXZFG4fpEV8t89w2FXGeU2vLHV1ppYpfefDoi1Qjgm7vxEPdEzys3ZxGJea9FXG78sQPurLF1XZtK1g6DV5L2YAyV3qC1pyGGibJvc5RNS6kdbihSwkpZnVRDwCr3Pk5DPiX","client_ip":"169.60.4.138","client_port":9702,"node_ip":"169.60.4.139","node_port":9701,"services":["VALIDATOR"]},"dest":"7mcctKwaBjyzAbNPS8ix1LTNxex4JchkyLvjYfw2XexR"},"metadata":{"digest":"933101316c883ce1ade5c0fd93e226448fc88f38d858788be4986596f7b9be38","from":"BD95LAmfVrD3JEwaereykM","reqId":1543519064797689800},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":79,"txnTime":1543519080},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"BD95LAmfVrD3JEwaereykM","value":"zPAr7xh7rcMYkAh3Vd73TFAoX45mtU3eaP57Ke6JPcv6ppMr4iYpafyB1X2DAB5sQsBRn2MVC1BJrfcwdCrDG1U"}]},"txn":{"data":{"data":{"alias":"ibmTest","blskey":"232Z7DQcjp5NPVZyzR6WWH9w9829F4NPBz87sx2LHZBnv2xntpaixyUc7J5hUtwnYgL7HyEZsf3Wgtdr5sGua7jhpJzixxtR2p4KoRZ48i62wA9Y5mJ4FmXBg3GxMwbegc2Nmqg33CGjB8cDGUZwR1jBERdZdsi3Y4CL9e9NsBqUu5C","blskey_pop":"RKL3Tji4ZKCsfBLaSAsnvDBn2TvmkkSSEKy2zDk467aXZFG4fpEV8t89w2FXGeU2vLHV1ppYpfefDoi1Qjgm7vxEPdEzys3ZxGJea9FXG78sQPurLF1XZtK1g6DV5L2YAyV3qC1pyGGibJvc5RNS6kdbihSwkpZnVRDwCr3Pk5DPiX","client_ip":"169.60.4.138","client_port":9702,"node_ip":"169.60.4.138","node_port":9701,"services":["VALIDATOR"]},"dest":"7mcctKwaBjyzAbNPS8ix1LTNxex4JchkyLvjYfw2XexR"},"metadata":{"digest":"2dcd0cac5e059298e5cdfa8cf0081c95b33a6d9a09086909eff9d7b91f05e23a","from":"BD95LAmfVrD3JEwaereykM","reqId":1543519131380345700},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":80,"txnTime":1543519147},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"AWZpBgGbFFCobzuzsqdeZg","value":"35aYZ3mw5UyEZWjKRB6ciL1d3JqZaMmbWCdAp3TtoV5i1YkDN4nRV98bzPqdSeh5sX1atEifuNKSfEWkBVg4qMhW"}]},"txn":{"data":{"data":{"alias":"sparknz","blskey":"34cHakLPF7ZZtRjysMoXT2SFmaqWinh19y2orQ4BPncYsA2J5fkfhtd34jruhjbRWWLpTw92XgCsTrQPPSdUheyqqs2AFZ7QDwKESAxuukV7N6NwWQBEf7i8GTfJaL5vBqqJxDwDNH3j9oLdeMvtTjU8vrnWZLWb6TKjmzD8NrtwF6o","blskey_pop":"Qp3N5anCNnktZFVWpWJQHexcT18j66dXM5cSd6SAsn9uwMAxU8VxVLjDJrRmutVwbR81EzduJfVojMgPfDdHEPxEDFQKjG2EP6qTk7o7HRyts7kaSfkL1f8Dwk8f8tbU5gkaaLrAYGRkXSjnmMPJHXaj6zeeNQRatZJGeRMAG8o8fh","client_ip":"146.171.248.185","client_port":9701,"node_ip":"146.171.248.186","node_port":9701,"services":["VALIDATOR"]},"dest":"DdAqLDrkEW96hcVLsEtf8SrQnUGFK7uMLyHi775kYFVw"},"metadata":{"digest":"5d1e7deda854cda687afab5defd30a1e940eed638dbe7d3c57cb4e326891bd3c","from":"AWZpBgGbFFCobzuzsqdeZg","reqId":1543870622701863717},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":81,"txnTime":1543870623},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"31oppTng8a1BtbZDEo4LNQhF58AMjSvAznR94KxjQkA6BFJg2sgSwzVXWVbEhVL1H4RzaDPjfnHNPWztjDGTUYVX"}]},"txn":{"data":{"data":{"alias":"sovrin.sicpa.com","services":[]},"dest":"AcaN2zJ1vkQyEvmi2EyUMLzvzczQRvarNPjR2CbtNFAX"},"metadata":{"digest":"2eb2a01dea5d319f834d1e7a06b8a07258e41f22d4f05422b12f9d5986bc34d5","from":"6feBTywcmJUriqqnGc1zSJ","reqId":1544074481553187626},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":82,"txnTime":1544074482},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"41YVszp9VT9djZsVqswxQTnSRX7BEpv2M7QLvPn6rPUGStbDipB2rxwWxLCzFZRGyNQKRvUi42R2KHrHPfU7Wic7"}]},"txn":{"data":{"data":{"alias":"vnode1","services":[]},"dest":"9Aj2LjQ2fwszJRSdZqg53q5e6ayScmtpeZyPGgKDswT8"},"metadata":{"digest":"a4f609e0cbf8747f759a746909dbf1e3c9248db7552685ead0405ac72c9e8927","from":"6feBTywcmJUriqqnGc1zSJ","reqId":1544074647137451532},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":83,"txnTime":1544074647},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"2KoQ12pS6MZA3ibexjZ2UqiTS4NiYvT79bwaxzS22cetgwDfqsmvsR7wWLuyXwkSU8HyX8X7NNK6xgfYPBN4mwMt"}]},"txn":{"data":{"data":{"alias":"vnode1","services":["VALIDATOR"]},"dest":"9Aj2LjQ2fwszJRSdZqg53q5e6ayScmtpeZyPGgKDswT8"},"metadata":{"digest":"92582f39703e76731d5698e5b73e19a8c1ba76f992f91932366607d707bb6a5f","from":"6feBTywcmJUriqqnGc1zSJ","reqId":1544075270586069533},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":84,"txnTime":1544075271},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"bPTNiLzWPFHKr7mJGaump","value":"32q6n5cXWTbbSafBxY1bS9yXopVjkL6esnq9RNPoWbGgNFRPntZFzZkZRpGf8g9WxJANYgHX5eWRcxtuAjVjuGMY"}]},"txn":{"data":{"data":{"alias":"sovrin.sicpa.com","services":["VALIDATOR"]},"dest":"AcaN2zJ1vkQyEvmi2EyUMLzvzczQRvarNPjR2CbtNFAX"},"metadata":{"digest":"0ba8cb01d0926a2bc950883a1fe1994ac6f1ec3ceded488e0d00fc95f494bfc0","from":"bPTNiLzWPFHKr7mJGaump","reqId":1544110495269165919},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":85,"txnTime":1544110495},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"KpBWkKc8yn3iWzjHDDmqBL","value":"5ZWLPJckDRWJc5TJrkpzyBxmsQQBEHfQhSvTKW6NSY2qVroijPMqVByf3tTAUXPfdQ4jGdTSWzS3E4YvvyqTaGf"}]},"txn":{"data":{"data":{"alias":"EBPI-validation-node","blskey":"4XiKTE8hX4d2WVxd85epKmN91wEz9knWXTrEu6Ug9RUb32zaQ4EC6KPmkVzPmE6QAigDaD9soYcKkUVxhzpTFSQuJbSCLUJuNpvDbdMznGw9YoX8n3bBM6bGgPxQzYfRtJGJ1JtWmhViHEF1FhyZxPYqHX1pUbUDd4yKzxJeEabMYDt","blskey_pop":"QkALSfgxL3p3fpswcYJhhaqzi6sYGQNErBSYjqVEuYkuYWPBvnFjNpCrw2GprHS8XcBzss2qeyTXpTRn4PPo3y4MFU61Jwbkbb4Du81Dwh7XUqjiWiV6HvHSdafaeX6P7cGdtcZZAFKsiUWxuosiaeXjk1y9T47ch1hEFSdoh6fBSo","client_ip":"185.242.244.69","client_port":9750,"node_ip":"185.242.244.69","node_port":9700,"services":["VALIDATOR"]},"dest":"j2JLXyTCAMuHSRqZ7eB2JCXSpPniDFUsyT5MJcGAjUG"},"metadata":{"digest":"7ac78f73c3c397596765d3a2b5afbf01096a051c7702d7e29e53573757912d3d","from":"KpBWkKc8yn3iWzjHDDmqBL","reqId":1544725436218772828},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":86,"txnTime":1544725436},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"3TmLPiQF71J954XuFXyPtFKpiECWTL52mCE9AABTCwsFMcx6rforPwsxVKvRjveEuJLv3uucY9ybPnoFfFxGgrKh"}]},"txn":{"data":{"data":{"alias":"EBPI-validation-node","services":[]},"dest":"j2JLXyTCAMuHSRqZ7eB2JCXSpPniDFUsyT5MJcGAjUG"},"metadata":{"digest":"c08be5f00f5976cd163f503430751494dad23d97b16a9c0835e717183039f081","from":"6feBTywcmJUriqqnGc1zSJ","reqId":1544726215993081431},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":87,"txnTime":1544727345},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"5M3i1PbpvEQmTk25EmAY6N","value":"2RTUVnKLx3FGwBQofPD86z4KvgCpN4dbw6Xjvz7Ka9RYdZnydJZ3oE7pZr2Q6V1mZzGqPfAmnW2YEDqozk52THDt"}]},"txn":{"data":{"data":{"alias":"EBPI-validation-node","services":["VALIDATOR"]},"dest":"j2JLXyTCAMuHSRqZ7eB2JCXSpPniDFUsyT5MJcGAjUG"},"metadata":{"digest":"7f6a8dd88af17b623f0f8f28bff0f2188805f9f940b390d9b24b9c0f24956cb2","from":"5M3i1PbpvEQmTk25EmAY6N","reqId":1544733913396713000},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":88,"txnTime":1544733914},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"5M3i1PbpvEQmTk25EmAY6N","value":"5hb9wbwvgaYCdwRYUAQvgHkUPzX6F6BhirapR2ni3BAYMGqT9irnJWVMciEdTGZj3rKY2ThAfVtNaMbSJnW6HCyc"}]},"txn":{"data":{"data":{"alias":"EBPI-validation-node","services":[]},"dest":"j2JLXyTCAMuHSRqZ7eB2JCXSpPniDFUsyT5MJcGAjUG"},"metadata":{"digest":"0f52e5c1d547772efd54bfd01d8ec1caa9ba6dce8ca9234ce977008835e4aa85","from":"5M3i1PbpvEQmTk25EmAY6N","reqId":1544734167152848000},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":89,"txnTime":1544734168},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"bPTNiLzWPFHKr7mJGaump","value":"5SwN2QC6rG7iuQpwwgNccDRhfNBG3rbu8trV5UFnQwHAw8FG4UfhEMkMSk1XUouAqrzY8xZVxThTFgHBxUYyPURx"}]},"txn":{"data":{"data":{"alias":"sovrin.sicpa.com","services":["VALIDATOR"]},"dest":"AcaN2zJ1vkQyEvmi2EyUMLzvzczQRvarNPjR2CbtNFAX"},"metadata":{"digest":"796c9b3f2b9f78bdd482763e0685e8d6b7f2764d4a3374c30b113a026dec6509","from":"bPTNiLzWPFHKr7mJGaump","reqId":1544781409602174729},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":90,"txnTime":1544781409},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"558b9TUNBbNFeGd7S5qW14uUYdx8tZzQP26UCMBuMbR1KXowJUPSebASQ5yMQWwTu3AoWwRUEH74en9wpMSLKo7P"}]},"txn":{"data":{"data":{"alias":"sovrin.sicpa.com","services":[]},"dest":"AcaN2zJ1vkQyEvmi2EyUMLzvzczQRvarNPjR2CbtNFAX"},"metadata":{"digest":"61352cdff0ee3db0e06ddd2675b04a977efc2ff24ab099e6be4ea37c431f80b4","from":"6feBTywcmJUriqqnGc1zSJ","reqId":1544812283315027137},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":91,"txnTime":1544812284},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"4xgBtM4FFMyfndQgbEb7wz","value":"3vBhqo64dvx2r86WuJKZuVfCtLD64FmWo3K1WY2wY1NYTZ7GZivqHjKi5ALCDyxmorD6U5yeMgFPgQCxCei69Ncx"}]},"txn":{"data":{"data":{"alias":"anonyome","blskey":"497qEgWR2PZx1ZUeCQBq2hTva16CkQZpVPtdG4o3tBFYRzXLQkvrEX7vyRrbov9LQQQriJfRdYZ41C8ju4BjPH77zF34diUeLxrtK1kMGoTdTHinLK1116XUW5GZpj7y7i3Aekxh69rDqZZbbd65JFrD2ZEJoNsHj8HydbVaAjm6wSa","blskey_pop":"QuNLxWz9jWEoFq3gh2DUbNZHBFiK26gQ66URFGGNNbd8WtKY9u8D94k2zL3P4K74Uzp6MmJPMJewAWuzVD7CQJCguzDPYMUtd57J1PX5VoJXp4ynmbDZhJQq4v393fU2YSLkhd6Fhci3nRovvyz3gPW4JbbtipzZGwp3VZPL1qZpf9","client_ip":"13.54.236.56","client_port":9744,"node_ip":"54.66.208.40","node_port":9733,"services":["VALIDATOR"]},"dest":"AM8oxRuxRyKvJoLRtAEBBPMXzpMqTtm9yQDenMkS76JQ"},"metadata":{"digest":"77ab8c07c8a525367353aae971bace52932b713b772dd57e9f6c6688942867d1","from":"4xgBtM4FFMyfndQgbEb7wz","reqId":1545088395580554723},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":92,"txnTime":1545088396},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"4xgBtM4FFMyfndQgbEb7wz","value":"5XCS6eP9z4jmSxCS4h3ai6vPJTaeNMNXttC2UyPFBinMEFQUtiZJFtCCPtY9Dx48wzN8JWuKPv8xnBqZhHb928Ey"}]},"txn":{"data":{"data":{"alias":"anonyome","blskey":"497qEgWR2PZx1ZUeCQBq2hTva16CkQZpVPtdG4o3tBFYRzXLQkvrEX7vyRrbov9LQQQriJfRdYZ41C8ju4BjPH77zF34diUeLxrtK1kMGoTdTHinLK1116XUW5GZpj7y7i3Aekxh69rDqZZbbd65JFrD2ZEJoNsHj8HydbVaAjm6wSa","blskey_pop":"QuNLxWz9jWEoFq3gh2DUbNZHBFiK26gQ66URFGGNNbd8WtKY9u8D94k2zL3P4K74Uzp6MmJPMJewAWuzVD7CQJCguzDPYMUtd57J1PX5VoJXp4ynmbDZhJQq4v393fU2YSLkhd6Fhci3nRovvyz3gPW4JbbtipzZGwp3VZPL1qZpf9","client_ip":"13.54.95.226","client_port":9744,"node_ip":"54.66.208.40","node_port":9733,"services":["VALIDATOR"]},"dest":"AM8oxRuxRyKvJoLRtAEBBPMXzpMqTtm9yQDenMkS76JQ"},"metadata":{"digest":"09742193d02bfd0a16e1a18f71e0cba235cd6872f018398f12945274f3117e65","from":"4xgBtM4FFMyfndQgbEb7wz","reqId":1545089703401067519},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":93,"txnTime":1545089703},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"e3SjQWaGqcQsq8EkBrCm7RTZUq6oB6LFF88w2gZ9h3xPES9AMioygTTYiRuLkgTtjLocHiYV1UjosX6ybGH7Y9F"}]},"txn":{"data":{"data":{"alias":"sovrin.sicpa.com","services":["VALIDATOR"]},"dest":"AcaN2zJ1vkQyEvmi2EyUMLzvzczQRvarNPjR2CbtNFAX"},"metadata":{"digest":"f9d4f83b612a218f58cb2aa50face3f7cb0ce488e6b37775d14f1ac85b68e6ce","from":"6feBTywcmJUriqqnGc1zSJ","reqId":1545149889900994815},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":94,"txnTime":1545149890},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"5M3i1PbpvEQmTk25EmAY6N","value":"4ijAWFcxfZHB2M169arvZMudfZtwUEjpfhHVKsFDx9TzAVhEU8jwgj8ZXmVU2bFa3rLzBPTW3MrT43KyTCj6Y6Pu"}]},"txn":{"data":{"data":{"alias":"NodeTwinPeek","services":[]},"dest":"2bDviHYdDiTjyXYXEW92zQHEf1C1QsbFatJ6uSYuYrHh"},"metadata":{"digest":"b5f9a593b5368b30899793f12e4cec879b232c49746da332a53fe4c83cc94b41","from":"5M3i1PbpvEQmTk25EmAY6N","reqId":1546646026772409000},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":95,"txnTime":1546646036},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"TK4JebQqeqq5t6x2bCwnD7","value":"2v25oRF7GET3wQZ7Q9TZqdMNVdaJAyR5rmsw3DGkyQkHw9HtyNHkq57EUV9K4Uf75gnyHhRQ9hxau2XJC6SNPa2C"}]},"txn":{"data":{"data":{"alias":"NodeTwinPeek","services":["VALIDATOR"]},"dest":"2bDviHYdDiTjyXYXEW92zQHEf1C1QsbFatJ6uSYuYrHh"},"metadata":{"digest":"f1402734f5bbc90db2dfa3db65d6cdc3ab839eadf13c1a7e16d769507e436696","from":"TK4JebQqeqq5t6x2bCwnD7","reqId":1546880167291826800},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":96,"txnTime":1546880167},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"4RvNoSPKWa1whZRGjpGEq5UDKQUVd3h1m5aRr4xThoFyCR7D2HiszbPGRJH9hhD8V4Sh2cERksU85fyHpW1BUZDz"}]},"txn":{"data":{"data":{"alias":"ibmTest","services":[]},"dest":"7mcctKwaBjyzAbNPS8ix1LTNxex4JchkyLvjYfw2XexR"},"metadata":{"digest":"d847f4140dbc101029081cd2abecc0f32465e310180917e12736d9f102dd2c6b","from":"6feBTywcmJUriqqnGc1zSJ","reqId":1547489538349798313},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":97,"txnTime":1547489539},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"5gCEwT2NHiUcuD53F6xW6vp6CnFabbk2kXoLLxfrUHqnjqMQDNwuSU6fm32aYFC2Z7KMjfs9jKfqPLEtwPFWASqi"}]},"txn":{"data":{"data":{"alias":"ibmTest","services":["VALIDATOR"]},"dest":"7mcctKwaBjyzAbNPS8ix1LTNxex4JchkyLvjYfw2XexR"},"metadata":{"digest":"e92c1fecf19b469d484bad7b3b2115b5e88df9c695afca551c5e1f3422f253f7","from":"6feBTywcmJUriqqnGc1zSJ","reqId":1547497859538640883},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":98,"txnTime":1547497859},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"BD95LAmfVrD3JEwaereykM","value":"3Pcohi5dAcVz9k8hryvXn8x6ddGob5hWYzmHoeZdDi628Asc4Au1rmsMjZasvLPqj69MN1VfbE4kTC9oESUPbAeC"}]},"txn":{"data":{"data":{"alias":"ibmTest","client_ip":"169.60.4.139","client_port":9702,"node_ip":"169.60.4.139","node_port":9701,"services":["VALIDATOR"]},"dest":"7mcctKwaBjyzAbNPS8ix1LTNxex4JchkyLvjYfw2XexR"},"metadata":{"digest":"56af49cfcb420ab39ecee2912fe3acaa2c0e9fcf4bc6dfdf783210cda55495eb","from":"BD95LAmfVrD3JEwaereykM","reqId":1547498794878924300},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":99,"txnTime":1547498795},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"BD95LAmfVrD3JEwaereykM","value":"46AVXqBesadhJLZvoRmcyPDDePE9Hi5DahjPC82fhw7irQnVXbvwNhqB7HXfCxtu8w8VifPhEcfihZcuNKBg995B"}]},"txn":{"data":{"data":{"alias":"ibmTest","blskey":"232Z7DQcjp5NPVZyzR6WWH9w9829F4NPBz87sx2LHZBnv2xntpaixyUc7J5hUtwnYgL7HyEZsf3Wgtdr5sGua7jhpJzixxtR2p4KoRZ48i62wA9Y5mJ4FmXBg3GxMwbegc2Nmqg33CGjB8cDGUZwR1jBERdZdsi3Y4CL9e9NsBqUu5C","blskey_pop":"RKL3Tji4ZKCsfBLaSAsnvDBn2TvmkkSSEKy2zDk467aXZFG4fpEV8t89w2FXGeU2vLHV1ppYpfefDoi1Qjgm7vxEPdEzys3ZxGJea9FXG78sQPurLF1XZtK1g6DV5L2YAyV3qC1pyGGibJvc5RNS6kdbihSwkpZnVRDwCr3Pk5DPiX","client_ip":"169.60.4.139","client_port":9702,"node_ip":"169.60.4.139","node_port":9701,"services":[]},"dest":"7mcctKwaBjyzAbNPS8ix1LTNxex4JchkyLvjYfw2XexR"},"metadata":{"digest":"a1412abace57327ba53e022db6a977e198a6134fec1dc4a17050de981f165845","from":"BD95LAmfVrD3JEwaereykM","reqId":1547500122390156800},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":100,"txnTime":1547500123},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"BD95LAmfVrD3JEwaereykM","value":"3yv5pLUCBnbC95FRb2qVrCtxRVBWB9ySRKkTxJ1M4pdTsXZPd3BHkDYTDqms9e3zPNtK5r8RQcg2ws6c5W4Nmy95"}]},"txn":{"data":{"data":{"alias":"ibmTest","blskey":"232Z7DQcjp5NPVZyzR6WWH9w9829F4NPBz87sx2LHZBnv2xntpaixyUc7J5hUtwnYgL7HyEZsf3Wgtdr5sGua7jhpJzixxtR2p4KoRZ48i62wA9Y5mJ4FmXBg3GxMwbegc2Nmqg33CGjB8cDGUZwR1jBERdZdsi3Y4CL9e9NsBqUu5C","blskey_pop":"RKL3Tji4ZKCsfBLaSAsnvDBn2TvmkkSSEKy2zDk467aXZFG4fpEV8t89w2FXGeU2vLHV1ppYpfefDoi1Qjgm7vxEPdEzys3ZxGJea9FXG78sQPurLF1XZtK1g6DV5L2YAyV3qC1pyGGibJvc5RNS6kdbihSwkpZnVRDwCr3Pk5DPiX","client_ip":"169.60.4.139","client_port":9702,"node_ip":"169.60.4.139","node_port":9701,"services":["VALIDATOR"]},"dest":"7mcctKwaBjyzAbNPS8ix1LTNxex4JchkyLvjYfw2XexR"},"metadata":{"digest":"1f584ac4cc88cb57ad5d9005e4f5f17156b70aad80f302b642289e4840076f74","from":"BD95LAmfVrD3JEwaereykM","reqId":1547500156383195400},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":101,"txnTime":1547500157},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"3f1sTShBSY8s7axeGypUxfY8a4V19kYkkFPyGygGGveJ2KDNVSEtKJHbLQNkaxk1nJnKudWQGKzCS2AdjBG766rw"}]},"txn":{"data":{"data":{"alias":"ibmTest","services":[]},"dest":"7mcctKwaBjyzAbNPS8ix1LTNxex4JchkyLvjYfw2XexR"},"metadata":{"digest":"03f65d7a7bc664f38199f4d34f6c8dd3fbeb5ad8744753b6a3f92def6d148ace","from":"6feBTywcmJUriqqnGc1zSJ","reqId":1547500445740297593},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":102,"txnTime":1547500446},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"BD95LAmfVrD3JEwaereykM","value":"5zo62TywH6pZij5L3QU9zmjEmAf7czZDJnyF3zFHXhqcGfGYLWCeUuFqJ7bVMc8Bnfx2XxkYY4UtwZ6oz3HwrqdL"}]},"txn":{"data":{"data":{"alias":"ibmTest","blskey":"232Z7DQcjp5NPVZyzR6WWH9w9829F4NPBz87sx2LHZBnv2xntpaixyUc7J5hUtwnYgL7HyEZsf3Wgtdr5sGua7jhpJzixxtR2p4KoRZ48i62wA9Y5mJ4FmXBg3GxMwbegc2Nmqg33CGjB8cDGUZwR1jBERdZdsi3Y4CL9e9NsBqUu5C","blskey_pop":"RKL3Tji4ZKCsfBLaSAsnvDBn2TvmkkSSEKy2zDk467aXZFG4fpEV8t89w2FXGeU2vLHV1ppYpfefDoi1Qjgm7vxEPdEzys3ZxGJea9FXG78sQPurLF1XZtK1g6DV5L2YAyV3qC1pyGGibJvc5RNS6kdbihSwkpZnVRDwCr3Pk5DPiX","client_ip":"169.60.4.139","client_port":9702,"node_ip":"169.60.4.139","node_port":9701,"services":["VALIDATOR"]},"dest":"7mcctKwaBjyzAbNPS8ix1LTNxex4JchkyLvjYfw2XexR"},"metadata":{"digest":"da6a5f92b960682e1c372ac18d3287e8a9db6e64cd5c07855a2cd95d5c13263b","from":"BD95LAmfVrD3JEwaereykM","reqId":1547500485921720200},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":103,"txnTime":1547500486},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"BD95LAmfVrD3JEwaereykM","value":"ftEtDcapN4TLHkeMDzvf4iQcrtAJvZx1VvvHnhDxqPxTcRVXWXLrQxNZWEjnjFet7ZNtsAQT6MmYHhZGztqrAVY"}]},"txn":{"data":{"data":{"alias":"ibmTest","blskey":"232Z7DQcjp5NPVZyzR6WWH9w9829F4NPBz87sx2LHZBnv2xntpaixyUc7J5hUtwnYgL7HyEZsf3Wgtdr5sGua7jhpJzixxtR2p4KoRZ48i62wA9Y5mJ4FmXBg3GxMwbegc2Nmqg33CGjB8cDGUZwR1jBERdZdsi3Y4CL9e9NsBqUu5C","blskey_pop":"RKL3Tji4ZKCsfBLaSAsnvDBn2TvmkkSSEKy2zDk467aXZFG4fpEV8t89w2FXGeU2vLHV1ppYpfefDoi1Qjgm7vxEPdEzys3ZxGJea9FXG78sQPurLF1XZtK1g6DV5L2YAyV3qC1pyGGibJvc5RNS6kdbihSwkpZnVRDwCr3Pk5DPiX","client_ip":"169.60.4.139","client_port":9702,"node_ip":"169.60.4.138","node_port":9701,"services":["VALIDATOR"]},"dest":"7mcctKwaBjyzAbNPS8ix1LTNxex4JchkyLvjYfw2XexR"},"metadata":{"digest":"15e71658452369fb383b2887eb9c4bf3833a3df8e6c48138de55730e086c0e6e","from":"BD95LAmfVrD3JEwaereykM","reqId":1547501596782347800},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":104,"txnTime":1547501597},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"7sTtbnHKD3zyosb1dFQAex","value":"23WRyTk9B2hPHXTMzFnjxJZZUhfsn9DLBbep5fEQqm6eTqYHiGrriTP9PbPLpVF1BHWsygVsVyr1jSQjr3VE6pKy"}]},"txn":{"data":{"data":{"alias":"regioit01","blskey":"RVjJZ8FJDMjFS6hTNVSXMx7S4BfQeX49CLTXvkHWvVQ4LRNBCsWAjwWFcDUzmdA2JA7hMRi9qvjh8vmPDahLeogJyWEByQFdJ4LnFo2NkDAfQwExHjLGXdawHPQjTduRrWYERpjwS9jFs3FXih6FcQRZb9mKrSW1tguSF7qGSdiNmV","blskey_pop":"R2v3TpVYmWpifxideMdW4EQo36w36VsppcDB44JNDxxCREiUZqrBj9RChgu6RRmHjj6SLchea5L515iadvA6STeQYh8tjMF87KH8s6RE5JAQagzX67X2fbpzai6A5Vq6w5wxLPJTKV4P9rkjxnH5Y6R1ReaVcKzZYk6j583WSUJZdZ","client_ip":"91.102.136.180","client_port":9700,"node_ip":"91.102.136.179","node_port":9701,"services":["VALIDATOR"]},"dest":"AQoViW7aucuvi8SC9QWur6u14ppmVvtMvduigy51NeCv"},"metadata":{"digest":"acd16644af0c402f1cce381e9dffcdd138d3d5098c54ac5c7d126be8b2923e50","from":"7sTtbnHKD3zyosb1dFQAex","reqId":1547571055916476853},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":105,"txnTime":1547571053},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"HS2VPUmJ1vJQHCjfH1w42H","value":"5htNrJWGu15CpxU7ocHYRkGQUygcaV41jcRmK9a1rvGoG59qWMJYpc4GvZeh2FttfobbxMZJfB57sggLhFS95y9S"}]},"txn":{"data":{"data":{"alias":"Absa","blskey":"31k6SUK7otXf9MXDgfGRb9N37z8xcZbdRmegNiK5k97sdfNvTSfKeEqSTxBqe7qqNa4ueYKDjW2MYgWBwYF1ohh5GzjUndykwttpffbkDGCrQAaUTJoBi9rJvrwCkkQeLKpoWTMkV6gYp1AiJkhKYiGhtCCAA3R5grGUpcMzDXqzt8R","blskey_pop":"QngATEwvD1MHDL4odeiMqg9AYp9emVmRDSQMeKwFXdtthR9x5tDvKrWFT1gZPECuaRWtEmQBQDzSxebiy5jZJ6DwNbP4EfLtKvHrmHUAVfXKvrzHJiwbeg56oXdyi84xsNLKKZrhhr8hEgpNN1F1FXHfJUDWNyMU3w81peiLLAkYrb","client_ip":"63.33.176.61","client_port":9702,"node_ip":"63.33.176.61","node_port":9701,"services":["VALIDATOR"]},"dest":"BUKQ26j7hqkW2bdQsoxHACyS1n7gCrHeYxLR4yaoWCr"},"metadata":{"digest":"31b150874511509e4ac355e37c9ce7f649fb12bc48a2cf9c591b0f390b076b67","from":"HS2VPUmJ1vJQHCjfH1w42H","reqId":1547574103955392127},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":106,"txnTime":1547574106},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"YTsBtQz1PgjHNNPsGa7i7i","value":"JJD9qYZF7z8nNqP2sAf1ER3HB9rH7FQBhPeVUjyaf3G9TsBUQCv3XVTgV9eGXke5tA7nmDHaQwhFhVDMfpZVq1E"}]},"txn":{"data":{"data":{"alias":"VALIDATOR1","blskey":"uSpMXhzYzgkShiEeWoSrKar8g2iCsg8KL9XaSSs9HNJt5MSCXKjPZtyHNN7KtuLi1ThxKZc8ZUUtjh9uz2ApXZU41PHLX4RsMEGdfMJf3FsPRP8RkodRtqXuxmTzKEvJJ4XihrgHCL85QBpBkmp2u7YioLqwhAxyDmFRLjFnHx4cwr","blskey_pop":"RHFFZHGBUFAkfYQr9nzn2FX2ZQn6u4FmRyfUTMC6DnVfBF7ogJz2oSS4vpi2MitFTwWCofZsB3g58wSPZA4PGAPR8KXjHQvEkB5MS3NDnAgjje1E8fX9XC41qhEJ1kdC68GtgTgJSJRfkmH9c3jjb8rhQskod6N8swtTpqwV4CGgoq","client_ip":"54.180.62.29","client_port":9798,"node_ip":"54.180.16.51","node_port":9799,"services":["VALIDATOR"]},"dest":"99UgWzvjVvhDHfd16V62VFdQEKn8Vk5fuMP2t1d6xx4w"},"metadata":{"digest":"d28d9fab163bd72cf7fbc254ca6b7b495101439870a064ceefd2b18f1d4417ad","from":"YTsBtQz1PgjHNNPsGa7i7i","reqId":1547599663946425568},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":107,"txnTime":1547599664},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"KSZhtVyy7yQGxHLq8pxQwX","value":"2tHAgZ2A32YBJzLBWbXcCCfEYjRAfUeswRQQkrfttwk8Av1zvwHyfqQUfQKHKtTaQc1UeUjd7Z1axgEQf9LQqTCS"}]},"txn":{"data":{"data":{"alias":"swisscom","blskey":"2Y6bbfnx22jRKT6vDFq6kJayzqrU3N6hBGvqaepepgQHrC8KyfjwsnbAxr6NAySdFq81SopX5is2nc33d2Kei2jXGjktA7VgT3JPaSQxi6cb1UVKA3taVaqPXdbQvedkkGrgdGuHJgz2Tz5yZQertL2YiqUmKjPn78vSJWF3b6BXQ4B","blskey_pop":"QqARZRNUxwb9DWJW66DAifJNMCeWo2r3Mxy2HPrDEEiFvhba7FiSxQ8czJoVa2r58GwvT9Srvh2tifKUjMsnwt2o1GioMDpTS42MyENa6tvZuGnnsErVHekH5xccnGRe4zVLd3MAmzha8RDL5pMZeLzRw5rDpQLSnJQJKrQzqLho2X","client_ip":"164.128.162.43","client_port":9702,"node_ip":"164.128.162.42","node_port":9701,"services":["VALIDATOR"]},"dest":"58b3Fy45qjcBfVtEt2Zi1MgiRzX9PPmj68FwD143SuWQ"},"metadata":{"digest":"b582d138c5f92a84059eccae5c624392fc89899e02b559dfe5521b25230b10f6","from":"KSZhtVyy7yQGxHLq8pxQwX","reqId":1547651916293792395},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":108,"txnTime":1547651916},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"KSZhtVyy7yQGxHLq8pxQwX","value":"2eF3euLofexGmoBY8BQutqNkPEGhWvomVQZK1PFs9iKRzUEkZPXAStxG8wuh59DRUcGTX3piZUQYPk6Cb7Dc3cCY"}]},"txn":{"data":{"data":{"alias":"swisscom","blskey":"2Y6bbfnx22jRKT6vDFq6kJayzqrU3N6hBGvqaepepgQHrC8KyfjwsnbAxr6NAySdFq81SopX5is2nc33d2Kei2jXGjktA7VgT3JPaSQxi6cb1UVKA3taVaqPXdbQvedkkGrgdGuHJgz2Tz5yZQertL2YiqUmKjPn78vSJWF3b6BXQ4B","blskey_pop":"QqARZRNUxwb9DWJW66DAifJNMCeWo2r3Mxy2HPrDEEiFvhba7FiSxQ8czJoVa2r58GwvT9Srvh2tifKUjMsnwt2o1GioMDpTS42MyENa6tvZuGnnsErVHekH5xccnGRe4zVLd3MAmzha8RDL5pMZeLzRw5rDpQLSnJQJKrQzqLho2X","client_ip":"164.128.162.42","client_port":9702,"node_ip":"164.128.162.43","node_port":9701,"services":["VALIDATOR"]},"dest":"58b3Fy45qjcBfVtEt2Zi1MgiRzX9PPmj68FwD143SuWQ"},"metadata":{"digest":"23c08c4db5ad3ca27e2fd38b3015525d3a76b41ba63c2fb82e2a15f67ca717fb","from":"KSZhtVyy7yQGxHLq8pxQwX","reqId":1547653252643574766},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":109,"txnTime":1547653252},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"KSZhtVyy7yQGxHLq8pxQwX","value":"mUhTwVA6XGHF82XJj4eEa5xpaK6qCFF2bwLHsVt4pnfxdVxTMYHJBVHaQfbYALSuDQfdrgktLKv6Goo8PRzvANc"}]},"txn":{"data":{"data":{"alias":"swisscom","services":[]},"dest":"58b3Fy45qjcBfVtEt2Zi1MgiRzX9PPmj68FwD143SuWQ"},"metadata":{"digest":"60ac2ccf34f393880b544c5fab223e5daf36a5fd92565556d22d589be6d2d9d1","from":"KSZhtVyy7yQGxHLq8pxQwX","reqId":1547656208364157351},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":110,"txnTime":1547656208},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"BD95LAmfVrD3JEwaereykM","value":"24goM7gvgMmhYs7VSd4TJtmUinGTySwYiB59ViLvpbQ9WV4TJZr4R9q36wX7nKRwu9aPBXiJSiEU33ozREQd3SUt"}]},"txn":{"data":{"data":{"alias":"ibmTest","blskey":"232Z7DQcjp5NPVZyzR6WWH9w9829F4NPBz87sx2LHZBnv2xntpaixyUc7J5hUtwnYgL7HyEZsf3Wgtdr5sGua7jhpJzixxtR2p4KoRZ48i62wA9Y5mJ4FmXBg3GxMwbegc2Nmqg33CGjB8cDGUZwR1jBERdZdsi3Y4CL9e9NsBqUu5C","blskey_pop":"RKL3Tji4ZKCsfBLaSAsnvDBn2TvmkkSSEKy2zDk467aXZFG4fpEV8t89w2FXGeU2vLHV1ppYpfefDoi1Qjgm7vxEPdEzys3ZxGJea9FXG78sQPurLF1XZtK1g6DV5L2YAyV3qC1pyGGibJvc5RNS6kdbihSwkpZnVRDwCr3Pk5DPiX","client_ip":"169.60.4.139","client_port":9702,"node_ip":"169.60.4.139","node_port":9701,"services":["VALIDATOR"]},"dest":"7mcctKwaBjyzAbNPS8ix1LTNxex4JchkyLvjYfw2XexR"},"metadata":{"digest":"2df2c048ffd27254d4abe5face1ca7984d058a819d791d15a11dfe6dc0885cb3","from":"BD95LAmfVrD3JEwaereykM","reqId":1547499944042787200},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":111,"txnTime":1547762408},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"KSZhtVyy7yQGxHLq8pxQwX","value":"3dz2LU41uRHr4jByQMQPN8UNbTixsMWnRkCLFBGFLH91NsFkC4hYvTmS1fSqAZWmabMwNyXGWTgCVce2axC6R52M"}]},"txn":{"data":{"data":{"alias":"swisscom","blskey":"2Y6bbfnx22jRKT6vDFq6kJayzqrU3N6hBGvqaepepgQHrC8KyfjwsnbAxr6NAySdFq81SopX5is2nc33d2Kei2jXGjktA7VgT3JPaSQxi6cb1UVKA3taVaqPXdbQvedkkGrgdGuHJgz2Tz5yZQertL2YiqUmKjPn78vSJWF3b6BXQ4B","blskey_pop":"QqARZRNUxwb9DWJW66DAifJNMCeWo2r3Mxy2HPrDEEiFvhba7FiSxQ8czJoVa2r58GwvT9Srvh2tifKUjMsnwt2o1GioMDpTS42MyENa6tvZuGnnsErVHekH5xccnGRe4zVLd3MAmzha8RDL5pMZeLzRw5rDpQLSnJQJKrQzqLho2X","client_ip":"164.128.162.43","client_port":9702,"node_ip":"164.128.162.42","node_port":9701,"services":["VALIDATOR"]},"dest":"58b3Fy45qjcBfVtEt2Zi1MgiRzX9PPmj68FwD143SuWQ"},"metadata":{"digest":"a81375c6b2e43e5ed4d44d565901e33066d77785798ddd93ed2726bea6930c4f","from":"KSZhtVyy7yQGxHLq8pxQwX","reqId":1547652168940154534},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":112,"txnTime":1547762409},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"554joew9xsZWAuwzfgK5CvAgw3hapNcET6Z7qEnVXBNBe23c9TCeAWeRoM9GYDpEypkZcQFwiQcV3jRJXq3wiFPF"}]},"txn":{"data":{"data":{"alias":"swisscom","services":[]},"dest":"58b3Fy45qjcBfVtEt2Zi1MgiRzX9PPmj68FwD143SuWQ"},"metadata":{"digest":"0a4a47a4080c3899997cc6e71e78d1e3ffd675e13d95908c9a0b122f2dd0dc8d","from":"6feBTywcmJUriqqnGc1zSJ","reqId":1548175587215323240},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":113,"txnTime":1548175587},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"nLE6kCvr6FwEBvZ8p6aw58DMwFSf7Q5CcEEyA17b4HHQMpZuYdwbpz5w2kuiSac4w9qRnPGB8ouLndmzMggFHi1"}]},"txn":{"data":{"data":{"alias":"EBPI-validation-node","services":["VALIDATOR"]},"dest":"j2JLXyTCAMuHSRqZ7eB2JCXSpPniDFUsyT5MJcGAjUG"},"metadata":{"digest":"03c6e7bb56d6a2870bc9cc7a8e3e4c226864faf1db51368047e9e92d38697138","from":"6feBTywcmJUriqqnGc1zSJ","reqId":1548184180516141458},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":114,"txnTime":1548184181},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"BD95LAmfVrD3JEwaereykM","value":"3pAYVxsFgE9u41tsucPUW4Jmy2LFQLKeNNiYcVi4MTm57GyheA5cVzbzLKq2wA4NABSd4EqLf2cCwmzZwUF2iAkE"}]},"txn":{"data":{"data":{"alias":"ibmTest","blskey":"232Z7DQcjp5NPVZyzR6WWH9w9829F4NPBz87sx2LHZBnv2xntpaixyUc7J5hUtwnYgL7HyEZsf3Wgtdr5sGua7jhpJzixxtR2p4KoRZ48i62wA9Y5mJ4FmXBg3GxMwbegc2Nmqg33CGjB8cDGUZwR1jBERdZdsi3Y4CL9e9NsBqUu5C","blskey_pop":"RKL3Tji4ZKCsfBLaSAsnvDBn2TvmkkSSEKy2zDk467aXZFG4fpEV8t89w2FXGeU2vLHV1ppYpfefDoi1Qjgm7vxEPdEzys3ZxGJea9FXG78sQPurLF1XZtK1g6DV5L2YAyV3qC1pyGGibJvc5RNS6kdbihSwkpZnVRDwCr3Pk5DPiX","client_ip":"169.60.4.138","client_port":9702,"node_ip":"169.60.4.138","node_port":9701,"services":["VALIDATOR"]},"dest":"7mcctKwaBjyzAbNPS8ix1LTNxex4JchkyLvjYfw2XexR"},"metadata":{"digest":"be3db7c6f4526eaafece89054a366726ff34fb6d93943b847222fe5660454323","from":"BD95LAmfVrD3JEwaereykM","reqId":1548190805953640600},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":115,"txnTime":1548190806},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"BD95LAmfVrD3JEwaereykM","value":"2rn9DmGEeqU4V41MbGThxEuvdZ6qLHsVDeYqJDnpDayCWVhdxXERAfKokcxrXVHPA1Q2gyekZ3jMSuLaFua1jCwD"}]},"txn":{"data":{"data":{"alias":"ibmTest","blskey":"232Z7DQcjp5NPVZyzR6WWH9w9829F4NPBz87sx2LHZBnv2xntpaixyUc7J5hUtwnYgL7HyEZsf3Wgtdr5sGua7jhpJzixxtR2p4KoRZ48i62wA9Y5mJ4FmXBg3GxMwbegc2Nmqg33CGjB8cDGUZwR1jBERdZdsi3Y4CL9e9NsBqUu5C","blskey_pop":"RKL3Tji4ZKCsfBLaSAsnvDBn2TvmkkSSEKy2zDk467aXZFG4fpEV8t89w2FXGeU2vLHV1ppYpfefDoi1Qjgm7vxEPdEzys3ZxGJea9FXG78sQPurLF1XZtK1g6DV5L2YAyV3qC1pyGGibJvc5RNS6kdbihSwkpZnVRDwCr3Pk5DPiX","client_ip":"169.60.4.139","client_port":9702,"node_ip":"169.60.4.138","node_port":9701,"services":["VALIDATOR"]},"dest":"7mcctKwaBjyzAbNPS8ix1LTNxex4JchkyLvjYfw2XexR"},"metadata":{"digest":"16bcd5c9ea536ed306bd414a3797076156c7e143ddcef630e95ee5b2a7d236d5","from":"BD95LAmfVrD3JEwaereykM","reqId":1548191738654080100},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":116,"txnTime":1548191739},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"KSZhtVyy7yQGxHLq8pxQwX","value":"2SedyJRXPkF7yyCHkvEhGeyZ34W9MXrH5AVcFFgQJ4tbsWpF9gKvYL6gawbuvAE8W2FqkKoufWFf8kgxouaZV89v"}]},"txn":{"data":{"data":{"alias":"swisscom","client_ip":"127.0.0.3","client_port":9702,"node_ip":"127.0.0.3","node_port":9701},"dest":"58b3Fy45qjcBfVtEt2Zi1MgiRzX9PPmj68FwD143SuWQ"},"metadata":{"digest":"92c8ec4f3f0aaf806b18b74afb1e8e52d06d5096b9e0c3b3996af0dfc4bf627b","from":"KSZhtVyy7yQGxHLq8pxQwX","reqId":1548781193697645899},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":117,"txnTime":1548781193},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"HMT5rCkqvjcjZZHQFvQtsX","value":"5QNoTkHzevZ328EMXUTzWWveowZE1v4bfdhxaKfNGUvuUk4ympwnkzCPRFnz57xrvouC4A2rtd2T3vj4opCgQbMB"}]},"txn":{"data":{"data":{"alias":"Swisscom","blskey":"2Dys6A6wihGsazQLKe2hN8kHQ17u9Hix9pZ2uTBtuvMSLMaaWZrMnbXYoHcv7iDc58mGBnGEA335gXN8Y1Dntjd3YgeDYS7ffpxGHDuvMzuRpD2iktMCzUCRmsSMim32vURLkPTHs8Pg2fgg4vGcsmAeGk4tFVaCVC6gASgNU9JqDKX","blskey_pop":"RZ31hdcUW3zcD2XMTqvazNcX2YxwY4HSWah9tDzTW6A7G2uhzVoy9UTqzdrGHgZ183VoNKw1EeZvB6kRZYFLckwnW8pKT7r1GS4gUPPcnQxAtogy2bMnQQ8S4ZY5e7WYn2URJ2GF1TSGnzUzqu4iQZWiMeFsBc1CVH98A9PGmYQ3z7","client_ip":"164.128.162.43","client_port":9702,"node_ip":"164.128.162.42","node_port":9701,"services":["VALIDATOR"]},"dest":"B3x2KTn46sZmajraNm9oh6EUWnZWC5yQTrJAUifwDWRV"},"metadata":{"digest":"0ad6663c3841906ffafd51a467d7c43480d912551fbd98e9cd415e1571344455","from":"HMT5rCkqvjcjZZHQFvQtsX","reqId":1548781315218601114},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":118,"txnTime":1548781315},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"G4tfohtFDtmQJAEg6Pwgg6","value":"3oR6cXp4AbetwhgHacWjnF7LhnS8q8kVzA4nqvsvvxKzDEbiFSEF4UEU5BFiiAxtXg9nm6xk5X496v6JHETYdYjU"}]},"txn":{"data":{"data":{"alias":"NECValidator","blskey":"4UVe2Ryi4oPiECy8jxEHrXbNKbyjBjADotdD7ibRfpkfHjkD7UnBVcJKq8NFFf3rmGb8G3i7hGvZw8dUyQvcx67uAKNvYA3QMc3AL77aFNXHjiU5HdEBhwvq9qjs3BWZGoPyRfxun7EjMohiHvGTiZUxAzZD3R8qpaYaJ7DUdC3k24Y","blskey_pop":"QkN8FyGfub1yoMMzHhDBdrRyfKyrqX8kuiA6dXfAM3ghMGq1wWGbA8VuuCf4eWtxZvaD8iz9shC5zJn2C6pzo3BpmmP2bufsAGVWcNhTqxKPfXHds2JC4DagX7BV5mDfTriv4mF4EJD8PbwVgGvHzGFj4FuGTx3BnA9oay3rGxf1m9","client_ip":"52.69.239.67","client_port":9702,"node_ip":"13.230.94.222","node_port":9701,"services":["VALIDATOR"]},"dest":"BLu5t8JVbpHrRrocSx1HtMqJC8xruDLisaYZMZverkBs"},"metadata":{"digest":"3e03ca15f515f8fce2287600d02ef5dee412bc2874b836b8a5831ef9cb526701","from":"G4tfohtFDtmQJAEg6Pwgg6","reqId":1548808410060957151},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":119,"txnTime":1548808410},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"Kv2YdE5KGgdruMGW6p5w4b","value":"2Fm6QXXRYDhh34H7xRYFxHJQyHymyimPBJotwKzGUWJBGEcWPdYUhUFk2VDp9JyYhkapDchyhtS7VxjvQnHc6yR1"}]},"txn":{"data":{"data":{"alias":"xsvalidatorec2irl","services":[]},"dest":"DXn8PUYKZZkq8gC7CZ2PqwECzUs2bpxYiA5TWgoYARa7"},"metadata":{"digest":"e5b3e73768c7698aafa3a9679d2b91b58be5b6a4f7e5b9669c27838b94e3cd27","from":"Kv2YdE5KGgdruMGW6p5w4b","reqId":1551902688751838000},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":120,"txnTime":1551902689},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"5M3i1PbpvEQmTk25EmAY6N","value":"5Rkz1NJxoU8rjaSeXHb77XrjD1Gedqm6ZxqN89YEtnajxztxcw5iKEBLnFg34in2ta2mkAdkLSBPEQbArPKFyG5f"}]},"txn":{"data":{"data":{"alias":"sparknz","services":[]},"dest":"DdAqLDrkEW96hcVLsEtf8SrQnUGFK7uMLyHi775kYFVw"},"metadata":{"digest":"34c208f6f214e973d926473b807e1220dd5f4167685101baa0fdde25da577054","from":"5M3i1PbpvEQmTk25EmAY6N","reqId":1551981105839004000},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":121,"txnTime":1551981106},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"5M3i1PbpvEQmTk25EmAY6N","value":"29EBhTyCNsXJ9rruhPUfY5DLoXW5JiyZy7eGNxZ649sYefMZmJdpf8dnd2LxkCNswD9oGWPXbiRZbGfCEXc35Zkf"}]},"txn":{"data":{"data":{"alias":"vnode1","services":[]},"dest":"9Aj2LjQ2fwszJRSdZqg53q5e6ayScmtpeZyPGgKDswT8"},"metadata":{"digest":"df690f4b4bd3897bbd321563ef5fbf4fdaba2b095546b19d5cc7840f309871a4","from":"5M3i1PbpvEQmTk25EmAY6N","reqId":1552398621045487000},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":122,"txnTime":1552398621},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"HS2VPUmJ1vJQHCjfH1w42H","value":"58FmzCHRRYsiyFE1NQht7Y6n5LLNMmxdVQkBnfBrpmmWHjgLWWjxSK3BwsJW1e2BHhoajGRBZdCSpMHPvwKDuXtU"}]},"txn":{"data":{"data":{"alias":"Absa","client_ip":"99.80.22.248","client_port":9702,"node_ip":"63.33.176.61","node_port":9701,"services":["VALIDATOR"]},"dest":"BUKQ26j7hqkW2bdQsoxHACyS1n7gCrHeYxLR4yaoWCr"},"metadata":{"digest":"96a1552ad574113e94baac125f9032c97e0a60abb5498ac43d2a12a85c0460fb","from":"HS2VPUmJ1vJQHCjfH1w42H","reqId":1552408626878108613},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":123,"txnTime":1552476998},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"BD95LAmfVrD3JEwaereykM","value":"4GCt8VdmfVFJtufoKD6HJBiiQTR6ujiK4bLn2NmdcQucKQNKD3Jr3McMAkwqnjDcduDdQW6AURLeSDyFBDqzZTfv"}]},"txn":{"data":{"data":{"alias":"ibmTest","services":[]},"dest":"7mcctKwaBjyzAbNPS8ix1LTNxex4JchkyLvjYfw2XexR"},"metadata":{"digest":"29a7d65b74832fc91178e60089521bf0212b48a05d7fc35be8841eeda8dc8f88","from":"BD95LAmfVrD3JEwaereykM","reqId":1552662332849012735},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":124,"txnTime":1552662333},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"c5GFhSHNMdaqjSyzQeaMa","value":"2ZSByqsx5w6rpQm6FbKt1scnUUu1VSbbwXBMoKcDCkyrdsm9yrgAKsR8myTW1z4EFt91zAFUJPoUaHnAd6oyBgin"}]},"txn":{"data":{"data":{"alias":"cynjanode","blskey":"4oMnfEbqH5fuLGQQSWLZA7L1y8D4zL232t6QiJhspA5GsKJAextNa3oyr1MK46byzax4EmyoyS74YkLD5ri6dJmRXFnKPZ9E4q8UTWFBRdmpwGiZXni9HXL8twBHhfnNE8vXirQLvzQ2gcSBRzdGHanPBwKnvqjoeNGfDfM1kT22pks","blskey_pop":"RFvdDmi1a8b1VYA8eRtTs9cC2dmhK8b2P7k9VWcPpPKwupyTQr2amdbq4GcbASyML6RXxAvZRuj2EJH3KabkT3hVPM8g1Wn1VYY2761pwCjcHfN1E2G2Nwe5sdwRqxvV965aYi9595SBVWWabx6bcJ9S5EDqKevrUnZ9nsG7xfoWEB","client_ip":"3.17.103.221","client_port":9702,"node_ip":"3.17.215.226","node_port":9701,"services":["VALIDATOR"]},"dest":"C8H9SzkM6NrfYB1jD6dMCmdBKXvcCgGZpvwD47xGdJFQ"},"metadata":{"digest":"eac8e6015ba1eb3f1b294f9c53e54bc79d27b0a690ab358bd826668999f9cc4a","from":"c5GFhSHNMdaqjSyzQeaMa","reqId":1552676534057365965},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":125,"txnTime":1552676534},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6aAJEoijPh3yqeDe9JCqRg","value":"2QzZSa4ComF5hNzGYp2KxtrAu57tstBk7jZrhv6CK95C36KL3Naif5hPJ2egD4ANjAo7VDyaSFks8fANFjFYTowH"}]},"txn":{"data":{"data":{"alias":"DigiCert-Node","blskey":"34ZnAnof88aahn2jShZqUPyvWXjM4pdjBukbH44BXAyZGcY2rivuMLHwCPZGGRf7JAVx6zGdnQiFziqwj8ndtGghht67H2DqHhoxxeCvgxv5aMAVW57z8ekGyMQXq1UWYEYgjFqY2Fi9bCTkGb4ywn4JEFvnfk3aEhVS92CpG5eYQHs","blskey_pop":"R5ksJ4cADE265315njhARQJS3eEqC4bBFjz6sW49Lc7cF814pMdKk4AjjHLCvKeViU6EP8YvhvpiuMhEYzmabsMnj7oesJGp6eqxkjSabFZ7LWk5wzfBW53fSAtBrK4KSGzAfU9zsmsNqBMuK1fiC7J1emxjaZfeXWkBV63dD36i95","client_ip":"63.33.233.212","client_port":9702,"node_ip":"34.250.128.221","node_port":9701,"services":["VALIDATOR"]},"dest":"5mYsynpwzx3muLWYP5ZmqWK8oZtP5k7xj5w85NDKJSM6"},"metadata":{"digest":"c4b76246a7000c018f70776f56accb4667a00eaab83933246b218f5cf4234fb2","from":"6aAJEoijPh3yqeDe9JCqRg","reqId":1553027997718160009},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":126,"txnTime":1553027997},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6aAJEoijPh3yqeDe9JCqRg","value":"2KPdokKdhFMouCFG2xFUmPpwhUSUzte5CdjykDd4YE1BdjZ8UuHsW7d7CLiLrcUkLxyFfKKZNHPZaLhTHjoSqTvF"}]},"txn":{"data":{"data":{"alias":"DigiCert-Node","blskey":"34ZnAnof88aahn2jShZqUPyvWXjM4pdjBukbH44BXAyZGcY2rivuMLHwCPZGGRf7JAVx6zGdnQiFziqwj8ndtGghht67H2DqHhoxxeCvgxv5aMAVW57z8ekGyMQXq1UWYEYgjFqY2Fi9bCTkGb4ywn4JEFvnfk3aEhVS92CpG5eYQHs","blskey_pop":"R5ksJ4cADE265315njhARQJS3eEqC4bBFjz6sW49Lc7cF814pMdKk4AjjHLCvKeViU6EP8YvhvpiuMhEYzmabsMnj7oesJGp6eqxkjSabFZ7LWk5wzfBW53fSAtBrK4KSGzAfU9zsmsNqBMuK1fiC7J1emxjaZfeXWkBV63dD36i95","client_ip":"34.250.128.221","client_port":9702,"node_ip":"34.250.128.221","node_port":9701,"services":["VALIDATOR"]},"dest":"5mYsynpwzx3muLWYP5ZmqWK8oZtP5k7xj5w85NDKJSM6"},"metadata":{"digest":"f5597be009afc3b9decda1e09c8f8d74bd039ac6d6cb890051c88ebeffaa16e9","from":"6aAJEoijPh3yqeDe9JCqRg","reqId":1553030138803227716},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":127,"txnTime":1553030138},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"2v7MzY14jwoMvakDWybDyf3o977GWDT1rQMd5eCEnmTjXy5kvoH99zZJVWXJibDYLU137JbsxQkh59T1HD4kNBbS"}]},"txn":{"data":{"data":{"alias":"brazil","services":[]},"dest":"2MHGDD2XpRJohQzsXu4FAANcmdypfNdpcqRbqnhkQsCq"},"metadata":{"digest":"8bca858f90639c68074c2bb5cdec23a1763e3f58ad38d82c8ebcc0c229c72daa","from":"6feBTywcmJUriqqnGc1zSJ","payloadDigest":"a89394bc38773f420ee0fa62a7e4be466a668c996b1a956e173c8c62ad4ec8ff","reqId":1558034106037397876},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":128,"txnTime":1558034106},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"QVvkFcetzE4g22g4px1iHqEonHimSsFBh7XkCTmEeBqK7oaN4j3TCDB7BjTxZmGhovc2GWVxRswN65nvFygYn7E"}]},"txn":{"data":{"data":{"alias":"canada","services":[]},"dest":"8NZ6tbcPN2NVvf2fVhZWqU11XModNudhbe15JSctCXab"},"metadata":{"digest":"59a7f83dc11a5fbb89f21738665dde7818425cade9b27ff2c944879d48aa2890","from":"6feBTywcmJUriqqnGc1zSJ","payloadDigest":"b9597e20b484f700011436a6c8b768918519980f808928de56b24225165e86e1","reqId":1558034149584193019},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":129,"txnTime":1558034149},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"gc57GehP57PUUN59tGadDjdE7LAmrfseFCqb1DgYenmFF73cUAF25gkPJxuLiFpPV5CiFPjSoAa1JQhAGUz5MDk"}]},"txn":{"data":{"data":{"alias":"england","services":[]},"dest":"DNuLANU7f1QvW1esN3Sv9Eap9j14QuLiPeYzf28Nub4W"},"metadata":{"digest":"f59bb98e1be7576c6575a5abc4ac38edd28148d84605a62437aaf3151c962f69","from":"6feBTywcmJUriqqnGc1zSJ","payloadDigest":"fe0b9e5440ac37828d86daa77be8a55c2b52c89274763673db58d9317c2d1925","reqId":1558034190209122296},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":130,"txnTime":1558034190},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"kU4vKskb9iZEy7YfUQWt9cVrYpmXcqTpctKCLnZ4JsQ9DCEL9ESZ9waC8Jw6qFAW7gQfDgqkehmkFbD9jZSgsyf"}]},"txn":{"data":{"data":{"alias":"korea","services":[]},"dest":"HCNuqUoXuK9GXGd2EULPaiMso2pJnxR6fCZpmRYbc7vM"},"metadata":{"digest":"45a6090bbffa535b34b103f0f4209b039e66c05fad50013d30e8cb139510d627","from":"6feBTywcmJUriqqnGc1zSJ","payloadDigest":"5724525adf9d82d113b1f785c39c6a3a6f6ea92e06e9dbdb57740f4e1e8a3654","reqId":1558034231813907676},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":131,"txnTime":1558034232},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"5VB9ELm2QkWug8s29obUiSxq5tWi588wnYX5nXJEmm5ewoVR5NSTHQcg9q2nm1rcy2aesVsB77e5LLWpae7uqjkb"}]},"txn":{"data":{"data":{"alias":"singapore","services":[]},"dest":"Dh99uW8jSNRBiRQ4JEMpGmJYvzmF35E6ibnmAAf7tbk8"},"metadata":{"digest":"0fb35dbf7589f7acfa487aa1eed473299d1405ed2c656b50b15175e5487f4aa9","from":"6feBTywcmJUriqqnGc1zSJ","payloadDigest":"0359d686d0935df89d4b8fbad5b7264104f2eef898a93cc388e67188d71980e4","reqId":1558034282845794593},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":132,"txnTime":1558034283},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"2wMAYGVoSt3ZtU3CzcvhzMAQ2EFhZvPwBsGKqpNmWvKVWbFeyC6yMZxHCVdtj2fqfj36FJkvPKkh3gwmvvrt6eeW"}]},"txn":{"data":{"data":{"alias":"virginia","services":[]},"dest":"EoGRm7eRADtHJRThMCrBXMUM2FpPRML19tNxDAG8YTP8"},"metadata":{"digest":"4ee79b267e7a5aa9ca96ee667f75dadfafdf1238c2841d2d5fa28accf542331c","from":"6feBTywcmJUriqqnGc1zSJ","payloadDigest":"1b4afb24a5d19cf90eb41bb9c265610a6922c6e0aa59386dc3af2016988f4dc6","reqId":1558034311268528084},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":133,"txnTime":1558034311},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"3QyhWLE53fg8wsNRFJijV6QKax2deCAzhUa1g152KYJ7exk1iqv6mLsHtY5KXNiXLg1a8vxQiFj8Hp8iRb7CXrCA"}]},"txn":{"data":{"data":{"alias":"RFCU","services":[]},"dest":"2B8bkZX3SvcBq3amP7aeATsSPz82RyyCJQbEjZpLgZLh"},"metadata":{"digest":"58c132bc0b8c96fb7628e8b7af9a9086ff2b2c894091090f88eb328ee945fe28","from":"6feBTywcmJUriqqnGc1zSJ","payloadDigest":"64b6882e3cbf71154369d91f9da431d069b465116dada6ba685928cd11c7b9e3","reqId":1558034435821210238},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":134,"txnTime":1558034436},"ver":"1"} -` +ALLOW_INSECURE_HTTP_URLS= + +ROOT_CA_VALIDITY_YEARS= +DCS_VALIDITY_YEARS= + +ROOT_CA_START_FROM_CURRENT_MONTH= +DCS_START_FROM_CURRENT_MONTH= + +NODE_ENV= \ No newline at end of file diff --git a/src/cliAgent.ts b/src/cliAgent.ts index af65b824..67e36552 100644 --- a/src/cliAgent.ts +++ b/src/cliAgent.ts @@ -22,7 +22,8 @@ import { InMemoryLruCache, WebDidResolver, LogLevel, - Agent + Agent, + X509Module } from '@credo-ts/core' import { HttpOutboundTransport, @@ -206,7 +207,7 @@ const getModules = ( : new W3cCredentialsModule(), didcomm: new DidCommModule({ processDidCommMessagesConcurrently: true - }), + }), oob: new OutOfBandModule(), mediationRecipient: new MediationRecipientModule(), discovery: new DiscoverFeaturesModule(), @@ -228,11 +229,16 @@ const getModules = ( serverUrl: fileServerUrl ? fileServerUrl : (process.env.SERVER_URL as string), }), openId4VcVerifier: new OpenId4VcVerifierModule({ - baseUrl: `http://${process.env.APP_URL}/oid4vp`, + + baseUrl: process.env.NODE_ENV === 'PROD' ? + `https://${process.env.APP_URL}/oid4vp`: + `${process.env.AGENT_HTTP_URL}/oid4vp`, router: openId4VpRouter, }), openId4VcIssuer: new OpenId4VcIssuerModule({ - baseUrl: `http://${process.env.APP_URL}/oid4vci`, + baseUrl: process.env.NODE_ENV === 'PROD' ? + `https://${process.env.APP_URL}/oid4vci` : + `${process.env.AGENT_HTTP_URL}/oid4vci`, router: openId4VciRouter, statefulCredentialOfferExpirationInSeconds: Number(process.env.OPENID_CRED_OFFER_EXPIRY) || 3600, accessTokenExpiresInSeconds: Number(process.env.OPENID_ACCESS_TOKEN_EXPIRY) || 3600, @@ -337,7 +343,7 @@ export async function runRestAgent(restConfig: AriesRestConfig) { // 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 - allowInsecureHttpUrls: true + allowInsecureHttpUrls: process.env.ALLOW_INSECURE_HTTP_URLS === 'true' } async function fetchLedgerData(ledgerConfig: { diff --git a/src/controllers/types.ts b/src/controllers/types.ts index 4149ead4..074afd93 100644 --- a/src/controllers/types.ts +++ b/src/controllers/types.ts @@ -17,6 +17,8 @@ import type { W3cJsonLdSignCredentialOptions, W3cCredential, W3cCredentialSubject, + X509CertificateIssuerAndSubjectOptions, + X509CreateCertificateOptions, } from '@credo-ts/core' import type { @@ -444,4 +446,26 @@ export type CustomW3cJsonLdSignCredentialOptions = Omit { + const keyObj: KeyObject = createPrivateKey({ + key: pem, + format: 'pem', + }); + + // Extract raw private key (as Buffer) + const rawPrivateKey = keyObj.export({ + format: 'jwk', + }).d!; + + return Buffer.from(rawPrivateKey, 'base64').toString('hex'); +} + +/** + * Extracts the raw private key (hex) from a PEM-encoded Ed25519 private key. + */ +export async function pemToRawEd25519PrivateKey(pem: string): Promise { + const keyObj: KeyObject = createPrivateKey({ + key: pem.replace(/\\n/g, '\n'), + format: 'pem', + }); + + // Ed25519 JWK exports the *seed* (first 32 bytes of the private key) + const jwk = keyObj.export({ format: 'jwk' }); + if (!jwk.d) throw new Error("Not an Ed25519 private key"); + + console.log(`JWK DETAILS-----------> ${JSON.stringify(jwk,null,2)}`) + + return Buffer.from(jwk.d, 'base64').toString('hex'); + } + + +// Example usage +// const pemP256 = ` +// -----BEGIN PRIVATE KEY----- +// MIGTAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBHkwdwIBAQQgnMryIV0XOLN4wtdX +// XjCFe2CthJA2ecvu7jmgRmD+N6KgCgYIKoZIzj0DAQehRANCAAQqVrIgPFQwSNmG +// zUf0nOp4mCIJ4Zy9Ckn4q//2yN9oPQPJ/aCZmKTY7Wvieez63ZAxD3xC+XPQLCwB +// i2r/6QL+ +// -----END PRIVATE KEY----- +// `.trim(); + +//pemToRawEcPrivateKey(pemP256).then(console.log); +// Output: "9ccaf2215d1738b378c2d7575e30857b60ad84903679cbeeee39a04660fe37a2" + + +// Example usage +// const pemEd25519 = ` +// -----BEGIN PRIVATE KEY----- +// MC4CAQAwBQYDK2VwBCIEICs3+innp/FXE74I6qk9nLz4gLY/9e9IFUTUm+ytzV9o +// -----END PRIVATE KEY----- +// `.trim(); + + +//pemToRawEd25519PrivateKey(pemEd25519).then(console.log); +// Output: "4cd74aec18805f10c107c3e4aed2d4a07bbd99bc2c6ed9abb3f9b90cd180cfb7" \ No newline at end of file diff --git a/src/controllers/x509/x509.Controller.ts b/src/controllers/x509/x509.Controller.ts new file mode 100644 index 00000000..16470079 --- /dev/null +++ b/src/controllers/x509/x509.Controller.ts @@ -0,0 +1,81 @@ +import type { RestMultiTenantAgentModules } from '../../cliAgent' +import type { TenantRecord } from '@credo-ts/tenants' + +import { Agent, JsonTransformer, injectable, RecordNotFoundError, X509CreateCertificateOptions, X509Service, X509KeyUsage, KeyType, TypedArrayEncoder, CredoError, X509ExtendedKeyUsage, Key } from '@credo-ts/core' +import { Request as Req } from 'express' +import jwt from 'jsonwebtoken' +import { Body, Controller, Delete, Post, Route, Tags, Path, Security, Request, Res, TsoaResponse, Get } from 'tsoa' + +import { AgentRole, SCOPES } from '../../enums' +import ErrorHandlingService from '../../errorHandlingService' +import { BasicX509CreateCertificateConfig, CreateTenantOptions, X509ImportCertificateOptionsDto } from '../types' +import { generateSecretKey, getCertificateValidityForSystem } from '../../utils/helpers' +import { x509ServiceT } from './x509.service' + + +@Tags('x509') +// @Security('jwt', [SCOPES.MULTITENANT_BASE_AGENT]) +@Security('jwt', [SCOPES.TENANT_AGENT, SCOPES.DEDICATED_AGENT]) +@Route('/x509') +@injectable() +export class X509Controller extends Controller { + @Post('/') + public async createSelfSignedDCS(@Request() request: Req, @Body() createX509Options: BasicX509CreateCertificateConfig) { + + try { + + return await x509ServiceT.createSelfSignedDCS(createX509Options, request); + } catch (error) { + throw ErrorHandlingService.handle(error) + } + } + + + @Post('/import') + public async ImportX509Certficates(@Request() request: Req, @Body() importX509Options: X509ImportCertificateOptionsDto) { + + try { +console.log('importX509Options', JSON.stringify(importX509Options)); + return await x509ServiceT.ImportX509Certficates(request, importX509Options); + } catch (error) { + throw ErrorHandlingService.handle(error) + } + } + + @Post('/trusted') + public async addTrustedCertificate(@Request() request: Req, @Body() options: { + certificate: string + }) { + try { + + return await x509ServiceT.addTrustedCertificate(request, options); + } catch (error) { + throw ErrorHandlingService.handle(error) + } + } + + @Get('/trusted') + public async getTrustedCertificates(@Request() request: Req) { + + try { + return await x509ServiceT.getTrustedCertificates(request); + } catch (error) { + throw ErrorHandlingService.handle(error) + } + } + + + @Post('/decode') + public async decodeCertificate(@Request() request: Req, @Body() options: { + certificate: string + }) { + try { + + return await x509ServiceT.decodeCertificate(request, options); + } catch (error) { + throw ErrorHandlingService.handle(error) + } + } + + +} \ No newline at end of file diff --git a/src/controllers/x509/x509.service.ts b/src/controllers/x509/x509.service.ts new file mode 100644 index 00000000..e44631b6 --- /dev/null +++ b/src/controllers/x509/x509.service.ts @@ -0,0 +1,170 @@ + +import { CredoError, KeyType, TypedArrayEncoder, WalletKeyExistsError, X509Certificate, X509ExtendedKeyUsage, X509KeyUsage, X509ModuleConfig, X509Service, type Agent } from '@credo-ts/core' +import type { OpenId4VcIssuanceSessionState } from '@credo-ts/openid4vc' + +import { OpenId4VcIssuanceSessionRepository } from '@credo-ts/openid4vc/build/openid4vc-issuer/repository' + + +import { Request as Req } from 'express' + +import { BasicX509CreateCertificateConfig, X509ImportCertificateOptionsDto } from '../types' +import { generateSecretKey, getCertificateValidityForSystem } from '../../utils/helpers' +import { pemToRawEd25519PrivateKey } from './crypto-util' + + +class x509Service { + + public async createSelfSignedDCS( + createX509Options: BasicX509CreateCertificateConfig, + agentReq: Req + ) { + const agent = agentReq.agent + + const authorityKey = await createKey(agent as Agent, createX509Options.keyType); + const AGENT_HOST = createX509Options.issuerAlternativeNameURL + const AGENT_DNS = AGENT_HOST.replace('https://', '') + const selfSignedx509certificate = await X509Service.createCertificate(agent.context, { + authorityKey: authorityKey, //createX509Options.subjectKey, + issuer: { countryName: createX509Options.countryName, commonName: createX509Options.commonName }, + validity: getCertificateValidityForSystem(false), + extensions: { + subjectKeyIdentifier: { + include: true, + }, + keyUsage: { + usages: [X509KeyUsage.KeyCertSign, X509KeyUsage.CrlSign, X509KeyUsage.DigitalSignature], + markAsCritical: true, + }, + subjectAlternativeName: { + name: [{ type: 'dns', value: AGENT_DNS }, { type: 'url', value: AGENT_HOST }], + }, + issuerAlternativeName: { + // biome-ignore lint/style/noNonNullAssertion: + //name: rootCertificate.issuerAlternativeNames!, + name: [{ type: 'dns', value: AGENT_DNS }, { type: 'url', value: AGENT_HOST }], + }, + extendedKeyUsage: { + usages: [X509ExtendedKeyUsage.MdlDs], + markAsCritical: true, + }, + basicConstraints: { + ca: true, + pathLenConstraint: 0, + markAsCritical: true, + }, + // TODO: Create revocation list and add URL here - store this in platform + // crlDistributionPoints: { + // urls: [`${"AGENT_HOST"}/crl`], + // }, + }, + }) + + console.log('======= X.509 IACA Self Signed Certificate ===========') + const selfSignedx509certificateBase64 = selfSignedx509certificate.toString('base64') + console.log('selfSignedx509certificateBase64', selfSignedx509certificateBase64); + return { selfSignedx509certificateBase64 }; + + } + + + public async ImportX509Certficates(agentReq: Req + , options: X509ImportCertificateOptionsDto + ) { + const agent = agentReq.agent + // const privateKey = TypedArrayEncoder.fromBase64(options.privateKey ?? '') + const secretHexKey = await pemToRawEd25519PrivateKey(options.privateKey ?? '') + const privateKey = TypedArrayEncoder.fromHex(secretHexKey) + + const parsedCertificate = X509Service.parseCertificate(agent.context, { + encodedCertificate: options.certificate, + }) + const issuerCertficicate = parsedCertificate.toString('base64') + + try { + const documentSignerKey = await agent.wallet.createKey({ + privateKey: privateKey, + keyType: options.keyType + }) + + if ( + parsedCertificate.publicKey.keyType !== options.keyType || + !Buffer.from(parsedCertificate.publicKey.publicKey).equals(Buffer.from(documentSignerKey.publicKey)) + ) { + throw new Error( + `Key mismatched in provided X509_CERTIFICATE to import` + ) + } + console.log(`Keys matched with certificate`) + } + catch (error) { + + // 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) + + } else { + throw error + } + } + + return { issuerCertficicate }; + } + + public addTrustedCertificate(agentReq: Req, options: { + certificate: string + }) { + const agent = agentReq.agent + return agent.x509.addTrustedCertificate(options.certificate); + } + + public getTrustedCertificates(agentReq: Req) { + + const trustedCertificates = agentReq.agent.context.dependencyManager.resolve(X509ModuleConfig) + .trustedCertificates?.map((cert) => + X509Certificate.fromEncodedCertificate(cert).toString('base64') + )// as [string, ...string[]] + + return trustedCertificates; + } + + /** + * Parses a base64-encoded X.509 certificate into a X509Certificate + * + * @param issuerAgent {Agent} + * @param options {x509Input} + * @returns + */ + public decodeCertificate(agentReq: Req, options: { + certificate: string + }) { + const parsedCertificate = X509Service.parseCertificate(agentReq.agent.context, { + encodedCertificate: options.certificate, + }) + + return parsedCertificate; + } + + +} + + +export const x509ServiceT = new x509Service() + + +export async function createKey(agent: Agent, keyType: KeyType) { + try { + const seed = await generateSecretKey(keyType === KeyType.P256 ? 64 : 32) + + agent.config.logger.debug(`createKey: got seed ${seed}`) + + const authorityKey = await agent.wallet.createKey({ + keyType: keyType, + seed: TypedArrayEncoder.fromString(seed), + }) + + return authorityKey + } catch (error) { + agent.config.logger.debug(`Error while creating authorityKey`, { message: (error as CredoError).message }) + throw error; + } +} \ No newline at end of file diff --git a/src/utils/agent.ts b/src/utils/agent.ts index 4a664452..4acfabf7 100644 --- a/src/utils/agent.ts +++ b/src/utils/agent.ts @@ -55,6 +55,7 @@ export const setupAgent = async ({ name, endpoints, port }: { name: string; endp key: name, }, logger: logger, + allowInsecureHttpUrls: process.env.ALLOW_INSECURE_HTTP_URLS === 'true' } const legacyIndyCredentialFormat = new LegacyIndyCredentialFormatService() diff --git a/src/utils/helpers.ts b/src/utils/helpers.ts index 877798c3..89fbce33 100644 --- a/src/utils/helpers.ts +++ b/src/utils/helpers.ts @@ -24,3 +24,45 @@ export async function generateSecretKey(length: number = 32): Promise { return secretKey } + + +export function getCertificateValidityForSystem(IsRootCA = false) { + let options: { validityYears?: number, startFromCurrentMonth?: boolean }; + if (IsRootCA) { + options = { + validityYears: parseInt(process.env.ROOT_CA_VALIDITY_YEARS ?? '3'), + startFromCurrentMonth: (process.env.ROOT_CA_START_FROM_CURRENT_MONTH ?? 'true') === 'true' ? true : false + } + + } else { + options = { + validityYears: parseInt(process.env.DCS_VALIDITY_YEARS ?? '3'), + startFromCurrentMonth: (process.env.DCS_START_FROM_CURRENT_MONTH ?? 'true') === 'true' ? true : false + } + + } + + return getCertificateValidity(options); + +} + +export function getCertificateValidity(options?: { + validityYears?: number + startFromCurrentMonth?: boolean +}) { + const { + validityYears = 3, + startFromCurrentMonth = false, + } = options || {} + + const now = new Date() + + const startYear = now.getUTCFullYear() + const startMonth = startFromCurrentMonth ? now.getUTCMonth() : 0 // 0 = January + const startDay = now.getUTCDate() + + const notBefore = new Date(Date.UTC(startYear, startMonth, startDay, 0, 0, 0)) + const notAfter = new Date(Date.UTC(startYear + validityYears, startMonth, startDay, 0, 0, 0)) + + return { notBefore, notAfter } +} \ No newline at end of file From 246eb89cce9e6c1c5a59bd610d4ff0411b6f2198 Mon Sep 17 00:00:00 2001 From: RinkalBhojani Date: Wed, 17 Sep 2025 11:08:49 +0530 Subject: [PATCH 007/152] added x509Module in agent config to add mapper function Signed-off-by: RinkalBhojani --- src/cliAgent.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/cliAgent.ts b/src/cliAgent.ts index 67e36552..196b91e5 100644 --- a/src/cliAgent.ts +++ b/src/cliAgent.ts @@ -248,6 +248,24 @@ const getModules = ( credentialRequestToCredentialMapper: (...args) => getCredentialRequestToCredentialMapper()(...args), }), openId4VcHolderModule: new OpenId4VcHolderModule(), + x509: new X509Module({ + // getTrustedCertificatesForVerification: (_agentContext, { certificateChain, verification }) => { + // //TODO: We need to trust the certificate tenant wise, for that we need to fetch those details from platform + // const firstCertificate = certificateChain[0] + // console.log( + // `dyncamically trusting certificate ${firstCertificate?.getIssuerNameField('C')?.toString()} for verification of ${ + // verification.type + // }`, + // true + // ) + + // const trustedCertificates = _agentContext.dependencyManager.resolve(X509ModuleConfig).trustedCertificates?.map((cert) => + // X509Certificate.fromEncodedCertificate(cert).toString('pem') + // ) as [string, ...string[]] + + // return [...trustedCertificates] + // } + }), } } From fa1f4c243c0c30841a6eea979e361b0f5a97b138 Mon Sep 17 00:00:00 2001 From: RinkalBhojani Date: Wed, 17 Sep 2025 12:09:53 +0530 Subject: [PATCH 008/152] removed unwanted log Signed-off-by: RinkalBhojani --- src/controllers/x509/crypto-util.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/controllers/x509/crypto-util.ts b/src/controllers/x509/crypto-util.ts index befc77ea..e04fd9dc 100644 --- a/src/controllers/x509/crypto-util.ts +++ b/src/controllers/x509/crypto-util.ts @@ -28,9 +28,7 @@ export async function pemToRawEd25519PrivateKey(pem: string): Promise { // Ed25519 JWK exports the *seed* (first 32 bytes of the private key) const jwk = keyObj.export({ format: 'jwk' }); - if (!jwk.d) throw new Error("Not an Ed25519 private key"); - - console.log(`JWK DETAILS-----------> ${JSON.stringify(jwk,null,2)}`) + if (!jwk.d) throw new Error("Not an Ed25519 private key"); return Buffer.from(jwk.d, 'base64').toString('hex'); } From 2e6fdb03ed5116260ad3c9ed335dd7b985fe9cc8 Mon Sep 17 00:00:00 2001 From: RinkalBhojani Date: Wed, 17 Sep 2025 12:12:15 +0530 Subject: [PATCH 009/152] removed unwanted log Signed-off-by: RinkalBhojani --- src/controllers/x509/x509.Controller.ts | 3 +-- src/controllers/x509/x509.service.ts | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/controllers/x509/x509.Controller.ts b/src/controllers/x509/x509.Controller.ts index 16470079..90f38867 100644 --- a/src/controllers/x509/x509.Controller.ts +++ b/src/controllers/x509/x509.Controller.ts @@ -14,7 +14,6 @@ import { x509ServiceT } from './x509.service' @Tags('x509') -// @Security('jwt', [SCOPES.MULTITENANT_BASE_AGENT]) @Security('jwt', [SCOPES.TENANT_AGENT, SCOPES.DEDICATED_AGENT]) @Route('/x509') @injectable() @@ -35,7 +34,7 @@ export class X509Controller extends Controller { public async ImportX509Certficates(@Request() request: Req, @Body() importX509Options: X509ImportCertificateOptionsDto) { try { -console.log('importX509Options', JSON.stringify(importX509Options)); + return await x509ServiceT.ImportX509Certficates(request, importX509Options); } catch (error) { throw ErrorHandlingService.handle(error) diff --git a/src/controllers/x509/x509.service.ts b/src/controllers/x509/x509.service.ts index e44631b6..1813cd93 100644 --- a/src/controllers/x509/x509.service.ts +++ b/src/controllers/x509/x509.service.ts @@ -71,7 +71,6 @@ class x509Service { , options: X509ImportCertificateOptionsDto ) { const agent = agentReq.agent - // const privateKey = TypedArrayEncoder.fromBase64(options.privateKey ?? '') const secretHexKey = await pemToRawEd25519PrivateKey(options.privateKey ?? '') const privateKey = TypedArrayEncoder.fromHex(secretHexKey) From d9df67f4cf00c2b39af3a1a6e00ef8ba86952cbb Mon Sep 17 00:00:00 2001 From: RinkalBhojani Date: Wed, 17 Sep 2025 14:17:45 +0530 Subject: [PATCH 010/152] removed example private key Signed-off-by: RinkalBhojani --- src/controllers/x509/crypto-util.ts | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/src/controllers/x509/crypto-util.ts b/src/controllers/x509/crypto-util.ts index e04fd9dc..74c1fef6 100644 --- a/src/controllers/x509/crypto-util.ts +++ b/src/controllers/x509/crypto-util.ts @@ -33,28 +33,3 @@ export async function pemToRawEd25519PrivateKey(pem: string): Promise { return Buffer.from(jwk.d, 'base64').toString('hex'); } - -// Example usage -// const pemP256 = ` -// -----BEGIN PRIVATE KEY----- -// MIGTAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBHkwdwIBAQQgnMryIV0XOLN4wtdX -// XjCFe2CthJA2ecvu7jmgRmD+N6KgCgYIKoZIzj0DAQehRANCAAQqVrIgPFQwSNmG -// zUf0nOp4mCIJ4Zy9Ckn4q//2yN9oPQPJ/aCZmKTY7Wvieez63ZAxD3xC+XPQLCwB -// i2r/6QL+ -// -----END PRIVATE KEY----- -// `.trim(); - -//pemToRawEcPrivateKey(pemP256).then(console.log); -// Output: "9ccaf2215d1738b378c2d7575e30857b60ad84903679cbeeee39a04660fe37a2" - - -// Example usage -// const pemEd25519 = ` -// -----BEGIN PRIVATE KEY----- -// MC4CAQAwBQYDK2VwBCIEICs3+innp/FXE74I6qk9nLz4gLY/9e9IFUTUm+ytzV9o -// -----END PRIVATE KEY----- -// `.trim(); - - -//pemToRawEd25519PrivateKey(pemEd25519).then(console.log); -// Output: "4cd74aec18805f10c107c3e4aed2d4a07bbd99bc2c6ed9abb3f9b90cd180cfb7" \ No newline at end of file From 2ccc3126a2926dd0c9d917fb741465e16f737ab2 Mon Sep 17 00:00:00 2001 From: RinkalBhojani Date: Thu, 18 Sep 2025 17:57:19 +0530 Subject: [PATCH 011/152] feat: support for mdoc credential with x509, moved signeroptions inside credential payload Signed-off-by: RinkalBhojani --- src/cliAgent.ts | 4 +- .../issuance-sessions.service.ts | 45 ++- .../openid4vc/types/issuer.types.ts | 18 +- src/routes/routes.ts | 231 +++++++++++- src/routes/swagger.json | 336 ++++++++++++++++-- src/utils/oid4vc-agent.ts | 13 +- 6 files changed, 580 insertions(+), 67 deletions(-) diff --git a/src/cliAgent.ts b/src/cliAgent.ts index 196b91e5..5c2fd1f2 100644 --- a/src/cliAgent.ts +++ b/src/cliAgent.ts @@ -67,7 +67,7 @@ import { generateSecretKey } from './utils/helpers' import { TsLogger } from './utils/logger' import { OpenId4VcHolderModule, OpenId4VcIssuerModule, OpenId4VcVerifierModule } from '@credo-ts/openid4vc' import { Router } from 'express' -import { getCredentialRequestToCredentialMapper } from './utils/oid4vc-agent' +import { getCredentialRequestToCredentialMapper, getMixedCredentialRequestToCredentialMapper } from './utils/oid4vc-agent' const openId4VciRouter = Router() const openId4VpRouter = Router() @@ -245,7 +245,7 @@ const getModules = ( authorizationCodeExpiresInSeconds: Number(process.env.OPENID_AUTH_CODE_EXPIRY) || 3600, cNonceExpiresInSeconds: Number(process.env.OPENID_CNONCE_EXPIRY) || 3600, dpopRequired: false, - credentialRequestToCredentialMapper: (...args) => getCredentialRequestToCredentialMapper()(...args), + credentialRequestToCredentialMapper: (...args) => getMixedCredentialRequestToCredentialMapper()(...args), }), openId4VcHolderModule: new OpenId4VcHolderModule(), x509: new X509Module({ diff --git a/src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts b/src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts index 4b8a6be4..b27605da 100644 --- a/src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts +++ b/src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts @@ -15,16 +15,16 @@ class IssuanceSessionsService { options: OpenId4VcIssuanceSessionsCreateOffer, agentReq: Req ) { - const { credentials, signerOption, publicIssuerId } = options + const { credentials, publicIssuerId } = options const issuer = await agentReq.agent.modules.openId4VcIssuer.getIssuerByIssuerId(publicIssuerId) - if (!signerOption || !signerOption.method) { - throw new BadRequestError(`signerOption must be provided with one of: ${Object.values(SignerMethod).join(', ')}`) - } - if (signerOption.method === SignerMethod.Did && !signerOption.did) { - throw new BadRequestError(`'did' must be provided when signer method is 'did'`) - } + // if (!signerOption || !signerOption.method) { + // throw new BadRequestError(`signerOption must be provided with one of: ${Object.values(SignerMethod).join(', ')}`) + // } + // if (signerOption.method === SignerMethod.Did && !signerOption.did) { + // throw new BadRequestError(`'did' must be provided when signer method is 'did'`) + // } const mappedCredentials = credentials.map((c) => { const supported = issuer.credentialConfigurationsSupported[c.credentialSupportedId] @@ -36,6 +36,20 @@ class IssuanceSessionsService { `Format mismatch for '${c.credentialSupportedId}': expected '${supported.format}', got '${c.format}'`, ) } + + // must have signing options + if (!c.signerOptions || !c.signerOptions.method) { + throw new BadRequestError(`signerOptions must be provided and allowed methods are ${Object.values(SignerMethod).join(', ')}`); + } + + if (c.signerOptions.method == SignerMethod.Did && !c.signerOptions.did) { + throw new BadRequestError(`For ${c.credentialSupportedId} : did must be present inside signerOptions if SignerMethod is 'did' `); + } + + if (c.signerOptions.method === SignerMethod.X5c && !c.signerOptions.x5c){ + throw new BadRequestError(`For ${c.credentialSupportedId} : x5c must be present inside signerOptions if SignerMethod is 'x5c' `); + } + return { ...c, payload: { @@ -46,22 +60,7 @@ class IssuanceSessionsService { // format: c.format as OpenId4VciCredentialFormatProfile, TODO: fix this type }) - options.issuanceMetadata ||= {} - - if (signerOption.method === SignerMethod.Did) { - options.issuanceMetadata.issuerDid = signerOption.did - } else if (signerOption.method === SignerMethod.X5c) { - const record = (await agentReq.agent.genericRecords.findById(X509_CERTIFICATE_RECORD)) as X509GenericRecord - if (!signerOption.x5c && !record) { - throw new Error('x5c certificate is required') - } - const cert = record?.content?.dcs - const certArray = Array.isArray(cert) ? cert : typeof cert === 'string' ? [cert] : [] - if (!certArray.length) { - throw new Error('x509 certificate must be non-empty') - } - options.issuanceMetadata.issuerx509certificate = signerOption.x5c ?? [...certArray] - } + options.issuanceMetadata ||= {} options.issuanceMetadata.credentials = mappedCredentials diff --git a/src/controllers/openid4vc/types/issuer.types.ts b/src/controllers/openid4vc/types/issuer.types.ts index 72aa366d..8dabcc22 100644 --- a/src/controllers/openid4vc/types/issuer.types.ts +++ b/src/controllers/openid4vc/types/issuer.types.ts @@ -1,11 +1,18 @@ +import { OpenId4VciCredentialFormatProfile } from "@credo-ts/openid4vc" + export enum SignerMethod { Did = 'did', X5c = 'x5c', } -export interface OpenId4VcIssuanceSessionCreateOfferSdJwtCredentialOptions { +export interface OpenId4VcIssuanceSessionCredentialOptions { credentialSupportedId: string - format: string + signerOptions: { + method: SignerMethod + did?: string + x5c?: string[] + } + format: OpenId4VciCredentialFormatProfile payload: { vct?: string [key: string]: unknown @@ -15,12 +22,7 @@ export interface OpenId4VcIssuanceSessionCreateOfferSdJwtCredentialOptions { export interface OpenId4VcIssuanceSessionsCreateOffer { publicIssuerId: string - signerOption: { - method: SignerMethod - did?: string - x5c?: string[] - } - credentials: Array + credentials: Array authorizationCodeFlowConfig?: { authorizationServerUrl: string requirePresentationDuringIssuance?: boolean diff --git a/src/routes/routes.ts b/src/routes/routes.ts index 0f05210e..6fecd69b 100644 --- a/src/routes/routes.ts +++ b/src/routes/routes.ts @@ -39,6 +39,8 @@ import { IssuerController } from './../controllers/openid4vc/issuers/issuer.Cont 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 { VerifierController } from './../controllers/openid4vc/verifiers/verifier.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 { X509Controller } from './../controllers/x509/x509.Controller'; import { expressAuthentication } from './../authentication'; // @ts-ignore - no great way to install types from subpackage import { iocContainer } from './../utils/tsyringeTsoaIocContainer'; @@ -1466,6 +1468,11 @@ const models: TsoaRoute.Models = { "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 + "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 "Record_string.boolean_": { "dataType": "refAlias", "type": {"dataType":"nestedObjectLiteral","nestedProperties":{},"validators":{}}, @@ -1476,11 +1483,12 @@ const models: TsoaRoute.Models = { "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 - "OpenId4VcIssuanceSessionCreateOfferSdJwtCredentialOptions": { + "OpenId4VcIssuanceSessionCredentialOptions": { "dataType": "refObject", "properties": { "credentialSupportedId": {"dataType":"string","required":true}, - "format": {"dataType":"string","required":true}, + "signerOptions": {"dataType":"nestedObjectLiteral","nestedProperties":{"x5c":{"dataType":"array","array":{"dataType":"string"}},"did":{"dataType":"string"},"method":{"ref":"SignerMethod","required":true}},"required":true}, + "format": {"ref":"OpenId4VciCredentialFormatProfile","required":true}, "payload": {"dataType":"nestedObjectLiteral","nestedProperties":{"vct":{"dataType":"string"}},"additionalProperties":{"dataType":"any"},"required":true}, "disclosureFrame": {"ref":"Record_string.boolean-or-Record_string.boolean__"}, }, @@ -1491,8 +1499,7 @@ const models: TsoaRoute.Models = { "dataType": "refObject", "properties": { "publicIssuerId": {"dataType":"string","required":true}, - "signerOption": {"dataType":"nestedObjectLiteral","nestedProperties":{"x5c":{"dataType":"array","array":{"dataType":"string"}},"did":{"dataType":"string"},"method":{"ref":"SignerMethod","required":true}},"required":true}, - "credentials": {"dataType":"array","array":{"dataType":"refObject","ref":"OpenId4VcIssuanceSessionCreateOfferSdJwtCredentialOptions"},"required":true}, + "credentials": {"dataType":"array","array":{"dataType":"refObject","ref":"OpenId4VcIssuanceSessionCredentialOptions"},"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_"}, @@ -1691,6 +1698,38 @@ const models: TsoaRoute.Models = { "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 + "BasicX509CreateCertificateConfig": { + "dataType": "refObject", + "properties": { + "countryName": {"dataType":"string"}, + "stateOrProvinceName": {"dataType":"string"}, + "organizationalUnit": {"dataType":"string"}, + "commonName": {"dataType":"string"}, + "keyType": {"ref":"KeyType","required":true}, + "issuerAlternativeNameURL": {"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 + "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 + "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 }; const templateService = new ExpressTemplateService(models, {"noImplicitAdditionalProperties":"throw-on-extras","bodyCoercion":true}); @@ -5060,6 +5099,190 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This 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_createSelfSignedDCS: Record = { + request: {"in":"request","name":"request","required":true,"dataType":"object"}, + createX509Options: {"in":"body","name":"createX509Options","required":true,"ref":"BasicX509CreateCertificateConfig"}, + }; + app.post('/x509', + authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), + ...(fetchMiddlewares(X509Controller)), + ...(fetchMiddlewares(X509Controller.prototype.createSelfSignedDCS)), + + async function X509Controller_createSelfSignedDCS(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_createSelfSignedDCS, 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: 'createSelfSignedDCS', + 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_ImportX509Certficates: 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.ImportX509Certficates)), + + async function X509Controller_ImportX509Certficates(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_ImportX509Certficates, 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: 'ImportX509Certficates', + 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 // WARNING: This 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 6932c208..f995a45c 100644 --- a/src/routes/swagger.json +++ b/src/routes/swagger.json @@ -3269,6 +3269,16 @@ ], "type": "string" }, + "OpenId4VciCredentialFormatProfile": { + "enum": [ + "jwt_vc_json", + "jwt_vc_json-ld", + "ldp_vc", + "vc+sd-jwt", + "mso_mdoc" + ], + "type": "string" + }, "Record_string.boolean_": { "properties": {}, "type": "object", @@ -3289,13 +3299,33 @@ "type": "object", "description": "Construct a type with a set of properties K of type T" }, - "OpenId4VcIssuanceSessionCreateOfferSdJwtCredentialOptions": { + "OpenId4VcIssuanceSessionCredentialOptions": { "properties": { "credentialSupportedId": { "type": "string" }, + "signerOptions": { + "properties": { + "x5c": { + "items": { + "type": "string" + }, + "type": "array" + }, + "did": { + "type": "string" + }, + "method": { + "$ref": "#/components/schemas/SignerMethod" + } + }, + "required": [ + "method" + ], + "type": "object" + }, "format": { - "type": "string" + "$ref": "#/components/schemas/OpenId4VciCredentialFormatProfile" }, "payload": { "properties": { @@ -3312,6 +3342,7 @@ }, "required": [ "credentialSupportedId", + "signerOptions", "format", "payload" ], @@ -3323,29 +3354,9 @@ "publicIssuerId": { "type": "string" }, - "signerOption": { - "properties": { - "x5c": { - "items": { - "type": "string" - }, - "type": "array" - }, - "did": { - "type": "string" - }, - "method": { - "$ref": "#/components/schemas/SignerMethod" - } - }, - "required": [ - "method" - ], - "type": "object" - }, "credentials": { "items": { - "$ref": "#/components/schemas/OpenId4VcIssuanceSessionCreateOfferSdJwtCredentialOptions" + "$ref": "#/components/schemas/OpenId4VcIssuanceSessionCredentialOptions" }, "type": "array" }, @@ -3405,7 +3416,6 @@ }, "required": [ "publicIssuerId", - "signerOption", "credentials" ], "type": "object", @@ -3783,6 +3793,68 @@ "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" + }, + "BasicX509CreateCertificateConfig": { + "properties": { + "countryName": { + "type": "string" + }, + "stateOrProvinceName": { + "type": "string" + }, + "organizationalUnit": { + "type": "string" + }, + "commonName": { + "type": "string" + }, + "keyType": { + "$ref": "#/components/schemas/KeyType" + }, + "issuerAlternativeNameURL": { + "type": "string" + } + }, + "required": [ + "keyType", + "issuerAlternativeNameURL" + ], + "type": "object", + "additionalProperties": false + }, + "X509ImportCertificateOptionsDto": { + "properties": { + "certificate": { + "type": "string" + }, + "privateKey": { + "type": "string" + }, + "keyType": { + "$ref": "#/components/schemas/KeyType" + } + }, + "required": [ + "certificate", + "keyType" + ], + "type": "object", + "additionalProperties": false + }, + "X509Certificate": { + "properties": { + "publicKey": { + "$ref": "#/components/schemas/Key" + }, + "privateKey": { + "$ref": "#/components/schemas/Uint8Array" + } + }, + "required": [ + "publicKey" + ], + "type": "object", + "additionalProperties": false } }, "securitySchemes": { @@ -8960,10 +9032,7 @@ "description": "Ok", "content": { "application/json": { - "schema": { - "type": "number", - "format": "double" - } + "schema": {} } } } @@ -9330,6 +9399,217 @@ } ] } + }, + "/x509": { + "post": { + "operationId": "CreateSelfSignedDCS", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "properties": { + "selfSignedx509certificateBase64": { + "type": "string" + } + }, + "required": [ + "selfSignedx509certificateBase64" + ], + "type": "object" + } + } + } + } + }, + "tags": [ + "x509" + ], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BasicX509CreateCertificateConfig" + } + } + } + } + } + }, + "/x509/import": { + "post": { + "operationId": "ImportX509Certficates", + "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" + } + } + } + } + } } }, "servers": [ diff --git a/src/utils/oid4vc-agent.ts b/src/utils/oid4vc-agent.ts index 7a1c9679..2e0fda86 100644 --- a/src/utils/oid4vc-agent.ts +++ b/src/utils/oid4vc-agent.ts @@ -185,7 +185,7 @@ export function getMixedCredentialRequestToCredentialMapper(): OpenId4VciCredent }) => { const issuanceMetadata = issuanceSession.issuanceMetadata; - const issuerx509certificate = issuanceMetadata?.["issuerx509certificate"] as string[] | undefined; + if (!issuanceMetadata?.["credentials"]) throw new Error('credential payload is not provided') @@ -205,6 +205,7 @@ export function getMixedCredentialRequestToCredentialMapper(): OpenId4VciCredent const credential = credentialPayload[0] let issuerDidVerificationMethod: string | undefined = ''; + let issuerx509certificate: string[] | undefined; if (credential.signerOptions.method === SignerMethod.Did) { if (credential.signerOptions.did) { @@ -220,6 +221,14 @@ export function getMixedCredentialRequestToCredentialMapper(): OpenId4VciCredent 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') { @@ -250,7 +259,7 @@ export function getMixedCredentialRequestToCredentialMapper(): OpenId4VciCredent if (credentialConfiguration.format === OpenId4VciCredentialFormatProfile.MsoMdoc) { if (!issuerx509certificate) - throw new Error(`issuerx509certificate is mot provided for credential type ${OpenId4VciCredentialFormatProfile.MsoMdoc}`) + 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)}`) From 152f642867ee82bd886e786eb85ba9f59d484436 Mon Sep 17 00:00:00 2001 From: RinkalBhojani Date: Fri, 19 Sep 2025 13:17:37 +0530 Subject: [PATCH 012/152] refactored code Signed-off-by: RinkalBhojani --- .../issuance-sessions.Controller.ts | 12 +- .../issuance-sessions.service.ts | 71 ++++------ src/utils/oid4vc-agent.ts | 125 +++++++++--------- 3 files changed, 94 insertions(+), 114 deletions(-) diff --git a/src/controllers/openid4vc/issuance-sessions/issuance-sessions.Controller.ts b/src/controllers/openid4vc/issuance-sessions/issuance-sessions.Controller.ts index dc6be380..792e58b4 100644 --- a/src/controllers/openid4vc/issuance-sessions/issuance-sessions.Controller.ts +++ b/src/controllers/openid4vc/issuance-sessions/issuance-sessions.Controller.ts @@ -1,16 +1,17 @@ -import { Agent } from '@credo-ts/core' 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 { AgentWithRootOrTenant } from '../../types/agent' import { OpenId4VcIssuanceSessionsCreateOffer } from '../types/issuer.types' -import { Request as Req } from 'express' import { issuanceSessionService } from './issuance-sessions.service' -import { SCOPES } from '../../../enums' + /** * Controller for managing OpenID4VC issuance sessions. * Provides endpoints to create credential offers, retrieve issuance sessions, @@ -25,10 +26,7 @@ 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, - ) { + public async createCredentialOffer(@Request() request: Req, @Body() options: OpenId4VcIssuanceSessionsCreateOffer) { try { return await issuanceSessionService.createCredentialOffer(options, request) } catch (error) { diff --git a/src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts b/src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts index b27605da..a8a0f5c7 100644 --- a/src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts +++ b/src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts @@ -1,66 +1,59 @@ -import type { RestAgentModules, RestMultiTenantAgentModules } from '../../../cliAgent' -import type { OpenId4VcIssuanceSessionsCreateOffer, X509GenericRecord } from '../types/issuer.types' -import type { Agent } from '@credo-ts/core' +import type { OpenId4VcIssuanceSessionsCreateOffer } from '../types/issuer.types' import type { OpenId4VcIssuanceSessionState } from '@credo-ts/openid4vc' +import type { Request as Req } from 'express' import { OpenId4VcIssuanceSessionRepository } from '@credo-ts/openid4vc/build/openid4vc-issuer/repository' import { SignerMethod } from '../../../enums/enum' import { BadRequestError, NotFoundError } from '../../../errors/errors' -import { X509_CERTIFICATE_RECORD } from '../../../utils/constant' -import { Request as Req } from 'express' class IssuanceSessionsService { - public async createCredentialOffer( - options: OpenId4VcIssuanceSessionsCreateOffer, - agentReq: Req - ) { + public async createCredentialOffer(options: OpenId4VcIssuanceSessionsCreateOffer, agentReq: Req) { const { credentials, publicIssuerId } = options const issuer = await agentReq.agent.modules.openId4VcIssuer.getIssuerByIssuerId(publicIssuerId) - // if (!signerOption || !signerOption.method) { - // throw new BadRequestError(`signerOption must be provided with one of: ${Object.values(SignerMethod).join(', ')}`) - // } - // if (signerOption.method === SignerMethod.Did && !signerOption.did) { - // throw new BadRequestError(`'did' must be provided when signer method is 'did'`) - // } - - const mappedCredentials = credentials.map((c) => { - const supported = issuer.credentialConfigurationsSupported[c.credentialSupportedId] + const mappedCredentials = credentials.map((cred) => { + const supported = issuer.credentialConfigurationsSupported[cred.credentialSupportedId] if (!supported) { - throw new Error(`CredentialSupportedId '${c.credentialSupportedId}' is not supported by issuer`) + throw new Error(`CredentialSupportedId '${cred.credentialSupportedId}' is not supported by issuer`) } - if (supported.format !== c.format) { + if (supported.format !== cred.format) { throw new Error( - `Format mismatch for '${c.credentialSupportedId}': expected '${supported.format}', got '${c.format}'`, + `Format mismatch for '${cred.credentialSupportedId}': expected '${supported.format}', got '${cred.format}'`, ) } // must have signing options - if (!c.signerOptions || !c.signerOptions.method) { - throw new BadRequestError(`signerOptions must be provided and allowed methods are ${Object.values(SignerMethod).join(', ')}`); + if (!cred.signerOptions?.method) { + throw new BadRequestError( + `signerOptions must be provided and allowed methods are ${Object.values(SignerMethod).join(', ')}`, + ) } - if (c.signerOptions.method == SignerMethod.Did && !c.signerOptions.did) { - throw new BadRequestError(`For ${c.credentialSupportedId} : did must be present inside signerOptions if SignerMethod is 'did' `); + 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 (c.signerOptions.method === SignerMethod.X5c && !c.signerOptions.x5c){ - throw new BadRequestError(`For ${c.credentialSupportedId} : x5c must be present inside signerOptions if SignerMethod is 'x5c' `); + 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' `, + ) } return { - ...c, + ...cred, payload: { - ...c.payload, - vct: c.payload?.vct ?? (typeof supported.vct === 'string' ? supported.vct : undefined), + ...cred.payload, + vct: cred.payload?.vct ?? (typeof supported.vct === 'string' ? supported.vct : undefined), }, } // format: c.format as OpenId4VciCredentialFormatProfile, TODO: fix this type }) - options.issuanceMetadata ||= {} + options.issuanceMetadata ||= {} options.issuanceMetadata.credentials = mappedCredentials @@ -75,10 +68,7 @@ class IssuanceSessionsService { return { credentialOffer, issuanceSession } } - public async getIssuanceSessionsById( - agentReq: Req, - sessionId: string, - ) { + public async getIssuanceSessionsById(agentReq: Req, sessionId: string) { return agentReq.agent.modules.openId4VcIssuer.getIssuanceSessionById(sessionId) } @@ -114,11 +104,7 @@ class IssuanceSessionsService { * @param metadata * @returns the updated issuance session record */ - public async updateSessionIssuanceMetadataById( - agentReq: Req, - sessionId: string, - metadata: 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) @@ -143,10 +129,7 @@ class IssuanceSessionsService { * @param sessionId * @param issuerAgent */ - public async deleteById( - agentReq: Req, - sessionId: string, - ): Promise { + public async deleteById(agentReq: Req, sessionId: string): Promise { const issuanceSessionRepository = agentReq.agent.dependencyManager.resolve(OpenId4VcIssuanceSessionRepository) await issuanceSessionRepository.deleteById(agentReq.agent.context, sessionId) } diff --git a/src/utils/oid4vc-agent.ts b/src/utils/oid4vc-agent.ts index 2e0fda86..10a2bba1 100644 --- a/src/utils/oid4vc-agent.ts +++ b/src/utils/oid4vc-agent.ts @@ -21,6 +21,7 @@ import { w3cDate, } from '@credo-ts/core' import { OpenId4VciCredentialFormatProfile } from '@credo-ts/openid4vc' + import { SignerMethod } from '../enums/enum' export function getCredentialRequestToCredentialMapper(): OpenId4VciCredentialRequestToCredentialMapper { @@ -36,9 +37,9 @@ export function getCredentialRequestToCredentialMapper(): OpenId4VciCredentialRe holderBindings: OpenId4VcCredentialHolderBinding[] issuanceSession: any verification?: any - credentialConfigurationIds: string[], - credentialConfigurationsSupported: any, - agentContext: any, + credentialConfigurationIds: string[] + credentialConfigurationsSupported: any + agentContext: any authorization: any }) => { const issuanceMetadata = issuanceSession.issuanceMetadata @@ -94,9 +95,9 @@ export function getCredentialRequestToCredentialMapper(): OpenId4VciCredentialRe issuer: holderBindings[0].method === 'did' ? { - method: 'did', - didUrl: issuerDidUrl ?? '', - } + method: 'did', + didUrl: issuerDidUrl ?? '', + } : { method: 'x5c', x5c: trustedCertificates, issuer: 'ISSUER_HOST ' }, })), } satisfies OpenId4VciSignSdJwtCredentials @@ -144,10 +145,9 @@ export function getCredentialRequestToCredentialMapper(): OpenId4VciCredentialRe 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 - : {}; + : {} return { credentialConfigurationId, @@ -157,15 +157,15 @@ export function getCredentialRequestToCredentialMapper(): OpenId4VciCredentialRe holder: holderBinding, issuer: issuerDidUrl ? { - method: 'did', - didUrl: issuerDidUrl, - } + method: 'did', + didUrl: issuerDidUrl, + } : { - method: 'x5c', - x5c: issuerx509certificate ?? [], //[issuerx509certificate??""], - issuer: process.env.AGENT_HOST ?? 'http://localhost:4001', - }, - disclosureFrame: disclosureFramePayload + method: 'x5c', + x5c: issuerx509certificate ?? [], //[issuerx509certificate??""], + issuer: process.env.AGENT_HOST ?? 'http://localhost:4001', + }, + disclosureFrame: disclosureFramePayload, })), } satisfies OpenId4VciSignSdJwtCredentials } @@ -183,42 +183,39 @@ export function getMixedCredentialRequestToCredentialMapper(): OpenId4VciCredent agentContext, authorization, }) => { + const issuanceMetadata = issuanceSession.issuanceMetadata - const issuanceMetadata = issuanceSession.issuanceMetadata; - - - if (!issuanceMetadata?.["credentials"]) - throw new Error('credential payload is not provided') + if (!issuanceMetadata?.['credentials']) throw new Error('credential payload is not provided') - const allCredentialPayload = issuanceMetadata?.["credentials"] + 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 - ) - : []; + (c: Record) => c.credentialSupportedId === credentialConfigurationId, + ) + : [] const credentialConfiguration = credentialConfigurationsSupported[credentialConfigurationId] const credential = credentialPayload[0] - let issuerDidVerificationMethod: string | undefined = ''; - let issuerx509certificate: string[] | undefined; + 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); + 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; + issuerDidVerificationMethod = didDocument.verificationMethod?.[0].id } if (!issuerDidVerificationMethod) { - throw new Error("No matching verification method found"); + throw new Error('No matching verification method found') } } } else if (credential.signerOptions.method === SignerMethod.X5c) { @@ -226,7 +223,7 @@ export function getMixedCredentialRequestToCredentialMapper(): OpenId4VciCredent issuerx509certificate = credential.signerOptions.x5c // as string[] | undefined; if (!issuerx509certificate) { - throw new Error("x509certificate must be provided when using x5c as signer method"); + throw new Error('x509certificate must be provided when using x5c as signer method') } } } @@ -249,9 +246,9 @@ export function getMixedCredentialRequestToCredentialMapper(): OpenId4VciCredent issuer: holderBindings[0].method === 'did' ? { - method: 'did', - didUrl: issuerDidVerificationMethod ?? '', - } + method: 'did', + didUrl: issuerDidVerificationMethod ?? '', + } : { method: 'x5c', x5c: trustedCertificates, issuer: 'ISSUER_HOST ' }, })), } satisfies OpenId4VciSignSdJwtCredentials @@ -259,10 +256,14 @@ export function getMixedCredentialRequestToCredentialMapper(): OpenId4VciCredent if (credentialConfiguration.format === OpenId4VciCredentialFormatProfile.MsoMdoc) { if (!issuerx509certificate) - throw new Error(`issuerx509certificate is not provided for credential type ${OpenId4VciCredentialFormatProfile.MsoMdoc}`) + 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)}`) + throw new Error( + `'doctype' not found in credential configuration, ${JSON.stringify(credentialConfiguration, null, 2)}`, + ) } // national id and ICAO default @@ -276,8 +277,8 @@ export function getMixedCredentialRequestToCredentialMapper(): OpenId4VciCredent holderKey: holderBinding.key, namespaces: { [namespace]: { - ...credential.payload - } + ...credential.payload, + }, }, // TODO - add validity info /*validityInfo: { @@ -311,26 +312,28 @@ export function getMixedCredentialRequestToCredentialMapper(): OpenId4VciCredent { id: parseDid(holderBinding.didUrl).did, claims: { - ...credential.payload - } + ...credential.payload, + }, }, - W3cCredentialSubject + W3cCredentialSubject, ), issuanceDate: w3cDate(Date.now()), }), verificationMethod: issuerDidVerificationMethod, } - console.log(`Final ClaimFormat.JwtVc ---> ${JSON.stringify(finalVC)}`) - return finalVC; + return finalVC }), } satisfies OpenId4VciSignW3cCredentials } if (credentialConfiguration.format === OpenId4VciCredentialFormatProfile.SdJwtVc) { - const disclosureFramePayload = { - _sd: credential.disclosureFrame ? - Array.isArray(credential.disclosureFrame._sd) ? credential.disclosureFrame._sd : [] - : [] + let sdArray: unknown[] = [] + if (credential.disclosureFrame && Array.isArray(credential.disclosureFrame._sd)) { + sdArray = credential.disclosureFrame._sd + } + + const disclosureFramePayload: any = { + _sd: sdArray, } return { @@ -339,16 +342,17 @@ export function getMixedCredentialRequestToCredentialMapper(): OpenId4VciCredent credentials: holderBindings.map((holderBinding) => ({ payload: credential.payload, holder: holderBinding, - issuer: issuerDidVerificationMethod ? { - method: 'did', - didUrl: issuerDidVerificationMethod - } + issuer: issuerDidVerificationMethod + ? { + method: 'did', + didUrl: issuerDidVerificationMethod, + } : { - method: 'x5c', - x5c: issuerx509certificate ?? [],//[issuerx509certificate??""], - issuer: `${process.env.AGENT_HTTP_URL}`, - }, - disclosureFrame: disclosureFramePayload + method: 'x5c', + x5c: issuerx509certificate ?? [], //[issuerx509certificate??""], + issuer: `${process.env.AGENT_HTTP_URL}`, + }, + disclosureFrame: disclosureFramePayload, })), } satisfies OpenId4VciSignSdJwtCredentials } @@ -365,11 +369,6 @@ function assertDidBasedHolderBinding( } } -// async function fetchCredentialConfiguration(credentialConfigurationId: string, issuerDid: string) { -// // Fetch from database or API instead of static imports -// return database.findOne("credential_configurations", { id: credentialConfigurationId, issuerDid }); -// } - export interface OpenId4VcIssuanceSessionCreateOfferSdJwtCredentialOptions { /** * The id of the `credential_supported` entry that is present in the issuer From 887581bee5cd350e1a437219cece828e5bf7c34c Mon Sep 17 00:00:00 2001 From: Rinkal Bhojani Date: Fri, 26 Sep 2025 12:52:37 +0530 Subject: [PATCH 013/152] added multiple namespace support for mdoc credential Signed-off-by: Rinkal Bhojani --- .../openid4vc/holder/holder.Controller.ts | 10 + .../openid4vc/holder/holder.service.ts | 13 + .../issuance-sessions.service.ts | 11 +- .../openid4vc/types/issuer.types.ts | 39 ++- src/routes/routes.ts | 133 ++++++- src/routes/swagger.json | 324 ++++++++++++++++-- src/utils/oid4vc-agent.ts | 24 +- 7 files changed, 491 insertions(+), 63 deletions(-) diff --git a/src/controllers/openid4vc/holder/holder.Controller.ts b/src/controllers/openid4vc/holder/holder.Controller.ts index 0f3f5ff7..e6724081 100644 --- a/src/controllers/openid4vc/holder/holder.Controller.ts +++ b/src/controllers/openid4vc/holder/holder.Controller.ts @@ -40,6 +40,16 @@ export class HolderController { return await this.holderService.getMdocCredentials(this.agent) } + /** + * Decode mso mdoc credential in wallet + */ + @Post('/mdoc-vcs/decode') + public async decodeMdocCredential(@Body() body:{ + base64Url: string + }) { + return await this.holderService.decodeMdocCredential(this.agent, body) + } + /** * Resolve a credential offer */ diff --git a/src/controllers/openid4vc/holder/holder.service.ts b/src/controllers/openid4vc/holder/holder.service.ts index 0fa210ef..ca548535 100644 --- a/src/controllers/openid4vc/holder/holder.service.ts +++ b/src/controllers/openid4vc/holder/holder.service.ts @@ -58,6 +58,19 @@ export class HolderService { return await agent.mdoc.getAll() } + public async decodeMdocCredential(agent: Agent, 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(agent: Agent, body: ResolveCredentialOfferBody) { // return await agent.modules.openId4VcHolderModule.resolveCredentialOffer(body.credentialOfferUri) // } diff --git a/src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts b/src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts index a8a0f5c7..703e186a 100644 --- a/src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts +++ b/src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts @@ -46,11 +46,14 @@ class IssuanceSessionsService { return { ...cred, payload: { - ...cred.payload, - vct: cred.payload?.vct ?? (typeof supported.vct === 'string' ? supported.vct : undefined), + ...cred?.payload, + ...("vct" in (cred?.payload ?? {}) && { + vct: (cred?.payload as any).vct ?? + (typeof supported.vct === "string" ? supported.vct : undefined), + }), }, - } - // format: c.format as OpenId4VciCredentialFormatProfile, TODO: fix this type + }; + }) options.issuanceMetadata ||= {} diff --git a/src/controllers/openid4vc/types/issuer.types.ts b/src/controllers/openid4vc/types/issuer.types.ts index 8dabcc22..7b695f68 100644 --- a/src/controllers/openid4vc/types/issuer.types.ts +++ b/src/controllers/openid4vc/types/issuer.types.ts @@ -1,28 +1,55 @@ -import { OpenId4VciCredentialFormatProfile } from "@credo-ts/openid4vc" +import { MdocNameSpaces, W3cCredential } from "@credo-ts/core" +import { OpenId4VciCreateCredentialOfferOptions, OpenId4VciCredentialFormatProfile, OpenId4VciSignCredentials } from "@credo-ts/openid4vc" export enum SignerMethod { Did = 'did', X5c = 'x5c', } -export interface OpenId4VcIssuanceSessionCredentialOptions { - credentialSupportedId: string +export interface OpenId4VciOfferCredentials { + credentialSupportedId: string + format: OpenId4VciCredentialFormatProfile, signerOptions: { method: SignerMethod did?: string x5c?: string[] } - format: OpenId4VciCredentialFormatProfile +} + +export interface OpenId4VciOfferSdJwtCredential extends OpenId4VciOfferCredentials { + payload: { vct?: string [key: string]: unknown } disclosureFrame?: Record> } +export interface ValidityInfo { + signed: Date; + validFrom: Date; + validUntil: Date; + expectedUpdate?: Date; +} + +export interface OpenId4VciOfferMdocCredential extends OpenId4VciOfferCredentials { + payload: { + docType: 'org.iso.18013.5.1.mDL' | (string & {}) + validityInfo?: Partial, + namespaces: MdocNameSpaces + } +} + +export interface OpenId4VciOfferW3cCredential extends OpenId4VciOfferCredentials { + payload: { + verificationMethod: string; + credential: W3cCredential; + } +} + -export interface OpenId4VcIssuanceSessionsCreateOffer { +export interface OpenId4VcIssuanceSessionsCreateOffer {//extends OpenId4VciCreateCredentialOfferOptions { publicIssuerId: string - credentials: Array + credentials: Array authorizationCodeFlowConfig?: { authorizationServerUrl: string requirePresentationDuringIssuance?: boolean diff --git a/src/routes/routes.ts b/src/routes/routes.ts index 6fecd69b..a5bbe254 100644 --- a/src/routes/routes.ts +++ b/src/routes/routes.ts @@ -1463,9 +1463,14 @@ const models: TsoaRoute.Models = { "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 - "SignerMethod": { - "dataType": "refEnum", - "enums": ["did","x5c"], + "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": { @@ -1473,24 +1478,56 @@ const models: TsoaRoute.Models = { "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 - "Record_string.boolean_": { + "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":{},"validators":{}}, + "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.boolean-or-Record_string.boolean__": { + "Record_string.Record_string.unknown__": { "dataType": "refAlias", - "type": {"dataType":"nestedObjectLiteral","nestedProperties":{},"additionalProperties":{"dataType":"union","subSchemas":[{"dataType":"boolean"},{"ref":"Record_string.boolean_"}]},"validators":{}}, + "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 - "OpenId4VcIssuanceSessionCredentialOptions": { + "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}, - "payload": {"dataType":"nestedObjectLiteral","nestedProperties":{"vct":{"dataType":"string"}},"additionalProperties":{"dataType":"any"},"required":true}, - "disclosureFrame": {"ref":"Record_string.boolean-or-Record_string.boolean__"}, + "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, }, @@ -1499,7 +1536,7 @@ const models: TsoaRoute.Models = { "dataType": "refObject", "properties": { "publicIssuerId": {"dataType":"string","required":true}, - "credentials": {"dataType":"array","array":{"dataType":"refObject","ref":"OpenId4VcIssuanceSessionCredentialOptions"},"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_"}, @@ -4168,6 +4205,44 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This 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_getTenants: Record = { + request: {"in":"request","name":"request","required":true,"dataType":"object"}, + 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', + authenticateMiddleware([{"jwt":["Basewallet"]}]), + ...(fetchMiddlewares(MultiTenancyController)), + ...(fetchMiddlewares(MultiTenancyController.prototype.getTenants)), + + async function MultiTenancyController_getTenants(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_getTenants, 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: 'getTenants', + 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"}, @@ -4468,6 +4543,42 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This 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 = { + body: {"in":"body","name":"body","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"base64Url":{"dataType":"string","required":true}}}, + }; + app.post('/openid4vc/holder/mdoc-vcs/decode', + authenticateMiddleware([{"apiKey":[]}]), + ...(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_requestAuthorizationForCredential: Record = { body: {"in":"body","name":"body","required":true,"ref":"AuthorizeRequestCredentialOffer"}, }; diff --git a/src/routes/swagger.json b/src/routes/swagger.json index f995a45c..e24dff20 100644 --- a/src/routes/swagger.json +++ b/src/routes/swagger.json @@ -3262,23 +3262,6 @@ "OpenId4VcIssuanceSessionRecord": { "$ref": "#/components/schemas/Record_string.unknown_" }, - "SignerMethod": { - "enum": [ - "did", - "x5c" - ], - "type": "string" - }, - "OpenId4VciCredentialFormatProfile": { - "enum": [ - "jwt_vc_json", - "jwt_vc_json-ld", - "ldp_vc", - "vc+sd-jwt", - "mso_mdoc" - ], - "type": "string" - }, "Record_string.boolean_": { "properties": {}, "type": "object", @@ -3299,11 +3282,31 @@ "type": "object", "description": "Construct a type with a set of properties K of type T" }, - "OpenId4VcIssuanceSessionCredentialOptions": { + "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": { @@ -3324,9 +3327,6 @@ ], "type": "object" }, - "format": { - "$ref": "#/components/schemas/OpenId4VciCredentialFormatProfile" - }, "payload": { "properties": { "vct": { @@ -3342,8 +3342,168 @@ }, "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", @@ -3356,7 +3516,17 @@ }, "credentials": { "items": { - "$ref": "#/components/schemas/OpenId4VcIssuanceSessionCredentialOptions" + "anyOf": [ + { + "$ref": "#/components/schemas/OpenId4VciOfferSdJwtCredential" + }, + { + "$ref": "#/components/schemas/OpenId4VciOfferMdocCredential" + }, + { + "$ref": "#/components/schemas/OpenId4VciOfferW3cCredential" + } + ] }, "type": "array" }, @@ -8091,6 +8261,68 @@ ] } }, + "/multi-tenancy": { + "get": { + "operationId": "GetTenants", + "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" + } + } + } + } + }, + "tags": [ + "MultiTenancy" + ], + "security": [ + { + "jwt": [ + "Basewallet" + ] + } + ], + "parameters": [] + } + }, "/openid4vc/issuance-sessions/create-credential-offer": { "post": { "operationId": "CreateCredentialOffer", @@ -8401,6 +8633,49 @@ "parameters": [] } }, + "/openid4vc/holder/mdoc-vcs/decode": { + "post": { + "operationId": "DecodeMdocCredential", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": {} + } + } + } + }, + "description": "Decode mso mdoc credential in wallet", + "tags": [ + "oid4vc holders" + ], + "security": [ + { + "apiKey": [] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "properties": { + "base64Url": { + "type": "string" + } + }, + "required": [ + "base64Url" + ], + "type": "object" + } + } + } + } + } + }, "/openid4vc/holder/authorization-request": { "post": { "operationId": "RequestAuthorizationForCredential", @@ -9032,7 +9307,10 @@ "description": "Ok", "content": { "application/json": { - "schema": {} + "schema": { + "type": "number", + "format": "double" + } } } } diff --git a/src/utils/oid4vc-agent.ts b/src/utils/oid4vc-agent.ts index 10a2bba1..e0142ffe 100644 --- a/src/utils/oid4vc-agent.ts +++ b/src/utils/oid4vc-agent.ts @@ -275,17 +275,7 @@ export function getMixedCredentialRequestToCredentialMapper(): OpenId4VciCredent credentials: holderBindings.map((holderBinding) => ({ issuerCertificate: issuerx509certificate[0], holderKey: holderBinding.key, - namespaces: { - [namespace]: { - ...credential.payload, - }, - }, - // TODO - add validity info - /*validityInfo: { - expectedUpdate: true, - validFrom: '', - validUntil: '' - },*/ + ...credential.payload, docType: credentialConfiguration.doctype, })), } satisfies OpenId4VciSignMdocCredentials @@ -327,14 +317,10 @@ export function getMixedCredentialRequestToCredentialMapper(): OpenId4VciCredent } if (credentialConfiguration.format === OpenId4VciCredentialFormatProfile.SdJwtVc) { - let sdArray: unknown[] = [] - if (credential.disclosureFrame && Array.isArray(credential.disclosureFrame._sd)) { - sdArray = credential.disclosureFrame._sd - } - - const disclosureFramePayload: any = { - _sd: sdArray, - } + const disclosureFramePayload = + credentialPayload[0].disclosureFrame && Object.keys(credentialPayload[0].disclosureFrame).length > 0 + ? credentialPayload[0].disclosureFrame + : {} return { credentialConfigurationId, From 5a6a4fd8144308428a48b6e6d791d4863d4c7803 Mon Sep 17 00:00:00 2001 From: Rinkal Bhojani Date: Sun, 28 Sep 2025 16:30:39 +0530 Subject: [PATCH 014/152] fixed minor issues with sd-jwt VC issuance Signed-off-by: Rinkal Bhojani --- .../issuance-sessions.service.ts | 38 ++++++++++++++----- src/utils/oid4vc-agent.ts | 11 ++++-- 2 files changed, 36 insertions(+), 13 deletions(-) diff --git a/src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts b/src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts index 703e186a..f26005d1 100644 --- a/src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts +++ b/src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts @@ -1,5 +1,5 @@ import type { OpenId4VcIssuanceSessionsCreateOffer } from '../types/issuer.types' -import type { OpenId4VcIssuanceSessionState } from '@credo-ts/openid4vc' +import { OpenId4VciCredentialFormatProfile, type OpenId4VcIssuanceSessionState } from '@credo-ts/openid4vc' import type { Request as Req } from 'express' import { OpenId4VcIssuanceSessionRepository } from '@credo-ts/openid4vc/build/openid4vc-issuer/repository' @@ -43,16 +43,34 @@ class IssuanceSessionsService { ) } + const currentVct = cred.payload && 'vct' in cred.payload ? cred.payload.vct : undefined; return { - ...cred, - payload: { - ...cred?.payload, - ...("vct" in (cred?.payload ?? {}) && { - vct: (cred?.payload as any).vct ?? - (typeof supported.vct === "string" ? supported.vct : undefined), - }), - }, - }; + ...cred, + payload: { + ...cred.payload, + vct: currentVct ?? (typeof supported.vct === 'string' ? supported.vct : undefined), + }, + } + + // if (cred.format === OpenId4VciCredentialFormatProfile.SdJwtVc) { + // return { + // ...cred, + // payload: { + // ...cred.payload, + // vct: cred.payload?.vct ?? (typeof supported.vct === 'string' ? supported.vct : undefined), + // }, + // } + // } + // else { + // return { + // ...cred, + // payload: { + // ...cred.payload + // }, + // } + // } + + // format: c.format as OpenId4VciCredentialFormatProfile, TODO: fix this type }) diff --git a/src/utils/oid4vc-agent.ts b/src/utils/oid4vc-agent.ts index e0142ffe..cea46aec 100644 --- a/src/utils/oid4vc-agent.ts +++ b/src/utils/oid4vc-agent.ts @@ -8,7 +8,7 @@ import type { OpenId4VciSignW3cCredentials, } from '@credo-ts/openid4vc' -import { DidsApi } from '@credo-ts/core' +import { DidsApi, X509Service } from '@credo-ts/core' import { ClaimFormat, CredoError, @@ -322,6 +322,11 @@ export function getMixedCredentialRequestToCredentialMapper(): OpenId4VciCredent ? credentialPayload[0].disclosureFrame : {} + //Taking leaf certifcate from chain as issuer certificate, if not provided explicitly taking AGENT_HTTP_URL as issuer + const parsedCertificate = X509Service.parseCertificate(agentContext, { + encodedCertificate: (issuerx509certificate ?? [`${process.env.AGENT_HTTP_URL}`])[0], + }) + return { credentialConfigurationId, format: ClaimFormat.SdJwtVc, @@ -335,8 +340,8 @@ export function getMixedCredentialRequestToCredentialMapper(): OpenId4VciCredent } : { method: 'x5c', - x5c: issuerx509certificate ?? [], //[issuerx509certificate??""], - issuer: `${process.env.AGENT_HTTP_URL}`, + x5c: issuerx509certificate ?? [], + issuer: parsedCertificate.sanUriNames[0], }, disclosureFrame: disclosureFramePayload, })), From 009e5e869509603fdd1ec74358872cd854d6d51c Mon Sep 17 00:00:00 2001 From: Tipu_Singh Date: Mon, 6 Oct 2025 18:00:43 +0530 Subject: [PATCH 015/152] fix: resolve comments Signed-off-by: Tipu_Singh --- .../issuance-sessions.service.ts | 21 ------- src/utils/oid4vc-agent.ts | 56 ++++++++++--------- 2 files changed, 30 insertions(+), 47 deletions(-) diff --git a/src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts b/src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts index f26005d1..2c6f600d 100644 --- a/src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts +++ b/src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts @@ -51,27 +51,6 @@ class IssuanceSessionsService { vct: currentVct ?? (typeof supported.vct === 'string' ? supported.vct : undefined), }, } - - // if (cred.format === OpenId4VciCredentialFormatProfile.SdJwtVc) { - // return { - // ...cred, - // payload: { - // ...cred.payload, - // vct: cred.payload?.vct ?? (typeof supported.vct === 'string' ? supported.vct : undefined), - // }, - // } - // } - // else { - // return { - // ...cred, - // payload: { - // ...cred.payload - // }, - // } - // } - - // format: c.format as OpenId4VciCredentialFormatProfile, TODO: fix this type - }) options.issuanceMetadata ||= {} diff --git a/src/utils/oid4vc-agent.ts b/src/utils/oid4vc-agent.ts index cea46aec..ec4bed8e 100644 --- a/src/utils/oid4vc-agent.ts +++ b/src/utils/oid4vc-agent.ts @@ -95,9 +95,9 @@ export function getCredentialRequestToCredentialMapper(): OpenId4VciCredentialRe issuer: holderBindings[0].method === 'did' ? { - method: 'did', - didUrl: issuerDidUrl ?? '', - } + method: 'did', + didUrl: issuerDidUrl ?? '', + } : { method: 'x5c', x5c: trustedCertificates, issuer: 'ISSUER_HOST ' }, })), } satisfies OpenId4VciSignSdJwtCredentials @@ -157,14 +157,14 @@ export function getCredentialRequestToCredentialMapper(): OpenId4VciCredentialRe holder: holderBinding, issuer: issuerDidUrl ? { - method: 'did', - didUrl: issuerDidUrl, - } + method: 'did', + didUrl: issuerDidUrl, + } : { - method: 'x5c', - x5c: issuerx509certificate ?? [], //[issuerx509certificate??""], - issuer: process.env.AGENT_HOST ?? 'http://localhost:4001', - }, + method: 'x5c', + x5c: issuerx509certificate ?? [], //[issuerx509certificate??""], + issuer: process.env.AGENT_HOST ?? 'http://localhost:4001', + }, disclosureFrame: disclosureFramePayload, })), } satisfies OpenId4VciSignSdJwtCredentials @@ -194,8 +194,8 @@ export function getMixedCredentialRequestToCredentialMapper(): OpenId4VciCredent // Returns an array of all matching credentials const credentialPayload = Array.isArray(allCredentialPayload) ? allCredentialPayload.filter( - (c: Record) => c.credentialSupportedId === credentialConfigurationId, - ) + (c: Record) => c.credentialSupportedId === credentialConfigurationId, + ) : [] const credentialConfiguration = credentialConfigurationsSupported[credentialConfigurationId] @@ -246,9 +246,9 @@ export function getMixedCredentialRequestToCredentialMapper(): OpenId4VciCredent issuer: holderBindings[0].method === 'did' ? { - method: 'did', - didUrl: issuerDidVerificationMethod ?? '', - } + method: 'did', + didUrl: issuerDidVerificationMethod ?? '', + } : { method: 'x5c', x5c: trustedCertificates, issuer: 'ISSUER_HOST ' }, })), } satisfies OpenId4VciSignSdJwtCredentials @@ -275,7 +275,7 @@ export function getMixedCredentialRequestToCredentialMapper(): OpenId4VciCredent credentials: holderBindings.map((holderBinding) => ({ issuerCertificate: issuerx509certificate[0], holderKey: holderBinding.key, - ...credential.payload, + ...credential.payload, docType: credentialConfiguration.doctype, })), } satisfies OpenId4VciSignMdocCredentials @@ -317,15 +317,19 @@ export function getMixedCredentialRequestToCredentialMapper(): OpenId4VciCredent } if (credentialConfiguration.format === OpenId4VciCredentialFormatProfile.SdJwtVc) { - const disclosureFramePayload = + 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 - const parsedCertificate = X509Service.parseCertificate(agentContext, { + //Taking leaf certifcate from chain as issuer certificate, if not provided explicitly taking AGENT_HTTP_URL as issuer + let parsedCertificate: any; + if (!issuerDidVerificationMethod) { + parsedCertificate = X509Service.parseCertificate(agentContext, { encodedCertificate: (issuerx509certificate ?? [`${process.env.AGENT_HTTP_URL}`])[0], }) + } + return { credentialConfigurationId, @@ -335,14 +339,14 @@ export function getMixedCredentialRequestToCredentialMapper(): OpenId4VciCredent holder: holderBinding, issuer: issuerDidVerificationMethod ? { - method: 'did', - didUrl: issuerDidVerificationMethod, - } + method: 'did', + didUrl: issuerDidVerificationMethod, + } : { - method: 'x5c', - x5c: issuerx509certificate ?? [], - issuer: parsedCertificate.sanUriNames[0], - }, + method: 'x5c', + x5c: issuerx509certificate ?? [], + issuer: parsedCertificate.sanUriNames[0], + }, disclosureFrame: disclosureFramePayload, })), } satisfies OpenId4VciSignSdJwtCredentials From 6e3e4818dfe288146eb868ed943a561f65f0b972 Mon Sep 17 00:00:00 2001 From: Rinkal Bhojani Date: Mon, 13 Oct 2025 22:45:14 +0530 Subject: [PATCH 016/152] feat: support for x509 certs (#319) * updated creat x509 method and few types Signed-off-by: Rinkal Bhojani * corrected mapper function for mdoc payload Signed-off-by: Rinkal Bhojani --------- Signed-off-by: Rinkal Bhojani --- src/controllers/x509/crypto-util.ts | 37 +- src/controllers/x509/x509.Controller.ts | 68 +- src/controllers/x509/x509.service.ts | 173 +++-- src/controllers/x509/x509.types.ts | 204 +++++ src/routes/routes.ts | 617 +++++++++------ src/routes/swagger.json | 968 ++++++++++++++++-------- 6 files changed, 1373 insertions(+), 694 deletions(-) create mode 100644 src/controllers/x509/x509.types.ts diff --git a/src/controllers/x509/crypto-util.ts b/src/controllers/x509/crypto-util.ts index 74c1fef6..32e92046 100644 --- a/src/controllers/x509/crypto-util.ts +++ b/src/controllers/x509/crypto-util.ts @@ -1,4 +1,4 @@ -import { createPrivateKey, KeyObject } from 'crypto'; +import { createPrivateKey, KeyObject } from 'crypto' /** * Extracts the raw private key (hex) from a PEM-encoded EC (P-256) private key. @@ -7,29 +7,32 @@ async function pemToRawEcPrivateKey(pem: string): Promise { const keyObj: KeyObject = createPrivateKey({ key: pem, format: 'pem', - }); + }) // Extract raw private key (as Buffer) const rawPrivateKey = keyObj.export({ format: 'jwk', - }).d!; + }).d! - return Buffer.from(rawPrivateKey, 'base64').toString('hex'); + return Buffer.from(rawPrivateKey, 'base64').toString('hex') } /** * Extracts the raw private key (hex) from a PEM-encoded Ed25519 private key. */ -export async function pemToRawEd25519PrivateKey(pem: string): Promise { - const keyObj: KeyObject = createPrivateKey({ - key: pem.replace(/\\n/g, '\n'), - format: 'pem', - }); - - // Ed25519 JWK exports the *seed* (first 32 bytes of the private key) - const jwk = keyObj.export({ format: 'jwk' }); - if (!jwk.d) throw new Error("Not an Ed25519 private key"); - - return Buffer.from(jwk.d, 'base64').toString('hex'); - } - +export async function pemToRawEd25519PrivateKey(derKey: string | Buffer): Promise { + // If it's a base64 string, convert to Buffer + const keyBuffer = typeof derKey === 'string' ? Buffer.from(derKey, 'base64') : derKey + + const keyObj: KeyObject = createPrivateKey({ + key: keyBuffer, + format: 'der', + type: 'pkcs8', // Use 'pkcs8' for private keys (works for Ed25519, P256, RSA) + }) + + // Ed25519 JWK exports the *seed* (first 32 bytes of the private key) + const jwk = keyObj.export({ format: 'jwk' }) + if (!jwk.d) throw new Error('Not an Ed25519 private key') + + return Buffer.from(jwk.d, 'base64').toString('hex') +} diff --git a/src/controllers/x509/x509.Controller.ts b/src/controllers/x509/x509.Controller.ts index 90f38867..61a412eb 100644 --- a/src/controllers/x509/x509.Controller.ts +++ b/src/controllers/x509/x509.Controller.ts @@ -1,17 +1,12 @@ -import type { RestMultiTenantAgentModules } from '../../cliAgent' -import type { TenantRecord } from '@credo-ts/tenants' - -import { Agent, JsonTransformer, injectable, RecordNotFoundError, X509CreateCertificateOptions, X509Service, X509KeyUsage, KeyType, TypedArrayEncoder, CredoError, X509ExtendedKeyUsage, Key } from '@credo-ts/core' +import { injectable } from '@credo-ts/core' import { Request as Req } from 'express' -import jwt from 'jsonwebtoken' -import { Body, Controller, Delete, Post, Route, Tags, Path, Security, Request, Res, TsoaResponse, Get } from 'tsoa' +import { Body, Controller, Post, Route, Tags, Security, Request, Get } from 'tsoa' -import { AgentRole, SCOPES } from '../../enums' +import { SCOPES } from '../../enums' import ErrorHandlingService from '../../errorHandlingService' -import { BasicX509CreateCertificateConfig, CreateTenantOptions, X509ImportCertificateOptionsDto } from '../types' -import { generateSecretKey, getCertificateValidityForSystem } from '../../utils/helpers' +import { X509ImportCertificateOptionsDto } from '../types' import { x509ServiceT } from './x509.service' - +import { X509CreateCertificateOptionsDto } from './x509.types' @Tags('x509') @Security('jwt', [SCOPES.TENANT_AGENT, SCOPES.DEDICATED_AGENT]) @@ -19,35 +14,39 @@ import { x509ServiceT } from './x509.service' @injectable() export class X509Controller extends Controller { @Post('/') - public async createSelfSignedDCS(@Request() request: Req, @Body() createX509Options: BasicX509CreateCertificateConfig) { - + public async createX509Certificate( + @Request() request: Req, + @Body() createX509Options: X509CreateCertificateOptionsDto, + ) { try { - - return await x509ServiceT.createSelfSignedDCS(createX509Options, request); + return await x509ServiceT.createCertificate(request, createX509Options) } catch (error) { throw ErrorHandlingService.handle(error) } } - @Post('/import') - public async ImportX509Certficates(@Request() request: Req, @Body() importX509Options: X509ImportCertificateOptionsDto) { - + public async ImportX509Certificates( + @Request() request: Req, + @Body() importX509Options: X509ImportCertificateOptionsDto, + ) { try { - - return await x509ServiceT.ImportX509Certficates(request, importX509Options); + return await x509ServiceT.ImportX509Certificates(request, importX509Options) } catch (error) { throw ErrorHandlingService.handle(error) } } @Post('/trusted') - public async addTrustedCertificate(@Request() request: Req, @Body() options: { - certificate: string - }) { + public async addTrustedCertificate( + @Request() request: Req, + @Body() + options: { + certificate: string + }, + ) { try { - - return await x509ServiceT.addTrustedCertificate(request, options); + return await x509ServiceT.addTrustedCertificate(request, options) } catch (error) { throw ErrorHandlingService.handle(error) } @@ -55,26 +54,25 @@ export class X509Controller extends Controller { @Get('/trusted') public async getTrustedCertificates(@Request() request: Req) { - try { - return await x509ServiceT.getTrustedCertificates(request); + return await x509ServiceT.getTrustedCertificates(request) } catch (error) { throw ErrorHandlingService.handle(error) } } - @Post('/decode') - public async decodeCertificate(@Request() request: Req, @Body() options: { - certificate: string - }) { + public async decodeCertificate( + @Request() request: Req, + @Body() + options: { + certificate: string + }, + ) { try { - - return await x509ServiceT.decodeCertificate(request, options); + return await x509ServiceT.decodeCertificate(request, options) } catch (error) { throw ErrorHandlingService.handle(error) } } - - -} \ No newline at end of file +} diff --git a/src/controllers/x509/x509.service.ts b/src/controllers/x509/x509.service.ts index 1813cd93..94d7d7a6 100644 --- a/src/controllers/x509/x509.service.ts +++ b/src/controllers/x509/x509.service.ts @@ -1,26 +1,29 @@ +import type { X509CreateCertificateOptionsDto } from './x509.types' +import type { BasicX509CreateCertificateConfig, X509ImportCertificateOptionsDto } from '../types' +import type { CredoError, Key } from '@credo-ts/core' +import type { Request as Req } from 'express' + +import { + KeyType, + TypedArrayEncoder, + WalletKeyExistsError, + X509Certificate, + X509ExtendedKeyUsage, + X509KeyUsage, + X509ModuleConfig, + X509Service, + type Agent, +} from '@credo-ts/core' -import { CredoError, KeyType, TypedArrayEncoder, WalletKeyExistsError, X509Certificate, X509ExtendedKeyUsage, X509KeyUsage, X509ModuleConfig, X509Service, type Agent } from '@credo-ts/core' -import type { OpenId4VcIssuanceSessionState } from '@credo-ts/openid4vc' - -import { OpenId4VcIssuanceSessionRepository } from '@credo-ts/openid4vc/build/openid4vc-issuer/repository' - - -import { Request as Req } from 'express' - -import { BasicX509CreateCertificateConfig, X509ImportCertificateOptionsDto } from '../types' import { generateSecretKey, getCertificateValidityForSystem } from '../../utils/helpers' -import { pemToRawEd25519PrivateKey } from './crypto-util' +import { pemToRawEd25519PrivateKey } from './crypto-util' class x509Service { - - public async createSelfSignedDCS( - createX509Options: BasicX509CreateCertificateConfig, - agentReq: Req - ) { + public async createSelfSignedDCS(createX509Options: BasicX509CreateCertificateConfig, agentReq: Req) { const agent = agentReq.agent - const authorityKey = await createKey(agent as Agent, createX509Options.keyType); + const authorityKey = await createKey(agent as Agent, createX509Options.keyType) const AGENT_HOST = createX509Options.issuerAlternativeNameURL const AGENT_DNS = AGENT_HOST.replace('https://', '') const selfSignedx509certificate = await X509Service.createCertificate(agent.context, { @@ -36,12 +39,18 @@ class x509Service { markAsCritical: true, }, subjectAlternativeName: { - name: [{ type: 'dns', value: AGENT_DNS }, { type: 'url', value: AGENT_HOST }], + name: [ + { type: 'dns', value: AGENT_DNS }, + { type: 'url', value: AGENT_HOST }, + ], }, issuerAlternativeName: { // biome-ignore lint/style/noNonNullAssertion: //name: rootCertificate.issuerAlternativeNames!, - name: [{ type: 'dns', value: AGENT_DNS }, { type: 'url', value: AGENT_HOST }], + name: [ + { type: 'dns', value: AGENT_DNS }, + { type: 'url', value: AGENT_HOST }, + ], }, extendedKeyUsage: { usages: [X509ExtendedKeyUsage.MdlDs], @@ -59,21 +68,64 @@ class x509Service { }, }) - console.log('======= X.509 IACA Self Signed Certificate ===========') + agent.config.logger.info('======= X.509 IACA Self Signed Certificate ===========') const selfSignedx509certificateBase64 = selfSignedx509certificate.toString('base64') - console.log('selfSignedx509certificateBase64', selfSignedx509certificateBase64); - return { selfSignedx509certificateBase64 }; - + agent.config.logger.debug('selfSignedx509certificateBase64', { selfSignedx509certificateBase64 }) + return { publicCertificateBase64: selfSignedx509certificateBase64 } } + public async createCertificate(agentReq: Req, options: X509CreateCertificateOptionsDto) { + const agent = agentReq.agent - public async ImportX509Certficates(agentReq: Req - , options: X509ImportCertificateOptionsDto - ) { + let authorityKeyID, subjectPublicKeyID + + 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), + }) + } else { + authorityKeyID = await agent.context.wallet.createKey({ + keyType: KeyType.P256, + }) + } + + 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), + }) + } else { + subjectPublicKeyID = await agent.context.wallet.createKey({ + keyType: KeyType.P256, + }) + } + } + + const certificate = await agent.x509.createCertificate({ + authorityKey: authorityKeyID as Key, + subjectPublicKey: (subjectPublicKeyID as Key) ?? undefined, + serialNumber: options.serialNumber, + issuer: options.issuer, + extensions: options.extensions, + subject: options.subject, + validity: options.validity, + }) + + const issuerCertificate = certificate.toString('base64') + return { publicCertificateBase64: issuerCertificate } + } + + public async ImportX509Certificates(agentReq: Req, options: X509ImportCertificateOptionsDto) { const agent = agentReq.agent + agent.config.logger.debug(`Start validating keys`) const secretHexKey = await pemToRawEd25519PrivateKey(options.privateKey ?? '') const privateKey = TypedArrayEncoder.fromHex(secretHexKey) + agent.config.logger.debug(`Decode certificate`) const parsedCertificate = X509Service.parseCertificate(agent.context, { encodedCertificate: options.certificate, }) @@ -82,74 +134,73 @@ class x509Service { try { const documentSignerKey = await agent.wallet.createKey({ privateKey: privateKey, - keyType: options.keyType + keyType: options.keyType, }) if ( parsedCertificate.publicKey.keyType !== options.keyType || !Buffer.from(parsedCertificate.publicKey.publicKey).equals(Buffer.from(documentSignerKey.publicKey)) ) { - throw new Error( - `Key mismatched in provided X509_CERTIFICATE to import` - ) + throw new Error(`Key mismatched in provided X509_CERTIFICATE to import`) } console.log(`Keys matched with certificate`) - } - catch (error) { - + } catch (error) { // 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) - + console.error( + `key already exists while importing certificate ${JSON.stringify(parsedCertificate.privateKey)}`, + parsedCertificate.privateKey, + ) } else { + agent.config.logger.error(`${JSON.stringify(error)}`) throw error } } - return { issuerCertficicate }; + return { issuerCertficicate } } - public addTrustedCertificate(agentReq: Req, options: { - certificate: string - }) { + public addTrustedCertificate( + agentReq: Req, + options: { + certificate: string + }, + ) { const agent = agentReq.agent - return agent.x509.addTrustedCertificate(options.certificate); + return agent.x509.addTrustedCertificate(options.certificate) } public getTrustedCertificates(agentReq: Req) { + const trustedCertificates = agentReq.agent.context.dependencyManager + .resolve(X509ModuleConfig) + .trustedCertificates?.map((cert) => X509Certificate.fromEncodedCertificate(cert).toString('base64')) // as [string, ...string[]] - const trustedCertificates = agentReq.agent.context.dependencyManager.resolve(X509ModuleConfig) - .trustedCertificates?.map((cert) => - X509Certificate.fromEncodedCertificate(cert).toString('base64') - )// as [string, ...string[]] - - return trustedCertificates; + return trustedCertificates } /** - * Parses a base64-encoded X.509 certificate into a X509Certificate - * - * @param issuerAgent {Agent} - * @param options {x509Input} - * @returns - */ - public decodeCertificate(agentReq: Req, options: { - certificate: string - }) { + * Parses a base64-encoded X.509 certificate into a X509Certificate + * + * @param issuerAgent {Agent} + * @param options {x509Input} + * @returns + */ + public decodeCertificate( + agentReq: Req, + options: { + certificate: string + }, + ) { const parsedCertificate = X509Service.parseCertificate(agentReq.agent.context, { encodedCertificate: options.certificate, }) - return parsedCertificate; + return parsedCertificate } - - } - export const x509ServiceT = new x509Service() - export async function createKey(agent: Agent, keyType: KeyType) { try { const seed = await generateSecretKey(keyType === KeyType.P256 ? 64 : 32) @@ -164,6 +215,6 @@ export async function createKey(agent: Agent, keyType: KeyType) { return authorityKey } catch (error) { agent.config.logger.debug(`Error while creating authorityKey`, { message: (error as CredoError).message }) - throw error; + throw error } -} \ No newline at end of file +} diff --git a/src/controllers/x509/x509.types.ts b/src/controllers/x509/x509.types.ts new file mode 100644 index 00000000..45eca35c --- /dev/null +++ b/src/controllers/x509/x509.types.ts @@ -0,0 +1,204 @@ +import type { KeyType, X509ExtendedKeyUsage, X509KeyUsage } from '@credo-ts/core' + +import { Extension, Example } from 'tsoa' + +// Enum remains the same +export enum GeneralNameType { + DNS = 'dns', + DN = 'dn', + EMAIL = 'email', + GUID = 'guid', + IP = 'ip', + URL = 'url', + UPN = 'upn', + REGISTERED_ID = 'id', +} + +export interface AuthorityAndSubjectKeyDto { + /** + * @example "my-seed-12345" + * @description Seed to deterministically derive the key (optional) + */ + seed?: string + + /** + * @example "3yPQbnk6WwLgX8K3JZ4t7vBnJ8XqY2mMpRcD9fNvGtHw" + * @description publicKeyBase58 for using existing key in wallet (optional) + */ + publicKeyBase58?: string + + /** + * @example "p256" + * @description Type of the key used for signing the X.509 Certificate (default is p256) + */ + keyType?: KeyType +} + +export interface NameDto { + /** + * @example "dns" + */ + type: GeneralNameType + + /** + * @example "example.com" + */ + value: string +} + +export interface X509CertificateIssuerAndSubjectOptionsDto { + /** + * @example "US" + */ + countryName?: string + + /** + * @example "California" + */ + stateOrProvinceName?: string + + /** + * @example "IT Department" + */ + organizationalUnit?: string + + /** + * @example "Example Corporation" + */ + commonName?: string +} + +export interface ValidityDto { + /** + * @example "2024-01-01T00:00:00.000Z" + */ + notBefore?: Date + + /** + * @example "2025-01-01T00:00:00.000Z" + */ + notAfter?: Date +} + +export interface KeyUsageDto { + /** + * @example ["digitalSignature", "keyEncipherment", "crlSign"] + */ + usages: X509KeyUsage[] + + /** + * @example true + */ + markAsCritical?: boolean +} + +export interface ExtendedKeyUsageDto { + /** + * @example ["MdlDs", "ServerAuth", "ClientAuth"] + */ + usages: X509ExtendedKeyUsage[] + + /** + * @example true + */ + markAsCritical?: boolean +} + +export interface NameListDto { + /** + * @example [{ "type": "dns", "value": "example.com" }, { "type": "email", "value": "admin@example.com" }] + */ + name: NameDto[] + + /** + * @example true + */ + markAsCritical?: boolean +} + +export interface AuthorityAndSubjectKeyIdentifierDto { + /** + * @example true + */ + include: boolean + + /** + * @example true + */ + markAsCritical?: boolean +} + +export interface BasicConstraintsDto { + /** + * @example false + */ + ca: boolean + + /** + * @example 0 + */ + pathLenConstraint?: number + + /** + * @example true + */ + markAsCritical?: boolean +} + +export interface CrlDistributionPointsDto { + /** + * @example ["http://crl.example.com/ca.crl"] + */ + urls: string[] + + /** + * @example true + */ + markAsCritical?: boolean +} + +export interface X509CertificateExtensionsOptionsDto { + keyUsage?: KeyUsageDto + extendedKeyUsage?: ExtendedKeyUsageDto + authorityKeyIdentifier?: AuthorityAndSubjectKeyIdentifierDto + subjectKeyIdentifier?: AuthorityAndSubjectKeyIdentifierDto + issuerAlternativeName?: NameListDto + subjectAlternativeName?: NameListDto + basicConstraints?: BasicConstraintsDto + crlDistributionPoints?: CrlDistributionPointsDto +} + +// Main DTO Interface +export interface X509CreateCertificateOptionsDto { + authorityKey?: AuthorityAndSubjectKeyDto + subjectPublicKey?: AuthorityAndSubjectKeyDto + + /** + * @example "1234567890" + */ + serialNumber?: string + + /** + * @example { + * "countryName": "US", + * "stateOrProvinceName": "California", + * "commonName": "Example CA" + * } + * OR + * @example "/C=US/ST=California/O=Example Corporation/CN=Example CA" + */ + issuer: X509CertificateIssuerAndSubjectOptionsDto | string + + /** + * @example { + * "countryName": "US", + * "commonName": "www.example.com" + * } + * OR + * @example "/C=US/CN=www.example.com" + */ + subject?: X509CertificateIssuerAndSubjectOptionsDto | string + + validity?: ValidityDto + extensions?: X509CertificateExtensionsOptionsDto +} diff --git a/src/routes/routes.ts b/src/routes/routes.ts index a5bbe254..fa10f105 100644 --- a/src/routes/routes.ts +++ b/src/routes/routes.ts @@ -4,6 +4,8 @@ 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'; @@ -39,8 +41,6 @@ import { IssuerController } from './../controllers/openid4vc/issuers/issuer.Cont 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 { VerifierController } from './../controllers/openid4vc/verifiers/verifier.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 { X509Controller } from './../controllers/x509/x509.Controller'; import { expressAuthentication } from './../authentication'; // @ts-ignore - no great way to install types from subpackage import { iocContainer } from './../utils/tsyringeTsoaIocContainer'; @@ -53,6 +53,184 @@ const expressAuthenticationRecasted = expressAuthentication as (req: ExRequest, // WARNING: This 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":{}}, @@ -348,11 +526,6 @@ const models: TsoaRoute.Models = { "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 - "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 "DidCreate": { "dataType": "refObject", "properties": { @@ -856,22 +1029,6 @@ const models: TsoaRoute.Models = { "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 - "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 "Routing": { "dataType": "refObject", "properties": { @@ -1735,55 +1892,207 @@ const models: TsoaRoute.Models = { "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 - "BasicX509CreateCertificateConfig": { - "dataType": "refObject", - "properties": { - "countryName": {"dataType":"string"}, - "stateOrProvinceName": {"dataType":"string"}, - "organizationalUnit": {"dataType":"string"}, - "commonName": {"dataType":"string"}, - "keyType": {"ref":"KeyType","required":true}, - "issuerAlternativeNameURL": {"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 - "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 - "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 }; 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 +// WARNING: This 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; -export function RegisterRoutes(app: Router) { + const controller: any = await container.get(X509Controller); + if (typeof controller['setStatus'] === 'function') { + controller.setStatus(undefined); + } - // ########################################################################################################### - // 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 - // ########################################################################################################### + 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', @@ -5210,190 +5519,6 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This 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_createSelfSignedDCS: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - createX509Options: {"in":"body","name":"createX509Options","required":true,"ref":"BasicX509CreateCertificateConfig"}, - }; - app.post('/x509', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(X509Controller)), - ...(fetchMiddlewares(X509Controller.prototype.createSelfSignedDCS)), - - async function X509Controller_createSelfSignedDCS(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_createSelfSignedDCS, 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: 'createSelfSignedDCS', - 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_ImportX509Certficates: 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.ImportX509Certficates)), - - async function X509Controller_ImportX509Certficates(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_ImportX509Certficates, 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: 'ImportX509Certficates', - 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 // WARNING: This 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 e24dff20..575ba001 100644 --- a/src/routes/swagger.json +++ b/src/routes/swagger.json @@ -7,6 +7,402 @@ "requestBodies": {}, "responses": {}, "schemas": { + "KeyType": { + "enum": [ + "ed25519", + "bls12381g1g2", + "bls12381g1", + "bls12381g2", + "x25519", + "p256", + "p384", + "p521", + "k256" + ], + "type": "string" + }, + "AuthorityAndSubjectKeyDto": { + "properties": { + "seed": { + "type": "string", + "example": "my-seed-12345" + }, + "publicKeyBase58": { + "type": "string", + "example": "3yPQbnk6WwLgX8K3JZ4t7vBnJ8XqY2mMpRcD9fNvGtHw" + }, + "keyType": { + "$ref": "#/components/schemas/KeyType", + "example": "p256" + } + }, + "type": "object", + "additionalProperties": false + }, + "X509CertificateIssuerAndSubjectOptionsDto": { + "properties": { + "countryName": { + "type": "string", + "example": "US" + }, + "stateOrProvinceName": { + "type": "string", + "example": "California" + }, + "organizationalUnit": { + "type": "string", + "example": "IT Department" + }, + "commonName": { + "type": "string", + "example": "Example Corporation" + } + }, + "type": "object", + "additionalProperties": false + }, + "ValidityDto": { + "properties": { + "notBefore": { + "type": "string", + "format": "date-time", + "example": "2024-01-01T00:00:00.000Z" + }, + "notAfter": { + "type": "string", + "format": "date-time", + "example": "2025-01-01T00:00:00.000Z" + } + }, + "type": "object", + "additionalProperties": false + }, + "X509KeyUsage": { + "enum": [ + 1, + 2, + 4, + 8, + 16, + 32, + 64, + 128, + 256 + ], + "type": "number" + }, + "KeyUsageDto": { + "properties": { + "usages": { + "items": { + "$ref": "#/components/schemas/X509KeyUsage" + }, + "type": "array", + "example": [ + "digitalSignature", + "keyEncipherment", + "crlSign" + ] + }, + "markAsCritical": { + "type": "boolean", + "example": true + } + }, + "required": [ + "usages" + ], + "type": "object", + "additionalProperties": false + }, + "X509ExtendedKeyUsage": { + "enum": [ + "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" + ], + "type": "string" + }, + "ExtendedKeyUsageDto": { + "properties": { + "usages": { + "items": { + "$ref": "#/components/schemas/X509ExtendedKeyUsage" + }, + "type": "array", + "example": [ + "MdlDs", + "ServerAuth", + "ClientAuth" + ] + }, + "markAsCritical": { + "type": "boolean", + "example": true + } + }, + "required": [ + "usages" + ], + "type": "object", + "additionalProperties": false + }, + "AuthorityAndSubjectKeyIdentifierDto": { + "properties": { + "include": { + "type": "boolean", + "example": true + }, + "markAsCritical": { + "type": "boolean", + "example": true + } + }, + "required": [ + "include" + ], + "type": "object", + "additionalProperties": false + }, + "GeneralNameType": { + "enum": [ + "dns", + "dn", + "email", + "guid", + "ip", + "url", + "upn", + "id" + ], + "type": "string" + }, + "NameDto": { + "properties": { + "type": { + "$ref": "#/components/schemas/GeneralNameType", + "example": "dns" + }, + "value": { + "type": "string", + "example": "example.com" + } + }, + "required": [ + "type", + "value" + ], + "type": "object", + "additionalProperties": false + }, + "NameListDto": { + "properties": { + "name": { + "items": { + "$ref": "#/components/schemas/NameDto" + }, + "type": "array", + "example": [ + { + "type": "dns", + "value": "example.com" + }, + { + "type": "email", + "value": "admin@example.com" + } + ] + }, + "markAsCritical": { + "type": "boolean", + "example": true + } + }, + "required": [ + "name" + ], + "type": "object", + "additionalProperties": false + }, + "BasicConstraintsDto": { + "properties": { + "ca": { + "type": "boolean", + "example": false + }, + "pathLenConstraint": { + "type": "number", + "format": "double", + "example": 0 + }, + "markAsCritical": { + "type": "boolean", + "example": true + } + }, + "required": [ + "ca" + ], + "type": "object", + "additionalProperties": false + }, + "CrlDistributionPointsDto": { + "properties": { + "urls": { + "items": { + "type": "string" + }, + "type": "array", + "example": [ + "http://crl.example.com/ca.crl" + ] + }, + "markAsCritical": { + "type": "boolean", + "example": true + } + }, + "required": [ + "urls" + ], + "type": "object", + "additionalProperties": false + }, + "X509CertificateExtensionsOptionsDto": { + "properties": { + "keyUsage": { + "$ref": "#/components/schemas/KeyUsageDto" + }, + "extendedKeyUsage": { + "$ref": "#/components/schemas/ExtendedKeyUsageDto" + }, + "authorityKeyIdentifier": { + "$ref": "#/components/schemas/AuthorityAndSubjectKeyIdentifierDto" + }, + "subjectKeyIdentifier": { + "$ref": "#/components/schemas/AuthorityAndSubjectKeyIdentifierDto" + }, + "issuerAlternativeName": { + "$ref": "#/components/schemas/NameListDto" + }, + "subjectAlternativeName": { + "$ref": "#/components/schemas/NameListDto" + }, + "basicConstraints": { + "$ref": "#/components/schemas/BasicConstraintsDto" + }, + "crlDistributionPoints": { + "$ref": "#/components/schemas/CrlDistributionPointsDto" + } + }, + "type": "object", + "additionalProperties": false + }, + "X509CreateCertificateOptionsDto": { + "properties": { + "authorityKey": { + "$ref": "#/components/schemas/AuthorityAndSubjectKeyDto" + }, + "subjectPublicKey": { + "$ref": "#/components/schemas/AuthorityAndSubjectKeyDto" + }, + "serialNumber": { + "type": "string", + "example": "1234567890" + }, + "issuer": { + "anyOf": [ + { + "$ref": "#/components/schemas/X509CertificateIssuerAndSubjectOptionsDto" + }, + { + "type": "string" + } + ] + }, + "subject": { + "anyOf": [ + { + "$ref": "#/components/schemas/X509CertificateIssuerAndSubjectOptionsDto" + }, + { + "type": "string" + } + ] + }, + "validity": { + "$ref": "#/components/schemas/ValidityDto" + }, + "extensions": { + "$ref": "#/components/schemas/X509CertificateExtensionsOptionsDto" + } + }, + "required": [ + "issuer" + ], + "type": "object", + "additionalProperties": false + }, + "X509ImportCertificateOptionsDto": { + "properties": { + "certificate": { + "type": "string" + }, + "privateKey": { + "type": "string" + }, + "keyType": { + "$ref": "#/components/schemas/KeyType" + } + }, + "required": [ + "certificate", + "keyType" + ], + "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.", + "properties": {}, + "type": "object", + "additionalProperties": false + }, + "Key": { + "properties": { + "publicKey": { + "$ref": "#/components/schemas/Uint8Array" + }, + "keyType": { + "$ref": "#/components/schemas/KeyType" + } + }, + "required": [ + "publicKey", + "keyType" + ], + "type": "object", + "additionalProperties": false + }, + "X509Certificate": { + "properties": { + "publicKey": { + "$ref": "#/components/schemas/Key" + }, + "privateKey": { + "$ref": "#/components/schemas/Uint8Array" + } + }, + "required": [ + "publicKey" + ], + "type": "object", + "additionalProperties": false + }, "Record_string.unknown_": { "properties": {}, "additionalProperties": {}, @@ -730,20 +1126,6 @@ "type": "string", "example": "did:key:z6Mkk7yqnGF3YwTrLpqrW6PGsKci7dNqh1CjnvMbzrMerSeL" }, - "KeyType": { - "enum": [ - "ed25519", - "bls12381g1g2", - "bls12381g1", - "bls12381g2", - "x25519", - "p256", - "p384", - "p521", - "k256" - ], - "type": "string" - }, "DidCreate": { "properties": { "keyType": { @@ -1884,42 +2266,20 @@ }, "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" - }, - "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 - }, - "Key": { - "properties": { - "publicKey": { - "$ref": "#/components/schemas/Uint8Array" - }, - "keyType": { - "$ref": "#/components/schemas/KeyType" - } - }, - "required": [ - "publicKey", - "keyType" + } + }, + "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": "object", - "additionalProperties": false + "type": "string" + }, + "AgentMessage": { + "$ref": "#/components/schemas/PlaintextMessage" }, "Routing": { "properties": { @@ -3963,93 +4323,242 @@ "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" + } + }, + "securitySchemes": { + "apiKey": { + "type": "apiKey", + "name": "Authorization", + "in": "header" }, - "BasicX509CreateCertificateConfig": { - "properties": { - "countryName": { - "type": "string" - }, - "stateOrProvinceName": { - "type": "string" - }, - "organizationalUnit": { - "type": "string" - }, - "commonName": { - "type": "string" - }, - "keyType": { - "$ref": "#/components/schemas/KeyType" - }, - "issuerAlternativeNameURL": { - "type": "string" + "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" + } + } + } } }, - "required": [ - "keyType", - "issuerAlternativeNameURL" + "tags": [ + "x509" ], - "type": "object", - "additionalProperties": false - }, - "X509ImportCertificateOptionsDto": { - "properties": { - "certificate": { - "type": "string" - }, - "privateKey": { - "type": "string" - }, - "keyType": { - "$ref": "#/components/schemas/KeyType" + "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" + } + } + } } }, - "required": [ - "certificate", - "keyType" + "tags": [ + "x509" ], - "type": "object", - "additionalProperties": false + "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" + } + } + } + } }, - "X509Certificate": { - "properties": { - "publicKey": { - "$ref": "#/components/schemas/Key" - }, - "privateKey": { - "$ref": "#/components/schemas/Uint8Array" + "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" + ] } - }, - "required": [ - "publicKey" ], - "type": "object", - "additionalProperties": false - } - }, - "securitySchemes": { - "apiKey": { - "type": "apiKey", - "name": "Authorization", - "in": "header" - }, - "jwt": { - "type": "http", - "scheme": "bearer", - "bearerFormat": "JWT" + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "properties": { + "certificate": { + "type": "string" + } + }, + "required": [ + "certificate" + ], + "type": "object" + } + } + } + } } - } - }, - "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": { "/polygon/create-keys": { "post": { "operationId": "CreateKeyPair", @@ -9677,217 +10186,6 @@ } ] } - }, - "/x509": { - "post": { - "operationId": "CreateSelfSignedDCS", - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": { - "properties": { - "selfSignedx509certificateBase64": { - "type": "string" - } - }, - "required": [ - "selfSignedx509certificateBase64" - ], - "type": "object" - } - } - } - } - }, - "tags": [ - "x509" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BasicX509CreateCertificateConfig" - } - } - } - } - } - }, - "/x509/import": { - "post": { - "operationId": "ImportX509Certficates", - "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" - } - } - } - } - } } }, "servers": [ From 8995dd3584624db79ce5dafaaaba649c817d6301 Mon Sep 17 00:00:00 2001 From: Tipu_Singh Date: Mon, 13 Oct 2025 18:05:07 +0530 Subject: [PATCH 017/152] feat: oid4vc presentation Signed-off-by: Tipu_Singh --- ...0250325224513+003+sdjwt-presentation.patch | 14 + .../openid4vc/holder/holder.Controller.ts | 162 +-- .../openid4vc/holder/holder.service.ts | 548 ++++----- .../openid4vc/types/verifier.types.ts | 51 +- .../verification-sessions.Controller.ts | 19 +- .../verification-sessions.service.ts | 45 +- .../verifiers/verifier.Controller.ts | 6 +- src/routes/routes.ts | 523 +++++++- src/routes/swagger.json | 1060 +++++++++++++++-- 9 files changed, 1893 insertions(+), 535 deletions(-) create mode 100644 patches/@credo-ts+core+0.6.0-alpha-20250325224513+003+sdjwt-presentation.patch diff --git a/patches/@credo-ts+core+0.6.0-alpha-20250325224513+003+sdjwt-presentation.patch b/patches/@credo-ts+core+0.6.0-alpha-20250325224513+003+sdjwt-presentation.patch new file mode 100644 index 00000000..b47305cd --- /dev/null +++ b/patches/@credo-ts+core+0.6.0-alpha-20250325224513+003+sdjwt-presentation.patch @@ -0,0 +1,14 @@ +diff --git a/node_modules/@credo-ts/core/build/modules/sd-jwt-vc/SdJwtVcService.js b/node_modules/@credo-ts/core/build/modules/sd-jwt-vc/SdJwtVcService.js +index 20073a3..9df7a4a 100644 +--- a/node_modules/@credo-ts/core/build/modules/sd-jwt-vc/SdJwtVcService.js ++++ b/node_modules/@credo-ts/core/build/modules/sd-jwt-vc/SdJwtVcService.js +@@ -102,7 +102,8 @@ let SdJwtVcService = class SdJwtVcService { + value: d.value, + })), presentationFrame); + const [jwt] = compactSdJwtVc.split('~'); +- const sdJwt = `${jwt}~${requiredDisclosures.map((d) => d.encoded).join('~')}~`; ++ const disclosureString = requiredDisclosures.length > 0 ? `${requiredDisclosures.map((d) => d.encoded).join('~')}~` : ''; ++ const sdJwt = `${jwt}~${disclosureString}`; + const disclosedDecoded = (0, decodeSdJwtVc_1.decodeSdJwtVc)(sdJwt); + return disclosedDecoded; + } diff --git a/src/controllers/openid4vc/holder/holder.Controller.ts b/src/controllers/openid4vc/holder/holder.Controller.ts index e6724081..ef724b17 100644 --- a/src/controllers/openid4vc/holder/holder.Controller.ts +++ b/src/controllers/openid4vc/holder/holder.Controller.ts @@ -1,92 +1,92 @@ -import { Agent } from '@credo-ts/core' -import { Body, Get, Post, Route, Security, Tags } from 'tsoa' -import { injectable } from 'tsyringe' +// import { Agent } from '@credo-ts/core' +// import { Body, Controller, Get, Post, Route, Security, Tags, Request } from 'tsoa' +// import { injectable } from 'tsyringe' +// import { Request as Req } from 'express' -import { - AuthorizeRequestCredentialOffer, - RequestCredentialBody, - ResolveCredentialOfferBody, - ResolveProofRequest, -} from '../types/holder.types' +// import { +// AuthorizeRequestCredentialOffer, +// RequestCredentialBody, +// ResolveCredentialOfferBody, +// ResolveProofRequest, +// } from '../types/holder.types' -import { HolderService } from './holder.service' +// import { holderService } from './holder.service' +// import { SCOPES } from '../../../enums/enum' -@Tags('oid4vc holders') -@Security('apiKey') -@Route('openid4vc/holder') -@injectable() -export class HolderController { - private agent: Agent - private holderService: HolderService +// @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) +// } - public constructor(agent: Agent) { - this.agent = agent - this.holderService = new HolderService() - } +// /** +// * Fetch all mso mdoc credentials in wallet +// */ +// @Get('/mdoc-vcs') +// public async getMdocCredentials(@Request() request: Req) { +// return await holderService.getMdocCredentials(request) +// } - /** - * Get SdJwt type of credentials - */ - @Get('/sd-jwt-vcs') - public async getSdJwtCredentials() { - return await this.holderService.getSdJwtCredentials(this.agent) - } +// /** +// * 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) +// } - /** - * Fetch all mso mdoc credentials in wallet - */ - @Get('/mdoc-vcs') - public async getMdocCredentials() { - return await this.holderService.getMdocCredentials(this.agent) - } +// /** +// * Resolve a credential offer +// */ +// // @Post('resolve-credential-offer') +// // public async resolveCredOffer(@Body() body: ResolveCredentialOfferBody) { +// // return await this.holderService.resolveCredentialOffer(this.agent, body) +// // } - /** - * Decode mso mdoc credential in wallet - */ - @Post('/mdoc-vcs/decode') - public async decodeMdocCredential(@Body() body:{ - base64Url: string - }) { - return await this.holderService.decodeMdocCredential(this.agent, body) - } +// /** +// * Initiate an OID4VCI authorization request +// */ +// @Post('authorization-request') +// public async requestAuthorizationForCredential(@Request() request: Req, @Body() body: AuthorizeRequestCredentialOffer) { +// return await holderService.requestAuthorizationForCredential(request, body) +// } - /** - * Resolve a credential offer - */ - // @Post('resolve-credential-offer') - // public async resolveCredOffer(@Body() body: ResolveCredentialOfferBody) { - // return await this.holderService.resolveCredentialOffer(this.agent, 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) +// } - /** - * Initiate an OID4VCI authorization request - */ - @Post('authorization-request') - public async requestAuthorizationForCredential(@Body() body: AuthorizeRequestCredentialOffer) { - return await this.holderService.requestAuthorizationForCredential(this.agent, body) - } +// /** +// * Resolve a proof request +// */ +// @Post('resolve-proof-request') +// public async resolveProofRequest(@Request() request: Req, @Body() body: ResolveProofRequest) { +// return await holderService.resolveProofRequest(request, body) +// } - /** - * Initiates a token request, then requests credentials from issuer - */ - @Post('request-credential') - public async requestCredential(@Body() body: RequestCredentialBody) { - return await this.holderService.requestCredential(this.agent, body) - } +// /** +// * Accept a proof request +// */ +// @Post('accept-proof-request') +// public async acceptProofRequest(@Request() request: Req, @Body() body: ResolveProofRequest) { +// return await holderService.acceptPresentationRequest(request, body) +// } - /** - * Resolve a proof request - */ - @Post('resolve-proof-request') - public async resolveProofRequest(@Body() body: ResolveProofRequest) { - return await this.holderService.resolveProofRequest(this.agent, body) - } - - /** - * Accept a proof request - */ - @Post('accept-proof-request') - public async acceptProofRequest(@Body() body: ResolveProofRequest) { - return await this.holderService.acceptPresentationRequest(this.agent, body) - } -} +// @Post('decode-sdjwt') +// public async decodeSdJwt(@Request() request: Req, @Body() body: { jwt: string }) { +// return await holderService.decodeSdJwt(request, body) +// } +// } diff --git a/src/controllers/openid4vc/holder/holder.service.ts b/src/controllers/openid4vc/holder/holder.service.ts index ca548535..ca3a8ac8 100644 --- a/src/controllers/openid4vc/holder/holder.service.ts +++ b/src/controllers/openid4vc/holder/holder.service.ts @@ -1,267 +1,281 @@ -import type { - AuthorizeRequestCredentialOffer, - RequestCredentialBody, - ResolveCredentialOfferBody, - ResolveProofRequest, -} from '../types/holder.types' -import type { Agent } 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' - -type MappedAttributesReturnType = - | string - | number - | boolean - | { [key: string]: MappedAttributesReturnType } - | null - | undefined - | Array - -function recursivelyMapAttribues(value: unknown): MappedAttributesReturnType { - if (value === null || value === undefined || typeof value === 'number' || typeof value === 'boolean') return value - if (typeof value === 'string') return value - if (value instanceof Map) { - return Object.fromEntries(Array.from(value.entries()).map(([key, value]) => [key, recursivelyMapAttribues(value)])) - } - if (Array.isArray(value)) return value.map(recursivelyMapAttribues) - return Object.fromEntries(Object.entries(value).map(([key, value]) => [key, recursivelyMapAttribues(value)])) -} - -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(agent: Agent) { - return await agent.sdJwtVc.getAll() - } - - public async getMdocCredentials(agent: Agent) { - return await agent.mdoc.getAll() - } - - public async decodeMdocCredential(agent: Agent, 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(agent: Agent, body: ResolveCredentialOfferBody) { - // return await agent.modules.openId4VcHolderModule.resolveCredentialOffer(body.credentialOfferUri) - // } - - public async requestAuthorizationForCredential(agent: Agent, body: AuthorizeRequestCredentialOffer) { - console.log('Requesting authorization for credential offer:', body) - const resolvedCredentialOffer = await agent.modules.openId4VcHolderModule.resolveCredentialOffer( - body.credentialOfferUri, - ) - console.log('Resolved credential offer:', resolvedCredentialOffer) - const resolvedAuthorization = await this.initiateAuthorization( - agent, - resolvedCredentialOffer, - body.credentialsToRequest, - ) - - 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 - } - - return { actionToTake, authorizationRequestUrl, codeVerifier } - } - - public async requestCredential(agent: Agent, body: RequestCredentialBody) { - const resolvedCredentialOffer = await 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 - } - - return await this.requestAndStoreCredentials(agent, resolvedCredentialOffer, options) - } - - private async requestAndStoreCredentials( - agent: Agent, - resolvedCredentialOffer: OpenId4VciResolvedCredentialOffer, - options: OpenId4VciTokenRequestOptions, - ) { - const tokenResponse = await agent.modules.openId4VcHolderModule.requestToken({ ...options }) - const credentialResponse = await 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 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 agent.w3cCredentials.storeCredential({ credential }) - } - if (credential instanceof Mdoc) { - return await agent.mdoc.store(credential) - } - return await agent.sdJwtVc.store(credential.compact) - }), - ) - - return storedCredentials - } - - private async initiateAuthorization( - agent: Agent, - resolvedCredentialOffer: OpenId4VciResolvedCredentialOffer, - credentialsToRequest: string[], - ) { - console.log("agent::::::::::::::", Object.keys(agent.modules.openId4VcHolderModule)) - - console.log('Initiating authorization with resolvedCredentialOffer:', resolvedCredentialOffer) - console.log('Credentials to request:', credentialsToRequest) - - 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 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 resolved = await agent.modules.openId4VcHolderModule.resolveIssuanceAuthorizationRequest( - 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, - } - } - - return { - ...resolved, - authorizationFlow: 'Oauth2Redirect' as const, - } - } - - // ❌ Unsupported grant - throw new Error('Unsupported grant type') - } - - public async resolveProofRequest(agent: Agent, body: ResolveProofRequest) { - return await agent.modules.openId4VcHolderModule.resolveOpenId4VpAuthorizationRequest(body.proofRequestUri) - } - - public async acceptPresentationRequest(agent: Agent, body: ResolveProofRequest) { - const resolved = await agent.modules.openId4VcHolderModule.resolveOpenId4VpAuthorizationRequest( - body.proofRequestUri, - ) - const presentationExchangeService = agent.dependencyManager.resolve(DifPresentationExchangeService) - - if (!resolved.presentationExchange) throw new Error('Missing presentation exchange on request') - - const submissionResult = await agent.modules.openId4VcHolderModule.acceptOpenId4VpAuthorizationRequest({ - authorizationRequestPayload: resolved.authorizationRequestPayload, - presentationExchange: { - credentials: presentationExchangeService.selectCredentialsForRequest( - resolved.presentationExchange.credentialsForRequest, - ), - }, - }) - - return submissionResult.serverResponse - } -} +// 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' + +// public async getSdJwtCredentials(agentReq: Req) { +// return await agentReq.agent.sdJwtVc.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 resolveCredentialOffer(agent: Agent, body: ResolveCredentialOfferBody) { +// // return await agent.modules.openId4VcHolderModule.resolveCredentialOffer(body.credentialOfferUri) +// // } + +// 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) + +// 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 } +// } + +// 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 +// } + +// return await this.requestAndStoreCredentials(agentReq.req, resolvedCredentialOffer, options) +// } + +// private async requestAndStoreCredentials( +// agent: Agent, +// resolvedCredentialOffer: OpenId4VciResolvedCredentialOffer, +// options: OpenId4VciTokenRequestOptions, +// ) { +// const tokenResponse = await agent.modules.openId4VcHolderModule.requestToken({ ...options }) +// const credentialResponse = await 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 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 agent.w3cCredentials.storeCredential({ credential }) +// } +// if (credential instanceof Mdoc) { +// return await agent.mdoc.store(credential) +// } +// return await agent.sdJwtVc.store(credential.compact) +// }), +// ) + +// return storedCredentials +// } + +// private async initiateAuthorization( +// agent: Agent, +// resolvedCredentialOffer: OpenId4VciResolvedCredentialOffer, +// credentialsToRequest: string[], +// ) { +// console.log("agent::::::::::::::", Object.keys(agent.modules.openId4VcHolderModule)) + +// console.log('Initiating authorization with resolvedCredentialOffer:', resolvedCredentialOffer) +// console.log('Credentials to request:', credentialsToRequest) + +// 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 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 resolved = await agent.modules.openId4VcHolderModule.resolveIssuanceAuthorizationRequest( +// 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, +// } +// } + +// return { +// ...resolved, +// authorizationFlow: 'Oauth2Redirect' as const, +// } +// } + +// // ❌ Unsupported grant +// throw new Error('Unsupported grant type') +// } + +// public async resolveProofRequest(agent: Agent, body: ResolveProofRequest) { +// return await agent.modules.openId4VcHolderModule.resolveOpenId4VpAuthorizationRequest(body.proofRequestUri) +// } + +// public async acceptPresentationRequest(agent: Agent, body: ResolveProofRequest) { +// const resolved = await agent.modules.openId4VcHolderModule.resolveOpenId4VpAuthorizationRequest( +// body.proofRequestUri, +// ) +// console.log('Resolved proof request:', resolved) +// // const presentationExchangeService = agent.dependencyManager.resolve(DifPresentationExchangeService) + +// const dcqlService = agent.dependencyManager.resolve(DifPresentationExchangeService) + +// // console.log('Resolved proof request:', resolved) + +// // console.log('Presentation exchange service:', presentationExchangeService) + +// if (!resolved.dcql) throw new Error('Missing DCQL on request') +// console.log('DCQL query result:', resolved.dcql.queryResult) +// // +// let dcqlCredentials +// try { +// dcqlCredentials = await agent.modules.openId4VcHolder.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 agent.modules.openId4VcHolderModule.acceptOpenId4VpAuthorizationRequest({ +// authorizationRequestPayload: resolved.authorizationRequestPayload, +// dcql: { +// credentials: dcqlCredentials as DcqlCredentialsForRequest, +// }, +// }) +// console.log('Presentation submission result:', submissionResult) +// return submissionResult.serverResponse +// } + +// public async decodeSdJwt(agent: Agent, body: { jwt: string }) { +// const sdJwt = 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 {}; // Placeholder return to avoid errors +// } +// } +// export const holderService = new HolderService() \ No newline at end of file diff --git a/src/controllers/openid4vc/types/verifier.types.ts b/src/controllers/openid4vc/types/verifier.types.ts index e0fb544a..fbb17263 100644 --- a/src/controllers/openid4vc/types/verifier.types.ts +++ b/src/controllers/openid4vc/types/verifier.types.ts @@ -4,14 +4,17 @@ import type { SubmissionRequirement, Format, Issuance, InputDescriptorV2 } from export enum ResponseModeEnum { DIRECT_POST = 'direct_post', - DIRECT_POSJWT = 'direct_post.jwt', -}// export interface SubmissionRequirementModel extends SubmissionRequirement { + DIRECT_POST_JWT = 'direct_post.jwt', +} + +/* -------------------------------------------------------------------------- */ +/* PRESENTATION MODELS */ +/* -------------------------------------------------------------------------- */ export interface InputDescriptorV2Model extends InputDescriptorV2 { format?: Format group?: string[] issuance?: Issuance[] - // constraints already inherited } export interface DifPresentationExchangeDefinitionV2Model extends DifPresentationExchangeDefinitionV2 { @@ -25,13 +28,51 @@ export interface PresentationDefinition { definition: DifPresentationExchangeDefinitionV2Model } +/* -------------------------------------------------------------------------- */ +/* DCQL MODELS */ +/* -------------------------------------------------------------------------- */ + +export interface DcqlClaim { + path: string[] + intent_to_retain?: boolean +} + +export interface DcqlCredential { + id: string + format: string + meta?: Record + require_cryptographic_holder_binding?: boolean + claims: DcqlClaim[] +} + +export interface DcqlQuery { + combine?: 'all' | 'any' + credentials: DcqlCredential[] +} + +export interface DcqlDefinition { + query: DcqlQuery +} + +/* -------------------------------------------------------------------------- */ +/* AUTHORIZATION REQUEST MODEL */ +/* -------------------------------------------------------------------------- */ + export interface CreateAuthorizationRequest { verifierId: string verifierDid: string - presentationExchange: PresentationDefinition + + // Either DIF Presentation Exchange or DCQL-based query + presentationExchange?: PresentationDefinition + dcql?: string | DcqlDefinition + responseMode?: ResponseModeEnum } +/* -------------------------------------------------------------------------- */ +/* VERIFIER METADATA */ +/* -------------------------------------------------------------------------- */ + export class OpenId4VcSiopVerifierClientMetadata { client_name?: string logo_uri?: string @@ -45,4 +86,4 @@ export class OpenId4VcSiopCreateVerifierOptions { export class OpenId4VcUpdateVerifierRecordOptions { verifierId!: string clientMetadata?: OpenId4VcSiopVerifierClientMetadata -} +} \ No newline at end of file diff --git a/src/controllers/openid4vc/verifier-sessions/verification-sessions.Controller.ts b/src/controllers/openid4vc/verifier-sessions/verification-sessions.Controller.ts index 7c9c1257..aefe1a82 100644 --- a/src/controllers/openid4vc/verifier-sessions/verification-sessions.Controller.ts +++ b/src/controllers/openid4vc/verifier-sessions/verification-sessions.Controller.ts @@ -1,12 +1,13 @@ import { Agent } from '@credo-ts/core' import { OpenId4VcVerificationSessionState } from '@credo-ts/openid4vc' -import { Controller, Get, Path, Query, Route, Request, Security, Tags } from 'tsoa' +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' @Tags('oid4vc verification sessions') @Route('/openid4vc/verification-sessions') @@ -17,14 +18,14 @@ export class VerificationSessionsController extends Controller { /** * Create an authorization request, acting as a Relying Party (RP) */ -// @Post('/create-presentation-request') -// public async createProofRequest(@Body() createAuthorizationRequest: any) { -// try { -// return await verificationSessionService.createProofRequest(this.agent, createAuthorizationRequest) -// } catch (error) { -// throw ErrorHandlingService.handle(error) -// } -// } + @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 diff --git a/src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts b/src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts index e890e7c9..807bbe85 100644 --- a/src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts +++ b/src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts @@ -16,29 +16,34 @@ import { Request as Req } from 'express' @injectable() class VerificationSessionsService { -// public async createProofRequest( -// verifierAgent: Agent | Agent, -// dto: any, // CreateAuthorizationRequest -// ) { -// const didDocument = await verifierAgent.dids.resolveDidDocument(dto.verifierDid) + public async createProofRequest( + agentReq: Req, + dto: any, // CreateAuthorizationRequest + ) { + const didDocument = await agentReq.agent.dids.resolveDidDocument(dto.verifierDid) -// let verifierDidUrl: string | undefined = undefined -// if (!verifierDidUrl && didDocument.verificationMethod?.[0].id) { -// verifierDidUrl = didDocument.verificationMethod?.[0].id -// } + let verifierDidUrl: string | undefined = undefined + if (!verifierDidUrl && didDocument.verificationMethod?.[0].id) { + verifierDidUrl = didDocument.verificationMethod?.[0].id + } -// if (!verifierDidUrl) throw new Error('No matching verification method found') + if (!verifierDidUrl) throw new Error('No matching verification method found') + const temp = { + requestSigner: { + method: "did" as "did", + didUrl: verifierDidUrl, + }, + verifierId: dto.verifierId, + dcql: dto.dcql, + responseMode: dto.responseMode, + } -// return await verifierAgent.modules.openId4VcVerifier.createAuthorizationRequest({ -// requestSigner: { -// method: 'did', -// didUrl: verifierDidUrl, -// }, -// verifierId: dto.verifierId, -// presentationExchange: dto.presentationExchange, -// responseMode: dto.responseMode, -// }) -// } + console.log('Creating presentation request with params:', {...temp}) + + return await agentReq.agent.modules.openId4VcVerifier.createAuthorizationRequest({ + ...temp + }) + } public async findVerificationSessionsByQuery( agentReq: Req, diff --git a/src/controllers/openid4vc/verifiers/verifier.Controller.ts b/src/controllers/openid4vc/verifiers/verifier.Controller.ts index af8e7dbc..21266961 100644 --- a/src/controllers/openid4vc/verifiers/verifier.Controller.ts +++ b/src/controllers/openid4vc/verifiers/verifier.Controller.ts @@ -2,7 +2,7 @@ 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 { OpenId4VcSiopCreateVerifierOptions, OpenId4VcUpdateVerifierRecordOptions } from '../types/verifier.types' import { VerifierService } from '../verifiers/verifier.service' @Tags('oid4vc verifiers') @@ -19,7 +19,7 @@ export class VerifierController { * Create a new verifier and store the verifier record */ @Post('/') - public async createVerifier(@Request() request: Req, @Body() options: any) { + public async createVerifier(@Request() request: Req, @Body() options: OpenId4VcSiopCreateVerifierOptions) { return await this.verifierService.createVerifier(request, options) } @@ -30,7 +30,7 @@ export class VerifierController { public async updateVerifierMetadata( @Request() request: Req, @Path('publicVerifierId') publicVerifierId: string, - @Body() verifierRecordOptions: any, + @Body() verifierRecordOptions: OpenId4VcUpdateVerifierRecordOptions, ) { return await this.verifierService.updateVerifierMetadata(request, { verifierId: publicVerifierId, diff --git a/src/routes/routes.ts b/src/routes/routes.ts index fa10f105..51205b8e 100644 --- a/src/routes/routes.ts +++ b/src/routes/routes.ts @@ -1882,6 +1882,349 @@ const models: TsoaRoute.Models = { "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 + "OpenId4VpCreateAuthorizationRequestReturn": { + "dataType": "refObject", + "properties": { + "authorizationRequest": {"dataType":"string","required":true}, + "verificationSession": {"ref":"OpenId4VcVerificationSessionRecord","required":true}, + "authorizationRequestObject": {"dataType":"any","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 + "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"], + }, + // WARNING: This 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}, + "verifierDid": {"dataType":"string","required":true}, + "presentationExchange": {"ref":"PresentationDefinition"}, + "dcql": {"dataType":"union","subSchemas":[{"dataType":"string"},{"ref":"DcqlDefinition"}]}, + "responseMode": {"ref":"ResponseModeEnum"}, + }, + "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 "OpenId4VcVerificationSessionState": { "dataType": "refEnum", "enums": ["RequestCreated","RequestUriRetrieved","ResponseVerified","Error"], @@ -1892,6 +2235,65 @@ const models: TsoaRoute.Models = { "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","required":true}, + "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 + "BasicX509CreateCertificateConfig": { + "dataType": "refObject", + "properties": { + "countryName": {"dataType":"string"}, + "stateOrProvinceName": {"dataType":"string"}, + "organizationalUnit": {"dataType":"string"}, + "commonName": {"dataType":"string"}, + "keyType": {"ref":"KeyType","required":true}, + "issuerAlternativeNameURL": {"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 + "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 + "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 }; const templateService = new ExpressTemplateService(models, {"noImplicitAdditionalProperties":"throw-on-extras","bodyCoercion":true}); @@ -4514,44 +4916,6 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This 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_getTenants: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - 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', - authenticateMiddleware([{"jwt":["Basewallet"]}]), - ...(fetchMiddlewares(MultiTenancyController)), - ...(fetchMiddlewares(MultiTenancyController.prototype.getTenants)), - - async function MultiTenancyController_getTenants(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_getTenants, 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: 'getTenants', - 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"}, @@ -4785,7 +5149,6 @@ export function RegisterRoutes(app: Router) { const argsHolderController_getSdJwtCredentials: Record = { }; app.get('/openid4vc/holder/sd-jwt-vcs', - authenticateMiddleware([{"apiKey":[]}]), ...(fetchMiddlewares(HolderController)), ...(fetchMiddlewares(HolderController.prototype.getSdJwtCredentials)), @@ -4820,7 +5183,6 @@ export function RegisterRoutes(app: Router) { const argsHolderController_getMdocCredentials: Record = { }; app.get('/openid4vc/holder/mdoc-vcs', - authenticateMiddleware([{"apiKey":[]}]), ...(fetchMiddlewares(HolderController)), ...(fetchMiddlewares(HolderController.prototype.getMdocCredentials)), @@ -4856,7 +5218,6 @@ export function RegisterRoutes(app: Router) { body: {"in":"body","name":"body","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"base64Url":{"dataType":"string","required":true}}}, }; app.post('/openid4vc/holder/mdoc-vcs/decode', - authenticateMiddleware([{"apiKey":[]}]), ...(fetchMiddlewares(HolderController)), ...(fetchMiddlewares(HolderController.prototype.decodeMdocCredential)), @@ -4892,7 +5253,6 @@ export function RegisterRoutes(app: Router) { body: {"in":"body","name":"body","required":true,"ref":"AuthorizeRequestCredentialOffer"}, }; app.post('/openid4vc/holder/authorization-request', - authenticateMiddleware([{"apiKey":[]}]), ...(fetchMiddlewares(HolderController)), ...(fetchMiddlewares(HolderController.prototype.requestAuthorizationForCredential)), @@ -4928,7 +5288,6 @@ export function RegisterRoutes(app: Router) { body: {"in":"body","name":"body","required":true,"ref":"RequestCredentialBody"}, }; app.post('/openid4vc/holder/request-credential', - authenticateMiddleware([{"apiKey":[]}]), ...(fetchMiddlewares(HolderController)), ...(fetchMiddlewares(HolderController.prototype.requestCredential)), @@ -4964,7 +5323,6 @@ export function RegisterRoutes(app: Router) { body: {"in":"body","name":"body","required":true,"ref":"ResolveProofRequest"}, }; app.post('/openid4vc/holder/resolve-proof-request', - authenticateMiddleware([{"apiKey":[]}]), ...(fetchMiddlewares(HolderController)), ...(fetchMiddlewares(HolderController.prototype.resolveProofRequest)), @@ -5000,7 +5358,6 @@ export function RegisterRoutes(app: Router) { body: {"in":"body","name":"body","required":true,"ref":"ResolveProofRequest"}, }; app.post('/openid4vc/holder/accept-proof-request', - authenticateMiddleware([{"apiKey":[]}]), ...(fetchMiddlewares(HolderController)), ...(fetchMiddlewares(HolderController.prototype.acceptProofRequest)), @@ -5032,6 +5389,41 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This 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 = { + body: {"in":"body","name":"body","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"jwt":{"dataType":"string","required":true}}}, + }; + app.post('/openid4vc/holder/decode-sdjwt', + ...(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 argsIssuerController_createIssuer: Record = { request: {"in":"request","name":"request","required":true,"dataType":"object"}, createIssuerOptions: {"in":"body","name":"createIssuerOptions","required":true,"ref":"CreateIssuerOptions"}, @@ -5255,6 +5647,43 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This 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"}, @@ -5335,7 +5764,7 @@ export function RegisterRoutes(app: Router) { // WARNING: This 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,"dataType":"any"}, + options: {"in":"body","name":"options","required":true,"ref":"OpenId4VcSiopCreateVerifierOptions"}, }; app.post('/openid4vc/verifier', authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), @@ -5373,7 +5802,7 @@ export function RegisterRoutes(app: Router) { 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,"dataType":"any"}, + verifierRecordOptions: {"in":"body","name":"verifierRecordOptions","required":true,"ref":"OpenId4VcUpdateVerifierRecordOptions"}, }; app.put('/openid4vc/verifier/:publicVerifierId', authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), diff --git a/src/routes/swagger.json b/src/routes/swagger.json index 575ba001..137575ff 100644 --- a/src/routes/swagger.json +++ b/src/routes/swagger.json @@ -4311,6 +4311,767 @@ "OpenId4VcVerificationSessionRecord": { "$ref": "#/components/schemas/Record_string.unknown_" }, + "OpenId4VpCreateAuthorizationRequestReturn": { + "properties": { + "authorizationRequest": { + "type": "string" + }, + "verificationSession": { + "$ref": "#/components/schemas/OpenId4VcVerificationSessionRecord" + }, + "authorizationRequestObject": {} + }, + "required": [ + "authorizationRequest", + "verificationSession", + "authorizationRequestObject" + ], + "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" + ], + "type": "string" + }, + "CreateAuthorizationRequest": { + "properties": { + "verifierId": { + "type": "string" + }, + "verifierDid": { + "type": "string" + }, + "presentationExchange": { + "$ref": "#/components/schemas/PresentationDefinition" + }, + "dcql": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/components/schemas/DcqlDefinition" + } + ] + }, + "responseMode": { + "$ref": "#/components/schemas/ResponseModeEnum" + } + }, + "required": [ + "verifierId", + "verifierDid" + ], + "type": "object", + "additionalProperties": false + }, "OpenId4VcVerificationSessionState": { "enum": [ "RequestCreated", @@ -4318,11 +5079,112 @@ "ResponseVerified", "Error" ], - "type": "string" + "type": "string" + }, + "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" + } + }, + "required": [ + "verifierId" + ], + "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" + "BasicX509CreateCertificateConfig": { + "properties": { + "countryName": { + "type": "string" + }, + "stateOrProvinceName": { + "type": "string" + }, + "organizationalUnit": { + "type": "string" + }, + "commonName": { + "type": "string" + }, + "keyType": { + "$ref": "#/components/schemas/KeyType" + }, + "issuerAlternativeNameURL": { + "type": "string" + } + }, + "required": [ + "keyType", + "issuerAlternativeNameURL" + ], + "type": "object", + "additionalProperties": false + }, + "X509ImportCertificateOptionsDto": { + "properties": { + "certificate": { + "type": "string" + }, + "privateKey": { + "type": "string" + }, + "keyType": { + "$ref": "#/components/schemas/KeyType" + } + }, + "required": [ + "certificate", + "keyType" + ], + "type": "object", + "additionalProperties": false + }, + "X509Certificate": { + "properties": { + "publicKey": { + "$ref": "#/components/schemas/Key" + }, + "privateKey": { + "$ref": "#/components/schemas/Uint8Array" + } + }, + "required": [ + "publicKey" + ], + "type": "object", + "additionalProperties": false } }, "securitySchemes": { @@ -8770,68 +9632,6 @@ ] } }, - "/multi-tenancy": { - "get": { - "operationId": "GetTenants", - "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" - } - } - } - } - }, - "tags": [ - "MultiTenancy" - ], - "security": [ - { - "jwt": [ - "Basewallet" - ] - } - ], - "parameters": [] - } - }, "/openid4vc/issuance-sessions/create-credential-offer": { "post": { "operationId": "CreateCredentialOffer", @@ -9104,11 +9904,7 @@ "tags": [ "oid4vc holders" ], - "security": [ - { - "apiKey": [] - } - ], + "security": [], "parameters": [] } }, @@ -9134,11 +9930,7 @@ "tags": [ "oid4vc holders" ], - "security": [ - { - "apiKey": [] - } - ], + "security": [], "parameters": [] } }, @@ -9159,11 +9951,7 @@ "tags": [ "oid4vc holders" ], - "security": [ - { - "apiKey": [] - } - ], + "security": [], "parameters": [], "requestBody": { "required": true, @@ -9220,11 +10008,7 @@ "tags": [ "oid4vc holders" ], - "security": [ - { - "apiKey": [] - } - ], + "security": [], "parameters": [], "requestBody": { "required": true, @@ -9258,11 +10042,7 @@ "tags": [ "oid4vc holders" ], - "security": [ - { - "apiKey": [] - } - ], + "security": [], "parameters": [], "requestBody": { "required": true, @@ -9293,11 +10073,7 @@ "tags": [ "oid4vc holders" ], - "security": [ - { - "apiKey": [] - } - ], + "security": [], "parameters": [], "requestBody": { "required": true, @@ -9328,18 +10104,52 @@ "tags": [ "oid4vc holders" ], - "security": [ - { - "apiKey": [] + "security": [], + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResolveProofRequest" + } + } + } + } + } + }, + "/openid4vc/holder/decode-sdjwt": { + "post": { + "operationId": "DecodeSdJwt", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": {} + } + } } + }, + "tags": [ + "oid4vc holders" ], + "security": [], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ResolveProofRequest" + "properties": { + "jwt": { + "type": "string" + } + }, + "required": [ + "jwt" + ], + "type": "object" } } } @@ -9880,6 +10690,46 @@ ] } }, + "/openid4vc/verification-sessions/create-presentation-request": { + "post": { + "operationId": "CreateProofRequest", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenId4VpCreateAuthorizationRequestReturn" + } + } + } + } + }, + "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" + } + } + } + } + } + }, "/openid4vc/verification-sessions": { "get": { "operationId": "GetAllVerificationSessions", @@ -9898,7 +10748,7 @@ } } }, - "description": "Create an authorization request, acting as a Relying Party (RP)", + "description": "Retrieve all verification session records", "tags": [ "oid4vc verification sessions" ], @@ -10025,7 +10875,9 @@ "required": true, "content": { "application/json": { - "schema": {} + "schema": { + "$ref": "#/components/schemas/OpenId4VcSiopCreateVerifierOptions" + } } } } @@ -10112,7 +10964,9 @@ "required": true, "content": { "application/json": { - "schema": {} + "schema": { + "$ref": "#/components/schemas/OpenId4VcUpdateVerifierRecordOptions" + } } } } From 099b0a86e77103aa70cae64fc1ef02e064f7c62e Mon Sep 17 00:00:00 2001 From: Tipu_Singh Date: Tue, 14 Oct 2025 00:47:45 +0530 Subject: [PATCH 018/152] fix: create presentation Signed-off-by: Tipu_Singh --- .../openid4vc/types/verifier.types.ts | 16 +- .../verification-sessions.service.ts | 62 +-- src/routes/routes.ts | 330 +--------------- src/routes/swagger.json | 367 ++---------------- 4 files changed, 86 insertions(+), 689 deletions(-) diff --git a/src/controllers/openid4vc/types/verifier.types.ts b/src/controllers/openid4vc/types/verifier.types.ts index fbb17263..ac7b722b 100644 --- a/src/controllers/openid4vc/types/verifier.types.ts +++ b/src/controllers/openid4vc/types/verifier.types.ts @@ -57,16 +57,26 @@ export interface DcqlDefinition { /* -------------------------------------------------------------------------- */ /* AUTHORIZATION REQUEST MODEL */ /* -------------------------------------------------------------------------- */ +export interface OpenId4VcJwtIssuerDid { + method: 'did' + didUrl: string +} + +export interface OpenId4VcIssuerX5c { + method: 'x5c' + issuer: string + x5c: string[] + alg: string +} export interface CreateAuthorizationRequest { verifierId: string - verifierDid: string - - // Either DIF Presentation Exchange or DCQL-based query presentationExchange?: PresentationDefinition dcql?: string | DcqlDefinition responseMode?: ResponseModeEnum + + requestSigner: OpenId4VcJwtIssuerDid } /* -------------------------------------------------------------------------- */ diff --git a/src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts b/src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts index 807bbe85..c83cc394 100644 --- a/src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts +++ b/src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts @@ -11,40 +11,56 @@ import { import { OpenId4VcVerificationSessionState } from '@credo-ts/openid4vc' import { injectable } from 'tsyringe' import { Request as Req } from 'express' +import { CreateAuthorizationRequest } from '../types/verifier.types' // import { CreateAuthorizationRequest } from '../types/verifier.types' @injectable() class VerificationSessionsService { - public async createProofRequest( - agentReq: Req, - dto: any, // CreateAuthorizationRequest - ) { - const didDocument = await agentReq.agent.dids.resolveDidDocument(dto.verifierDid) + public async createProofRequest(agentReq: Req, dto: CreateAuthorizationRequest) { + try { + const didToResolve = dto.requestSigner?.didUrl + if (!didToResolve) { + throw new Error('No DID provided to resolve (neither requestSigner.didUrl nor verifierDid present)'); + } - let verifierDidUrl: string | undefined = undefined - if (!verifierDidUrl && didDocument.verificationMethod?.[0].id) { - verifierDidUrl = didDocument.verificationMethod?.[0].id - } + const didDocument = await agentReq.agent.dids.resolveDidDocument(didToResolve); - if (!verifierDidUrl) throw new Error('No matching verification method found') - const temp = { - requestSigner: { - method: "did" as "did", - didUrl: verifierDidUrl, - }, - verifierId: dto.verifierId, - dcql: dto.dcql, - responseMode: dto.responseMode, - } + 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'); + } + let requestSigner = dto.requestSigner; + if (!requestSigner) { + requestSigner = { method: 'did', didUrl: verifierDidUrl } as any; + } else if (requestSigner.method === 'did') { + if (!requestSigner.didUrl || !String(requestSigner.didUrl).includes('#')) { + requestSigner.didUrl = verifierDidUrl; + } + } + const options: any = { + requestSigner, + verifierId: dto.verifierId, + }; - console.log('Creating presentation request with params:', {...temp}) + 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({ - ...temp - }) + return await agentReq.agent.modules.openId4VcVerifier.createAuthorizationRequest(options); + } catch (error) { + throw error; + } } + public async findVerificationSessionsByQuery( agentReq: Req, publicVerifierId?: string, diff --git a/src/routes/routes.ts b/src/routes/routes.ts index 51205b8e..921ebcdd 100644 --- a/src/routes/routes.ts +++ b/src/routes/routes.ts @@ -34,8 +34,6 @@ import { MultiTenancyController } from './../controllers/multi-tenancy/MultiTena // WARNING: This 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 { 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 { 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'; @@ -1706,45 +1704,6 @@ const models: TsoaRoute.Models = { "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 - "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 - "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 "OpenId4VcIssuerRecord": { "dataType": "refAlias", "type": {"ref":"Record_string.unknown_","validators":{}}, @@ -2213,14 +2172,23 @@ const models: TsoaRoute.Models = { "enums": ["direct_post","direct_post.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": "refObject", + "properties": { + "method": {"dataType":"enum","enums":["did"],"required":true}, + "didUrl": {"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 "CreateAuthorizationRequest": { "dataType": "refObject", "properties": { "verifierId": {"dataType":"string","required":true}, - "verifierDid": {"dataType":"string","required":true}, "presentationExchange": {"ref":"PresentationDefinition"}, "dcql": {"dataType":"union","subSchemas":[{"dataType":"string"},{"ref":"DcqlDefinition"}]}, "responseMode": {"ref":"ResponseModeEnum"}, + "requestSigner": {"ref":"OpenId4VcJwtIssuerDid","required":true}, }, "additionalProperties": false, }, @@ -5146,284 +5114,6 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This 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 = { - }; - app.get('/openid4vc/holder/sd-jwt-vcs', - ...(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 = { - }; - app.get('/openid4vc/holder/mdoc-vcs', - ...(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 = { - body: {"in":"body","name":"body","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"base64Url":{"dataType":"string","required":true}}}, - }; - app.post('/openid4vc/holder/mdoc-vcs/decode', - ...(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_requestAuthorizationForCredential: Record = { - body: {"in":"body","name":"body","required":true,"ref":"AuthorizeRequestCredentialOffer"}, - }; - app.post('/openid4vc/holder/authorization-request', - ...(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 = { - body: {"in":"body","name":"body","required":true,"ref":"RequestCredentialBody"}, - }; - app.post('/openid4vc/holder/request-credential', - ...(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 = { - body: {"in":"body","name":"body","required":true,"ref":"ResolveProofRequest"}, - }; - app.post('/openid4vc/holder/resolve-proof-request', - ...(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 = { - body: {"in":"body","name":"body","required":true,"ref":"ResolveProofRequest"}, - }; - app.post('/openid4vc/holder/accept-proof-request', - ...(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 = { - body: {"in":"body","name":"body","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"jwt":{"dataType":"string","required":true}}}, - }; - app.post('/openid4vc/holder/decode-sdjwt', - ...(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 argsIssuerController_createIssuer: Record = { request: {"in":"request","name":"request","required":true,"dataType":"object"}, createIssuerOptions: {"in":"body","name":"createIssuerOptions","required":true,"ref":"CreateIssuerOptions"}, diff --git a/src/routes/swagger.json b/src/routes/swagger.json index 137575ff..77aa14b5 100644 --- a/src/routes/swagger.json +++ b/src/routes/swagger.json @@ -3966,71 +3966,6 @@ ], "type": "string" }, - "SdJwtVcRecord": { - "$ref": "#/components/schemas/Record_string.unknown_" - }, - "MdocRecord": { - "$ref": "#/components/schemas/Record_string.unknown_" - }, - "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 - }, "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" @@ -5040,14 +4975,31 @@ ], "type": "string" }, + "OpenId4VcJwtIssuerDid": { + "properties": { + "method": { + "type": "string", + "enum": [ + "did" + ], + "nullable": false + }, + "didUrl": { + "type": "string" + } + }, + "required": [ + "method", + "didUrl" + ], + "type": "object", + "additionalProperties": false + }, "CreateAuthorizationRequest": { "properties": { "verifierId": { "type": "string" }, - "verifierDid": { - "type": "string" - }, "presentationExchange": { "$ref": "#/components/schemas/PresentationDefinition" }, @@ -5063,11 +5015,14 @@ }, "responseMode": { "$ref": "#/components/schemas/ResponseModeEnum" + }, + "requestSigner": { + "$ref": "#/components/schemas/OpenId4VcJwtIssuerDid" } }, "required": [ "verifierId", - "verifierDid" + "requestSigner" ], "type": "object", "additionalProperties": false @@ -9882,280 +9837,6 @@ ] } }, - "/openid4vc/holder/sd-jwt-vcs": { - "get": { - "operationId": "GetSdJwtCredentials", - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": { - "items": { - "$ref": "#/components/schemas/SdJwtVcRecord" - }, - "type": "array" - } - } - } - } - }, - "description": "Get SdJwt type of credentials", - "tags": [ - "oid4vc holders" - ], - "security": [], - "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": [] - } - }, - "/openid4vc/holder/mdoc-vcs/decode": { - "post": { - "operationId": "DecodeMdocCredential", - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": {} - } - } - } - }, - "description": "Decode mso mdoc credential in wallet", - "tags": [ - "oid4vc holders" - ], - "security": [], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "properties": { - "base64Url": { - "type": "string" - } - }, - "required": [ - "base64Url" - ], - "type": "object" - } - } - } - } - } - }, - "/openid4vc/holder/authorization-request": { - "post": { - "operationId": "RequestAuthorizationForCredential", - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": { - "properties": { - "codeVerifier": { - "type": "string" - }, - "authorizationRequestUrl": { - "type": "string" - }, - "actionToTake": { - "type": "string" - } - }, - "required": [ - "codeVerifier", - "authorizationRequestUrl", - "actionToTake" - ], - "type": "object" - } - } - } - } - }, - "description": "Resolve a credential offer", - "tags": [ - "oid4vc holders" - ], - "security": [], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AuthorizeRequestCredentialOffer" - } - } - } - } - } - }, - "/openid4vc/holder/request-credential": { - "post": { - "operationId": "RequestCredential", - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": { - "items": {}, - "type": "array" - } - } - } - } - }, - "description": "Initiates a token request, then requests credentials from issuer", - "tags": [ - "oid4vc holders" - ], - "security": [], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RequestCredentialBody" - } - } - } - } - } - }, - "/openid4vc/holder/resolve-proof-request": { - "post": { - "operationId": "ResolveProofRequest", - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": {} - } - } - } - }, - "description": "Resolve a proof request", - "tags": [ - "oid4vc holders" - ], - "security": [], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ResolveProofRequest" - } - } - } - } - } - }, - "/openid4vc/holder/accept-proof-request": { - "post": { - "operationId": "AcceptProofRequest", - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": {} - } - } - } - }, - "description": "Accept a proof request", - "tags": [ - "oid4vc holders" - ], - "security": [], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ResolveProofRequest" - } - } - } - } - } - }, - "/openid4vc/holder/decode-sdjwt": { - "post": { - "operationId": "DecodeSdJwt", - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": {} - } - } - } - }, - "tags": [ - "oid4vc holders" - ], - "security": [], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "properties": { - "jwt": { - "type": "string" - } - }, - "required": [ - "jwt" - ], - "type": "object" - } - } - } - } - } - }, "/openid4vc/issuer": { "post": { "operationId": "CreateIssuer", From bc3dff46f9fd8bb193b9ac4853bc47d346584335 Mon Sep 17 00:00:00 2001 From: Tipu_Singh Date: Tue, 14 Oct 2025 14:41:45 +0530 Subject: [PATCH 019/152] fix: holder APIs type issue Signed-off-by: Tipu_Singh --- .../openid4vc/holder/holder.Controller.ts | 154 ++--- .../openid4vc/holder/holder.service.ts | 561 +++++++++--------- src/routes/routes.ts | 396 ++++++++++++- src/routes/swagger.json | 505 ++++++++++++++-- 4 files changed, 1183 insertions(+), 433 deletions(-) diff --git a/src/controllers/openid4vc/holder/holder.Controller.ts b/src/controllers/openid4vc/holder/holder.Controller.ts index ef724b17..846f336e 100644 --- a/src/controllers/openid4vc/holder/holder.Controller.ts +++ b/src/controllers/openid4vc/holder/holder.Controller.ts @@ -1,92 +1,92 @@ -// import { Agent } from '@credo-ts/core' -// import { Body, Controller, Get, Post, Route, Security, Tags, Request } from 'tsoa' -// import { injectable } from 'tsyringe' -// import { Request as Req } from 'express' +import { Agent } from '@credo-ts/core' +import { Body, Controller, Get, Post, Route, Security, Tags, Request } from 'tsoa' +import { injectable } from 'tsyringe' +import { Request as Req } from 'express' -// import { -// AuthorizeRequestCredentialOffer, -// RequestCredentialBody, -// ResolveCredentialOfferBody, -// ResolveProofRequest, -// } from '../types/holder.types' +import { + AuthorizeRequestCredentialOffer, + RequestCredentialBody, + ResolveCredentialOfferBody, + ResolveProofRequest, +} from '../types/holder.types' -// import { holderService } from './holder.service' -// import { SCOPES } from '../../../enums/enum' +import { holderService } from './holder.service' +import { SCOPES } from '../../../enums/enum' -// @Tags('oid4vc holders') -// @Security('jwt', [SCOPES.TENANT_AGENT, SCOPES.DEDICATED_AGENT]) -// @Route('openid4vc/holder') -// @injectable() -// export class HolderController extends Controller { +@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) -// } + /** + * 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(@Body() body: ResolveCredentialOfferBody) { -// // return await this.holderService.resolveCredentialOffer(this.agent, 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) -// } + @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) -// } -// } + @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 ca3a8ac8..8ebe8282 100644 --- a/src/controllers/openid4vc/holder/holder.service.ts +++ b/src/controllers/openid4vc/holder/holder.service.ts @@ -1,281 +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 { -// 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 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 resolveCredentialOffer(agent: Agent, body: ResolveCredentialOfferBody) { -// // return await agent.modules.openId4VcHolderModule.resolveCredentialOffer(body.credentialOfferUri) -// // } - -// 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) - -// 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 } -// } - -// 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 -// } - -// return await this.requestAndStoreCredentials(agentReq.req, resolvedCredentialOffer, options) -// } - -// private async requestAndStoreCredentials( -// agent: Agent, -// resolvedCredentialOffer: OpenId4VciResolvedCredentialOffer, -// options: OpenId4VciTokenRequestOptions, -// ) { -// const tokenResponse = await agent.modules.openId4VcHolderModule.requestToken({ ...options }) -// const credentialResponse = await 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 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 agent.w3cCredentials.storeCredential({ credential }) -// } -// if (credential instanceof Mdoc) { -// return await agent.mdoc.store(credential) -// } -// return await agent.sdJwtVc.store(credential.compact) -// }), -// ) - -// return storedCredentials -// } - -// private async initiateAuthorization( -// agent: Agent, -// resolvedCredentialOffer: OpenId4VciResolvedCredentialOffer, -// credentialsToRequest: string[], -// ) { -// console.log("agent::::::::::::::", Object.keys(agent.modules.openId4VcHolderModule)) - -// console.log('Initiating authorization with resolvedCredentialOffer:', resolvedCredentialOffer) -// console.log('Credentials to request:', credentialsToRequest) - -// 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 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 resolved = await agent.modules.openId4VcHolderModule.resolveIssuanceAuthorizationRequest( -// 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, -// } -// } - -// return { -// ...resolved, -// authorizationFlow: 'Oauth2Redirect' as const, -// } -// } - -// // ❌ Unsupported grant -// throw new Error('Unsupported grant type') -// } - -// public async resolveProofRequest(agent: Agent, body: ResolveProofRequest) { -// return await agent.modules.openId4VcHolderModule.resolveOpenId4VpAuthorizationRequest(body.proofRequestUri) -// } - -// public async acceptPresentationRequest(agent: Agent, body: ResolveProofRequest) { -// const resolved = await agent.modules.openId4VcHolderModule.resolveOpenId4VpAuthorizationRequest( -// body.proofRequestUri, -// ) -// console.log('Resolved proof request:', resolved) -// // const presentationExchangeService = agent.dependencyManager.resolve(DifPresentationExchangeService) - -// const dcqlService = agent.dependencyManager.resolve(DifPresentationExchangeService) - -// // console.log('Resolved proof request:', resolved) - -// // console.log('Presentation exchange service:', presentationExchangeService) - -// if (!resolved.dcql) throw new Error('Missing DCQL on request') -// console.log('DCQL query result:', resolved.dcql.queryResult) -// // -// let dcqlCredentials -// try { -// dcqlCredentials = await agent.modules.openId4VcHolder.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 agent.modules.openId4VcHolderModule.acceptOpenId4VpAuthorizationRequest({ -// authorizationRequestPayload: resolved.authorizationRequestPayload, -// dcql: { -// credentials: dcqlCredentials as DcqlCredentialsForRequest, -// }, -// }) -// console.log('Presentation submission result:', submissionResult) -// return submissionResult.serverResponse -// } - -// public async decodeSdJwt(agent: Agent, body: { jwt: string }) { -// const sdJwt = 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 {}; // Placeholder return to avoid errors -// } -// } -// export const holderService = new HolderService() \ No newline at end of file +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' + + public async getSdJwtCredentials(agentReq: Req) { + return await agentReq.agent.sdJwtVc.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 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, + ) + + 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 + } + + return { actionToTake, authorizationRequestUrl, codeVerifier } as any + } + + 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 + } + + return await this.requestAndStoreCredentials(agentReq, resolvedCredentialOffer, options) 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, + }) + + 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 + } + + private async initiateAuthorization( + agentReq: Req, + resolvedCredentialOffer: OpenId4VciResolvedCredentialOffer, + credentialsToRequest: string[], + ) { + console.log("agent::::::::::::::", Object.keys(agentReq.agent.modules.openId4VcHolderModule)) + + console.log('Initiating authorization with resolvedCredentialOffer:', resolvedCredentialOffer) + console.log('Credentials to request:', credentialsToRequest) + + 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 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 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, + } + } + + return { + ...resolved, + authorizationFlow: 'Oauth2Redirect' as const, + } as any + } + + // ❌ 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 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) + + const dcqlService = agentReq.agent.dependencyManager.resolve(DifPresentationExchangeService) + + // console.log('Resolved proof request:', resolved) + + // console.log('Presentation exchange service:', presentationExchangeService) + + 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 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() \ No newline at end of file diff --git a/src/routes/routes.ts b/src/routes/routes.ts index 921ebcdd..569421c1 100644 --- a/src/routes/routes.ts +++ b/src/routes/routes.ts @@ -38,6 +38,8 @@ import { IssuerController } from './../controllers/openid4vc/issuers/issuer.Cont // WARNING: This 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 @@ -2198,66 +2200,81 @@ const models: TsoaRoute.Models = { "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 - "OpenId4VcVerifierRecord": { + "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 - "OpenId4VcSiopVerifierClientMetadata": { + "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": { - "client_name": {"dataType":"string"}, - "logo_uri": {"dataType":"string"}, + "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 - "OpenId4VcSiopCreateVerifierOptions": { + "AuthorizeRequestCredentialOffer": { "dataType": "refObject", "properties": { - "verifierId": {"dataType":"string"}, - "clientMetadata": {"ref":"OpenId4VcSiopVerifierClientMetadata"}, + "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 - "OpenId4VcUpdateVerifierRecordOptions": { + "RequestCredentialBody": { "dataType": "refObject", "properties": { - "verifierId": {"dataType":"string","required":true}, - "clientMetadata": {"ref":"OpenId4VcSiopVerifierClientMetadata"}, + "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 - "BasicX509CreateCertificateConfig": { + "ResolveProofRequest": { "dataType": "refObject", "properties": { - "countryName": {"dataType":"string"}, - "stateOrProvinceName": {"dataType":"string"}, - "organizationalUnit": {"dataType":"string"}, - "commonName": {"dataType":"string"}, - "keyType": {"ref":"KeyType","required":true}, - "issuerAlternativeNameURL": {"dataType":"string","required":true}, + "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 - "X509ImportCertificateOptionsDto": { + "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": { - "certificate": {"dataType":"string","required":true}, - "privateKey": {"dataType":"string"}, - "keyType": {"ref":"KeyType","required":true}, + "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 - "X509Certificate": { + "OpenId4VcSiopCreateVerifierOptions": { "dataType": "refObject", "properties": { - "publicKey": {"ref":"Key","required":true}, - "privateKey": {"ref":"Uint8Array"}, + "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","required":true}, + "clientMetadata": {"ref":"OpenId4VcSiopVerifierClientMetadata"}, }, "additionalProperties": false, }, @@ -5452,6 +5469,337 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This 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"}, diff --git a/src/routes/swagger.json b/src/routes/swagger.json index 77aa14b5..e4245c2e 100644 --- a/src/routes/swagger.json +++ b/src/routes/swagger.json @@ -5036,107 +5036,122 @@ ], "type": "string" }, - "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" + "SdJwtVcRecord": { + "$ref": "#/components/schemas/Record_string.unknown_" }, - "OpenId4VcSiopVerifierClientMetadata": { - "properties": { - "client_name": { - "type": "string" - }, - "logo_uri": { - "type": "string" - } - }, - "type": "object", - "additionalProperties": false + "MdocRecord": { + "$ref": "#/components/schemas/Record_string.unknown_" }, - "OpenId4VcSiopCreateVerifierOptions": { + "ResolveCredentialOfferBody": { "properties": { - "verifierId": { + "credentialOfferUri": { "type": "string" - }, - "clientMetadata": { - "$ref": "#/components/schemas/OpenId4VcSiopVerifierClientMetadata" } }, + "required": [ + "credentialOfferUri" + ], "type": "object", "additionalProperties": false }, - "OpenId4VcUpdateVerifierRecordOptions": { + "AuthorizeRequestCredentialOffer": { "properties": { - "verifierId": { + "credentialOfferUri": { "type": "string" }, - "clientMetadata": { - "$ref": "#/components/schemas/OpenId4VcSiopVerifierClientMetadata" + "credentialsToRequest": { + "items": { + "type": "string" + }, + "type": "array" } }, "required": [ - "verifierId" + "credentialOfferUri", + "credentialsToRequest" ], "type": "object", "additionalProperties": false }, - "BasicX509CreateCertificateConfig": { + "RequestCredentialBody": { "properties": { - "countryName": { + "credentialOfferUri": { "type": "string" }, - "stateOrProvinceName": { - "type": "string" + "credentialsToRequest": { + "items": { + "type": "string" + }, + "type": "array" }, - "organizationalUnit": { + "authorizationCode": { "type": "string" }, - "commonName": { + "codeVerifier": { "type": "string" }, - "keyType": { - "$ref": "#/components/schemas/KeyType" - }, - "issuerAlternativeNameURL": { + "txCode": { "type": "string" } }, "required": [ - "keyType", - "issuerAlternativeNameURL" + "credentialOfferUri", + "credentialsToRequest" ], "type": "object", "additionalProperties": false }, - "X509ImportCertificateOptionsDto": { + "ResolveProofRequest": { "properties": { - "certificate": { + "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" }, - "privateKey": { + "logo_uri": { + "type": "string" + } + }, + "type": "object", + "additionalProperties": false + }, + "OpenId4VcSiopCreateVerifierOptions": { + "properties": { + "verifierId": { "type": "string" }, - "keyType": { - "$ref": "#/components/schemas/KeyType" + "clientMetadata": { + "$ref": "#/components/schemas/OpenId4VcSiopVerifierClientMetadata" } }, - "required": [ - "certificate", - "keyType" - ], "type": "object", "additionalProperties": false }, - "X509Certificate": { + "OpenId4VcUpdateVerifierRecordOptions": { "properties": { - "publicKey": { - "$ref": "#/components/schemas/Key" + "verifierId": { + "type": "string" }, - "privateKey": { - "$ref": "#/components/schemas/Uint8Array" + "clientMetadata": { + "$ref": "#/components/schemas/OpenId4VcSiopVerifierClientMetadata" } }, "required": [ - "publicKey" + "verifierId" ], "type": "object", "additionalProperties": false @@ -10524,6 +10539,394 @@ ] } }, + "/openid4vc/holder/sd-jwt-vcs": { + "get": { + "operationId": "GetSdJwtCredentials", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/SdJwtVcRecord" + }, + "type": "array" + } + } + } + } + }, + "description": "Get SdJwt type of credentials", + "tags": [ + "oid4vc holders" + ], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } + ], + "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": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } + ], + "parameters": [] + } + }, + "/openid4vc/holder/mdoc-vcs/decode": { + "post": { + "operationId": "DecodeMdocCredential", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": {} + } + } + } + }, + "description": "Decode mso mdoc credential in wallet", + "tags": [ + "oid4vc holders" + ], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "properties": { + "base64Url": { + "type": "string" + } + }, + "required": [ + "base64Url" + ], + "type": "object" + } + } + } + } + } + }, + "/openid4vc/holder/resolve-credential-offer": { + "post": { + "operationId": "ResolveCredOffer", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": {} + } + } + } + }, + "description": "Resolve a credential offer", + "tags": [ + "oid4vc holders" + ], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResolveCredentialOfferBody" + } + } + } + } + } + }, + "/openid4vc/holder/authorization-request": { + "post": { + "operationId": "RequestAuthorizationForCredential", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": {} + } + } + } + }, + "tags": [ + "oid4vc holders" + ], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthorizeRequestCredentialOffer" + } + } + } + } + } + }, + "/openid4vc/holder/request-credential": { + "post": { + "operationId": "RequestCredential", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": {} + } + } + } + }, + "description": "Initiates a token request, then requests credentials from issuer", + "tags": [ + "oid4vc holders" + ], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RequestCredentialBody" + } + } + } + } + } + }, + "/openid4vc/holder/resolve-proof-request": { + "post": { + "operationId": "ResolveProofRequest", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": {} + } + } + } + }, + "description": "Resolve a proof request", + "tags": [ + "oid4vc holders" + ], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResolveProofRequest" + } + } + } + } + } + }, + "/openid4vc/holder/accept-proof-request": { + "post": { + "operationId": "AcceptProofRequest", + "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" + } + ] + } + } + } + } + }, + "description": "Accept a proof request", + "tags": [ + "oid4vc holders" + ], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResolveProofRequest" + } + } + } + } + } + }, + "/openid4vc/holder/decode-sdjwt": { + "post": { + "operationId": "DecodeSdJwt", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": {} + } + } + } + }, + "tags": [ + "oid4vc holders" + ], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "properties": { + "jwt": { + "type": "string" + } + }, + "required": [ + "jwt" + ], + "type": "object" + } + } + } + } + } + }, "/openid4vc/verifier": { "post": { "operationId": "CreateVerifier", From c12c106b9c55ee6d3d4a8e25a404795835b6a58d Mon Sep 17 00:00:00 2001 From: Rinkal Bhojani Date: Tue, 21 Oct 2025 17:12:40 +0530 Subject: [PATCH 020/152] added verification response method once proof is received for DCQL Signed-off-by: Rinkal Bhojani --- .../verification-sessions.Controller.ts | 30 +- .../verification-sessions.service.ts | 168 ++++--- src/routes/routes.ts | 369 ++------------- src/routes/swagger.json | 445 +++--------------- 4 files changed, 241 insertions(+), 771 deletions(-) diff --git a/src/controllers/openid4vc/verifier-sessions/verification-sessions.Controller.ts b/src/controllers/openid4vc/verifier-sessions/verification-sessions.Controller.ts index aefe1a82..20d47555 100644 --- a/src/controllers/openid4vc/verifier-sessions/verification-sessions.Controller.ts +++ b/src/controllers/openid4vc/verifier-sessions/verification-sessions.Controller.ts @@ -14,12 +14,14 @@ import { CreateAuthorizationRequest } from '../types/verifier.types' @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) { + public async createProofRequest( + @Request() request: Req, + @Body() createAuthorizationRequest: CreateAuthorizationRequest, + ) { try { return await verificationSessionService.createProofRequest(request, createAuthorizationRequest) } catch (error) { @@ -57,7 +59,10 @@ export class VerificationSessionsController extends Controller { * Get verification session by ID */ @Get('/:verificationSessionId') - public async getVerificationSessionsById(@Request() request: Req, @Path('verificationSessionId') verificationSessionId: string) { + public async getVerificationSessionsById( + @Request() request: Req, + @Path('verificationSessionId') verificationSessionId: string, + ) { try { return await verificationSessionService.getVerificationSessionsById(request, verificationSessionId) } catch (error) { @@ -68,12 +73,15 @@ export class VerificationSessionsController extends Controller { // /** // * Get verification response by verification Session ID // */ - // @Get('/response/:verificationSessionId') - // public async getVerifiedAuthorizationResponse(@Path('verificationSessionId') verificationSessionId: string) { - // try { - // return await verificationSessionService.getVerifiedAuthorizationResponse(this.agent, verificationSessionId) - // } catch (error) { - // throw ErrorHandlingService.handle(error) - // } - // } + @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 c83cc394..319a49b6 100644 --- a/src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts +++ b/src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts @@ -4,7 +4,12 @@ import { Agent, ClaimFormat, DidKey, + JsonEncoder, + JsonTransformer, Jwt, + MdocDeviceResponse, + RecordNotFoundError, + TypedArrayEncoder, W3cJsonLdVerifiablePresentation, W3cJwtVerifiablePresentation, } from '@credo-ts/core' @@ -21,46 +26,45 @@ class VerificationSessionsService { try { const didToResolve = dto.requestSigner?.didUrl if (!didToResolve) { - throw new Error('No DID provided to resolve (neither requestSigner.didUrl nor verifierDid present)'); + throw new Error('No DID provided to resolve (neither requestSigner.didUrl nor verifierDid present)') } - const didDocument = await agentReq.agent.dids.resolveDidDocument(didToResolve); + const didDocument = await agentReq.agent.dids.resolveDidDocument(didToResolve) - let verifierDidUrl: string | undefined = undefined; + let verifierDidUrl: string | undefined = undefined if (didDocument.verificationMethod?.[0]?.id) { - verifierDidUrl = didDocument.verificationMethod[0].id; + verifierDidUrl = didDocument.verificationMethod[0].id } if (!verifierDidUrl) { - throw new Error('No matching verification method found on verifier DID document'); + throw new Error('No matching verification method found on verifier DID document') } - let requestSigner = dto.requestSigner; + let requestSigner = dto.requestSigner if (!requestSigner) { - requestSigner = { method: 'did', didUrl: verifierDidUrl } as any; + requestSigner = { method: 'did', didUrl: verifierDidUrl } as any } else if (requestSigner.method === 'did') { if (!requestSigner.didUrl || !String(requestSigner.didUrl).includes('#')) { - requestSigner.didUrl = verifierDidUrl; + requestSigner.didUrl = verifierDidUrl } } const options: any = { requestSigner, verifierId: dto.verifierId, - }; + } - if (dto.responseMode) options.responseMode = dto.responseMode; + if (dto.responseMode) options.responseMode = dto.responseMode if (dto.presentationExchange) { - options.presentationExchange = dto.presentationExchange; + options.presentationExchange = dto.presentationExchange } else if (dto.dcql) { - options.dcql = dto.dcql; + options.dcql = dto.dcql } - return await agentReq.agent.modules.openId4VcVerifier.createAuthorizationRequest(options); + return (await agentReq.agent.modules.openId4VcVerifier.createAuthorizationRequest(options)) as any } catch (error) { - throw error; + throw error } } - public async findVerificationSessionsByQuery( agentReq: Req, publicVerifierId?: string, @@ -78,53 +82,105 @@ class VerificationSessionsService { }) } - public async getVerificationSessionsById( - agentReq: Req, - verificationSessionId: string, - ) { + public async getVerificationSessionsById(agentReq: Req, verificationSessionId: string) { return await agentReq.agent.modules.openId4VcVerifier.getVerificationSessionById(verificationSessionId) } - public async getVerifiedAuthorizationResponse( - verifierAgent: Agent | Agent, - verificationSessionId: string, - ) { - const verifiedAuthorizationResponse = - await verifierAgent.modules.openId4VcVerifier.getVerifiedAuthorizationResponse(verificationSessionId) - - const presentations = verifiedAuthorizationResponse.presentationExchange?.presentations.map((presentation) => { - if (presentation instanceof W3cJsonLdVerifiablePresentation) { - return { - format: presentation.claimFormat, - encoded: presentation.toJSON(), - vcPayload: presentation.toJSON(), - } - } else if (presentation instanceof W3cJwtVerifiablePresentation) { - return { - format: presentation.claimFormat, - encoded: presentation.serializedJwt, - vcPayload: presentation.presentation.toJSON(), - signedPayload: presentation.jwt.payload.toJson(), - header: presentation.jwt.header, - } - } else { - const sdJwtPresentation: any = presentation - return { - format: ClaimFormat.SdJwtVc, - encoded: sdJwtPresentation.compact, - vcPayload: sdJwtPresentation.prettyClaims, - signedPayload: sdJwtPresentation.payload, - header: sdJwtPresentation.header as Jwt['header'], - } - } - }) + 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 { - ...verifiedAuthorizationResponse, - presentationExchange: verifiedAuthorizationResponse.presentationExchange - ? { ...verifiedAuthorizationResponse.presentationExchange, presentations } + 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 } } diff --git a/src/routes/routes.ts b/src/routes/routes.ts index 569421c1..64a44b45 100644 --- a/src/routes/routes.ts +++ b/src/routes/routes.ts @@ -1838,21 +1838,6 @@ const models: TsoaRoute.Models = { "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 - "OpenId4VpCreateAuthorizationRequestReturn": { - "dataType": "refObject", - "properties": { - "authorizationRequest": {"dataType":"string","required":true}, - "verificationSession": {"ref":"OpenId4VcVerificationSessionRecord","required":true}, - "authorizationRequestObject": {"dataType":"any","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 "JwtObject": { "dataType": "refObject", "properties": { @@ -2195,6 +2180,11 @@ const models: TsoaRoute.Models = { "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"], @@ -5131,6 +5121,43 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This 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_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/issuance-sessions/decode-sdjwt', + authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), + ...(fetchMiddlewares(IssuanceSessionsController)), + ...(fetchMiddlewares(IssuanceSessionsController.prototype.decodeSdJwt)), + + async function IssuanceSessionsController_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: argsIssuanceSessionsController_decodeSdJwt, 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: '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 argsIssuerController_createIssuer: Record = { request: {"in":"request","name":"request","required":true,"dataType":"object"}, createIssuerOptions: {"in":"body","name":"createIssuerOptions","required":true,"ref":"CreateIssuerOptions"}, @@ -5469,326 +5496,32 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This 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 = { + 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/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', + app.get('/openid4vc/verification-sessions/response/:verificationSessionId', authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(HolderController)), - ...(fetchMiddlewares(HolderController.prototype.decodeSdJwt)), + ...(fetchMiddlewares(VerificationSessionsController)), + ...(fetchMiddlewares(VerificationSessionsController.prototype.getVerifiedAuthorizationResponse)), - async function HolderController_decodeSdJwt(request: ExRequest, response: ExResponse, next: any) { + 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: argsHolderController_decodeSdJwt, request, response }); + 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(HolderController); + const controller: any = await container.get(VerificationSessionsController); if (typeof controller['setStatus'] === 'function') { controller.setStatus(undefined); } await templateService.apiHandler({ - methodName: 'decodeSdJwt', + methodName: 'getVerifiedAuthorizationResponse', controller, response, next, diff --git a/src/routes/swagger.json b/src/routes/swagger.json index e4245c2e..21069785 100644 --- a/src/routes/swagger.json +++ b/src/routes/swagger.json @@ -4243,27 +4243,6 @@ "type": "object", "additionalProperties": false }, - "OpenId4VcVerificationSessionRecord": { - "$ref": "#/components/schemas/Record_string.unknown_" - }, - "OpenId4VpCreateAuthorizationRequestReturn": { - "properties": { - "authorizationRequest": { - "type": "string" - }, - "verificationSession": { - "$ref": "#/components/schemas/OpenId4VcVerificationSessionRecord" - }, - "authorizationRequestObject": {} - }, - "required": [ - "authorizationRequest", - "verificationSession", - "authorizationRequestObject" - ], - "type": "object", - "additionalProperties": false - }, "JwtObject": { "properties": { "alg": { @@ -5027,6 +5006,9 @@ "type": "object", "additionalProperties": false }, + "OpenId4VcVerificationSessionRecord": { + "$ref": "#/components/schemas/Record_string.unknown_" + }, "OpenId4VcVerificationSessionState": { "enum": [ "RequestCreated", @@ -9852,6 +9834,51 @@ ] } }, + "/openid4vc/issuance-sessions/decode-sdjwt": { + "post": { + "operationId": "DecodeSdJwt", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": {} + } + } + } + }, + "tags": [ + "oid4vc issuance sessions" + ], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "properties": { + "jwt": { + "type": "string" + } + }, + "required": [ + "jwt" + ], + "type": "object" + } + } + } + } + } + }, "/openid4vc/issuer": { "post": { "operationId": "CreateIssuer", @@ -10394,9 +10421,7 @@ "description": "Ok", "content": { "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenId4VpCreateAuthorizationRequestReturn" - } + "schema": {} } } } @@ -10539,121 +10564,9 @@ ] } }, - "/openid4vc/holder/sd-jwt-vcs": { - "get": { - "operationId": "GetSdJwtCredentials", - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": { - "items": { - "$ref": "#/components/schemas/SdJwtVcRecord" - }, - "type": "array" - } - } - } - } - }, - "description": "Get SdJwt type of credentials", - "tags": [ - "oid4vc holders" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [] - } - }, - "/openid4vc/holder/mdoc-vcs": { + "/openid4vc/verification-sessions/response/{verificationSessionId}": { "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": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [] - } - }, - "/openid4vc/holder/mdoc-vcs/decode": { - "post": { - "operationId": "DecodeMdocCredential", - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": {} - } - } - } - }, - "description": "Decode mso mdoc credential in wallet", - "tags": [ - "oid4vc holders" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "properties": { - "base64Url": { - "type": "string" - } - }, - "required": [ - "base64Url" - ], - "type": "object" - } - } - } - } - } - }, - "/openid4vc/holder/resolve-credential-offer": { - "post": { - "operationId": "ResolveCredOffer", + "operationId": "GetVerifiedAuthorizationResponse", "responses": { "200": { "description": "Ok", @@ -10664,202 +10577,8 @@ } } }, - "description": "Resolve a credential offer", "tags": [ - "oid4vc holders" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ResolveCredentialOfferBody" - } - } - } - } - } - }, - "/openid4vc/holder/authorization-request": { - "post": { - "operationId": "RequestAuthorizationForCredential", - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": {} - } - } - } - }, - "tags": [ - "oid4vc holders" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AuthorizeRequestCredentialOffer" - } - } - } - } - } - }, - "/openid4vc/holder/request-credential": { - "post": { - "operationId": "RequestCredential", - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": {} - } - } - } - }, - "description": "Initiates a token request, then requests credentials from issuer", - "tags": [ - "oid4vc holders" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RequestCredentialBody" - } - } - } - } - } - }, - "/openid4vc/holder/resolve-proof-request": { - "post": { - "operationId": "ResolveProofRequest", - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": {} - } - } - } - }, - "description": "Resolve a proof request", - "tags": [ - "oid4vc holders" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ResolveProofRequest" - } - } - } - } - } - }, - "/openid4vc/holder/accept-proof-request": { - "post": { - "operationId": "AcceptProofRequest", - "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" - } - ] - } - } - } - } - }, - "description": "Accept a proof request", - "tags": [ - "oid4vc holders" + "oid4vc verification sessions" ], "security": [ { @@ -10869,62 +10588,16 @@ ] } ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ResolveProofRequest" - } - } - } - } - } - }, - "/openid4vc/holder/decode-sdjwt": { - "post": { - "operationId": "DecodeSdJwt", - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": {} - } - } - } - }, - "tags": [ - "oid4vc holders" - ], - "security": [ + "parameters": [ { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "properties": { - "jwt": { - "type": "string" - } - }, - "required": [ - "jwt" - ], - "type": "object" - } + "in": "path", + "name": "verificationSessionId", + "required": true, + "schema": { + "type": "string" } } - } + ] } }, "/openid4vc/verifier": { From 2200b03d41d2edbd99098134f79194e61af28fa6 Mon Sep 17 00:00:00 2001 From: Rinkal Bhojani Date: Tue, 21 Oct 2025 17:40:10 +0530 Subject: [PATCH 021/152] updated route and swagger.json file Signed-off-by: Rinkal Bhojani --- src/routes/routes.ts | 368 ++++++++++++++++++++++++++++++---- src/routes/swagger.json | 433 +++++++++++++++++++++++++++++++++++----- 2 files changed, 719 insertions(+), 82 deletions(-) diff --git a/src/routes/routes.ts b/src/routes/routes.ts index 64a44b45..ea22ab1a 100644 --- a/src/routes/routes.ts +++ b/src/routes/routes.ts @@ -5121,43 +5121,6 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This 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_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/issuance-sessions/decode-sdjwt', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(IssuanceSessionsController)), - ...(fetchMiddlewares(IssuanceSessionsController.prototype.decodeSdJwt)), - - async function IssuanceSessionsController_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: argsIssuanceSessionsController_decodeSdJwt, 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: '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 argsIssuerController_createIssuer: Record = { request: {"in":"request","name":"request","required":true,"dataType":"object"}, createIssuerOptions: {"in":"body","name":"createIssuerOptions","required":true,"ref":"CreateIssuerOptions"}, @@ -5533,6 +5496,337 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This 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"}, diff --git a/src/routes/swagger.json b/src/routes/swagger.json index 21069785..135c17d3 100644 --- a/src/routes/swagger.json +++ b/src/routes/swagger.json @@ -9834,51 +9834,6 @@ ] } }, - "/openid4vc/issuance-sessions/decode-sdjwt": { - "post": { - "operationId": "DecodeSdJwt", - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": {} - } - } - } - }, - "tags": [ - "oid4vc issuance sessions" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "properties": { - "jwt": { - "type": "string" - } - }, - "required": [ - "jwt" - ], - "type": "object" - } - } - } - } - } - }, "/openid4vc/issuer": { "post": { "operationId": "CreateIssuer", @@ -10600,6 +10555,394 @@ ] } }, + "/openid4vc/holder/sd-jwt-vcs": { + "get": { + "operationId": "GetSdJwtCredentials", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/SdJwtVcRecord" + }, + "type": "array" + } + } + } + } + }, + "description": "Get SdJwt type of credentials", + "tags": [ + "oid4vc holders" + ], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } + ], + "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": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } + ], + "parameters": [] + } + }, + "/openid4vc/holder/mdoc-vcs/decode": { + "post": { + "operationId": "DecodeMdocCredential", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": {} + } + } + } + }, + "description": "Decode mso mdoc credential in wallet", + "tags": [ + "oid4vc holders" + ], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "properties": { + "base64Url": { + "type": "string" + } + }, + "required": [ + "base64Url" + ], + "type": "object" + } + } + } + } + } + }, + "/openid4vc/holder/resolve-credential-offer": { + "post": { + "operationId": "ResolveCredOffer", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": {} + } + } + } + }, + "description": "Resolve a credential offer", + "tags": [ + "oid4vc holders" + ], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResolveCredentialOfferBody" + } + } + } + } + } + }, + "/openid4vc/holder/authorization-request": { + "post": { + "operationId": "RequestAuthorizationForCredential", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": {} + } + } + } + }, + "tags": [ + "oid4vc holders" + ], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthorizeRequestCredentialOffer" + } + } + } + } + } + }, + "/openid4vc/holder/request-credential": { + "post": { + "operationId": "RequestCredential", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": {} + } + } + } + }, + "description": "Initiates a token request, then requests credentials from issuer", + "tags": [ + "oid4vc holders" + ], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RequestCredentialBody" + } + } + } + } + } + }, + "/openid4vc/holder/resolve-proof-request": { + "post": { + "operationId": "ResolveProofRequest", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": {} + } + } + } + }, + "description": "Resolve a proof request", + "tags": [ + "oid4vc holders" + ], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResolveProofRequest" + } + } + } + } + } + }, + "/openid4vc/holder/accept-proof-request": { + "post": { + "operationId": "AcceptProofRequest", + "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" + } + ] + } + } + } + } + }, + "description": "Accept a proof request", + "tags": [ + "oid4vc holders" + ], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResolveProofRequest" + } + } + } + } + } + }, + "/openid4vc/holder/decode-sdjwt": { + "post": { + "operationId": "DecodeSdJwt", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": {} + } + } + } + }, + "tags": [ + "oid4vc holders" + ], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "properties": { + "jwt": { + "type": "string" + } + }, + "required": [ + "jwt" + ], + "type": "object" + } + } + } + } + } + }, "/openid4vc/verifier": { "post": { "operationId": "CreateVerifier", From 21898827e87cb84fa8f8d2f31eb81c6a0f1e1702 Mon Sep 17 00:00:00 2001 From: Tipu_Singh Date: Tue, 28 Oct 2025 18:22:16 +0530 Subject: [PATCH 022/152] fix: claims type issue Signed-off-by: Tipu_Singh --- src/controllers/openid4vc/types/issuer.types.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/controllers/openid4vc/types/issuer.types.ts b/src/controllers/openid4vc/types/issuer.types.ts index 7b695f68..30f432d5 100644 --- a/src/controllers/openid4vc/types/issuer.types.ts +++ b/src/controllers/openid4vc/types/issuer.types.ts @@ -128,7 +128,7 @@ export interface CredentialConfigurationSupportedWithFormats { vct?: string, doctype?: string, scope?: string - claims?: Record + claims?: any cryptographic_binding_methods_supported?: string[] credential_signing_alg_values_supported?: string[] proof_types_supported?: Record From 8ad5fdd422c3b6186946d36ad85082505e2de0cc Mon Sep 17 00:00:00 2001 From: Krishna Waske Date: Wed, 29 Oct 2025 18:18:35 +0530 Subject: [PATCH 023/152] fix: verifer id optional Signed-off-by: Krishna Waske --- src/controllers/openid4vc/types/verifier.types.ts | 2 +- src/routes/routes.ts | 2 +- src/routes/swagger.json | 3 --- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/controllers/openid4vc/types/verifier.types.ts b/src/controllers/openid4vc/types/verifier.types.ts index ac7b722b..d83d3227 100644 --- a/src/controllers/openid4vc/types/verifier.types.ts +++ b/src/controllers/openid4vc/types/verifier.types.ts @@ -94,6 +94,6 @@ export class OpenId4VcSiopCreateVerifierOptions { } export class OpenId4VcUpdateVerifierRecordOptions { - verifierId!: string + verifierId?: string clientMetadata?: OpenId4VcSiopVerifierClientMetadata } \ No newline at end of file diff --git a/src/routes/routes.ts b/src/routes/routes.ts index ea22ab1a..6c7b9c9b 100644 --- a/src/routes/routes.ts +++ b/src/routes/routes.ts @@ -2263,7 +2263,7 @@ const models: TsoaRoute.Models = { "OpenId4VcUpdateVerifierRecordOptions": { "dataType": "refObject", "properties": { - "verifierId": {"dataType":"string","required":true}, + "verifierId": {"dataType":"string"}, "clientMetadata": {"ref":"OpenId4VcSiopVerifierClientMetadata"}, }, "additionalProperties": false, diff --git a/src/routes/swagger.json b/src/routes/swagger.json index 135c17d3..7750bcda 100644 --- a/src/routes/swagger.json +++ b/src/routes/swagger.json @@ -5132,9 +5132,6 @@ "$ref": "#/components/schemas/OpenId4VcSiopVerifierClientMetadata" } }, - "required": [ - "verifierId" - ], "type": "object", "additionalProperties": false } From 01d5885ae2933ba262f9fedff77f147b2610b920 Mon Sep 17 00:00:00 2001 From: Tipu_Singh Date: Wed, 29 Oct 2025 19:01:52 +0530 Subject: [PATCH 024/152] fix: webhook for 0id4vc issuance Signed-off-by: Tipu_Singh --- src/routes/routes.ts | 2 +- src/routes/swagger.json | 4 +--- src/server.ts | 2 ++ 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/routes/routes.ts b/src/routes/routes.ts index 6c7b9c9b..b9e61d89 100644 --- a/src/routes/routes.ts +++ b/src/routes/routes.ts @@ -1790,7 +1790,7 @@ const models: TsoaRoute.Models = { "vct": {"dataType":"string"}, "doctype": {"dataType":"string"}, "scope": {"dataType":"string"}, - "claims": {"ref":"Record_string.unknown_"}, + "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_"}, diff --git a/src/routes/swagger.json b/src/routes/swagger.json index 7750bcda..149c444b 100644 --- a/src/routes/swagger.json +++ b/src/routes/swagger.json @@ -4122,9 +4122,7 @@ "scope": { "type": "string" }, - "claims": { - "$ref": "#/components/schemas/Record_string.unknown_" - }, + "claims": {}, "cryptographic_binding_methods_supported": { "items": { "type": "string" diff --git a/src/server.ts b/src/server.ts index 1b4d2768..2201dfb2 100644 --- a/src/server.ts +++ b/src/server.ts @@ -29,6 +29,7 @@ import { questionAnswerEvents } from './events/QuestionAnswerEvents' import { reuseConnectionEvents } from './events/ReuseConnectionEvents' import { RegisterRoutes } from './routes/routes' import { SecurityMiddleware } from './securityMiddleware' +import { openId4VcIssuanceSessionEvents } from './events/openId4VcIssuanceSessionEvents' dotenv.config() @@ -50,6 +51,7 @@ export const setupServer = async ( basicMessageEvents(agent, config) connectionEvents(agent, config) credentialEvents(agent, config) + openId4VcIssuanceSessionEvents(agent, config) proofEvents(agent, config) reuseConnectionEvents(agent, config) } From f604bf9dcdfba8daf9165a71d533cd91134929fc Mon Sep 17 00:00:00 2001 From: Rinkal Bhojani Date: Thu, 30 Oct 2025 16:29:15 +0530 Subject: [PATCH 025/152] fix: Added getTrustedCert function and refactored code Signed-off-by: Rinkal Bhojani --- .env.demo | 4 +- .env.sample | 3 +- src/cliAgent.ts | 57 +++++++-------- .../openid4vc/holder/holder.Controller.ts | 29 ++++---- .../openid4vc/holder/holder.service.ts | 35 ++++++---- .../issuance-sessions.service.ts | 16 ++--- src/utils/oid4vc-agent.ts | 70 ++++++++++++------- 7 files changed, 120 insertions(+), 94 deletions(-) diff --git a/.env.demo b/.env.demo index c7328b45..e12280d4 100644 --- a/.env.demo +++ b/.env.demo @@ -62,4 +62,6 @@ DCS_VALIDITY_YEARS=3 ROOT_CA_START_FROM_CURRENT_MONTH=true DCS_START_FROM_CURRENT_MONTH=true -NODE_ENV=DEV \ No newline at end of file +NODE_ENV=DEV + +TRUST_LIST_URL= \ No newline at end of file diff --git a/.env.sample b/.env.sample index 0e726ab9..0cd90fbe 100644 --- a/.env.sample +++ b/.env.sample @@ -60,4 +60,5 @@ DCS_VALIDITY_YEARS= ROOT_CA_START_FROM_CURRENT_MONTH= DCS_START_FROM_CURRENT_MONTH= -NODE_ENV= \ No newline at end of file +NODE_ENV= +TRUST_LIST_URL= \ No newline at end of file diff --git a/src/cliAgent.ts b/src/cliAgent.ts index 5c2fd1f2..e6df92c3 100644 --- a/src/cliAgent.ts +++ b/src/cliAgent.ts @@ -23,7 +23,7 @@ import { WebDidResolver, LogLevel, Agent, - X509Module + X509Module, } from '@credo-ts/core' import { HttpOutboundTransport, @@ -54,7 +54,7 @@ import { agentDependencies, HttpInboundTransport, WsInboundTransport } from '@cr import { QuestionAnswerModule } from '@credo-ts/question-answer' import { TenantsModule } from '@credo-ts/tenants' import { anoncreds } from '@hyperledger/anoncreds-nodejs' -import { askar} from '@openwallet-foundation/askar-nodejs' +import { askar } from '@openwallet-foundation/askar-nodejs' import { indyVdr } from '@hyperledger/indy-vdr-nodejs' import axios from 'axios' import { readFile } from 'fs/promises' @@ -67,7 +67,11 @@ 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 } from './utils/oid4vc-agent' +import { + getCredentialRequestToCredentialMapper, + getMixedCredentialRequestToCredentialMapper, + getTrustedCerts, +} from './utils/oid4vc-agent' const openId4VciRouter = Router() const openId4VpRouter = Router() @@ -207,7 +211,7 @@ const getModules = ( : new W3cCredentialsModule(), didcomm: new DidCommModule({ processDidCommMessagesConcurrently: true - }), + }), oob: new OutOfBandModule(), mediationRecipient: new MediationRecipientModule(), discovery: new DiscoverFeaturesModule(), @@ -229,16 +233,17 @@ const getModules = ( 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`, + baseUrl: + process.env.NODE_ENV === 'PROD' + ? `https://${process.env.APP_URL}/oid4vp` + : `${process.env.AGENT_HTTP_URL}/oid4vp`, router: openId4VpRouter, }), openId4VcIssuer: new OpenId4VcIssuerModule({ - baseUrl: process.env.NODE_ENV === 'PROD' ? - `https://${process.env.APP_URL}/oid4vci` : - `${process.env.AGENT_HTTP_URL}/oid4vci`, + baseUrl: + process.env.NODE_ENV === 'PROD' + ? `https://${process.env.APP_URL}/oid4vci` + : `${process.env.AGENT_HTTP_URL}/oid4vci`, router: openId4VciRouter, statefulCredentialOfferExpirationInSeconds: Number(process.env.OPENID_CRED_OFFER_EXPIRY) || 3600, accessTokenExpiresInSeconds: Number(process.env.OPENID_ACCESS_TOKEN_EXPIRY) || 3600, @@ -248,23 +253,13 @@ const getModules = ( credentialRequestToCredentialMapper: (...args) => getMixedCredentialRequestToCredentialMapper()(...args), }), openId4VcHolderModule: new OpenId4VcHolderModule(), - x509: new X509Module({ - // getTrustedCertificatesForVerification: (_agentContext, { certificateChain, verification }) => { - // //TODO: We need to trust the certificate tenant wise, for that we need to fetch those details from platform - // const firstCertificate = certificateChain[0] - // console.log( - // `dyncamically trusting certificate ${firstCertificate?.getIssuerNameField('C')?.toString()} for verification of ${ - // verification.type - // }`, - // true - // ) - - // const trustedCertificates = _agentContext.dependencyManager.resolve(X509ModuleConfig).trustedCertificates?.map((cert) => - // X509Certificate.fromEncodedCertificate(cert).toString('pem') - // ) as [string, ...string[]] - - // return [...trustedCertificates] - // } + x509: new X509Module({ + getTrustedCertificatesForVerification: async (_agentContext, { certificateChain, verification }) => { + //TODO: We need to trust the certificate tenant wise, for that we need to fetch those details from platform + const certs: string[] = await getTrustedCerts() + + return certs + }, }), } } @@ -361,7 +356,7 @@ export async function runRestAgent(restConfig: AriesRestConfig) { // 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 - allowInsecureHttpUrls: process.env.ALLOW_INSECURE_HTTP_URLS === 'true' + allowInsecureHttpUrls: process.env.ALLOW_INSECURE_HTTP_URLS === 'true', } async function fetchLedgerData(ledgerConfig: { @@ -448,8 +443,8 @@ export async function runRestAgent(restConfig: AriesRestConfig) { modules: { ...(afjConfig.tenancy ? { - ...tenantModule, - } + ...tenantModule, + } : {}), ...modules, }, diff --git a/src/controllers/openid4vc/holder/holder.Controller.ts b/src/controllers/openid4vc/holder/holder.Controller.ts index 846f336e..c071da3a 100644 --- a/src/controllers/openid4vc/holder/holder.Controller.ts +++ b/src/controllers/openid4vc/holder/holder.Controller.ts @@ -1,8 +1,8 @@ -import { Agent } from '@credo-ts/core' +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 { SCOPES } from '../../../enums/enum' import { AuthorizeRequestCredentialOffer, RequestCredentialBody, @@ -11,14 +11,12 @@ import { } from '../types/holder.types' import { holderService } from './holder.service' -import { SCOPES } from '../../../enums/enum' @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 */ @@ -27,7 +25,7 @@ export class HolderController extends Controller { return await holderService.getSdJwtCredentials(request) } - /** + /** * Fetch all mso mdoc credentials in wallet */ @Get('/mdoc-vcs') @@ -35,13 +33,17 @@ export class HolderController extends Controller { return await holderService.getMdocCredentials(request) } - /** + /** * Decode mso mdoc credential in wallet */ @Post('/mdoc-vcs/decode') - public async decodeMdocCredential(@Request() request: Req, @Body() body:{ + public async decodeMdocCredential( + @Request() request: Req, + @Body() + body: { base64Url: string - }) { + }, + ) { return await holderService.decodeMdocCredential(request, body) } @@ -53,11 +55,14 @@ export class HolderController extends Controller { return await holderService.resolveCredentialOffer(request, body) } -// /** -// * Initiate an OID4VCI authorization request -// */ + // /** + // * Initiate an OID4VCI authorization request + // */ @Post('authorization-request') - public async requestAuthorizationForCredential(@Request() request: Req, @Body() body: AuthorizeRequestCredentialOffer) { + public async requestAuthorizationForCredential( + @Request() request: Req, + @Body() body: AuthorizeRequestCredentialOffer, + ) { return await holderService.requestAuthorizationForCredential(request, body) } diff --git a/src/controllers/openid4vc/holder/holder.service.ts b/src/controllers/openid4vc/holder/holder.service.ts index 8ebe8282..cfd36fc3 100644 --- a/src/controllers/openid4vc/holder/holder.service.ts +++ b/src/controllers/openid4vc/holder/holder.service.ts @@ -39,20 +39,23 @@ export class HolderService { return await agentReq.agent.mdoc.getAll() } - public async decodeMdocCredential(agentReq : Req, options: { - base64Url: string - }) { + 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 + issuerSignedCertificateChain: credential.issuerSignedCertificateChain, } as any } public async resolveCredentialOffer(agentReq: Req, body: ResolveCredentialOfferBody) { - return await agentReq.agent.modules.openId4VcHolderModule.resolveCredentialOffer(body.credentialOfferUri) as any + return (await agentReq.agent.modules.openId4VcHolderModule.resolveCredentialOffer(body.credentialOfferUri)) as any } public async requestAuthorizationForCredential(agentReq: Req, body: AuthorizeRequestCredentialOffer) { @@ -113,7 +116,7 @@ export class HolderService { } as OpenId4VcAuthorizationCodeTokenRequestOptions } - return await this.requestAndStoreCredentials(agentReq, resolvedCredentialOffer, options) as any + return (await this.requestAndStoreCredentials(agentReq, resolvedCredentialOffer, options)) as any } private async requestAndStoreCredentials( @@ -169,8 +172,6 @@ export class HolderService { resolvedCredentialOffer: OpenId4VciResolvedCredentialOffer, credentialsToRequest: string[], ) { - console.log("agent::::::::::::::", Object.keys(agentReq.agent.modules.openId4VcHolderModule)) - console.log('Initiating authorization with resolvedCredentialOffer:', resolvedCredentialOffer) console.log('Credentials to request:', credentialsToRequest) @@ -222,7 +223,9 @@ export class HolderService { } public async resolveProofRequest(agentReq: Req, body: ResolveProofRequest) { - return await agentReq.agent.modules.openId4VcHolderModule.resolveOpenId4VpAuthorizationRequest(body.proofRequestUri) as any + return (await agentReq.agent.modules.openId4VcHolderModule.resolveOpenId4VpAuthorizationRequest( + body.proofRequestUri, + )) as any } public async acceptPresentationRequest(agentReq: Req, body: ResolveProofRequest) { @@ -244,7 +247,7 @@ export class HolderService { let dcqlCredentials try { dcqlCredentials = await agentReq.agent.modules.openId4VcHolderModule.selectCredentialsForDcqlRequest( - resolved.dcql.queryResult + resolved.dcql.queryResult, ) console.log('Selected credentials for DCQL request:', dcqlCredentials) } catch (error) { @@ -268,13 +271,15 @@ export class HolderService { public async getSelectedCredentialsForRequest( dcqlQueryResult: DcqlQueryResult, - selectedCredentials: { [credentialQueryId: string]: string } + 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') + 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 - } + return {} as any // Placeholder return to avoid errors + } } -export const holderService = new HolderService() \ No newline at end of file +export const holderService = new HolderService() diff --git a/src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts b/src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts index 2c6f600d..e45755a3 100644 --- a/src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts +++ b/src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts @@ -1,7 +1,7 @@ import type { OpenId4VcIssuanceSessionsCreateOffer } from '../types/issuer.types' -import { OpenId4VciCredentialFormatProfile, type OpenId4VcIssuanceSessionState } from '@credo-ts/openid4vc' 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' @@ -43,14 +43,14 @@ class IssuanceSessionsService { ) } - const currentVct = cred.payload && 'vct' in cred.payload ? cred.payload.vct : undefined; + 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), - }, - } + ...cred, + payload: { + ...cred.payload, + vct: currentVct ?? (typeof supported.vct === 'string' ? supported.vct : undefined), + }, + } }) options.issuanceMetadata ||= {} diff --git a/src/utils/oid4vc-agent.ts b/src/utils/oid4vc-agent.ts index ec4bed8e..d76be9c5 100644 --- a/src/utils/oid4vc-agent.ts +++ b/src/utils/oid4vc-agent.ts @@ -95,9 +95,9 @@ export function getCredentialRequestToCredentialMapper(): OpenId4VciCredentialRe issuer: holderBindings[0].method === 'did' ? { - method: 'did', - didUrl: issuerDidUrl ?? '', - } + method: 'did', + didUrl: issuerDidUrl ?? '', + } : { method: 'x5c', x5c: trustedCertificates, issuer: 'ISSUER_HOST ' }, })), } satisfies OpenId4VciSignSdJwtCredentials @@ -157,14 +157,14 @@ export function getCredentialRequestToCredentialMapper(): OpenId4VciCredentialRe holder: holderBinding, issuer: issuerDidUrl ? { - method: 'did', - didUrl: issuerDidUrl, - } + method: 'did', + didUrl: issuerDidUrl, + } : { - method: 'x5c', - x5c: issuerx509certificate ?? [], //[issuerx509certificate??""], - issuer: process.env.AGENT_HOST ?? 'http://localhost:4001', - }, + method: 'x5c', + x5c: issuerx509certificate ?? [], //[issuerx509certificate??""], + issuer: process.env.AGENT_HOST ?? 'http://localhost:4001', + }, disclosureFrame: disclosureFramePayload, })), } satisfies OpenId4VciSignSdJwtCredentials @@ -194,8 +194,8 @@ export function getMixedCredentialRequestToCredentialMapper(): OpenId4VciCredent // Returns an array of all matching credentials const credentialPayload = Array.isArray(allCredentialPayload) ? allCredentialPayload.filter( - (c: Record) => c.credentialSupportedId === credentialConfigurationId, - ) + (c: Record) => c.credentialSupportedId === credentialConfigurationId, + ) : [] const credentialConfiguration = credentialConfigurationsSupported[credentialConfigurationId] @@ -246,9 +246,9 @@ export function getMixedCredentialRequestToCredentialMapper(): OpenId4VciCredent issuer: holderBindings[0].method === 'did' ? { - method: 'did', - didUrl: issuerDidVerificationMethod ?? '', - } + method: 'did', + didUrl: issuerDidVerificationMethod ?? '', + } : { method: 'x5c', x5c: trustedCertificates, issuer: 'ISSUER_HOST ' }, })), } satisfies OpenId4VciSignSdJwtCredentials @@ -323,14 +323,15 @@ export function getMixedCredentialRequestToCredentialMapper(): OpenId4VciCredent : {} //Taking leaf certifcate from chain as issuer certificate, if not provided explicitly taking AGENT_HTTP_URL as issuer - let parsedCertificate: any; - if (!issuerDidVerificationMethod) { + let parsedCertificate: any + if (!issuerDidVerificationMethod && issuerx509certificate) { parsedCertificate = X509Service.parseCertificate(agentContext, { - encodedCertificate: (issuerx509certificate ?? [`${process.env.AGENT_HTTP_URL}`])[0], + encodedCertificate: issuerx509certificate[0], }) + } else { + throw new Error(`issuerx509certificate is not provided for credential ${credentialConfigurationId}`) } - return { credentialConfigurationId, format: ClaimFormat.SdJwtVc, @@ -339,14 +340,14 @@ export function getMixedCredentialRequestToCredentialMapper(): OpenId4VciCredent holder: holderBinding, issuer: issuerDidVerificationMethod ? { - method: 'did', - didUrl: issuerDidVerificationMethod, - } + method: 'did', + didUrl: issuerDidVerificationMethod, + } : { - method: 'x5c', - x5c: issuerx509certificate ?? [], - issuer: parsedCertificate.sanUriNames[0], - }, + method: 'x5c', + x5c: issuerx509certificate ?? [], + issuer: parsedCertificate.sanUriNames[0], + }, disclosureFrame: disclosureFramePayload, })), } satisfies OpenId4VciSignSdJwtCredentials @@ -419,3 +420,20 @@ export interface OpenId4VcIssuanceSessionCreateOfferSdJwtCredentialOptions { */ disclosureFrame: DisclosureFrame } + +export async function getTrustedCerts() { + try { + const response = await fetch(`${process.env.TRUST_LIST_URL}`) + + if (!response.ok) { + throw new Error(`HTTP error! status: ${response.status}`) + } + + const data = await response.json() + console.log('Success:', data) + return data as string[] + } catch (error) { + console.error('Error fetching data:', error) + return [] + } +} From 52c9ee68c74d1c8141921096d1eef4bc5804e043 Mon Sep 17 00:00:00 2001 From: Rinkal Bhojani Date: Thu, 30 Oct 2025 22:04:55 +0530 Subject: [PATCH 026/152] fix: fixed condition Signed-off-by: Rinkal Bhojani --- src/utils/oid4vc-agent.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/oid4vc-agent.ts b/src/utils/oid4vc-agent.ts index d76be9c5..14ef14aa 100644 --- a/src/utils/oid4vc-agent.ts +++ b/src/utils/oid4vc-agent.ts @@ -328,7 +328,7 @@ export function getMixedCredentialRequestToCredentialMapper(): OpenId4VciCredent parsedCertificate = X509Service.parseCertificate(agentContext, { encodedCertificate: issuerx509certificate[0], }) - } else { + } else if (!issuerDidVerificationMethod) { throw new Error(`issuerx509certificate is not provided for credential ${credentialConfigurationId}`) } From 7d78116ac08003b2fc35e23f2d5485ca4ac58a51 Mon Sep 17 00:00:00 2001 From: Tipu_Singh Date: Thu, 6 Nov 2025 15:20:14 +0530 Subject: [PATCH 027/152] fix: presentation webhook Signed-off-by: Tipu_Singh --- src/server.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/server.ts b/src/server.ts index 2201dfb2..b4bf2b5d 100644 --- a/src/server.ts +++ b/src/server.ts @@ -30,6 +30,7 @@ import { reuseConnectionEvents } from './events/ReuseConnectionEvents' import { RegisterRoutes } from './routes/routes' import { SecurityMiddleware } from './securityMiddleware' import { openId4VcIssuanceSessionEvents } from './events/openId4VcIssuanceSessionEvents' +import { openId4VcVerificationSessionEvents } from './events/openId4VcVerificationSessionEvents' dotenv.config() @@ -52,6 +53,7 @@ export const setupServer = async ( connectionEvents(agent, config) credentialEvents(agent, config) openId4VcIssuanceSessionEvents(agent, config) + openId4VcVerificationSessionEvents(agent, config) proofEvents(agent, config) reuseConnectionEvents(agent, config) } From 83fcea403fd6eab7ac1bc66e63da8df45f208821 Mon Sep 17 00:00:00 2001 From: Rinkal Bhojani Date: Thu, 6 Nov 2025 17:58:21 +0530 Subject: [PATCH 028/152] feat: added x5c signermethod capability in creating verification requests Signed-off-by: Rinkal Bhojani --- .../openid4vc/types/verifier.types.ts | 12 ++--- .../verification-sessions.Controller.ts | 1 + .../verification-sessions.service.ts | 50 ++++++++++++------- src/routes/routes.ts | 15 +++--- src/routes/swagger.json | 46 ++++++++++++++--- 5 files changed, 88 insertions(+), 36 deletions(-) diff --git a/src/controllers/openid4vc/types/verifier.types.ts b/src/controllers/openid4vc/types/verifier.types.ts index d83d3227..270620f3 100644 --- a/src/controllers/openid4vc/types/verifier.types.ts +++ b/src/controllers/openid4vc/types/verifier.types.ts @@ -57,16 +57,16 @@ export interface DcqlDefinition { /* -------------------------------------------------------------------------- */ /* AUTHORIZATION REQUEST MODEL */ /* -------------------------------------------------------------------------- */ -export interface OpenId4VcJwtIssuerDid { +export type OpenId4VcJwtIssuerDid = { method: 'did' didUrl: string } -export interface OpenId4VcIssuerX5c { +export type OpenId4VcIssuerX5c = { method: 'x5c' - issuer: string + issuer?: string x5c: string[] - alg: string + alg?: string } export interface CreateAuthorizationRequest { @@ -76,7 +76,7 @@ export interface CreateAuthorizationRequest { responseMode?: ResponseModeEnum - requestSigner: OpenId4VcJwtIssuerDid + requestSigner: OpenId4VcJwtIssuerDid | OpenId4VcIssuerX5c } /* -------------------------------------------------------------------------- */ @@ -96,4 +96,4 @@ export class OpenId4VcSiopCreateVerifierOptions { export class OpenId4VcUpdateVerifierRecordOptions { verifierId?: string clientMetadata?: OpenId4VcSiopVerifierClientMetadata -} \ No newline at end of file +} diff --git a/src/controllers/openid4vc/verifier-sessions/verification-sessions.Controller.ts b/src/controllers/openid4vc/verifier-sessions/verification-sessions.Controller.ts index 20d47555..e2219c52 100644 --- a/src/controllers/openid4vc/verifier-sessions/verification-sessions.Controller.ts +++ b/src/controllers/openid4vc/verifier-sessions/verification-sessions.Controller.ts @@ -23,6 +23,7 @@ export class VerificationSessionsController extends Controller { @Body() createAuthorizationRequest: CreateAuthorizationRequest, ) { try { + console.log(`IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII`, JSON.stringify(createAuthorizationRequest)) return await verificationSessionService.createProofRequest(request, createAuthorizationRequest) } 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 319a49b6..defa6932 100644 --- a/src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts +++ b/src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts @@ -12,10 +12,12 @@ import { TypedArrayEncoder, W3cJsonLdVerifiablePresentation, W3cJwtVerifiablePresentation, + X509Service, } from '@credo-ts/core' -import { OpenId4VcVerificationSessionState } from '@credo-ts/openid4vc' +import { OpenId4VcIssuerX5c, OpenId4VcJwtIssuerDid, OpenId4VcVerificationSessionState } from '@credo-ts/openid4vc' import { injectable } from 'tsyringe' import { Request as Req } from 'express' +import { SignerMethod } from '../../../enums' import { CreateAuthorizationRequest } from '../types/verifier.types' // import { CreateAuthorizationRequest } from '../types/verifier.types' @@ -24,28 +26,42 @@ import { CreateAuthorizationRequest } from '../types/verifier.types' class VerificationSessionsService { public async createProofRequest(agentReq: Req, dto: CreateAuthorizationRequest) { try { - const didToResolve = dto.requestSigner?.didUrl - if (!didToResolve) { - throw new Error('No DID provided to resolve (neither requestSigner.didUrl nor verifierDid present)') - } + let requestSigner + if (dto.requestSigner.method === SignerMethod.Did) { + requestSigner = dto.requestSigner as OpenId4VcJwtIssuerDid - const didDocument = await agentReq.agent.dids.resolveDidDocument(didToResolve) + const didToResolve = dto.requestSigner?.didUrl + if (!didToResolve) { + throw new Error('No DID provided to resolve (neither requestSigner.didUrl nor verifierDid present)') + } - let verifierDidUrl: string | undefined = undefined - if (didDocument.verificationMethod?.[0]?.id) { - verifierDidUrl = didDocument.verificationMethod[0].id - } + 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 (!verifierDidUrl) { - throw new Error('No matching verification method found on verifier DID document') - } - let requestSigner = dto.requestSigner - if (!requestSigner) { - requestSigner = { method: 'did', didUrl: verifierDidUrl } as any - } else if (requestSigner.method === 'did') { 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, diff --git a/src/routes/routes.ts b/src/routes/routes.ts index b9e61d89..886d580f 100644 --- a/src/routes/routes.ts +++ b/src/routes/routes.ts @@ -2160,12 +2160,13 @@ const models: TsoaRoute.Models = { }, // WARNING: This 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": "refObject", - "properties": { - "method": {"dataType":"enum","enums":["did"],"required":true}, - "didUrl": {"dataType":"string","required":true}, - }, - "additionalProperties": false, + "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": { @@ -2175,7 +2176,7 @@ const models: TsoaRoute.Models = { "presentationExchange": {"ref":"PresentationDefinition"}, "dcql": {"dataType":"union","subSchemas":[{"dataType":"string"},{"ref":"DcqlDefinition"}]}, "responseMode": {"ref":"ResponseModeEnum"}, - "requestSigner": {"ref":"OpenId4VcJwtIssuerDid","required":true}, + "requestSigner": {"dataType":"union","subSchemas":[{"ref":"OpenId4VcJwtIssuerDid"},{"ref":"OpenId4VcIssuerX5c"}],"required":true}, }, "additionalProperties": false, }, diff --git a/src/routes/swagger.json b/src/routes/swagger.json index 149c444b..1bcf372a 100644 --- a/src/routes/swagger.json +++ b/src/routes/swagger.json @@ -4954,23 +4954,50 @@ }, "OpenId4VcJwtIssuerDid": { "properties": { + "didUrl": { + "type": "string" + }, "method": { "type": "string", "enum": [ "did" ], "nullable": false + } + }, + "required": [ + "didUrl", + "method" + ], + "type": "object" + }, + "OpenId4VcIssuerX5c": { + "properties": { + "alg": { + "type": "string" }, - "didUrl": { + "x5c": { + "items": { + "type": "string" + }, + "type": "array" + }, + "issuer": { "type": "string" + }, + "method": { + "type": "string", + "enum": [ + "x5c" + ], + "nullable": false } }, "required": [ - "method", - "didUrl" + "x5c", + "method" ], - "type": "object", - "additionalProperties": false + "type": "object" }, "CreateAuthorizationRequest": { "properties": { @@ -4994,7 +5021,14 @@ "$ref": "#/components/schemas/ResponseModeEnum" }, "requestSigner": { - "$ref": "#/components/schemas/OpenId4VcJwtIssuerDid" + "anyOf": [ + { + "$ref": "#/components/schemas/OpenId4VcJwtIssuerDid" + }, + { + "$ref": "#/components/schemas/OpenId4VcIssuerX5c" + } + ] } }, "required": [ From 3860df9fa0fb76dbe373e9243c1c8210b2a01853 Mon Sep 17 00:00:00 2001 From: Rinkal Bhojani Date: Mon, 10 Nov 2025 18:01:36 +0530 Subject: [PATCH 029/152] feat: added configuration variables in .env Signed-off-by: Rinkal Bhojani --- .env.demo | 11 +++- .env.sample | 11 +++- .env.test | 154 ++++++++++++++++++++++++++++++++++++++++++++++++ src/cliAgent.ts | 9 +-- 4 files changed, 179 insertions(+), 6 deletions(-) create mode 100644 .env.test diff --git a/.env.demo b/.env.demo index e12280d4..89a2bdbd 100644 --- a/.env.demo +++ b/.env.demo @@ -64,4 +64,13 @@ DCS_START_FROM_CURRENT_MONTH=true NODE_ENV=DEV -TRUST_LIST_URL= \ No newline at end of file +TRUST_LIST_URL= + +# Expiry is in seconds +OID4VCI_CRED_OFFER_EXPIRY=3600 +OID4VCI_ACCESS_TOKEN_EXPIRY=3600 +OID4VCI_AUTH_CODE_EXPIRY=3600 +OID4VCI_CNONCE_EXPIRY=3600 + +# Expiry is in seconds +OID4VP_AUTH_REQUEST_PROOF_REQUEST_EXPIRY=3600 \ No newline at end of file diff --git a/.env.sample b/.env.sample index 0cd90fbe..3cc26fef 100644 --- a/.env.sample +++ b/.env.sample @@ -61,4 +61,13 @@ ROOT_CA_START_FROM_CURRENT_MONTH= DCS_START_FROM_CURRENT_MONTH= NODE_ENV= -TRUST_LIST_URL= \ No newline at end of file +TRUST_LIST_URL= + +# Expiry is in seconds +OID4VCI_CRED_OFFER_EXPIRY=3600 +OID4VCI_ACCESS_TOKEN_EXPIRY=3600 +OID4VCI_AUTH_CODE_EXPIRY=3600 +OID4VCI_CNONCE_EXPIRY=3600 + +# Expiry is in seconds +OID4VP_AUTH_REQUEST_PROOF_REQUEST_EXPIRY=3600 \ No newline at end of file diff --git a/.env.test b/.env.test new file mode 100644 index 00000000..33b8a3ab --- /dev/null +++ b/.env.test @@ -0,0 +1,154 @@ +{ + "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoiUmVzdFRlbmFudEFnZW50IiwidGVuYW50SWQiOiIzMTMyMDM1ZC04NDllLTQ0NWUtYmM5NC1hN2Q3ZGZmYTUzMjciLCJpYXQiOjE3NjE4MTAxMDF9.UCo2HZgOewFs8a63XJAr313-j94pMwew26A0mzEFyAg", + "_tags": {}, + "type": "TenantRecord", + "metadata": { + "data": {} + }, + "storageVersion": "0.5", + "id": "3132035d-849e-445e-bc94-a7d7dffa5327", + "createdAt": "2025-10-30T07:41:41.352Z", + "config": { + "label": "holder-test", + "walletConfig": { + "id": "tenant-3132035d-849e-445e-bc94-a7d7dffa5327", + "key": "BhPEWGEtkrVRGNDFXxgVaQGTou8gfBbLnkKNH1LGWwU5", + "keyDerivationMethod": "RAW" + } + }, + "updatedAt": "2025-10-30T07:41:41.352Z" +} + +{ + "verifierId": "indigo", + "requestSigner": { + "method": "x5c", + "x5c": ["MIICsDCCAlagAwIBAgIQIqTxt6YWpzgTIi9Li6A+6jAKBggqhkjOPQQDAjA0MSUwIwYDVQQDExxFeGFtcGxlIFZlcmlmaWVyIENvcnBvcmF0aW9uMQswCQYDVQQGEwJVUzAeFw0yNTAxMDEwMDAwMDBaFw0yNjAxMDEwMDAwMDBaMDQxJTAjBgNVBAMTHEV4YW1wbGUgVmVyaWZpZXIgQ29ycG9yYXRpb24xCzAJBgNVBAYTAlVTMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEc2PMmczHrr1eg7wraEpkIszjv8NmfX2BCBvEr9I35R8+eaz8jPKjr1WEve+xOk6R+RPO5f/4MBfdoVGcIzeCn6OCAUgwggFEMB0GA1UdDgQWBBQ89y8cqjRLnZsfd+DzATrJZcwrbDAOBgNVHQ8BAf8EBAMCAaIwFQYDVR0lAQH/BAswCQYHKIGMXQUBAjAiBgNVHSMBAf8EGDAWgBQ89y8cqjRLnZsfd+DzATrJZcwrbDBdBgNVHRIBAf8EUzBRggtleGFtcGxlLmNvbYYhaHR0cDovL2V4YW1wbGVpc3N1ZXIuVmVyaWZpZXIuY29tgR9hZG1pbkBleGFtcGxlaXNzdWVyVmVyaWZpZXIuY29tMGUGA1UdEQEB/wRbMFmCFGV4YW1wbGUuVmVyaWZpZXIuY29thhhodHRwOi8vMTkyLjE2OC4xLjIxOjQwMDKCDDE5Mi4xNjguMS4yMYEZYWRtaW5AZXhhbXBsZVZlcmlmaWVyLmNvbTASBgNVHRMBAf8ECDAGAQH/AgEAMAoGCCqGSM49BAMCA0gAMEUCIQD79OwetGh5FHpk4qXPA/X0ZW/Hvg28rRpggEY9oQQc3wIgbtgH6zm4Rmptwe7lHgyzBITKwouh193LVo/kU5m0sqQ="] + }, + "dcql": { + "query": { + "combine": "all", + "credentials": [ + { + "id": "orgiso23220photoID1", + "format": "mso_mdoc", + "meta": { + "doctype": "org.iso.23220.photoID.1" + }, + "require_cryptographic_holder_binding": true, + "claims": [ + { + "path": [ + "org.iso.23220.photoID.1", + "given_name" + ], + "intent_to_retain": true + }, + { + "path": [ + "org.iso.23220.photoID.1", + "family_name" + ], + "intent_to_retain": true + }, + { + "path": [ + "org.iso.23220.photoID.1", + "document_number" + ], + "intent_to_retain": true + }, + { + "path": [ + "org.iso.23220.photoID.1", + "nationality" + ], + "intent_to_retain": true + }, + { + "path": [ + "org.iso.23220.photoID.1", + "sex" + ], + "intent_to_retain": true + }, + { + "path": [ + "org.iso.23220.photoID.1", + "expiry_date" + ], + "intent_to_retain": true + } + ] + }, + { + "id": "boardingPass", + "format": "dc+sd-jwt", + "meta": { + "vct": "BoardingPass" + }, + "require_cryptographic_holder_binding": true, + "claims": [ + { + "path": [ + "paxName" + ], + "intent_to_retain": true + }, + { + "path": [ + "boardingPass", + "barcodeString" + ], + "intent_to_retain": true + }, + { + "path": [ + "boardingPass", + "ticketLessOrElectronicTicketInd" + ], + "intent_to_retain": true + }, + { + "path": [ + "boardingPass", + "paxSegments", + "0", + "operatingCarrierFlightNumber" + ], + "intent_to_retain": true + }, + { + "path": [ + "boardingPass", + "paxSegments", + "0", + "originStationIATALocationCode" + ], + "intent_to_retain": true + }, + { + "path": [ + "boardingPass", + "paxSegments", + "0", + "destStationIATALocationCode" + ], + "intent_to_retain": true + }, + { + "path": [ + "boardingPass", + "paxSegments", + "0", + "seatAssignmentStatusOrSeatNumberCode" + ], + "intent_to_retain": true + } + ] + } + ] + } + }, + "responseMode": "direct_post.jwt" +} \ No newline at end of file diff --git a/src/cliAgent.ts b/src/cliAgent.ts index e6df92c3..9023859b 100644 --- a/src/cliAgent.ts +++ b/src/cliAgent.ts @@ -238,6 +238,7 @@ const getModules = ( ? `https://${process.env.APP_URL}/oid4vp` : `${process.env.AGENT_HTTP_URL}/oid4vp`, router: openId4VpRouter, + authorizationRequestExpirationInSeconds: Number(process.env.OID4VP_AUTH_REQUEST_PROOF_REQUEST_EXPIRY) || 3600, }), openId4VcIssuer: new OpenId4VcIssuerModule({ baseUrl: @@ -245,10 +246,10 @@ const getModules = ( ? `https://${process.env.APP_URL}/oid4vci` : `${process.env.AGENT_HTTP_URL}/oid4vci`, router: openId4VciRouter, - statefulCredentialOfferExpirationInSeconds: Number(process.env.OPENID_CRED_OFFER_EXPIRY) || 3600, - accessTokenExpiresInSeconds: Number(process.env.OPENID_ACCESS_TOKEN_EXPIRY) || 3600, - authorizationCodeExpiresInSeconds: Number(process.env.OPENID_AUTH_CODE_EXPIRY) || 3600, - cNonceExpiresInSeconds: Number(process.env.OPENID_CNONCE_EXPIRY) || 3600, + 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), }), From 47225497b3ffc043f3330700ea5b12959ae9b846 Mon Sep 17 00:00:00 2001 From: Rinkal Bhojani Date: Mon, 10 Nov 2025 18:05:36 +0530 Subject: [PATCH 030/152] refactor: removed unwanted console logs Signed-off-by: Rinkal Bhojani --- src/controllers/openid4vc/holder/holder.service.ts | 8 +------- .../verifier-sessions/verification-sessions.Controller.ts | 1 - 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/src/controllers/openid4vc/holder/holder.service.ts b/src/controllers/openid4vc/holder/holder.service.ts index cfd36fc3..1d7be42c 100644 --- a/src/controllers/openid4vc/holder/holder.service.ts +++ b/src/controllers/openid4vc/holder/holder.service.ts @@ -73,7 +73,7 @@ export class HolderService { let actionToTake = '' let authorizationRequestUrl: string | undefined = undefined let codeVerifier: string | undefined = undefined - console.log('Resolved authorization:::::::::::::', resolvedAuthorization) + console.log('Resolved authorization', resolvedAuthorization) switch (resolvedAuthorization.authorizationFlow) { case 'Oauth2Redirect': @@ -235,12 +235,6 @@ export class HolderService { console.log('Resolved proof request:', resolved) // const presentationExchangeService = agent.dependencyManager.resolve(DifPresentationExchangeService) - const dcqlService = agentReq.agent.dependencyManager.resolve(DifPresentationExchangeService) - - // console.log('Resolved proof request:', resolved) - - // console.log('Presentation exchange service:', presentationExchangeService) - if (!resolved.dcql) throw new Error('Missing DCQL on request') console.log('DCQL query result:', resolved.dcql.queryResult) // diff --git a/src/controllers/openid4vc/verifier-sessions/verification-sessions.Controller.ts b/src/controllers/openid4vc/verifier-sessions/verification-sessions.Controller.ts index e2219c52..20d47555 100644 --- a/src/controllers/openid4vc/verifier-sessions/verification-sessions.Controller.ts +++ b/src/controllers/openid4vc/verifier-sessions/verification-sessions.Controller.ts @@ -23,7 +23,6 @@ export class VerificationSessionsController extends Controller { @Body() createAuthorizationRequest: CreateAuthorizationRequest, ) { try { - console.log(`IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII`, JSON.stringify(createAuthorizationRequest)) return await verificationSessionService.createProofRequest(request, createAuthorizationRequest) } catch (error) { throw ErrorHandlingService.handle(error) From 1238140627d37c22e4de9c81fe119321fa9fda15 Mon Sep 17 00:00:00 2001 From: Rinkal Bhojani Date: Mon, 10 Nov 2025 18:15:14 +0530 Subject: [PATCH 031/152] refactor: removed unwanted file Signed-off-by: Rinkal Bhojani --- .env.test | 154 ------------------------------------------------------ 1 file changed, 154 deletions(-) delete mode 100644 .env.test diff --git a/.env.test b/.env.test deleted file mode 100644 index 33b8a3ab..00000000 --- a/.env.test +++ /dev/null @@ -1,154 +0,0 @@ -{ - "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoiUmVzdFRlbmFudEFnZW50IiwidGVuYW50SWQiOiIzMTMyMDM1ZC04NDllLTQ0NWUtYmM5NC1hN2Q3ZGZmYTUzMjciLCJpYXQiOjE3NjE4MTAxMDF9.UCo2HZgOewFs8a63XJAr313-j94pMwew26A0mzEFyAg", - "_tags": {}, - "type": "TenantRecord", - "metadata": { - "data": {} - }, - "storageVersion": "0.5", - "id": "3132035d-849e-445e-bc94-a7d7dffa5327", - "createdAt": "2025-10-30T07:41:41.352Z", - "config": { - "label": "holder-test", - "walletConfig": { - "id": "tenant-3132035d-849e-445e-bc94-a7d7dffa5327", - "key": "BhPEWGEtkrVRGNDFXxgVaQGTou8gfBbLnkKNH1LGWwU5", - "keyDerivationMethod": "RAW" - } - }, - "updatedAt": "2025-10-30T07:41:41.352Z" -} - -{ - "verifierId": "indigo", - "requestSigner": { - "method": "x5c", - "x5c": ["MIICsDCCAlagAwIBAgIQIqTxt6YWpzgTIi9Li6A+6jAKBggqhkjOPQQDAjA0MSUwIwYDVQQDExxFeGFtcGxlIFZlcmlmaWVyIENvcnBvcmF0aW9uMQswCQYDVQQGEwJVUzAeFw0yNTAxMDEwMDAwMDBaFw0yNjAxMDEwMDAwMDBaMDQxJTAjBgNVBAMTHEV4YW1wbGUgVmVyaWZpZXIgQ29ycG9yYXRpb24xCzAJBgNVBAYTAlVTMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEc2PMmczHrr1eg7wraEpkIszjv8NmfX2BCBvEr9I35R8+eaz8jPKjr1WEve+xOk6R+RPO5f/4MBfdoVGcIzeCn6OCAUgwggFEMB0GA1UdDgQWBBQ89y8cqjRLnZsfd+DzATrJZcwrbDAOBgNVHQ8BAf8EBAMCAaIwFQYDVR0lAQH/BAswCQYHKIGMXQUBAjAiBgNVHSMBAf8EGDAWgBQ89y8cqjRLnZsfd+DzATrJZcwrbDBdBgNVHRIBAf8EUzBRggtleGFtcGxlLmNvbYYhaHR0cDovL2V4YW1wbGVpc3N1ZXIuVmVyaWZpZXIuY29tgR9hZG1pbkBleGFtcGxlaXNzdWVyVmVyaWZpZXIuY29tMGUGA1UdEQEB/wRbMFmCFGV4YW1wbGUuVmVyaWZpZXIuY29thhhodHRwOi8vMTkyLjE2OC4xLjIxOjQwMDKCDDE5Mi4xNjguMS4yMYEZYWRtaW5AZXhhbXBsZVZlcmlmaWVyLmNvbTASBgNVHRMBAf8ECDAGAQH/AgEAMAoGCCqGSM49BAMCA0gAMEUCIQD79OwetGh5FHpk4qXPA/X0ZW/Hvg28rRpggEY9oQQc3wIgbtgH6zm4Rmptwe7lHgyzBITKwouh193LVo/kU5m0sqQ="] - }, - "dcql": { - "query": { - "combine": "all", - "credentials": [ - { - "id": "orgiso23220photoID1", - "format": "mso_mdoc", - "meta": { - "doctype": "org.iso.23220.photoID.1" - }, - "require_cryptographic_holder_binding": true, - "claims": [ - { - "path": [ - "org.iso.23220.photoID.1", - "given_name" - ], - "intent_to_retain": true - }, - { - "path": [ - "org.iso.23220.photoID.1", - "family_name" - ], - "intent_to_retain": true - }, - { - "path": [ - "org.iso.23220.photoID.1", - "document_number" - ], - "intent_to_retain": true - }, - { - "path": [ - "org.iso.23220.photoID.1", - "nationality" - ], - "intent_to_retain": true - }, - { - "path": [ - "org.iso.23220.photoID.1", - "sex" - ], - "intent_to_retain": true - }, - { - "path": [ - "org.iso.23220.photoID.1", - "expiry_date" - ], - "intent_to_retain": true - } - ] - }, - { - "id": "boardingPass", - "format": "dc+sd-jwt", - "meta": { - "vct": "BoardingPass" - }, - "require_cryptographic_holder_binding": true, - "claims": [ - { - "path": [ - "paxName" - ], - "intent_to_retain": true - }, - { - "path": [ - "boardingPass", - "barcodeString" - ], - "intent_to_retain": true - }, - { - "path": [ - "boardingPass", - "ticketLessOrElectronicTicketInd" - ], - "intent_to_retain": true - }, - { - "path": [ - "boardingPass", - "paxSegments", - "0", - "operatingCarrierFlightNumber" - ], - "intent_to_retain": true - }, - { - "path": [ - "boardingPass", - "paxSegments", - "0", - "originStationIATALocationCode" - ], - "intent_to_retain": true - }, - { - "path": [ - "boardingPass", - "paxSegments", - "0", - "destStationIATALocationCode" - ], - "intent_to_retain": true - }, - { - "path": [ - "boardingPass", - "paxSegments", - "0", - "seatAssignmentStatusOrSeatNumberCode" - ], - "intent_to_retain": true - } - ] - } - ] - } - }, - "responseMode": "direct_post.jwt" -} \ No newline at end of file From c032d999c22c46852c58e0c9eb55f1e7ee7bfb28 Mon Sep 17 00:00:00 2001 From: Rinkal Bhojani Date: Fri, 14 Nov 2025 15:06:12 +0530 Subject: [PATCH 032/152] fix: fixed issue with url encoded body size for agent's internal endpoints Signed-off-by: Rinkal Bhojani --- .env.demo | 5 ++++- .env.sample | 5 ++++- src/authentication.ts | 3 --- src/cliAgent.ts | 9 +++++++++ src/server.ts | 4 ++-- 5 files changed, 19 insertions(+), 7 deletions(-) diff --git a/.env.demo b/.env.demo index 89a2bdbd..28d87956 100644 --- a/.env.demo +++ b/.env.demo @@ -73,4 +73,7 @@ OID4VCI_AUTH_CODE_EXPIRY=3600 OID4VCI_CNONCE_EXPIRY=3600 # Expiry is in seconds -OID4VP_AUTH_REQUEST_PROOF_REQUEST_EXPIRY=3600 \ No newline at end of file +OID4VP_AUTH_REQUEST_PROOF_REQUEST_EXPIRY=3600 + +APP_JSON_BODY_SIZE=5mb +APP_URL_ENCODED_BODY_SIZE=5mb \ No newline at end of file diff --git a/.env.sample b/.env.sample index 3cc26fef..74f41f73 100644 --- a/.env.sample +++ b/.env.sample @@ -70,4 +70,7 @@ OID4VCI_AUTH_CODE_EXPIRY=3600 OID4VCI_CNONCE_EXPIRY=3600 # Expiry is in seconds -OID4VP_AUTH_REQUEST_PROOF_REQUEST_EXPIRY=3600 \ No newline at end of file +OID4VP_AUTH_REQUEST_PROOF_REQUEST_EXPIRY=3600 + +APP_JSON_BODY_SIZE=5mb +APP_URL_ENCODED_BODY_SIZE=5mb \ No newline at end of file diff --git a/src/authentication.ts b/src/authentication.ts index c9004794..e41e49bf 100644 --- a/src/authentication.ts +++ b/src/authentication.ts @@ -25,9 +25,6 @@ export async function expressAuthentication(request: Request, securityName: stri const logger = new TsLogger(LogLevel.info) const agent = container.resolve(Agent) - logger.info(`securityName::: ${securityName}`) - logger.info(`scopes::: ${scopes}`) - if (scopes && scopes?.includes(SCOPES.UNPROTECTED)) { // Skip authentication for this route or controller request.agent = agent diff --git a/src/cliAgent.ts b/src/cliAgent.ts index 9023859b..3121c913 100644 --- a/src/cliAgent.ts +++ b/src/cliAgent.ts @@ -72,6 +72,7 @@ import { getMixedCredentialRequestToCredentialMapper, getTrustedCerts, } from './utils/oid4vc-agent' +import bodyParser from 'body-parser' const openId4VciRouter = Router() const openId4VpRouter = Router() @@ -472,6 +473,14 @@ export async function runRestAgent(restConfig: AriesRestConfig) { // Configure the oid4vc routers on the http inbound transport if (transport instanceof HttpInboundTransport) { + transport.app.use( + bodyParser.urlencoded({ + extended: true, + limit: process.env.APP_URL_ENCODED_BODY_SIZE ?? '5mb', + }), + ) + 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) } diff --git a/src/server.ts b/src/server.ts index b4bf2b5d..39ab1928 100644 --- a/src/server.ts +++ b/src/server.ts @@ -62,13 +62,13 @@ export const setupServer = async ( app.use( bodyParser.urlencoded({ extended: true, - limit: '50mb', + limit: process.env.APP_URL_ENCODED_BODY_SIZE ?? '5mb', }), ) setDynamicApiKey(apiKey ? apiKey : '') - app.use(bodyParser.json({ limit: '50mb' })) + app.use(bodyParser.json({ limit: process.env.APP_JSON_BODY_SIZE ?? '5mb' })) app.use('/docs', serve, (_req: ExRequest, res: ExResponse, next: NextFunction) => { import('./routes/swagger.json') .then((swaggerJson) => { From 7094e26620b6c759e2c2565636c9d42997be20de Mon Sep 17 00:00:00 2001 From: Tipu_Singh Date: Tue, 2 Dec 2025 14:52:45 +0530 Subject: [PATCH 033/152] feat: dcapi support Signed-off-by: Tipu_Singh --- src/controllers/openid4vc/types/verifier.types.ts | 3 +++ .../verifier-sessions/verification-sessions.service.ts | 6 +++++- src/routes/routes.ts | 3 ++- src/routes/swagger.json | 10 +++++++++- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/controllers/openid4vc/types/verifier.types.ts b/src/controllers/openid4vc/types/verifier.types.ts index 270620f3..bcee1882 100644 --- a/src/controllers/openid4vc/types/verifier.types.ts +++ b/src/controllers/openid4vc/types/verifier.types.ts @@ -5,6 +5,8 @@ import type { SubmissionRequirement, Format, Issuance, InputDescriptorV2 } from export enum ResponseModeEnum { DIRECT_POST = 'direct_post', DIRECT_POST_JWT = 'direct_post.jwt', + DC_API = 'dc_api', + DC_API_JWT = 'dc_api.jwt' } /* -------------------------------------------------------------------------- */ @@ -77,6 +79,7 @@ export interface CreateAuthorizationRequest { responseMode?: ResponseModeEnum requestSigner: OpenId4VcJwtIssuerDid | OpenId4VcIssuerX5c + expectedOrigins?: string [] } /* -------------------------------------------------------------------------- */ diff --git a/src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts b/src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts index defa6932..ffa49c0c 100644 --- a/src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts +++ b/src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts @@ -18,7 +18,7 @@ import { OpenId4VcIssuerX5c, OpenId4VcJwtIssuerDid, OpenId4VcVerificationSession import { injectable } from 'tsyringe' import { Request as Req } from 'express' import { SignerMethod } from '../../../enums' -import { CreateAuthorizationRequest } from '../types/verifier.types' +import { CreateAuthorizationRequest, ResponseModeEnum } from '../types/verifier.types' // import { CreateAuthorizationRequest } from '../types/verifier.types' @@ -68,6 +68,10 @@ class VerificationSessionsService { 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 diff --git a/src/routes/routes.ts b/src/routes/routes.ts index 886d580f..ad89c3b4 100644 --- a/src/routes/routes.ts +++ b/src/routes/routes.ts @@ -2156,7 +2156,7 @@ const models: TsoaRoute.Models = { // WARNING: This 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"], + "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": { @@ -2177,6 +2177,7 @@ const models: TsoaRoute.Models = { "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, }, diff --git a/src/routes/swagger.json b/src/routes/swagger.json index 1bcf372a..1e13eb1f 100644 --- a/src/routes/swagger.json +++ b/src/routes/swagger.json @@ -4948,7 +4948,9 @@ "ResponseModeEnum": { "enum": [ "direct_post", - "direct_post.jwt" + "direct_post.jwt", + "dc_api", + "dc_api.jwt" ], "type": "string" }, @@ -5029,6 +5031,12 @@ "$ref": "#/components/schemas/OpenId4VcIssuerX5c" } ] + }, + "expectedOrigins": { + "items": { + "type": "string" + }, + "type": "array" } }, "required": [ From 8ac372e2408694ee2c0d371b4f934fb025018a8c Mon Sep 17 00:00:00 2001 From: Rinkal Bhojani Date: Wed, 31 Dec 2025 12:00:49 +0530 Subject: [PATCH 034/152] fix: fixed issue with disclosure frame in SD-JWT issuance Signed-off-by: Rinkal Bhojani --- .../openid4vc/types/issuer.types.ts | 48 ++++++++++--------- src/routes/routes.ts | 16 +++---- src/routes/swagger.json | 28 ++++++----- src/utils/oid4vc-agent.ts | 5 +- 4 files changed, 51 insertions(+), 46 deletions(-) diff --git a/src/controllers/openid4vc/types/issuer.types.ts b/src/controllers/openid4vc/types/issuer.types.ts index 30f432d5..9c37ea52 100644 --- a/src/controllers/openid4vc/types/issuer.types.ts +++ b/src/controllers/openid4vc/types/issuer.types.ts @@ -1,5 +1,5 @@ -import { MdocNameSpaces, W3cCredential } from "@credo-ts/core" -import { OpenId4VciCreateCredentialOfferOptions, OpenId4VciCredentialFormatProfile, OpenId4VciSignCredentials } from "@credo-ts/openid4vc" +import type { MdocNameSpaces, W3cCredential } from '@credo-ts/core' +import type { OpenId4VciCredentialFormatProfile } from '@credo-ts/openid4vc' export enum SignerMethod { Did = 'did', @@ -7,8 +7,8 @@ export enum SignerMethod { } export interface OpenId4VciOfferCredentials { - credentialSupportedId: string - format: OpenId4VciCredentialFormatProfile, + credentialSupportedId: string + format: OpenId4VciCredentialFormatProfile signerOptions: { method: SignerMethod did?: string @@ -16,40 +16,44 @@ export interface OpenId4VciOfferCredentials { } } +export interface DisclosureFrame { + _sd?: string[] + [claim: string]: DisclosureFrame | string[] | undefined +} + export interface OpenId4VciOfferSdJwtCredential extends OpenId4VciOfferCredentials { - payload: { vct?: string [key: string]: unknown } - disclosureFrame?: Record> + // disclosureFrame?: Record> + disclosureFrame?: DisclosureFrame } export interface ValidityInfo { - signed: Date; - validFrom: Date; - validUntil: Date; - expectedUpdate?: Date; + signed: Date + validFrom: Date + validUntil: Date + expectedUpdate?: Date } -export interface OpenId4VciOfferMdocCredential extends OpenId4VciOfferCredentials { +export interface OpenId4VciOfferMdocCredential extends OpenId4VciOfferCredentials { payload: { docType: 'org.iso.18013.5.1.mDL' | (string & {}) - validityInfo?: Partial, - namespaces: MdocNameSpaces + validityInfo?: Partial + namespaces: MdocNameSpaces } } -export interface OpenId4VciOfferW3cCredential extends OpenId4VciOfferCredentials { +export interface OpenId4VciOfferW3cCredential extends OpenId4VciOfferCredentials { payload: { - verificationMethod: string; - credential: W3cCredential; + verificationMethod: string + credential: W3cCredential } } - -export interface OpenId4VcIssuanceSessionsCreateOffer {//extends OpenId4VciCreateCredentialOfferOptions { +export interface OpenId4VcIssuanceSessionsCreateOffer { publicIssuerId: string - credentials: Array + credentials: Array authorizationCodeFlowConfig?: { authorizationServerUrl: string requirePresentationDuringIssuance?: boolean @@ -124,9 +128,9 @@ export interface CredentialDefinition { } export interface CredentialConfigurationSupportedWithFormats { - format: 'vc+sd-jwt' | 'mso_mdoc' | 'jwt_vc_json' | string, - vct?: string, - doctype?: string, + format: 'vc+sd-jwt' | 'mso_mdoc' | 'jwt_vc_json' | string + vct?: string + doctype?: string scope?: string claims?: any cryptographic_binding_methods_supported?: string[] diff --git a/src/routes/routes.ts b/src/routes/routes.ts index ad89c3b4..e8c91093 100644 --- a/src/routes/routes.ts +++ b/src/routes/routes.ts @@ -1620,14 +1620,12 @@ const models: TsoaRoute.Models = { "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":{}}, + "DisclosureFrame": { + "dataType": "refObject", + "properties": { + "_sd": {"dataType":"array","array":{"dataType":"string"}}, + }, + "additionalProperties": {"dataType":"union","subSchemas":[{"ref":"DisclosureFrame"},{"dataType":"array","array":{"dataType":"string"}},{"dataType":"undefined"}]}, }, // WARNING: This 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": { @@ -1647,7 +1645,7 @@ const models: TsoaRoute.Models = { "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__"}, + "disclosureFrame": {"ref":"DisclosureFrame"}, }, "additionalProperties": false, }, diff --git a/src/routes/swagger.json b/src/routes/swagger.json index 1e13eb1f..92394f98 100644 --- a/src/routes/swagger.json +++ b/src/routes/swagger.json @@ -3622,25 +3622,29 @@ "OpenId4VcIssuanceSessionRecord": { "$ref": "#/components/schemas/Record_string.unknown_" }, - "Record_string.boolean_": { - "properties": {}, + "DisclosureFrame": { + "properties": { + "_sd": { + "items": { + "type": "string" + }, + "type": "array" + } + }, "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/DisclosureFrame" }, { - "$ref": "#/components/schemas/Record_string.boolean_" + "items": { + "type": "string" + }, + "type": "array" } ] - }, - "type": "object", - "description": "Construct a type with a set of properties K of type T" + } }, "OpenId4VciCredentialFormatProfile": { "enum": [ @@ -3697,7 +3701,7 @@ "type": "object" }, "disclosureFrame": { - "$ref": "#/components/schemas/Record_string.boolean-or-Record_string.boolean__" + "$ref": "#/components/schemas/DisclosureFrame" } }, "required": [ diff --git a/src/utils/oid4vc-agent.ts b/src/utils/oid4vc-agent.ts index 14ef14aa..672bdf5e 100644 --- a/src/utils/oid4vc-agent.ts +++ b/src/utils/oid4vc-agent.ts @@ -318,8 +318,8 @@ export function getMixedCredentialRequestToCredentialMapper(): OpenId4VciCredent if (credentialConfiguration.format === OpenId4VciCredentialFormatProfile.SdJwtVc) { const disclosureFramePayload = - credentialPayload[0].disclosureFrame && Object.keys(credentialPayload[0].disclosureFrame).length > 0 - ? credentialPayload[0].disclosureFrame + credential.disclosureFrame && Object.keys(credential.disclosureFrame).length > 0 + ? credential.disclosureFrame : {} //Taking leaf certifcate from chain as issuer certificate, if not provided explicitly taking AGENT_HTTP_URL as issuer @@ -430,7 +430,6 @@ export async function getTrustedCerts() { } const data = await response.json() - console.log('Success:', data) return data as string[] } catch (error) { console.error('Error fetching data:', error) From 8f74ce0a28db412dabf01b9108d91174ac537521 Mon Sep 17 00:00:00 2001 From: Rinkal Bhojani Date: Fri, 2 Jan 2026 19:53:46 +0530 Subject: [PATCH 035/152] Made dcql query type as any to support all combination for now, support no-auth code implementation Signed-off-by: Rinkal Bhojani --- .../openid4vc/types/issuer.types.ts | 12 +-- .../openid4vc/types/verifier.types.ts | 36 ++++----- src/routes/routes.ts | 34 +-------- src/routes/swagger.json | 73 +------------------ 4 files changed, 28 insertions(+), 127 deletions(-) diff --git a/src/controllers/openid4vc/types/issuer.types.ts b/src/controllers/openid4vc/types/issuer.types.ts index 9c37ea52..98da6ac1 100644 --- a/src/controllers/openid4vc/types/issuer.types.ts +++ b/src/controllers/openid4vc/types/issuer.types.ts @@ -61,11 +61,13 @@ export interface OpenId4VcIssuanceSessionsCreateOffer { } preAuthorizedCodeFlowConfig?: { preAuthorizedCode?: string - txCode?: { - description?: string - length?: number - input_mode?: 'numeric' | 'text' - } + txCode?: + | { + description?: string + length?: number + input_mode?: 'numeric' | 'text' + } + | undefined authorizationServerUrl: string } issuanceMetadata?: Record diff --git a/src/controllers/openid4vc/types/verifier.types.ts b/src/controllers/openid4vc/types/verifier.types.ts index bcee1882..61ea0b95 100644 --- a/src/controllers/openid4vc/types/verifier.types.ts +++ b/src/controllers/openid4vc/types/verifier.types.ts @@ -34,26 +34,26 @@ export interface PresentationDefinition { /* DCQL MODELS */ /* -------------------------------------------------------------------------- */ -export interface DcqlClaim { - path: string[] - intent_to_retain?: boolean -} - -export interface DcqlCredential { - id: string - format: string - meta?: Record - require_cryptographic_holder_binding?: boolean - claims: DcqlClaim[] -} - -export interface DcqlQuery { - combine?: 'all' | 'any' - credentials: DcqlCredential[] -} +// export interface DcqlClaim { +// path: string[] +// intent_to_retain?: boolean +// } + +// export interface DcqlCredential { +// id: string +// format: string +// meta?: Record +// require_cryptographic_holder_binding?: boolean +// claims: DcqlClaim[] +// } + +// export interface DcqlQuery { +// combine?: 'all' | 'any' +// credentials: DcqlCredential[] +// } export interface DcqlDefinition { - query: DcqlQuery + query: any } /* -------------------------------------------------------------------------- */ diff --git a/src/routes/routes.ts b/src/routes/routes.ts index e8c91093..b0c9e188 100644 --- a/src/routes/routes.ts +++ b/src/routes/routes.ts @@ -1693,7 +1693,7 @@ const models: TsoaRoute.Models = { "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"}}}, + "preAuthorizedCodeFlowConfig": {"dataType":"nestedObjectLiteral","nestedProperties":{"authorizationServerUrl":{"dataType":"string","required":true},"txCode":{"dataType":"union","subSchemas":[{"dataType":"nestedObjectLiteral","nestedProperties":{"input_mode":{"dataType":"union","subSchemas":[{"dataType":"enum","enums":["numeric"]},{"dataType":"enum","enums":["text"]}]},"length":{"dataType":"double"},"description":{"dataType":"string"}}},{"dataType":"undefined"}]},"preAuthorizedCode":{"dataType":"string"}}}, "issuanceMetadata": {"ref":"Record_string.unknown_"}, }, "additionalProperties": false, @@ -2114,40 +2114,10 @@ const models: TsoaRoute.Models = { "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}, + "query": {"dataType":"any","required":true}, }, "additionalProperties": false, }, diff --git a/src/routes/swagger.json b/src/routes/swagger.json index 92394f98..7c35d65b 100644 --- a/src/routes/swagger.json +++ b/src/routes/swagger.json @@ -4868,80 +4868,9 @@ "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" - } + "query": {} }, "required": [ "query" From f3693c73e60ba41d47d2e1eb6072b30b5b3f3c7a Mon Sep 17 00:00:00 2001 From: Rinkal Bhojani Date: Mon, 5 Jan 2026 11:31:58 +0530 Subject: [PATCH 036/152] fix: fixed typescript issue Signed-off-by: Rinkal Bhojani --- src/controllers/openid4vc/types/issuer.types.ts | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/controllers/openid4vc/types/issuer.types.ts b/src/controllers/openid4vc/types/issuer.types.ts index 98da6ac1..9c37ea52 100644 --- a/src/controllers/openid4vc/types/issuer.types.ts +++ b/src/controllers/openid4vc/types/issuer.types.ts @@ -61,13 +61,11 @@ export interface OpenId4VcIssuanceSessionsCreateOffer { } preAuthorizedCodeFlowConfig?: { preAuthorizedCode?: string - txCode?: - | { - description?: string - length?: number - input_mode?: 'numeric' | 'text' - } - | undefined + txCode?: { + description?: string + length?: number + input_mode?: 'numeric' | 'text' + } authorizationServerUrl: string } issuanceMetadata?: Record From bab09334bf594c750b84f7947e8cb664f7778a5d Mon Sep 17 00:00:00 2001 From: Krishna Waske Date: Thu, 4 Dec 2025 15:41:14 +0530 Subject: [PATCH 037/152] fix: changes for types Signed-off-by: Krishna Waske --- src/controllers/types.ts | 87 +++++++++++++++++++--------------------- 1 file changed, 42 insertions(+), 45 deletions(-) diff --git a/src/controllers/types.ts b/src/controllers/types.ts index 074afd93..32005d73 100644 --- a/src/controllers/types.ts +++ b/src/controllers/types.ts @@ -1,6 +1,6 @@ import type { RecordId } from './examples' import type { CustomHandshakeProtocol } from '../enums' -import type { AnonCredsCredentialFormat, LegacyIndyCredentialFormat } from '@credo-ts/anoncreds' +import type { AnonCredsCredentialDefinitionRecord, AnonCredsDidCommCredentialFormat, LegacyIndyCredentialFormat } from '@credo-ts/anoncreds' import type { DidResolutionMetadata, DidDocumentMetadata, @@ -8,9 +8,7 @@ import type { DidDocument, DidRegistrationSecretOptions, InitConfig, - WalletConfig, DidResolutionOptions, - KeyType, JsonObject, W3cJsonLdVerifyCredentialOptions, DataIntegrityProofOptions, @@ -19,31 +17,30 @@ import type { W3cCredentialSubject, X509CertificateIssuerAndSubjectOptions, X509CreateCertificateOptions, + SingleOrArray, } from '@credo-ts/core' import type { - AutoAcceptCredential, - AutoAcceptProof, - JsonLdCredentialFormat, JsonCredential, - AgentMessage, - Routing, - Attachment, - CredentialExchangeRecord, - ProofExchangeRecord, - ProofFormat, - CredentialFormatPayload, - HandshakeProtocol, ReceiveOutOfBandInvitationConfig, OutOfBandDidCommService, + DidCommCredentialFormatPayload, + DidCommAutoAcceptCredential, + DidCommProofExchangeRecord, + DidCommJsonLdCredentialFormat, + DidCommCredentialExchangeRecord, + DidCommAutoAcceptProof, + DidCommHandshakeProtocol, + DidCommMessage, + DidCommRouting, + DidCommAttachment, } from '@credo-ts/didcomm' -import type { LinkedDataProofOptions } from '@credo-ts/core/build/modules/vc/data-integrity/models/LinkedDataProof' -import type { SingleOrArray } from '@credo-ts/core/build/utils' 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' -export type CustomTenantConfig = Pick & { +export type CustomTenantConfig = {label: string} & { connectionImageUrl?: string - walletConfig: Pick } export interface AgentInfo { @@ -71,11 +68,11 @@ export interface DidResolutionResultProps { export interface ProofRequestMessageResponse { message: string - proofRecord: ProofExchangeRecord + proofRecord: DidCommProofExchangeRecord } // type CredentialFormats = [CredentialFormat] -type CredentialFormats = [LegacyIndyCredentialFormat, AnonCredsCredentialFormat, JsonLdCredentialFormat] +type CredentialFormats = [LegacyIndyCredentialFormat, AnonCredsDidCommCredentialFormat, DidCommJsonLdCredentialFormat] enum ProtocolVersion { v1 = 'v1', @@ -83,8 +80,8 @@ enum ProtocolVersion { } export interface ProposeCredentialOptions { protocolVersion: ProtocolVersion - credentialFormats: CredentialFormatPayload - autoAcceptCredential?: AutoAcceptCredential + credentialFormats: DidCommCredentialFormatPayload + autoAcceptCredential?: DidCommAutoAcceptCredential comment?: string connectionId: RecordId } @@ -92,32 +89,32 @@ export interface ProposeCredentialOptions { // export interface ProposeCredentialOptions extends BaseOptions { // connectionId: string // protocolVersion: CredentialProtocolVersionType -// credentialFormats: CredentialFormatPayload, 'createProposal'> +// credentialFormats: DidCommCredentialFormatPayload, 'createProposal'> // } export interface AcceptCredentialProposalOptions { credentialRecordId: string - credentialFormats?: CredentialFormatPayload - autoAcceptCredential?: AutoAcceptCredential + credentialFormats?: DidCommCredentialFormatPayload + autoAcceptCredential?: DidCommAutoAcceptCredential comment?: string } export interface CreateOfferOptions { protocolVersion: ProtocolVersion connectionId: RecordId - credentialFormats: CredentialFormatPayload - autoAcceptCredential?: AutoAcceptCredential + credentialFormats: DidCommCredentialFormatPayload + autoAcceptCredential?: DidCommAutoAcceptCredential comment?: string goalCode?: string goal?: string } -type CredentialFormatType = LegacyIndyCredentialFormat | JsonLdCredentialFormat | AnonCredsCredentialFormat +type CredentialFormatType = LegacyIndyCredentialFormat | DidCommJsonLdCredentialFormat | AnonCredsDidCommCredentialFormat export interface CreateOfferOobOptions { protocolVersion: string - credentialFormats: CredentialFormatPayload - autoAcceptCredential?: AutoAcceptCredential + credentialFormats: DidCommCredentialFormatPayload + autoAcceptCredential?: DidCommAutoAcceptCredential comment?: string goalCode?: string parentThreadId?: string @@ -128,7 +125,7 @@ export interface CreateOfferOobOptions { invitationDid?: string } export interface CredentialCreateOfferOptions { - credentialRecord: CredentialExchangeRecord + credentialRecord: DidCommCredentialExchangeRecord credentialFormats: JsonCredential options: any attachmentId?: string @@ -140,7 +137,7 @@ export interface CreateProofRequestOobOptions { goalCode?: string parentThreadId?: string willConfirm?: boolean - autoAcceptProof?: AutoAcceptProof + autoAcceptProof?: DidCommAutoAcceptProof comment?: string label?: string imageUrl?: string @@ -158,7 +155,7 @@ export interface OfferCredentialOptions { }[] } } - autoAcceptCredential?: AutoAcceptCredential + autoAcceptCredential?: DidCommAutoAcceptCredential comment?: string connectionId: string } @@ -184,15 +181,15 @@ export interface AcceptCredential { export interface CredentialOfferOptions { credentialRecordId: RecordId - credentialFormats?: CredentialFormatPayload - autoAcceptCredential?: AutoAcceptCredential + credentialFormats?: DidCommCredentialFormatPayload + autoAcceptCredential?: DidCommAutoAcceptCredential comment?: string } export interface AcceptCredentialRequestOptions { credentialRecordId: RecordId - credentialFormats?: CredentialFormatPayload - autoAcceptCredential?: AutoAcceptCredential + credentialFormats?: DidCommCredentialFormatPayload + autoAcceptCredential?: DidCommAutoAcceptCredential comment?: string } @@ -245,7 +242,7 @@ export interface ConnectionInvitationSchema { // // TODO: added indy proof formate // proofFormats: ProofFormatPayload<[IndyProofFormat], 'createRequest'> // comment: string -// autoAcceptProof?: AutoAcceptProof +// autoAcceptProof?: DidCommAutoAcceptProof // parentThreadId?: string // } @@ -254,7 +251,7 @@ export interface RequestProofOptions { protocolVersion: string proofFormats: any comment: string - autoAcceptProof: AutoAcceptProof + autoAcceptProof: DidCommAutoAcceptProof goalCode?: string parentThreadId?: string willConfirm?: boolean @@ -266,7 +263,7 @@ export interface RequestProofProposalOptions { proofFormats: any goalCode?: string parentThreadId?: string - autoAcceptProof?: AutoAcceptProof + autoAcceptProof?: DidCommAutoAcceptProof comment?: string } @@ -274,7 +271,7 @@ export interface AcceptProofProposal { proofRecordId: string proofFormats: any comment?: string - autoAcceptProof?: AutoAcceptProof + autoAcceptProof?: DidCommAutoAcceptProof goalCode?: string willConfirm?: boolean } @@ -337,12 +334,12 @@ export interface CreateInvitationOptions { goalCode?: string goal?: string handshake?: boolean - handshakeProtocols?: HandshakeProtocol[] - messages?: AgentMessage[] + handshakeProtocols?: DidCommHandshakeProtocol[] + messages?: DidCommMessage[] multiUseInvitation?: boolean autoAcceptConnection?: boolean - routing?: Routing - appendedAttachments?: Attachment[] + routing?: DidCommRouting + appendedAttachments?: DidCommAttachment[] invitationDid?: string } From 8f285664be268f7eb6a508e2452c8432da30704d Mon Sep 17 00:00:00 2001 From: Krishna Waske Date: Mon, 8 Dec 2025 16:08:49 +0530 Subject: [PATCH 038/152] fix: version update and types update Signed-off-by: Krishna Waske --- package.json | 23 ++++---- src/authentication.ts | 4 +- src/controllers/examples.ts | 58 +++++++++---------- src/events/BasicMessageEvents.ts | 4 +- src/events/ConnectionEvents.ts | 4 +- src/events/CredentialEvents.ts | 6 +- src/events/ProofEvents.ts | 4 +- src/events/ReuseConnectionEvents.ts | 4 +- src/events/openId4VcIssuanceSessionEvents.ts | 2 - .../openId4VcVerificationSessionEvents.ts | 2 - src/server.ts | 2 +- src/types/request.d.ts | 2 +- src/utils/helpers.ts | 3 +- 13 files changed, 57 insertions(+), 61 deletions(-) diff --git a/package.json b/package.json index abf8daf1..a89e5d93 100644 --- a/package.json +++ b/package.json @@ -40,17 +40,16 @@ }, "dependencies": { "@ayanworks/credo-polygon-w3c-module": "1.0.1-alpha.1", - "@credo-ts/anoncreds": "0.6.0-alpha-20250325224513", - "@credo-ts/askar": "0.6.0-alpha-20250325224513", - "@credo-ts/core": "0.6.0-alpha-20250325224513", - "@credo-ts/indy-vdr": "0.6.0-alpha-20250325224513", - "@credo-ts/node": "^0.6.0-alpha-20250325224513", - "@credo-ts/openid4vc": "0.6.0-alpha-20250325224513", + "@credo-ts/anoncreds": "0.6.0", + "@credo-ts/askar": "0.6.0", + "@credo-ts/core": "0.6.0", + "@credo-ts/indy-vdr": "0.6.0", + "@credo-ts/node": "^0.6.0", + "@credo-ts/openid4vc": "0.6.0", "@credo-ts/push-notifications": "^0.7.1", - "@credo-ts/question-answer": "0.6.0-alpha-20250325224513", - "@credo-ts/tenants": "0.6.0-alpha-20250325224513", + "@credo-ts/question-answer": "0.6.0", + "@credo-ts/tenants": "0.6.0", "@hyperledger/anoncreds-nodejs": "0.3.1", - "@openwallet-foundation/askar-nodejs": "^0.3.2", "@hyperledger/indy-vdr-nodejs": "0.2.2", "@opentelemetry/api": "^1.9.0", "@opentelemetry/exporter-logs-otlp-http": "^0.202.0", @@ -62,6 +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", "@tsoa/runtime": "^6.6.0", "@types/node-fetch": "^2.6.4", "@types/ref-struct-di": "^1.1.12", @@ -82,6 +82,7 @@ "tslog": "^3.3.3", "tsoa": "^6.0.1", "tsyringe": "^4.8.0", + "uuid": "^13.0.0", "ws": "^8.18.2", "yargs": "^17.7.2" }, @@ -116,7 +117,7 @@ "typescript": "^5.8.3" }, "resolutions": { - "@credo-ts/core": "0.6.0-alpha-20250325224513", - "@credo-ts/askar": "0.6.0-alpha-20250325224513" + "@credo-ts/core": "0.6.0", + "@credo-ts/askar": "0.6.0" } } diff --git a/src/authentication.ts b/src/authentication.ts index e41e49bf..29a7e939 100644 --- a/src/authentication.ts +++ b/src/authentication.ts @@ -1,15 +1,15 @@ import type { RestAgentModules, RestMultiTenantAgentModules } from './cliAgent' -import type { TenantAgent } from '@credo-ts/tenants/build/TenantAgent' import type { Request } from 'express' import { Agent, LogLevel } from '@credo-ts/core' -import { uuid } from '@credo-ts/core/build/utils/uuid' import jwt, { decode } from 'jsonwebtoken' import { container } from 'tsyringe' import { AgentRole, ErrorMessages, SCOPES } from './enums' import { StatusException } from './errors' import { TsLogger } from './utils/logger' +import { TenantAgent } from '@credo-ts/tenants' +import { randomUUID as uuid } from 'node:crypto' // export type AgentType = Agent | Agent | TenantAgent diff --git a/src/controllers/examples.ts b/src/controllers/examples.ts index d7094905..b6027fcf 100644 --- a/src/controllers/examples.ts +++ b/src/controllers/examples.ts @@ -1,17 +1,17 @@ import type { - ProofRole, - AutoAcceptProof, - BasicMessageRole, - CredentialState, - DidExchangeRole, - DidExchangeState, - OutOfBandInvitationOptions, - OutOfBandRecordProps, - ProofExchangeRecordProps, - ProofState, - OutOfBandRole, - OutOfBandState, - CredentialRole, + DidCommProofRole, + DidCommBasicMessageRole, + DidCommCredentialState, + DidCommDidExchangeRole, + DidCommDidExchangeState, + DidCommOutOfBandInvitationOptions, + DidCommOutOfBandRecordProps, + DidCommProofExchangeRecordProps, + DidCommProofState, + DidCommOutOfBandRole, + DidCommOutOfBandState, + DidCommCredentialRole, + DidCommAutoAcceptProof, } from '@credo-ts/didcomm' /** @@ -50,7 +50,7 @@ export const BasicMessageRecordExample = { content: 'string', sentTime: '2022-08-18T08:38:40.216Z', connectionId: '2aecf74c-3073-4f98-9acb-92415d096834', - role: 'sender' as BasicMessageRole, + role: 'sender' as DidCommBasicMessageRole, } export const ConnectionRecordExample = { @@ -58,18 +58,18 @@ export const ConnectionRecordExample = { invitationDid: 'did:peer:2.SeyJzIjoiaHR0cHM6Ly9kYTIzLTg5LTIwLTE2Mi0xNDYubmdyb2suaW8iLCJ0IjoiZGlkLWNvbW11bmljYXRpb24iLCJwcmlvcml0eSI6MCwicmVjaXBpZW50S2V5cyI6WyJkaWQ6a2V5Ono2TWtualg3U1lXRmdHMThCYkNEZHJnemhuQnA0UlhyOGVITHZxQ3FvRXllckxiTiN6Nk1rbmpYN1NZV0ZnRzE4QmJDRGRyZ3pobkJwNFJYcjhlSEx2cUNxb0V5ZXJMYk4iXSwiciI6W119', did: 'did:peer:1zQmfQh1T3rSqarP2FZ37uKjdQHPKFdVyo2mGiAPHZ8Ep7hv', - state: 'invitation-sent' as DidExchangeState, + state: 'invitation-sent' as DidCommDidExchangeState, invitationKey: '9HG4rJFpLiWf56MWxHj9rgdpErFzim2zEpHuxy1dw7oz', outOfBandId: 'edbc89fe-785f-4774-a288-46012486881d', verkey: '9HG4rJFpLiWf56MWxHj9rgdpErFzim2zEpHuxy1dw7oz', - role: 'responder' as DidExchangeRole, + role: 'responder' as DidCommDidExchangeRole, }, metadata: {}, id: '821f9b26-ad04-4f56-89b6-e2ef9c72b36e', createdAt: new Date('2022-01-01T00:00:00.000Z'), did: 'did:peer:1zQmfQh1T3rSqarP2FZ37uKjdQHPKFdVyo2mGiAPHZ8Ep7hv', - state: 'invitation-sent' as DidExchangeState, - role: 'responder' as DidExchangeRole, + state: 'invitation-sent' as DidCommDidExchangeState, + role: 'responder' as DidCommDidExchangeRole, invitationDid: 'did:peer:2.SeyJzIjoiaHR0cHM6Ly9kYTIzLTg5LTIwLTE2Mi0xNDYubmdyb2suaW8iLCJ0IjoiZGlkLWNvbW11bmljYXRpb24iLCJwcmlvcml0eSI6MCwicmVjaXBpZW50S2V5cyI6WyJkaWQ6a2V5Ono2TWtualg3U1lXRmdHMThCYkNEZHJnemhuQnA0UlhyOGVITHZxQ3FvRXllckxiTiN6Nk1rbmpYN1NZV0ZnRzE4QmJDRGRyZ3pobkJwNFJYcjhlSEx2cUNxb0V5ZXJMYk4iXSwiciI6W119', outOfBandId: 'edbc89fe-785f-4774-a288-46012486881d', @@ -121,9 +121,9 @@ export const DidRecordExample = { }, } -type OutOfBandRecordProperties = Omit +type OutOfBandRecordProperties = Omit export type OutOfBandInvitationProps = Omit< - OutOfBandInvitationOptions, + DidCommOutOfBandInvitationOptions, 'handshakeProtocols' | 'services' | 'appendedAttachments' > @@ -159,8 +159,8 @@ export const outOfBandRecordExample = { metadata: {}, id: '42a95528-0e30-4f86-a462-0efb02178b53', createdAt: new Date('2022-01-01T00:00:00.000Z'), - role: 'sender' as OutOfBandRole, - state: 'await-response' as OutOfBandState, + role: 'sender' as DidCommOutOfBandRole, + state: 'await-response' as DidCommOutOfBandState, reusable: false, } @@ -208,29 +208,29 @@ export const CredentialExchangeRecordExample = { credentials: [], id: '821f9b26-ad04-4f56-89b6-e2ef9c72b36e', createdAt: new Date('2022-01-01T00:00:00.000Z'), - state: 'offer-sent' as CredentialState, + state: 'offer-sent' as DidCommCredentialState, connectionId: 'ac6d0fdd-0db8-4f52-8a3d-de7ff8ddc14b', threadId: '82701488-b43c-4d7b-9244-4bb204a7ae26', credentialAttributes: [], protocolVersion: 'v1', - role: 'issuer' as CredentialRole.Issuer, + role: 'issuer' as DidCommCredentialRole.Issuer, } export const ProofRecordExample = { _tags: { - state: 'proposal-sent' as ProofState, + state: 'proposal-sent' as DidCommProofState, threadId: '0019d466-5eea-4269-8c40-031b4896c5b7', connectionId: '2aecf74c-3073-4f98-9acb-92415d096834', - } as ProofExchangeRecordProps, + } as DidCommProofExchangeRecordProps, metadata: {}, id: '821f9b26-ad04-4f56-89b6-e2ef9c72b36e', createdAt: new Date('2022-01-01T00:00:00.000Z'), - state: 'proposal-sent' as ProofState, + state: 'proposal-sent' as DidCommProofState, connectionId: '2aecf74c-3073-4f98-9acb-92415d096834', threadId: '0019d466-5eea-4269-8c40-031b4896c5b7', - autoAcceptProof: 'always' as AutoAcceptProof, + autoAcceptProof: 'always' as DidCommAutoAcceptProof, protocolVersion: 'v1', - role: 'verifier' as ProofRole.Verifier, + role: 'verifier' as DidCommProofRole.Verifier, } export const SchemaExample = { diff --git a/src/events/BasicMessageEvents.ts b/src/events/BasicMessageEvents.ts index 73d3cb2a..93470d64 100644 --- a/src/events/BasicMessageEvents.ts +++ b/src/events/BasicMessageEvents.ts @@ -1,12 +1,12 @@ import type { ServerConfig } from '../utils/ServerConfig' import type { Agent } from '@credo-ts/core' -import { BasicMessageEventTypes,BasicMessageStateChangedEvent } from '@credo-ts/didcomm' +import { DidCommBasicMessageEventTypes,DidCommBasicMessageStateChangedEvent } from '@credo-ts/didcomm' import { sendWebSocketEvent } from './WebSocketEvents' import { sendWebhookEvent } from './WebhookEvent' export const basicMessageEvents = async (agent: Agent, config: ServerConfig) => { - agent.events.on(BasicMessageEventTypes.BasicMessageStateChanged, async (event: BasicMessageStateChangedEvent) => { + agent.events.on(DidCommBasicMessageEventTypes.DidCommBasicMessageStateChanged, async (event: DidCommBasicMessageStateChangedEvent) => { const record = event.payload.basicMessageRecord const body = record.toJSON() diff --git a/src/events/ConnectionEvents.ts b/src/events/ConnectionEvents.ts index 28451f06..ae8cda39 100644 --- a/src/events/ConnectionEvents.ts +++ b/src/events/ConnectionEvents.ts @@ -1,13 +1,13 @@ import type { ServerConfig } from '../utils/ServerConfig' import type { Agent } from '@credo-ts/core' -import { ConnectionEventTypes, ConnectionStateChangedEvent } from '@credo-ts/didcomm' +import { DidCommConnectionEventTypes, DidCommConnectionStateChangedEvent } from '@credo-ts/didcomm' import { sendWebSocketEvent } from './WebSocketEvents' import { sendWebhookEvent } from './WebhookEvent' export const connectionEvents = async (agent: Agent, config: ServerConfig) => { - agent.events.on(ConnectionEventTypes.ConnectionStateChanged, async (event: ConnectionStateChangedEvent) => { + agent.events.on(DidCommConnectionEventTypes.DidCommConnectionStateChanged, async (event: DidCommConnectionStateChangedEvent) => { const record = event.payload.connectionRecord const body = { ...record.toJSON(), ...event.metadata } diff --git a/src/events/CredentialEvents.ts b/src/events/CredentialEvents.ts index 41530e7e..d9b8cf14 100644 --- a/src/events/CredentialEvents.ts +++ b/src/events/CredentialEvents.ts @@ -2,14 +2,14 @@ import type { RestMultiTenantAgentModules } from '../cliAgent' import type { ServerConfig } from '../utils/ServerConfig' import type { Agent } from '@credo-ts/core' -import { CredentialEventTypes, CredentialStateChangedEvent } from '@credo-ts/didcomm' +import { DidCommCredentialEventTypes, DidCommCredentialStateChangedEvent } from '@credo-ts/didcomm' import { sendWebSocketEvent } from './WebSocketEvents' import { sendWebhookEvent } from './WebhookEvent' export const credentialEvents = async (agent: Agent, config: ServerConfig) => { - agent.events.on(CredentialEventTypes.CredentialStateChanged, async (event: CredentialStateChangedEvent) => { - const record = event.payload.credentialRecord + agent.events.on(DidCommCredentialEventTypes.DidCommCredentialStateChanged, async (event: DidCommCredentialStateChangedEvent) => { + const record = event.payload.credentialExchangeRecord const body: Record = { ...record.toJSON(), diff --git a/src/events/ProofEvents.ts b/src/events/ProofEvents.ts index 65ac477f..ad961675 100644 --- a/src/events/ProofEvents.ts +++ b/src/events/ProofEvents.ts @@ -1,12 +1,12 @@ import type { ServerConfig } from '../utils/ServerConfig' import type { Agent, } from '@credo-ts/core' -import { ProofStateChangedEvent, ProofEventTypes } from '@credo-ts/didcomm' +import { DidCommProofStateChangedEvent, DidCommProofEventTypes } from '@credo-ts/didcomm' import { sendWebSocketEvent } from './WebSocketEvents' import { sendWebhookEvent } from './WebhookEvent' export const proofEvents = async (agent: Agent, config: ServerConfig) => { - agent.events.on(ProofEventTypes.ProofStateChanged, async (event: ProofStateChangedEvent) => { + agent.events.on(DidCommProofEventTypes.ProofStateChanged, async (event: DidCommProofStateChangedEvent) => { const record = event.payload.proofRecord const body = { ...record.toJSON(), ...event.metadata } as { proofData?: any } if (event.metadata.contextCorrelationId !== 'default') { diff --git a/src/events/ReuseConnectionEvents.ts b/src/events/ReuseConnectionEvents.ts index 8865dd32..5ad47afc 100644 --- a/src/events/ReuseConnectionEvents.ts +++ b/src/events/ReuseConnectionEvents.ts @@ -1,13 +1,13 @@ import type { ServerConfig } from '../utils/ServerConfig' import type { Agent } from '@credo-ts/core' -import { OutOfBandEventTypes, HandshakeReusedEvent } from '@credo-ts/didcomm' +import { DidCommOutOfBandEventTypes, DidCommHandshakeReusedEvent } from '@credo-ts/didcomm' import { sendWebSocketEvent } from './WebSocketEvents' import { sendWebhookEvent } from './WebhookEvent' export const reuseConnectionEvents = async (agent: Agent, config: ServerConfig) => { - agent.events.on(OutOfBandEventTypes.HandshakeReused, async (event: HandshakeReusedEvent) => { + agent.events.on(DidCommOutOfBandEventTypes.HandshakeReused, async (event: DidCommHandshakeReusedEvent) => { const body = { ...event.payload.connectionRecord.toJSON(), outOfBandRecord: event.payload.outOfBandRecord.toJSON(), diff --git a/src/events/openId4VcIssuanceSessionEvents.ts b/src/events/openId4VcIssuanceSessionEvents.ts index 5e639ffb..291331a0 100644 --- a/src/events/openId4VcIssuanceSessionEvents.ts +++ b/src/events/openId4VcIssuanceSessionEvents.ts @@ -1,8 +1,6 @@ import type { ServerConfig } from '../utils/ServerConfig' import type { Agent } from '@credo-ts/core' -import { CredentialEventTypes, CredentialStateChangedEvent } from '@credo-ts/didcomm' - import { sendWebSocketEvent } from './WebSocketEvents' import { sendWebhookEvent } from './WebhookEvent' import { OpenId4VcIssuerEvents } from '@credo-ts/openid4vc' diff --git a/src/events/openId4VcVerificationSessionEvents.ts b/src/events/openId4VcVerificationSessionEvents.ts index 617ab0cb..4643b44d 100644 --- a/src/events/openId4VcVerificationSessionEvents.ts +++ b/src/events/openId4VcVerificationSessionEvents.ts @@ -1,8 +1,6 @@ import type { ServerConfig } from '../utils/ServerConfig' import type { Agent } from '@credo-ts/core' -import { CredentialEventTypes, CredentialStateChangedEvent } from '@credo-ts/didcomm' - import { sendWebSocketEvent } from './WebSocketEvents' import { sendWebhookEvent } from './WebhookEvent' import { OpenId4VcVerificationSessionStateChangedEvent, OpenId4VcVerifierEvents } from '@credo-ts/openid4vc' diff --git a/src/server.ts b/src/server.ts index 39ab1928..f94c23c6 100644 --- a/src/server.ts +++ b/src/server.ts @@ -7,7 +7,6 @@ import type { ServerConfig } from './utils/ServerConfig' import type { Response as ExResponse, Request as ExRequest, NextFunction, ErrorRequestHandler } from 'express' import { Agent } from '@credo-ts/core' -import { TenantAgent } from '@credo-ts/tenants/build/TenantAgent' import bodyParser from 'body-parser' import cors from 'cors' import dotenv from 'dotenv' @@ -31,6 +30,7 @@ import { RegisterRoutes } from './routes/routes' import { SecurityMiddleware } from './securityMiddleware' import { openId4VcIssuanceSessionEvents } from './events/openId4VcIssuanceSessionEvents' import { openId4VcVerificationSessionEvents } from './events/openId4VcVerificationSessionEvents' +import { TenantAgent } from '@credo-ts/tenants' dotenv.config() diff --git a/src/types/request.d.ts b/src/types/request.d.ts index 89841327..91ef0e3a 100644 --- a/src/types/request.d.ts +++ b/src/types/request.d.ts @@ -1,6 +1,6 @@ import type { RestAgentModules, RestMultiTenantAgentModules } from '../cliAgent' import type { Agent } from '@credo-ts/core' -import type { TenantAgent } from '@credo-ts/tenants/build/TenantAgent' +import type { TenantAgent } from '@credo-ts/tenants' // declare global { // namespace Express { diff --git a/src/utils/helpers.ts b/src/utils/helpers.ts index 89fbce33..fdee31ae 100644 --- a/src/utils/helpers.ts +++ b/src/utils/helpers.ts @@ -1,5 +1,4 @@ -import { JsonTransformer } from '@credo-ts/core' -import { JsonEncoder } from '@credo-ts/core/build/utils/JsonEncoder' +import { JsonEncoder, JsonTransformer } from '@credo-ts/core' import { randomBytes } from 'crypto' export function objectToJson(result: T) { From fd3f06082037dbaff5e11ca52a68d13b08f30487 Mon Sep 17 00:00:00 2001 From: Krishna Waske Date: Mon, 8 Dec 2025 18:06:45 +0530 Subject: [PATCH 039/152] fix: for now we'll delete all the patch and apply as required Signed-off-by: Krishna Waske --- ... model conflict in AnonCreds and DID.patch | 272 -- ...+001+fix: change version string type.patch | 21 + ...13+001+fix: message type for message.patch | 12 - ...+002+fix: change version string type.patch | 13 - ...0250325224513+003+sdjwt-presentation.patch | 14 - ...13+001+fix: message type for message.patch | 31 - ...prettyVc-in-JsonCredential-interface.patch | 12 - ...resentation to avoid abandoned issue.patch | 14 - yarn.lock | 2621 +++++++---------- 9 files changed, 1081 insertions(+), 1929 deletions(-) delete mode 100644 patches/@credo-ts+anoncreds+0.6.0-alpha-20250325224513+001+fix: extensible model conflict in AnonCreds and DID.patch create mode 100644 patches/@credo-ts+core+0.6.0+001+fix: change version string type.patch delete mode 100644 patches/@credo-ts+core+0.6.0-alpha-20250325224513+001+fix: message type for message.patch delete mode 100644 patches/@credo-ts+core+0.6.0-alpha-20250325224513+002+fix: change version string type.patch delete mode 100644 patches/@credo-ts+core+0.6.0-alpha-20250325224513+003+sdjwt-presentation.patch delete mode 100644 patches/@credo-ts+didcomm+0.6.0-alpha-20250325224513+001+fix: message type for message.patch delete mode 100644 patches/@credo-ts+didcomm+0.6.0-alpha-20250325224513+002+fix: added-prettyVc-in-JsonCredential-interface.patch delete mode 100644 patches/@credo-ts+didcomm+0.6.0-alpha-20250325224513+003+fix: commenting validationPresentation to avoid abandoned issue.patch diff --git a/patches/@credo-ts+anoncreds+0.6.0-alpha-20250325224513+001+fix: extensible model conflict in AnonCreds and DID.patch b/patches/@credo-ts+anoncreds+0.6.0-alpha-20250325224513+001+fix: extensible model conflict in AnonCreds and DID.patch deleted file mode 100644 index 1f00b40b..00000000 --- a/patches/@credo-ts+anoncreds+0.6.0-alpha-20250325224513+001+fix: extensible model conflict in AnonCreds and DID.patch +++ /dev/null @@ -1,272 +0,0 @@ -diff --git a/node_modules/@credo-ts/anoncreds/build/AnonCredsApi.d.ts b/node_modules/@credo-ts/anoncreds/build/AnonCredsApi.d.ts -index 9cbc1d8..ac26d6b 100644 ---- a/node_modules/@credo-ts/anoncreds/build/AnonCredsApi.d.ts -+++ b/node_modules/@credo-ts/anoncreds/build/AnonCredsApi.d.ts -@@ -2,7 +2,7 @@ import type { SimpleQuery } from '@credo-ts/core'; - import type { AnonCredsCreateLinkSecretOptions, AnonCredsRegisterCredentialDefinitionOptions, AnonCredsRegisterRevocationRegistryDefinitionOptions, AnonCredsRegisterRevocationStatusListOptions, AnonCredsUpdateRevocationStatusListOptions } from './AnonCredsApiOptions'; - import type { AnonCredsSchema } from './models'; - import type { GetCredentialDefinitionReturn, GetCredentialsOptions, GetRevocationRegistryDefinitionReturn, GetRevocationStatusListReturn, GetSchemaReturn, RegisterCredentialDefinitionReturn, RegisterRevocationRegistryDefinitionReturn, RegisterRevocationStatusListReturn, RegisterSchemaReturn } from './services'; --import type { Extensible } from './services/registry/base'; -+import type { CredoExtensible } from './services/registry/base'; - import { AgentContext } from '@credo-ts/core'; - import { AnonCredsModuleConfig } from './AnonCredsModuleConfig'; - import { AnonCredsCredentialDefinitionPrivateRepository, AnonCredsKeyCorrectnessProofRepository, AnonCredsLinkSecretRepository, AnonCredsRevocationRegistryDefinitionPrivateRepository, AnonCredsRevocationRegistryDefinitionRepository } from './repository'; -@@ -41,28 +41,28 @@ export declare class AnonCredsApi { - * with the {@link schemaId} - */ - getSchema(schemaId: string): Promise; -- registerSchema(options: AnonCredsRegisterSchema): Promise; -+ registerSchema(options: AnonCredsRegisterSchema): Promise; - getCreatedSchemas(query: SimpleQuery): Promise; - /** - * Retrieve a {@link GetCredentialDefinitionReturn} from the registry associated - * with the {@link credentialDefinitionId} - */ - getCredentialDefinition(credentialDefinitionId: string): Promise; -- registerCredentialDefinition(options: AnonCredsRegisterCredentialDefinition): Promise; -+ registerCredentialDefinition(options: AnonCredsRegisterCredentialDefinition): Promise; - getCreatedCredentialDefinitions(query: SimpleQuery): Promise; - /** - * Retrieve a {@link AnonCredsRevocationRegistryDefinition} from the registry associated - * with the {@link revocationRegistryDefinitionId} - */ - getRevocationRegistryDefinition(revocationRegistryDefinitionId: string): Promise; -- registerRevocationRegistryDefinition(options: AnonCredsRegisterRevocationRegistryDefinition): Promise; -+ registerRevocationRegistryDefinition(options: AnonCredsRegisterRevocationRegistryDefinition): Promise; - /** - * Retrieve the {@link AnonCredsRevocationStatusList} for the given {@link timestamp} from the registry associated - * with the {@link revocationRegistryDefinitionId} - */ - getRevocationStatusList(revocationRegistryDefinitionId: string, timestamp: number): Promise; -- registerRevocationStatusList(options: AnonCredsRegisterRevocationStatusList): Promise; -- updateRevocationStatusList(options: AnonCredsUpdateRevocationStatusList): Promise; -+ registerRevocationStatusList(options: AnonCredsRegisterRevocationStatusList): Promise; -+ updateRevocationStatusList(options: AnonCredsUpdateRevocationStatusList): Promise; - getCredential(id: string): Promise; - getCredentials(options: GetCredentialsOptions): Promise; - private storeRevocationRegistryDefinitionRecord; -@@ -74,23 +74,23 @@ export declare class AnonCredsApi { - export interface AnonCredsRegisterCredentialDefinitionApiOptions { - supportRevocation: boolean; - } --interface AnonCredsRegisterCredentialDefinition { -+interface AnonCredsRegisterCredentialDefinition { - credentialDefinition: AnonCredsRegisterCredentialDefinitionOptions; - options: T & AnonCredsRegisterCredentialDefinitionApiOptions; - } --interface AnonCredsRegisterSchema { -+interface AnonCredsRegisterSchema { - schema: AnonCredsSchema; - options: T; - } --interface AnonCredsRegisterRevocationRegistryDefinition { -+interface AnonCredsRegisterRevocationRegistryDefinition { - revocationRegistryDefinition: AnonCredsRegisterRevocationRegistryDefinitionOptions; - options: T; - } --interface AnonCredsRegisterRevocationStatusList { -+interface AnonCredsRegisterRevocationStatusList { - revocationStatusList: AnonCredsRegisterRevocationStatusListOptions; - options: T; - } --interface AnonCredsUpdateRevocationStatusList { -+interface AnonCredsUpdateRevocationStatusList { - revocationStatusList: AnonCredsUpdateRevocationStatusListOptions; - options: T; - } -diff --git a/node_modules/@credo-ts/anoncreds/build/repository/anonCredsCredentialDefinitionRecordMetadataTypes.d.ts b/node_modules/@credo-ts/anoncreds/build/repository/anonCredsCredentialDefinitionRecordMetadataTypes.d.ts -index 2980520..0304d87 100644 ---- a/node_modules/@credo-ts/anoncreds/build/repository/anonCredsCredentialDefinitionRecordMetadataTypes.d.ts -+++ b/node_modules/@credo-ts/anoncreds/build/repository/anonCredsCredentialDefinitionRecordMetadataTypes.d.ts -@@ -1,9 +1,9 @@ --import type { Extensible } from '../services/registry/base'; -+import type { CredoExtensible } from '../services/registry/base'; - export declare enum AnonCredsCredentialDefinitionRecordMetadataKeys { - CredentialDefinitionRegistrationMetadata = "_internal/anonCredsCredentialDefinitionRegistrationMetadata", - CredentialDefinitionMetadata = "_internal/anonCredsCredentialDefinitionMetadata" - } - export type AnonCredsCredentialDefinitionRecordMetadata = { -- [AnonCredsCredentialDefinitionRecordMetadataKeys.CredentialDefinitionRegistrationMetadata]: Extensible; -- [AnonCredsCredentialDefinitionRecordMetadataKeys.CredentialDefinitionMetadata]: Extensible; -+ [AnonCredsCredentialDefinitionRecordMetadataKeys.CredentialDefinitionRegistrationMetadata]: CredoExtensible; -+ [AnonCredsCredentialDefinitionRecordMetadataKeys.CredentialDefinitionMetadata]: CredoExtensible; - }; -diff --git a/node_modules/@credo-ts/anoncreds/build/repository/anonCredsRevocationRegistryDefinitionRecordMetadataTypes.d.ts b/node_modules/@credo-ts/anoncreds/build/repository/anonCredsRevocationRegistryDefinitionRecordMetadataTypes.d.ts -index 25aea87..1b0c4aa 100644 ---- a/node_modules/@credo-ts/anoncreds/build/repository/anonCredsRevocationRegistryDefinitionRecordMetadataTypes.d.ts -+++ b/node_modules/@credo-ts/anoncreds/build/repository/anonCredsRevocationRegistryDefinitionRecordMetadataTypes.d.ts -@@ -1,9 +1,9 @@ --import type { Extensible } from '../services/registry/base'; -+import type { CredoExtensible } from '../services/registry/base'; - export declare enum AnonCredsRevocationRegistryDefinitionRecordMetadataKeys { - RevocationRegistryDefinitionRegistrationMetadata = "_internal/anonCredsRevocationRegistryDefinitionRegistrationMetadata", - RevocationRegistryDefinitionMetadata = "_internal/anonCredsRevocationRegistryDefinitionMetadata" - } - export type AnonCredsRevocationRegistryDefinitionRecordMetadata = { -- [AnonCredsRevocationRegistryDefinitionRecordMetadataKeys.RevocationRegistryDefinitionRegistrationMetadata]: Extensible; -- [AnonCredsRevocationRegistryDefinitionRecordMetadataKeys.RevocationRegistryDefinitionMetadata]: Extensible; -+ [AnonCredsRevocationRegistryDefinitionRecordMetadataKeys.RevocationRegistryDefinitionRegistrationMetadata]: CredoExtensible; -+ [AnonCredsRevocationRegistryDefinitionRecordMetadataKeys.RevocationRegistryDefinitionMetadata]: CredoExtensible; - }; -diff --git a/node_modules/@credo-ts/anoncreds/build/repository/anonCredsSchemaRecordMetadataTypes.d.ts b/node_modules/@credo-ts/anoncreds/build/repository/anonCredsSchemaRecordMetadataTypes.d.ts -index 452ec04..f66058d 100644 ---- a/node_modules/@credo-ts/anoncreds/build/repository/anonCredsSchemaRecordMetadataTypes.d.ts -+++ b/node_modules/@credo-ts/anoncreds/build/repository/anonCredsSchemaRecordMetadataTypes.d.ts -@@ -1,9 +1,9 @@ --import type { Extensible } from '../services/registry/base'; -+import type { CredoExtensible } from '../services/registry/base'; - export declare enum AnonCredsSchemaRecordMetadataKeys { - SchemaRegistrationMetadata = "_internal/anonCredsSchemaRegistrationMetadata", - SchemaMetadata = "_internal/anonCredsSchemaMetadata" - } - export type AnonCredsSchemaRecordMetadata = { -- [AnonCredsSchemaRecordMetadataKeys.SchemaRegistrationMetadata]: Extensible; -- [AnonCredsSchemaRecordMetadataKeys.SchemaMetadata]: Extensible; -+ [AnonCredsSchemaRecordMetadataKeys.SchemaRegistrationMetadata]: CredoExtensible; -+ [AnonCredsSchemaRecordMetadataKeys.SchemaMetadata]: CredoExtensible; - }; -diff --git a/node_modules/@credo-ts/anoncreds/build/services/registry/CredentialDefinitionOptions.d.ts b/node_modules/@credo-ts/anoncreds/build/services/registry/CredentialDefinitionOptions.d.ts -index 0cedde3..169337b 100644 ---- a/node_modules/@credo-ts/anoncreds/build/services/registry/CredentialDefinitionOptions.d.ts -+++ b/node_modules/@credo-ts/anoncreds/build/services/registry/CredentialDefinitionOptions.d.ts -@@ -1,14 +1,14 @@ - import type { AnonCredsCredentialDefinition } from '../../models/registry'; --import type { AnonCredsOperationStateAction, AnonCredsOperationStateFailed, AnonCredsOperationStateFinished, AnonCredsOperationStateWait, AnonCredsResolutionMetadata, Extensible } from './base'; -+import type { AnonCredsOperationStateAction, AnonCredsOperationStateFailed, AnonCredsOperationStateFinished, AnonCredsOperationStateWait, AnonCredsResolutionMetadata, CredoExtensible } from './base'; - export interface GetCredentialDefinitionReturn { - credentialDefinition?: AnonCredsCredentialDefinition; - credentialDefinitionId: string; - resolutionMetadata: AnonCredsResolutionMetadata; -- credentialDefinitionMetadata: Extensible; -+ credentialDefinitionMetadata: CredoExtensible; - } - export interface RegisterCredentialDefinitionOptions { - credentialDefinition: AnonCredsCredentialDefinition; -- options: Extensible; -+ options: CredoExtensible; - } - export interface RegisterCredentialDefinitionReturnStateFailed extends AnonCredsOperationStateFailed { - credentialDefinition?: AnonCredsCredentialDefinition; -@@ -29,6 +29,6 @@ export interface RegisterCredentialDefinitionReturnStateAction extends AnonCreds - export interface RegisterCredentialDefinitionReturn { - jobId?: string; - credentialDefinitionState: RegisterCredentialDefinitionReturnStateWait | RegisterCredentialDefinitionReturnStateAction | RegisterCredentialDefinitionReturnStateFinished | RegisterCredentialDefinitionReturnStateFailed; -- credentialDefinitionMetadata: Extensible; -- registrationMetadata: Extensible; -+ credentialDefinitionMetadata: CredoExtensible; -+ registrationMetadata: CredoExtensible; - } -diff --git a/node_modules/@credo-ts/anoncreds/build/services/registry/RevocationRegistryDefinitionOptions.d.ts b/node_modules/@credo-ts/anoncreds/build/services/registry/RevocationRegistryDefinitionOptions.d.ts -index 7b9ffde..a3c9a53 100644 ---- a/node_modules/@credo-ts/anoncreds/build/services/registry/RevocationRegistryDefinitionOptions.d.ts -+++ b/node_modules/@credo-ts/anoncreds/build/services/registry/RevocationRegistryDefinitionOptions.d.ts -@@ -1,14 +1,14 @@ - import type { AnonCredsRevocationRegistryDefinition } from '../../models/registry'; --import type { AnonCredsOperationStateAction, AnonCredsOperationStateFailed, AnonCredsOperationStateFinished, AnonCredsOperationStateWait, AnonCredsResolutionMetadata, Extensible } from './base'; -+import type { AnonCredsOperationStateAction, AnonCredsOperationStateFailed, AnonCredsOperationStateFinished, AnonCredsOperationStateWait, AnonCredsResolutionMetadata, CredoExtensible } from './base'; - export interface GetRevocationRegistryDefinitionReturn { - revocationRegistryDefinition?: AnonCredsRevocationRegistryDefinition; - revocationRegistryDefinitionId: string; - resolutionMetadata: AnonCredsResolutionMetadata; -- revocationRegistryDefinitionMetadata: Extensible; -+ revocationRegistryDefinitionMetadata: CredoExtensible; - } - export interface RegisterRevocationRegistryDefinitionOptions { - revocationRegistryDefinition: AnonCredsRevocationRegistryDefinition; -- options: Extensible; -+ options: CredoExtensible; - } - export interface RegisterRevocationRegistryDefinitionReturnStateAction extends AnonCredsOperationStateAction { - revocationRegistryDefinition: AnonCredsRevocationRegistryDefinition; -@@ -29,6 +29,6 @@ export interface RegisterRevocationRegistryDefinitionReturnStateFinished extends - export interface RegisterRevocationRegistryDefinitionReturn { - jobId?: string; - revocationRegistryDefinitionState: RegisterRevocationRegistryDefinitionReturnStateWait | RegisterRevocationRegistryDefinitionReturnStateAction | RegisterRevocationRegistryDefinitionReturnStateFailed | RegisterRevocationRegistryDefinitionReturnStateFinished; -- revocationRegistryDefinitionMetadata: Extensible; -- registrationMetadata: Extensible; -+ revocationRegistryDefinitionMetadata: CredoExtensible; -+ registrationMetadata: CredoExtensible; - } -diff --git a/node_modules/@credo-ts/anoncreds/build/services/registry/RevocationStatusListOptions.d.ts b/node_modules/@credo-ts/anoncreds/build/services/registry/RevocationStatusListOptions.d.ts -index c28d20c..eca15ca 100644 ---- a/node_modules/@credo-ts/anoncreds/build/services/registry/RevocationStatusListOptions.d.ts -+++ b/node_modules/@credo-ts/anoncreds/build/services/registry/RevocationStatusListOptions.d.ts -@@ -1,16 +1,16 @@ - import type { Optional } from '@credo-ts/core'; - import type { AnonCredsRevocationStatusList } from '../../models/registry'; --import type { AnonCredsOperationStateAction, AnonCredsOperationStateFailed, AnonCredsOperationStateFinished, AnonCredsOperationStateWait, AnonCredsResolutionMetadata, Extensible } from './base'; -+import type { AnonCredsOperationStateAction, AnonCredsOperationStateFailed, AnonCredsOperationStateFinished, AnonCredsOperationStateWait, AnonCredsResolutionMetadata, CredoExtensible } from './base'; - export interface GetRevocationStatusListReturn { - revocationStatusList?: AnonCredsRevocationStatusList; - resolutionMetadata: AnonCredsResolutionMetadata; -- revocationStatusListMetadata: Extensible; -+ revocationStatusListMetadata: CredoExtensible; - } - export type AnonCredsRevocationStatusListWithoutTimestamp = Omit; - export type AnonCredsRevocationStatusListWithOptionalTimestamp = Optional; - export interface RegisterRevocationStatusListOptions { - revocationStatusList: AnonCredsRevocationStatusListWithoutTimestamp; -- options: Extensible; -+ options: CredoExtensible; - } - export interface RegisterRevocationStatusListReturnStateAction extends AnonCredsOperationStateAction { - revocationStatusList: AnonCredsRevocationStatusListWithOptionalTimestamp; -@@ -27,6 +27,6 @@ export interface RegisterRevocationStatusListReturnStateFinished extends AnonCre - export interface RegisterRevocationStatusListReturn { - jobId?: string; - revocationStatusListState: RegisterRevocationStatusListReturnStateWait | RegisterRevocationStatusListReturnStateAction | RegisterRevocationStatusListReturnStateFailed | RegisterRevocationStatusListReturnStateFinished; -- revocationStatusListMetadata: Extensible; -- registrationMetadata: Extensible; -+ revocationStatusListMetadata: CredoExtensible; -+ registrationMetadata: CredoExtensible; - } -diff --git a/node_modules/@credo-ts/anoncreds/build/services/registry/SchemaOptions.d.ts b/node_modules/@credo-ts/anoncreds/build/services/registry/SchemaOptions.d.ts -index fcafaa3..c894be4 100644 ---- a/node_modules/@credo-ts/anoncreds/build/services/registry/SchemaOptions.d.ts -+++ b/node_modules/@credo-ts/anoncreds/build/services/registry/SchemaOptions.d.ts -@@ -1,14 +1,14 @@ - import type { AnonCredsSchema } from '../../models/registry'; --import type { AnonCredsOperationStateAction, AnonCredsOperationStateFailed, AnonCredsOperationStateFinished, AnonCredsOperationStateWait, AnonCredsResolutionMetadata, Extensible } from './base'; -+import type { AnonCredsOperationStateAction, AnonCredsOperationStateFailed, AnonCredsOperationStateFinished, AnonCredsOperationStateWait, AnonCredsResolutionMetadata, CredoExtensible } from './base'; - export interface GetSchemaReturn { - schema?: AnonCredsSchema; - schemaId: string; - resolutionMetadata: AnonCredsResolutionMetadata; -- schemaMetadata: Extensible; -+ schemaMetadata: CredoExtensible; - } - export interface RegisterSchemaOptions { - schema: AnonCredsSchema; -- options: Extensible; -+ options: CredoExtensible; - } - export interface RegisterSchemaReturnStateFailed extends AnonCredsOperationStateFailed { - schema?: AnonCredsSchema; -@@ -29,6 +29,6 @@ export interface RegisterSchemaReturnStateWait extends AnonCredsOperationStateWa - export interface RegisterSchemaReturn { - jobId?: string; - schemaState: RegisterSchemaReturnStateWait | RegisterSchemaReturnStateAction | RegisterSchemaReturnStateFinished | RegisterSchemaReturnStateFailed; -- schemaMetadata: Extensible; -- registrationMetadata: Extensible; -+ schemaMetadata: CredoExtensible; -+ registrationMetadata: CredoExtensible; - } -diff --git a/node_modules/@credo-ts/anoncreds/build/services/registry/base.d.ts b/node_modules/@credo-ts/anoncreds/build/services/registry/base.d.ts -index 3b37667..931bcc6 100644 ---- a/node_modules/@credo-ts/anoncreds/build/services/registry/base.d.ts -+++ b/node_modules/@credo-ts/anoncreds/build/services/registry/base.d.ts -@@ -1,4 +1,4 @@ --export type Extensible = Record; -+export type CredoExtensible = Record; - export interface AnonCredsOperationStateWait { - state: 'wait'; - } -@@ -13,7 +13,7 @@ export interface AnonCredsOperationStateFailed { - state: 'failed'; - reason: string; - } --export interface AnonCredsResolutionMetadata extends Extensible { -+export interface AnonCredsResolutionMetadata extends CredoExtensible { - error?: 'invalid' | 'notFound' | 'unsupportedAnonCredsMethod' | string; - message?: string; - } diff --git a/patches/@credo-ts+core+0.6.0+001+fix: change version string type.patch b/patches/@credo-ts+core+0.6.0+001+fix: change version string type.patch new file mode 100644 index 00000000..d0791805 --- /dev/null +++ b/patches/@credo-ts+core+0.6.0+001+fix: change version string type.patch @@ -0,0 +1,21 @@ +diff --git a/node_modules/@credo-ts/core/build/utils/version.d.mts b/node_modules/@credo-ts/core/build/utils/version.d.mts +index a71659d..8ed88e2 100644 +--- a/node_modules/@credo-ts/core/build/utils/version.d.mts ++++ b/node_modules/@credo-ts/core/build/utils/version.d.mts +@@ -1,5 +1,5 @@ + //#region src/utils/version.d.ts +-type VersionString = `${number}.${number}` | `${number}.${number}.${number}`; ++type VersionString = string; + //#endregion + export { VersionString }; + //# sourceMappingURL=version.d.mts.map +\ No newline at end of file +diff --git a/node_modules/@credo-ts/core/build/utils/version.mjs.map b/node_modules/@credo-ts/core/build/utils/version.mjs.map +index 19457ed..5fb595f 100644 +--- a/node_modules/@credo-ts/core/build/utils/version.mjs.map ++++ b/node_modules/@credo-ts/core/build/utils/version.mjs.map +@@ -1 +1 @@ +-{"version":3,"file":"version.mjs","names":[],"sources":["../../src/utils/version.ts"],"sourcesContent":["export function parseVersionString(version: VersionString): Version {\n const [major, minor, patch] = version.split('.')\n\n return [Number(major), Number(minor), Number(patch ?? '0')]\n}\n\nexport function isFirstVersionHigherThanSecond(first: Version, second: Version) {\n return (\n first[0] > second[0] ||\n (first[0] === second[0] && first[1] > second[1]) ||\n (first[0] === second[0] && first[1] === second[1] && first[2] > second[2])\n )\n}\n\nexport function isFirstVersionEqualToSecond(first: Version, second: Version) {\n return first[0] === second[0] && first[1] === second[1] && first[2] === second[2]\n}\n\nexport type VersionString = `${number}.${number}` | `${number}.${number}.${number}`\nexport type MajorVersion = number\nexport type MinorVersion = number\nexport type PatchVersion = number\nexport type Version = [MajorVersion, MinorVersion, PatchVersion]\n"],"mappings":";;;AAAA,SAAgB,mBAAmB,SAAiC;CAClE,MAAM,CAAC,OAAO,OAAO,SAAS,QAAQ,MAAM,IAAI;AAEhD,QAAO;EAAC,OAAO,MAAM;EAAE,OAAO,MAAM;EAAE,OAAO,SAAS,IAAI;EAAC;;AAG7D,SAAgB,+BAA+B,OAAgB,QAAiB;AAC9E,QACE,MAAM,KAAK,OAAO,MACjB,MAAM,OAAO,OAAO,MAAM,MAAM,KAAK,OAAO,MAC5C,MAAM,OAAO,OAAO,MAAM,MAAM,OAAO,OAAO,MAAM,MAAM,KAAK,OAAO;;AAI3E,SAAgB,4BAA4B,OAAgB,QAAiB;AAC3E,QAAO,MAAM,OAAO,OAAO,MAAM,MAAM,OAAO,OAAO,MAAM,MAAM,OAAO,OAAO"} +\ No newline at end of file ++{"version":3,"file":"version.mjs","names":[],"sources":["../../src/utils/version.ts"],"sourcesContent":["export function parseVersionString(version: VersionString): Version {\n const [major, minor, patch] = version.split('.')\n\n return [Number(major), Number(minor), Number(patch ?? '0')]\n}\n\nexport function isFirstVersionHigherThanSecond(first: Version, second: Version) {\n return (\n first[0] > second[0] ||\n (first[0] === second[0] && first[1] > second[1]) ||\n (first[0] === second[0] && first[1] === second[1] && first[2] > second[2])\n )\n}\n\nexport function isFirstVersionEqualToSecond(first: Version, second: Version) {\n return first[0] === second[0] && first[1] === second[1] && first[2] === second[2]\n}\n\nexport type VersionString = string\nexport type MajorVersion = number\nexport type MinorVersion = number\nexport type PatchVersion = number\nexport type Version = [MajorVersion, MinorVersion, PatchVersion]\n"],"mappings":";;;AAAA,SAAgB,mBAAmB,SAAiC;CAClE,MAAM,CAAC,OAAO,OAAO,SAAS,QAAQ,MAAM,IAAI;AAEhD,QAAO;EAAC,OAAO,MAAM;EAAE,OAAO,MAAM;EAAE,OAAO,SAAS,IAAI;EAAC;;AAG7D,SAAgB,+BAA+B,OAAgB,QAAiB;AAC9E,QACE,MAAM,KAAK,OAAO,MACjB,MAAM,OAAO,OAAO,MAAM,MAAM,KAAK,OAAO,MAC5C,MAAM,OAAO,OAAO,MAAM,MAAM,OAAO,OAAO,MAAM,MAAM,KAAK,OAAO;;AAI3E,SAAgB,4BAA4B,OAAgB,QAAiB;AAC3E,QAAO,MAAM,OAAO,OAAO,MAAM,MAAM,OAAO,OAAO,MAAM,MAAM,OAAO,OAAO"} +\ No newline at end of file diff --git a/patches/@credo-ts+core+0.6.0-alpha-20250325224513+001+fix: message type for message.patch b/patches/@credo-ts+core+0.6.0-alpha-20250325224513+001+fix: message type for message.patch deleted file mode 100644 index ce9e2a5e..00000000 --- a/patches/@credo-ts+core+0.6.0-alpha-20250325224513+001+fix: message type for message.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/node_modules/@credo-ts/core/build/types.d.ts b/node_modules/@credo-ts/core/build/types.d.ts -index 964f309..4447f64 100644 ---- a/node_modules/@credo-ts/core/build/types.d.ts -+++ b/node_modules/@credo-ts/core/build/types.d.ts -@@ -88,6 +88,7 @@ export interface PlaintextMessage { - thid?: string; - pthid?: string; - }; -+ messageType?: string; - [key: string]: unknown; - } - export type EncryptedMessage = { diff --git a/patches/@credo-ts+core+0.6.0-alpha-20250325224513+002+fix: change version string type.patch b/patches/@credo-ts+core+0.6.0-alpha-20250325224513+002+fix: change version string type.patch deleted file mode 100644 index 02a2d309..00000000 --- a/patches/@credo-ts+core+0.6.0-alpha-20250325224513+002+fix: change version string type.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/node_modules/@credo-ts/core/build/utils/version.d.ts b/node_modules/@credo-ts/core/build/utils/version.d.ts -index 0ad7e14..e0588dc 100644 ---- a/node_modules/@credo-ts/core/build/utils/version.d.ts -+++ b/node_modules/@credo-ts/core/build/utils/version.d.ts -@@ -1,7 +1,7 @@ - export declare function parseVersionString(version: VersionString): Version; - export declare function isFirstVersionHigherThanSecond(first: Version, second: Version): boolean; - export declare function isFirstVersionEqualToSecond(first: Version, second: Version): boolean; --export type VersionString = `${number}.${number}` | `${number}.${number}.${number}`; -+export type VersionString = string; - export type MajorVersion = number; - export type MinorVersion = number; - export type PatchVersion = number; diff --git a/patches/@credo-ts+core+0.6.0-alpha-20250325224513+003+sdjwt-presentation.patch b/patches/@credo-ts+core+0.6.0-alpha-20250325224513+003+sdjwt-presentation.patch deleted file mode 100644 index b47305cd..00000000 --- a/patches/@credo-ts+core+0.6.0-alpha-20250325224513+003+sdjwt-presentation.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/node_modules/@credo-ts/core/build/modules/sd-jwt-vc/SdJwtVcService.js b/node_modules/@credo-ts/core/build/modules/sd-jwt-vc/SdJwtVcService.js -index 20073a3..9df7a4a 100644 ---- a/node_modules/@credo-ts/core/build/modules/sd-jwt-vc/SdJwtVcService.js -+++ b/node_modules/@credo-ts/core/build/modules/sd-jwt-vc/SdJwtVcService.js -@@ -102,7 +102,8 @@ let SdJwtVcService = class SdJwtVcService { - value: d.value, - })), presentationFrame); - const [jwt] = compactSdJwtVc.split('~'); -- const sdJwt = `${jwt}~${requiredDisclosures.map((d) => d.encoded).join('~')}~`; -+ const disclosureString = requiredDisclosures.length > 0 ? `${requiredDisclosures.map((d) => d.encoded).join('~')}~` : ''; -+ const sdJwt = `${jwt}~${disclosureString}`; - const disclosedDecoded = (0, decodeSdJwtVc_1.decodeSdJwtVc)(sdJwt); - return disclosedDecoded; - } diff --git a/patches/@credo-ts+didcomm+0.6.0-alpha-20250325224513+001+fix: message type for message.patch b/patches/@credo-ts+didcomm+0.6.0-alpha-20250325224513+001+fix: message type for message.patch deleted file mode 100644 index 7e6d0d21..00000000 --- a/patches/@credo-ts+didcomm+0.6.0-alpha-20250325224513+001+fix: message type for message.patch +++ /dev/null @@ -1,31 +0,0 @@ -diff --git a/node_modules/@credo-ts/didcomm/build/EnvelopeService.js b/node_modules/@credo-ts/didcomm/build/EnvelopeService.js -index c0c84d4..0752b11 100644 ---- a/node_modules/@credo-ts/didcomm/build/EnvelopeService.js -+++ b/node_modules/@credo-ts/didcomm/build/EnvelopeService.js -@@ -38,6 +38,7 @@ let EnvelopeService = class EnvelopeService { - message: encryptedMessage, - }); - recipientKeysBase58 = [routingKeyBase58]; -+ forwardMessage["messageType"] = message['@type']; - this.logger.debug('Forward message created', forwardMessage); - const forwardJson = forwardMessage.toJSON({ - useDidSovPrefixWhereAllowed: didcommConfig.useDidSovPrefixWhereAllowed, -diff --git a/node_modules/@credo-ts/didcomm/build/modules/routing/messages/ForwardMessage.d.ts b/node_modules/@credo-ts/didcomm/build/modules/routing/messages/ForwardMessage.d.ts -index 108b477..d307051 100644 ---- a/node_modules/@credo-ts/didcomm/build/modules/routing/messages/ForwardMessage.d.ts -+++ b/node_modules/@credo-ts/didcomm/build/modules/routing/messages/ForwardMessage.d.ts -@@ -3,6 +3,7 @@ import { EncryptedMessage } from '../../../types'; - export interface ForwardMessageOptions { - id?: string; - to: string; -+ messageType: string; - message: EncryptedMessage; - } - /** -@@ -19,5 +20,6 @@ export declare class ForwardMessage extends AgentMessage { - readonly type: string; - static readonly type: import("../../../util/messageType").ParsedMessageType; - to: string; -+ messageType: string; - message: EncryptedMessage; - } diff --git a/patches/@credo-ts+didcomm+0.6.0-alpha-20250325224513+002+fix: added-prettyVc-in-JsonCredential-interface.patch b/patches/@credo-ts+didcomm+0.6.0-alpha-20250325224513+002+fix: added-prettyVc-in-JsonCredential-interface.patch deleted file mode 100644 index 60057d13..00000000 --- a/patches/@credo-ts+didcomm+0.6.0-alpha-20250325224513+002+fix: added-prettyVc-in-JsonCredential-interface.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/node_modules/@credo-ts/didcomm/build/modules/credentials/formats/jsonld/JsonLdCredentialFormat.d.ts b/node_modules/@credo-ts/didcomm/build/modules/credentials/formats/jsonld/JsonLdCredentialFormat.d.ts -index c0a6140..c3d2c8b 100644 ---- a/node_modules/@credo-ts/didcomm/build/modules/credentials/formats/jsonld/JsonLdCredentialFormat.d.ts -+++ b/node_modules/@credo-ts/didcomm/build/modules/credentials/formats/jsonld/JsonLdCredentialFormat.d.ts -@@ -8,6 +8,7 @@ export interface JsonCredential { - issuanceDate: string; - expirationDate?: string; - credentialSubject: SingleOrArray; -+ prettyVc?: any; - [key: string]: unknown; - } - /** diff --git a/patches/@credo-ts+didcomm+0.6.0-alpha-20250325224513+003+fix: commenting validationPresentation to avoid abandoned issue.patch b/patches/@credo-ts+didcomm+0.6.0-alpha-20250325224513+003+fix: commenting validationPresentation to avoid abandoned issue.patch deleted file mode 100644 index 74e5d1ed..00000000 --- a/patches/@credo-ts+didcomm+0.6.0-alpha-20250325224513+003+fix: commenting validationPresentation to avoid abandoned issue.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/node_modules/@credo-ts/didcomm/build/modules/proofs/formats/dif-presentation-exchange/DifPresentationExchangeProofFormatService.js b/node_modules/@credo-ts/didcomm/build/modules/proofs/formats/dif-presentation-exchange/DifPresentationExchangeProofFormatService.js -index 202adff..1124458 100644 ---- a/node_modules/@credo-ts/didcomm/build/modules/proofs/formats/dif-presentation-exchange/DifPresentationExchangeProofFormatService.js -+++ b/node_modules/@credo-ts/didcomm/build/modules/proofs/formats/dif-presentation-exchange/DifPresentationExchangeProofFormatService.js -@@ -168,7 +168,8 @@ class DifPresentationExchangeProofFormatService { - try { - ps.validatePresentationDefinition(request.presentation_definition); - ps.validatePresentationSubmission(jsonPresentation.presentation_submission); -- ps.validatePresentation(request.presentation_definition, parsedPresentation); -+ // FIXME: Commenting validatePresentation() for now due to intermittent abandoned issue -+ // ps.validatePresentation(request.presentation_definition, parsedPresentation); - let verificationResult; - // FIXME: for some reason it won't accept the input if it doesn't know - // whether it's a JWT or JSON-LD VP even though the input is the same. diff --git a/yarn.lock b/yarn.lock index aa544109..32efea90 100644 --- a/yarn.lock +++ b/yarn.lock @@ -29,14 +29,6 @@ resolved "https://registry.yarnpkg.com/@adraffy/ens-normalize/-/ens-normalize-1.10.1.tgz#63430d04bd8c5e74f8d7d049338f1cd9d4f02069" integrity sha512-96Z2IP3mYmF1Xg2cDm8f1gWGf/HUVedQ3FMifV4kG/PQ4yEP51xDtRAEfhVNt5f/uzpNkZHwWQuUcu6D6K+Ekw== -"@ampproject/remapping@^2.2.0": - version "2.3.0" - resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.3.0.tgz#ed441b6fa600072520ce18b43d2c8cc8caecc7f4" - integrity sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw== - dependencies: - "@jridgewell/gen-mapping" "^0.3.5" - "@jridgewell/trace-mapping" "^0.3.24" - "@animo-id/mdoc@^0.5.2": version "0.5.2" resolved "https://registry.yarnpkg.com/@animo-id/mdoc/-/mdoc-0.5.2.tgz#77c4ac564925126f3dac9a989be888ad9e38afa1" @@ -44,11 +36,12 @@ dependencies: compare-versions "^6.1.1" -"@animo-id/pex@5.2.0": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@animo-id/pex/-/pex-5.2.0.tgz#540895b7ffb36da800d303cd2aee12daebd52850" - integrity sha512-W0nopdAS1boDOuhH1L5yUyNOo4LJwIqVc3x90ua0ypNXuOv6gDkr78nNTqIjaF0eBKakagTYegbDZrfQrlmRBQ== +"@animo-id/pex@^6.1.1": + version "6.1.1" + resolved "https://registry.yarnpkg.com/@animo-id/pex/-/pex-6.1.1.tgz#a09b12afebbb58eb35b6957c45b9c268590f2c9a" + integrity sha512-my3g9Divea1sseZRzgD2tnrv0ett9fTlyoZp1x9nSjyRwtai/BBnFQigknMFscJuG6vnwYNcaj6TFQprw+v5xw== dependencies: + "@animo-id/mdoc" "^0.5.2" "@astronautlabs/jsonpath" "^1.1.2" "@sd-jwt/decode" "^0.7.2" "@sd-jwt/present" "^0.7.2" @@ -135,38 +128,38 @@ picocolors "^1.1.1" "@babel/compat-data@^7.27.2": - version "7.28.0" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.28.0.tgz#9fc6fd58c2a6a15243cd13983224968392070790" - integrity sha512-60X7qkglvrap8mn1lh2ebxXdZYtUcpd7gsmy9kLaBJ4i/WdY8PqTSdxyA8qraikqKQK5C1KRBKXqznrVapyNaw== + version "7.28.5" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.28.5.tgz#a8a4962e1567121ac0b3b487f52107443b455c7f" + integrity sha512-6uFXyCayocRbqhZOB+6XcuZbkMNimwfVGFji8CTZnCzOHVGvDqzvitu1re2AU5LROliz7eQPhB8CpAMvnx9EjA== -"@babel/core@^7.11.6", "@babel/core@^7.12.3", "@babel/core@^7.14.6", "@babel/core@^7.23.9": - version "7.28.3" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.28.3.tgz#aceddde69c5d1def69b839d09efa3e3ff59c97cb" - integrity sha512-yDBHV9kQNcr2/sUr9jghVyz9C3Y5G2zUM2H2lo+9mKv4sFgbA8s8Z9t8D1jiTkGoO/NoIfKMyKWr4s6CN23ZwQ== +"@babel/core@^7.11.6", "@babel/core@^7.12.3", "@babel/core@^7.23.9": + version "7.28.5" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.28.5.tgz#4c81b35e51e1b734f510c99b07dfbc7bbbb48f7e" + integrity sha512-e7jT4DxYvIDLk1ZHmU/m/mB19rex9sv0c2ftBtjSBv+kVM/902eh0fINUzD7UwLLNR+jU585GxUJ8/EBfAM5fw== dependencies: - "@ampproject/remapping" "^2.2.0" "@babel/code-frame" "^7.27.1" - "@babel/generator" "^7.28.3" + "@babel/generator" "^7.28.5" "@babel/helper-compilation-targets" "^7.27.2" "@babel/helper-module-transforms" "^7.28.3" - "@babel/helpers" "^7.28.3" - "@babel/parser" "^7.28.3" + "@babel/helpers" "^7.28.4" + "@babel/parser" "^7.28.5" "@babel/template" "^7.27.2" - "@babel/traverse" "^7.28.3" - "@babel/types" "^7.28.2" + "@babel/traverse" "^7.28.5" + "@babel/types" "^7.28.5" + "@jridgewell/remapping" "^2.3.5" convert-source-map "^2.0.0" debug "^4.1.0" gensync "^1.0.0-beta.2" json5 "^2.2.3" semver "^6.3.1" -"@babel/generator@^7.28.3", "@babel/generator@^7.7.2": - version "7.28.3" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.28.3.tgz#9626c1741c650cbac39121694a0f2d7451b8ef3e" - integrity sha512-3lSpxGgvnmZznmBkCRnVREPUFJv2wrv9iAoFDvADJc0ypmdOxdUtcLeBgBJ6zE0PMeTKnxeQzyk0xTBq4Ep7zw== +"@babel/generator@^7.28.5", "@babel/generator@^7.7.2": + version "7.28.5" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.28.5.tgz#712722d5e50f44d07bc7ac9fe84438742dd61298" + integrity sha512-3EwLFhZ38J4VyIP6WNtt2kUdW9dokXA9Cr4IVIFHuCpZ3H8/YFOl5JjZHisrn1fATPBmKKqXzDFvh9fUwHz6CQ== dependencies: - "@babel/parser" "^7.28.3" - "@babel/types" "^7.28.2" + "@babel/parser" "^7.28.5" + "@babel/types" "^7.28.5" "@jridgewell/gen-mapping" "^0.3.12" "@jridgewell/trace-mapping" "^0.3.28" jsesc "^3.0.2" @@ -195,7 +188,7 @@ "@babel/traverse" "^7.27.1" "@babel/types" "^7.27.1" -"@babel/helper-module-transforms@^7.27.1", "@babel/helper-module-transforms@^7.28.3": +"@babel/helper-module-transforms@^7.28.3": version "7.28.3" resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.28.3.tgz#a2b37d3da3b2344fe085dab234426f2b9a2fa5f6" integrity sha512-gytXUbs8k2sXS9PnQptz5o0QnpLL51SwASIORY6XaBKF88nsOT0Zw9szLqlSGQDP/4TljBAD5y98p2U1fqkdsw== @@ -204,7 +197,7 @@ "@babel/helper-validator-identifier" "^7.27.1" "@babel/traverse" "^7.28.3" -"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.18.9", "@babel/helper-plugin-utils@^7.27.1", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": +"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.27.1", "@babel/helper-plugin-utils@^7.8.0": version "7.27.1" resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.27.1.tgz#ddb2f876534ff8013e6c2b299bf4d39b3c51d44c" integrity sha512-1gn1Up5YXka3YYAHGKpbideQ5Yjf1tDa9qYcgysz+cNCXukyLl6DjPXhD3VRwSb8c0J9tA4b2+rHEZtc6R0tlw== @@ -214,38 +207,30 @@ resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz#54da796097ab19ce67ed9f88b47bb2ec49367687" integrity sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA== -"@babel/helper-validator-identifier@^7.27.1": - version "7.27.1" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.27.1.tgz#a7054dcc145a967dd4dc8fee845a57c1316c9df8" - integrity sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow== +"@babel/helper-validator-identifier@^7.27.1", "@babel/helper-validator-identifier@^7.28.5": + version "7.28.5" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz#010b6938fab7cb7df74aa2bbc06aa503b8fe5fb4" + integrity sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q== "@babel/helper-validator-option@^7.27.1": version "7.27.1" resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.27.1.tgz#fa52f5b1e7db1ab049445b421c4471303897702f" integrity sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg== -"@babel/helpers@^7.28.3": - version "7.28.3" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.28.3.tgz#b83156c0a2232c133d1b535dd5d3452119c7e441" - integrity sha512-PTNtvUQihsAsDHMOP5pfobP8C6CM4JWXmP8DrEIt46c3r2bf87Ua1zoqevsMo9g+tWDwgWrFP5EIxuBx5RudAw== +"@babel/helpers@^7.28.4": + version "7.28.4" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.28.4.tgz#fe07274742e95bdf7cf1443593eeb8926ab63827" + integrity sha512-HFN59MmQXGHVyYadKLVumYsA9dBFun/ldYxipEjzA4196jpLZd8UjEEBLkbEkvfYreDqJhZxYAWFPtrfhNpj4w== dependencies: "@babel/template" "^7.27.2" - "@babel/types" "^7.28.2" + "@babel/types" "^7.28.4" -"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.20.7", "@babel/parser@^7.23.9", "@babel/parser@^7.27.2", "@babel/parser@^7.28.3": - version "7.28.3" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.28.3.tgz#d2d25b814621bca5fe9d172bc93792547e7a2a71" - integrity sha512-7+Ey1mAgYqFAx2h0RuoxcQT5+MlG3GTV0TQrgr7/ZliKsm/MNDxVVutlWaziMq7wJNAz8MTqz55XLpWvva6StA== +"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.20.7", "@babel/parser@^7.23.9", "@babel/parser@^7.27.2", "@babel/parser@^7.28.5": + version "7.28.5" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.28.5.tgz#0b0225ee90362f030efd644e8034c99468893b08" + integrity sha512-KKBU1VGYR7ORr3At5HAtUQ+TV3SzRCXmA/8OdDZiLDBIZxVyzXuztPjfLd3BV1PRAQGCMWWSHYhL0F8d5uHBDQ== dependencies: - "@babel/types" "^7.28.2" - -"@babel/plugin-proposal-export-namespace-from@^7.14.5": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.18.9.tgz#5f7313ab348cdb19d590145f9247540e94761203" - integrity sha512-k1NtHyOMvlDDFeb9G5PhUXuGj8m/wiwojgQVEhJ/fsVsMCpLyOP4h0uGEjYJKrRI+EVPlb5Jk+Gt9P97lOGwtA== - dependencies: - "@babel/helper-plugin-utils" "^7.18.9" - "@babel/plugin-syntax-export-namespace-from" "^7.8.3" + "@babel/types" "^7.28.5" "@babel/plugin-syntax-async-generators@^7.8.4": version "7.8.4" @@ -275,13 +260,6 @@ dependencies: "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-syntax-export-namespace-from@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.8.3.tgz#028964a9ba80dbc094c915c487ad7c4e7a66465a" - integrity sha512-MXf5laXo6c1IbEbegDmzGPwGNTsHZmEy6QGznu5Sh2UCWvueywb2ee+CCE4zQiZstxU9BMoQO9i6zUFSY0Kj0Q== - dependencies: - "@babel/helper-plugin-utils" "^7.8.3" - "@babel/plugin-syntax-import-attributes@^7.24.7": version "7.27.1" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.27.1.tgz#34c017d54496f9b11b61474e7ea3dfd5563ffe07" @@ -373,14 +351,6 @@ dependencies: "@babel/helper-plugin-utils" "^7.27.1" -"@babel/plugin-transform-modules-commonjs@^7.14.5": - version "7.27.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.27.1.tgz#8e44ed37c2787ecc23bdc367f49977476614e832" - integrity sha512-OJguuwlTYlN0gBZFRPqwOGNWssZjfIUdS7HMYtN8c1KmwpwHFBwTeFZrg9XZa+DFTitWOW5iTAG7tyCUPsCCyw== - dependencies: - "@babel/helper-module-transforms" "^7.27.1" - "@babel/helper-plugin-utils" "^7.27.1" - "@babel/template@^7.27.2", "@babel/template@^7.3.3": version "7.27.2" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.27.2.tgz#fa78ceed3c4e7b63ebf6cb39e5852fca45f6809d" @@ -390,162 +360,153 @@ "@babel/parser" "^7.27.2" "@babel/types" "^7.27.1" -"@babel/traverse@^7.27.1", "@babel/traverse@^7.28.3": - version "7.28.3" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.28.3.tgz#6911a10795d2cce43ec6a28cffc440cca2593434" - integrity sha512-7w4kZYHneL3A6NP2nxzHvT3HCZ7puDZZjFMqDpBPECub79sTtSO5CGXDkKrTQq8ksAwfD/XI2MRFX23njdDaIQ== +"@babel/traverse@^7.27.1", "@babel/traverse@^7.28.3", "@babel/traverse@^7.28.5": + version "7.28.5" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.28.5.tgz#450cab9135d21a7a2ca9d2d35aa05c20e68c360b" + integrity sha512-TCCj4t55U90khlYkVV/0TfkJkAkUg3jZFA3Neb7unZT8CPok7iiRfaX0F+WnqWqt7OxhOn0uBKXCw4lbL8W0aQ== dependencies: "@babel/code-frame" "^7.27.1" - "@babel/generator" "^7.28.3" + "@babel/generator" "^7.28.5" "@babel/helper-globals" "^7.28.0" - "@babel/parser" "^7.28.3" + "@babel/parser" "^7.28.5" "@babel/template" "^7.27.2" - "@babel/types" "^7.28.2" + "@babel/types" "^7.28.5" debug "^4.3.1" -"@babel/types@^7.0.0", "@babel/types@^7.20.7", "@babel/types@^7.27.1", "@babel/types@^7.28.2", "@babel/types@^7.3.3": - version "7.28.2" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.28.2.tgz#da9db0856a9a88e0a13b019881d7513588cf712b" - integrity sha512-ruv7Ae4J5dUYULmeXw1gmb7rYRz57OWCPM57pHojnLq/3Z1CK2lNSLTCVjxVk1F/TZHwOZZrOWi0ur95BbLxNQ== +"@babel/types@^7.0.0", "@babel/types@^7.20.7", "@babel/types@^7.27.1", "@babel/types@^7.28.2", "@babel/types@^7.28.4", "@babel/types@^7.28.5", "@babel/types@^7.3.3": + version "7.28.5" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.28.5.tgz#10fc405f60897c35f07e85493c932c7b5ca0592b" + integrity sha512-qQ5m48eI/MFLQ5PxQj4PFaprjyCTLI37ElWMmNs0K8Lk3dVeOdNpB3ks8jc7yM5CDmVC73eMVk/trk3fgmrUpA== dependencies: "@babel/helper-string-parser" "^7.27.1" - "@babel/helper-validator-identifier" "^7.27.1" + "@babel/helper-validator-identifier" "^7.28.5" "@bcoe/v8-coverage@^0.2.3": version "0.2.3" resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@credo-ts/anoncreds@0.6.0-alpha-20250325224513": - version "0.6.0-alpha-20250325224513" - resolved "https://registry.yarnpkg.com/@credo-ts/anoncreds/-/anoncreds-0.6.0-alpha-20250325224513.tgz#cf9bec49a96c058a356489ee742b79c4c22eb543" - integrity sha512-l4cGks+X5tRLUGZrtNW11R6CM310z0wODuqYzVQcROmz9qf0uM2ZKn2RunDbLLfouoxU66TISqG728oqX7IG+Q== +"@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== dependencies: "@astronautlabs/jsonpath" "^1.1.2" - "@credo-ts/core" "0.6.0-alpha-20250325224513" - "@credo-ts/didcomm" "0.6.0-alpha-20250325224513" + "@credo-ts/core" "0.6.0" + "@credo-ts/didcomm" "0.6.0" "@sphereon/pex-models" "^2.3.2" class-transformer "0.5.1" - class-validator "0.14.1" - reflect-metadata "^0.1.13" + class-validator "^0.14.1" + reflect-metadata "0.2.2" -"@credo-ts/askar@0.5.3", "@credo-ts/askar@0.6.0-alpha-20250325224513": - version "0.6.0-alpha-20250325224513" - resolved "https://registry.yarnpkg.com/@credo-ts/askar/-/askar-0.6.0-alpha-20250325224513.tgz#62009e8618cef60cc014eb2f104aa1c3030ba5be" - integrity sha512-zj8U2QXB3wEqGWhQyZHLMvkvrsksuX2eyYl+ewfQqdPW/dS0A/eZqPxOwBEGLuqWzzWt4Ny/lOX/ioYst2/uew== +"@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== dependencies: - "@credo-ts/core" "0.6.0-alpha-20250325224513" + "@credo-ts/core" "0.6.0" class-transformer "0.5.1" - class-validator "0.14.1" - rxjs "^7.8.0" - tsyringe "^4.8.0" + 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-alpha-20250325224513", "@credo-ts/core@0.6.0-pr-2324-20250728121454": - version "0.6.0-alpha-20250325224513" - resolved "https://registry.yarnpkg.com/@credo-ts/core/-/core-0.6.0-alpha-20250325224513.tgz#8cede1953352b4a3899a939b26e1db61d65ab263" - integrity sha512-DJ5m3NR4zWBD1Tsi5xvZz7+fy7MlxdI2pi1SyHWGsfMFaNaprKfR12ydF/Db6S3Id23KC//8HWYTj4i+fufIQg== +"@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== dependencies: "@animo-id/mdoc" "^0.5.2" - "@animo-id/pex" "5.2.0" + "@animo-id/pex" "^6.1.1" "@astronautlabs/jsonpath" "^1.1.2" - "@digitalcredentials/jsonld" "^6.0.0" - "@digitalcredentials/jsonld-signatures" "^9.4.0" - "@digitalcredentials/vc" "^6.0.1" + "@digitalcredentials/jsonld" "^9.0.0" + "@digitalcredentials/jsonld-signatures" "^12.0.1" + "@digitalcredentials/vc" "^10.0.2" "@multiformats/base-x" "^4.0.1" - "@noble/curves" "^1.8.1" - "@noble/hashes" "^1.7.1" - "@peculiar/asn1-ecc" "^2.3.13" - "@peculiar/asn1-schema" "^2.3.13" - "@peculiar/asn1-x509" "^2.3.13" - "@peculiar/x509" "^1.12.1" - "@sd-jwt/core" "^0.7.2" - "@sd-jwt/decode" "^0.7.2" - "@sd-jwt/jwt-status-list" "^0.7.2" - "@sd-jwt/present" "^0.7.2" - "@sd-jwt/sd-jwt-vc" "^0.7.2" - "@sd-jwt/types" "^0.7.2" - "@sd-jwt/utils" "^0.7.2" + "@noble/curves" "^2.0.1" + "@noble/hashes" "^2.0.1" + "@peculiar/asn1-ecc" "^2.6.0" + "@peculiar/asn1-rsa" "^2.6.0" + "@peculiar/asn1-schema" "^2.6.0" + "@peculiar/asn1-x509" "^2.6.0" + "@peculiar/x509" "^1.14.2" + "@sd-jwt/core" "^0.17.0" + "@sd-jwt/decode" "^0.17.0" + "@sd-jwt/jwt-status-list" "^0.17.1" + "@sd-jwt/present" "^0.17.0" + "@sd-jwt/sd-jwt-vc" "^0.17.1" + "@sd-jwt/types" "^0.17.0" + "@sd-jwt/utils" "^0.17.0" "@sphereon/pex-models" "^2.3.2" "@sphereon/ssi-types" "0.33.0" - "@stablelib/ed25519" "^1.0.2" - "@types/ws" "^8.5.4" - borc "^3.0.0" + "@stablelib/ed25519" "^2.0.2" + "@types/ws" "^8.18.1" buffer "^6.0.3" class-transformer "0.5.1" - class-validator "0.14.1" - dcql "^0.2.20" + class-validator "^0.14.1" + dcql "^3.0.0" did-resolver "^4.1.0" - ec-compression "0.0.1-alpha.11" + ec-compression "0.0.1-alpha.12" lru_map "^0.4.1" make-error "^1.3.6" - object-inspect "^1.10.3" - reflect-metadata "^0.1.13" - rxjs "^7.8.0" - tsyringe "^4.8.0" - uuid "^9.0.0" + object-inspect "^1.13.4" + reflect-metadata "0.2.2" + rxjs "^7.8.2" + tsyringe "^4.10.0" + uuid "^13.0.0" varint "^6.0.0" - web-did-resolver "^2.0.21" - webcrypto-core "^1.8.0" + web-did-resolver "^2.0.31" + webcrypto-core "^1.8.1" + zod "^4.1.12" -"@credo-ts/didcomm@0.6.0-alpha-20250325224513": - version "0.6.0-alpha-20250325224513" - resolved "https://registry.yarnpkg.com/@credo-ts/didcomm/-/didcomm-0.6.0-alpha-20250325224513.tgz#87fdac5ca23bb717a6ffc905edeff71f97cba61f" - integrity sha512-nJGCJmVPJbd/5vYRjjEBr1IPpRntEax4WsFFdmH5almCFRf7Wwr40gzPSohY469aMV68VfBoP/qX3wmQQslu0g== +"@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== dependencies: - "@credo-ts/core" "0.6.0-alpha-20250325224513" + "@credo-ts/core" "0.6.0" class-transformer "0.5.1" - class-validator "0.14.1" - luxon "^3.5.0" - query-string "^7.0.1" - rxjs "^7.8.0" - -"@credo-ts/didcomm@0.6.0-pr-2324-20250728121454": - version "0.6.0-pr-2324-20250728121454" - resolved "https://registry.yarnpkg.com/@credo-ts/didcomm/-/didcomm-0.6.0-pr-2324-20250728121454.tgz#37b94da1f5eaf1a7de9e2fc39f0a149face0e475" - integrity sha512-1oT1WjCGV4Z/lHzzGgGnsvjp/KbiSZA/EmOhXAOzJmpTk2fcWHQtvDMTOla4Jp55x3p4bd45BQIG5J0cToErkw== - dependencies: - "@credo-ts/core" "0.6.0-pr-2324-20250728121454" - class-transformer "0.5.1" - class-validator "0.14.1" - luxon "^3.5.0" - query-string "^7.0.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-alpha-20250325224513": - version "0.6.0-alpha-20250325224513" - resolved "https://registry.yarnpkg.com/@credo-ts/indy-vdr/-/indy-vdr-0.6.0-alpha-20250325224513.tgz#ba72ec4ef9cb81f282b91b599099872deebddbe5" - integrity sha512-dFVZtBKVkZkgNb/ai9DxQNcN9Bw/6sysLVR3sstHqbn2+DWK4k2j5CCkHjFdJFizHpeH5RBKjy5ESS+SdENk2g== +"@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== dependencies: - "@credo-ts/anoncreds" "0.6.0-alpha-20250325224513" - "@credo-ts/core" "0.6.0-alpha-20250325224513" + "@credo-ts/anoncreds" "0.6.0" + "@credo-ts/core" "0.6.0" -"@credo-ts/node@^0.6.0-alpha-20250325224513": - version "0.6.0-pr-2324-20250728121454" - resolved "https://registry.yarnpkg.com/@credo-ts/node/-/node-0.6.0-pr-2324-20250728121454.tgz#c63fa27bc99a93e47e50bcf90d3fe326345d925f" - integrity sha512-Oall4TL+cfVnP5T94SiWAFcPY1tlVRWNmSi8hUT/Qqzy2zpr6uTkS9rsII7F5bspdECUwUMUrsyQ9CmM5zJV4g== +"@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== dependencies: "@2060.io/ffi-napi" "^4.0.9" "@2060.io/ref-napi" "^3.0.6" - "@credo-ts/core" "0.6.0-pr-2324-20250728121454" - "@credo-ts/didcomm" "0.6.0-pr-2324-20250728121454" - "@types/express" "^4.17.23" - express "^4.21.2" + "@credo-ts/core" "0.6.0" + "@credo-ts/didcomm" "0.6.0" + "@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" + "@types/express" "^5.0.6" + class-transformer "0.5.1" + express "^5.2.0" rxjs "^7.8.2" - ws "^8.18.2" - -"@credo-ts/openid4vc@0.6.0-alpha-20250325224513": - version "0.6.0-alpha-20250325224513" - resolved "https://registry.yarnpkg.com/@credo-ts/openid4vc/-/openid4vc-0.6.0-alpha-20250325224513.tgz#04aebd7f631353c406795fa520999a06e8a0e630" - integrity sha512-DRgMZ3gX3mCnocY6XNKmFllLmH7L58r6UQue/bHPKj8YcrfiLW2Pha2abg9W/7y13E4oNvpgznup64bvUn8VqQ== - dependencies: - "@credo-ts/core" "0.6.0-alpha-20250325224513" - "@openid4vc/oauth2" "0.3.0-alpha-20250322171044" - "@openid4vc/openid4vci" "0.3.0-alpha-20250322171044" - "@openid4vc/openid4vp" "0.3.0-alpha-20250322171044" - "@openid4vc/utils" "0.3.0-alpha-20250322171044" - class-transformer "^0.5.1" - rxjs "^7.8.0" - zod "^3.23.8" + zod "^4.1.12" "@credo-ts/push-notifications@^0.7.1": version "0.7.1" @@ -556,25 +517,25 @@ class-validator "0.14.1" tsyringe "^4.6.0" -"@credo-ts/question-answer@0.6.0-alpha-20250325224513": - version "0.6.0-alpha-20250325224513" - resolved "https://registry.yarnpkg.com/@credo-ts/question-answer/-/question-answer-0.6.0-alpha-20250325224513.tgz#69b528e70104eea117d297eaabe69328c1d76149" - integrity sha512-Xa/hnN5gHB61ZuiLvLlU053jGimLAXHXlClw6n77R2E5E9EVvHXAGJ9FeL+tPNWAqGjtmGsDUI16ZhsthN3MJw== +"@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== dependencies: - "@credo-ts/core" "0.6.0-alpha-20250325224513" - "@credo-ts/didcomm" "0.6.0-alpha-20250325224513" + "@credo-ts/core" "0.6.0" + "@credo-ts/didcomm" "0.6.0" class-transformer "0.5.1" - class-validator "0.14.1" - rxjs "^7.8.0" + class-validator "^0.14.1" + rxjs "^7.8.2" -"@credo-ts/tenants@0.6.0-alpha-20250325224513": - version "0.6.0-alpha-20250325224513" - resolved "https://registry.yarnpkg.com/@credo-ts/tenants/-/tenants-0.6.0-alpha-20250325224513.tgz#8fbee1e755ba5005076629d6f54b640c214fab07" - integrity sha512-YbYHdYCCwGYrPrZRKgJ4HvlHTp0CcPYYa+hrcQl56lLcAlhdG+/lbItcyHJwbqio7DCjD3TmwyatgLkva6qznA== +"@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== dependencies: - "@credo-ts/core" "0.6.0-alpha-20250325224513" - "@credo-ts/didcomm" "0.6.0-alpha-20250325224513" - async-mutex "^0.4.0" + "@credo-ts/core" "0.6.0" + "@credo-ts/didcomm" "0.6.0" + async-mutex "^0.5.0" "@cspotcode/source-map-support@^0.8.0": version "0.8.1" @@ -583,237 +544,122 @@ dependencies: "@jridgewell/trace-mapping" "0.3.9" -"@digitalbazaar/bitstring@^3.0.0": - version "3.1.0" - resolved "https://registry.yarnpkg.com/@digitalbazaar/bitstring/-/bitstring-3.1.0.tgz#bbbacb80eaaa53594723a801879b3a95a0401b11" - integrity sha512-Cii+Sl++qaexOvv3vchhgZFfSmtHPNIPzGegaq4ffPnflVXFu+V2qrJ17aL2+gfLxrlC/zazZFuAltyKTPq7eg== - dependencies: - base64url-universal "^2.0.0" - pako "^2.0.4" - -"@digitalbazaar/http-client@^3.4.1": - version "3.4.1" - resolved "https://registry.yarnpkg.com/@digitalbazaar/http-client/-/http-client-3.4.1.tgz#5116fc44290d647cfe4b615d1f3fad9d6005e44d" - integrity sha512-Ahk1N+s7urkgj7WvvUND5f8GiWEPfUw0D41hdElaqLgu8wZScI8gdI0q+qWw5N1d35x7GCRH2uk9mi+Uzo9M3g== - dependencies: - ky "^0.33.3" - ky-universal "^0.11.0" - undici "^5.21.2" - "@digitalbazaar/security-context@^1.0.0": version "1.0.1" resolved "https://registry.yarnpkg.com/@digitalbazaar/security-context/-/security-context-1.0.1.tgz#badc4b8da03411a32d4e7321ce7c4b355776b410" integrity sha512-0WZa6tPiTZZF8leBtQgYAfXQePFQp2z5ivpCEN/iZguYYZ0TB9qRmWtan5XH6mNFuusHtMcyIzAcReyE6rZPhA== -"@digitalbazaar/vc-status-list-context@^3.0.1": - version "3.1.1" - resolved "https://registry.yarnpkg.com/@digitalbazaar/vc-status-list-context/-/vc-status-list-context-3.1.1.tgz#cbe570d8d6d39d7b636bf1fce3c5601e2d104696" - integrity sha512-cMVtd+EV+4KN2kUG4/vsV74JVsGE6dcpod6zRoFB/AJA2W/sZbJqR44KL3G6P262+GcAECNhtnSsKsTnQ6y8+w== - -"@digitalbazaar/vc-status-list@^7.0.0": - version "7.1.0" - resolved "https://registry.yarnpkg.com/@digitalbazaar/vc-status-list/-/vc-status-list-7.1.0.tgz#1d585a1766106e1586e1e2f87092dd0381b3f036" - integrity sha512-p5uxKJlX13N8TcTuv9qFDeej+6bndU+Rh1Cez2MT+bXQE6Jpn5t336FBSHmcECB4yUfZQpkmV/LOcYU4lW8Ojw== - dependencies: - "@digitalbazaar/bitstring" "^3.0.0" - "@digitalbazaar/vc" "^5.0.0" - "@digitalbazaar/vc-status-list-context" "^3.0.1" - credentials-context "^2.0.0" - -"@digitalbazaar/vc@^5.0.0": - version "5.0.0" - resolved "https://registry.yarnpkg.com/@digitalbazaar/vc/-/vc-5.0.0.tgz#20180fb492cb755eb2c6b6df9a17f7407d5e4b5a" - integrity sha512-XmLM7Ag5W+XidGnFuxFIyUFSMnHnWEMJlHei602GG94+WzFJ6Ik8txzPQL8T18egSoiTsd1VekymbIlSimhuaQ== - dependencies: - credentials-context "^2.0.0" - jsonld "^8.0.0" - jsonld-signatures "^11.0.0" - -"@digitalcredentials/base58-universal@^1.0.1": - version "1.0.1" - resolved "https://registry.yarnpkg.com/@digitalcredentials/base58-universal/-/base58-universal-1.0.1.tgz#41b5a16cdeaac9cf01b23f1e564c560c2599b607" - integrity sha512-1xKdJnfITMvrF/sCgwBx2C4p7qcNAARyIvrAOZGqIHmBaT/hAenpC8bf44qVY+UIMuCYP23kqpIfJQebQDThDQ== - -"@digitalcredentials/base64url-universal@^2.0.2": - version "2.0.6" - resolved "https://registry.yarnpkg.com/@digitalcredentials/base64url-universal/-/base64url-universal-2.0.6.tgz#43c59c62a33b024e7adc3c56403d18dbcb61ec61" - integrity sha512-QJyK6xS8BYNnkKLhEAgQc6Tb9DMe+GkHnBAWJKITCxVRXJAFLhJnr+FsJnCThS3x2Y0UiiDAXoWjwMqtUrp4Kg== - dependencies: - base64url "^3.0.1" - -"@digitalcredentials/bitstring@^2.0.1": - version "2.0.1" - resolved "https://registry.yarnpkg.com/@digitalcredentials/bitstring/-/bitstring-2.0.1.tgz#bb887f1d0999980598754e426d831c96a26a3863" - integrity sha512-9priXvsEJGI4LYHPwLqf5jv9HtQGlG0MgeuY8Q4NHN+xWz5rYMylh1TYTVThKa3XI6xF2pR2oEfKZD21eWXveQ== - dependencies: - "@digitalcredentials/base64url-universal" "^2.0.2" - pako "^2.0.4" - -"@digitalcredentials/ed25519-signature-2020@^3.0.2": - version "3.0.2" - resolved "https://registry.yarnpkg.com/@digitalcredentials/ed25519-signature-2020/-/ed25519-signature-2020-3.0.2.tgz#2df8fb6f814a1964b40ebb3402d41630c30120da" - integrity sha512-R8IrR21Dh+75CYriQov3nVHKaOVusbxfk9gyi6eCAwLHKn6fllUt+2LQfuUrL7Ts/sGIJqQcev7YvkX9GvyYRA== - dependencies: - "@digitalcredentials/base58-universal" "^1.0.1" - "@digitalcredentials/ed25519-verification-key-2020" "^3.1.1" - "@digitalcredentials/jsonld-signatures" "^9.3.1" - ed25519-signature-2018-context "^1.1.0" - ed25519-signature-2020-context "^1.0.1" +"@digitalcredentials/credentials-v2-context@^0.0.1-beta.0": + version "0.0.1-beta.0" + resolved "https://registry.yarnpkg.com/@digitalcredentials/credentials-v2-context/-/credentials-v2-context-0.0.1-beta.0.tgz#9892f5342fb11ce47afa19e34a245dd02ea6b90d" + integrity sha512-i0AQXFnMeOqf2uKNBUcnN78mO8L9H91QKMdpDqsgDYzTIKGLnNCOOxbRbrJOimhR+soYO64xn54U8/R7Qx0nyA== -"@digitalcredentials/ed25519-verification-key-2020@^3.1.1": - version "3.2.2" - resolved "https://registry.yarnpkg.com/@digitalcredentials/ed25519-verification-key-2020/-/ed25519-verification-key-2020-3.2.2.tgz#cdf271bf4bb44dd2c417dcde6d7a0436e31d84ca" - integrity sha512-ZfxNFZlA379MZpf+gV2tUYyiZ15eGVgjtCQLWlyu3frWxsumUgv++o0OJlMnrDsWGwzFMRrsXcosd5+752rLOA== - dependencies: - "@digitalcredentials/base58-universal" "^1.0.1" - "@stablelib/ed25519" "^1.0.1" - base64url-universal "^1.1.0" - crypto-ld "^6.0.0" - -"@digitalcredentials/http-client@^1.0.0": - version "1.2.2" - resolved "https://registry.yarnpkg.com/@digitalcredentials/http-client/-/http-client-1.2.2.tgz#8b09ab6f1e3aa8878d91d3ca51946ca8265cc92e" - integrity sha512-YOwaE+vUDSwiDhZT0BbXSWVg+bvp1HA1eg/gEc8OCwCOj9Bn9FRQdu8P9Y/fnYqyFCioDwwTRzGxgJLl50baEg== +"@digitalcredentials/http-client@^5.0.1": + version "5.0.4" + resolved "https://registry.yarnpkg.com/@digitalcredentials/http-client/-/http-client-5.0.4.tgz#44e73ea1133d24bab720c0515f92df9126912fe7" + integrity sha512-TbbfFauhd5fUAcZ/6TDenTuYqkzqdEhxYk1Rqicxcz33B9rzvJcmT+/81KF9DrUXmu6gpoqCranT2UkZftsxZA== dependencies: - ky "^0.25.1" - ky-universal "^0.8.2" + ky "^1.0.1" + undici "^6.6.2" -"@digitalcredentials/jsonld-signatures@^9.3.1", "@digitalcredentials/jsonld-signatures@^9.3.2", "@digitalcredentials/jsonld-signatures@^9.4.0": - version "9.4.0" - resolved "https://registry.yarnpkg.com/@digitalcredentials/jsonld-signatures/-/jsonld-signatures-9.4.0.tgz#d5881122c4202449b88a7e2384f8e615ae55582c" - integrity sha512-DnR+HDTm7qpcDd0wcD1w6GdlAwfHjQSgu+ahion8REkCkkMRywF+CLunU7t8AZpFB2Gr/+N8naUtiEBNje1Oew== +"@digitalcredentials/jsonld-signatures@^12.0.1": + version "12.0.1" + resolved "https://registry.yarnpkg.com/@digitalcredentials/jsonld-signatures/-/jsonld-signatures-12.0.1.tgz#af0c0018f84721218463bab203ecbec85606f6ff" + integrity sha512-KdyE7Bex+boqKRbvxofRyuI09BD6/8hQGSC5qbrXEmHd0oSLqePqKBM2pu9UZnzjxMZrN9sB3RqHxpijYEFh/w== dependencies: "@digitalbazaar/security-context" "^1.0.0" - "@digitalcredentials/jsonld" "^6.0.0" + "@digitalcredentials/jsonld" "^9.0.0" fast-text-encoding "^1.0.3" - isomorphic-webcrypto "^2.3.8" serialize-error "^8.0.1" -"@digitalcredentials/jsonld@^5.2.1": - version "5.2.2" - resolved "https://registry.yarnpkg.com/@digitalcredentials/jsonld/-/jsonld-5.2.2.tgz#d2bdefe25788ece77e900a9491c64c2187e3344c" - integrity sha512-hz7YR3kv6+8UUdgMyTGl1o8NjVKKwnMry/Rh/rWeAvwL+NqgoUHorWzI3rM+PW+MPFyDC0ieXStClt9n9D9SGA== +"@digitalcredentials/jsonld@^9.0.0": + version "9.0.0" + resolved "https://registry.yarnpkg.com/@digitalcredentials/jsonld/-/jsonld-9.0.0.tgz#545abb40fd87caaa5ba95ec41b9ff84cb0d2696a" + integrity sha512-lWVpg65xQbi4lvXWs3BezCwPrGDAllFjHwTBUWJCoKsfGzxtxTwbRNXpfhii5psQ2vvpjPXSI+y0uyRNOzr4cw== dependencies: - "@digitalcredentials/http-client" "^1.0.0" - "@digitalcredentials/rdf-canonize" "^1.0.0" - canonicalize "^1.0.1" - lru-cache "^6.0.0" - -"@digitalcredentials/jsonld@^6.0.0": - version "6.0.0" - resolved "https://registry.yarnpkg.com/@digitalcredentials/jsonld/-/jsonld-6.0.0.tgz#05d34cb1d81c4bbdfacf61f8958bbaede33be598" - integrity sha512-5tTakj0/GsqAJi8beQFVMQ97wUJZnuxViW9xRuAATL6eOBIefGBwHkVryAgEq2I4J/xKgb/nEyw1ZXX0G8wQJQ== - dependencies: - "@digitalcredentials/http-client" "^1.0.0" - "@digitalcredentials/rdf-canonize" "^1.0.0" + "@digitalcredentials/http-client" "^5.0.1" canonicalize "^1.0.1" lru-cache "^6.0.0" + rdf-canonize "^3.4.0" "@digitalcredentials/open-badges-context@^2.1.0": version "2.1.0" resolved "https://registry.yarnpkg.com/@digitalcredentials/open-badges-context/-/open-badges-context-2.1.0.tgz#cefd29af4642adf8feeed5bb7ede663b14913c2f" integrity sha512-VK7X5u6OoBFxkyIFplNqUPVbo+8vFSAEoam8tSozpj05KPfcGw41Tp5p9fqMnY38oPfwtZR2yDNSctj/slrE0A== -"@digitalcredentials/rdf-canonize@^1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@digitalcredentials/rdf-canonize/-/rdf-canonize-1.0.0.tgz#6297d512072004c2be7f280246383a9c4b0877ff" - integrity sha512-z8St0Ex2doecsExCFK1uI4gJC+a5EqYYu1xpRH1pKmqSS9l/nxfuVxexNFyaeEum4dUdg1EetIC2rTwLIFhPRA== +"@digitalcredentials/vc@^10.0.2": + version "10.0.2" + resolved "https://registry.yarnpkg.com/@digitalcredentials/vc/-/vc-10.0.2.tgz#9716d161f55657cd818c2baf7dcd927729d00d0c" + integrity sha512-Mmts8WtAQmgdrSurQv+SFZNozNgvPzsruWQNIBlmfrlJ7QSyCoO7jybSnq43EuLm3UcqyqSb2mLHwAza310mhw== dependencies: - fast-text-encoding "^1.0.3" - isomorphic-webcrypto "^2.3.8" - -"@digitalcredentials/vc-status-list@^5.0.2": - version "5.0.2" - resolved "https://registry.yarnpkg.com/@digitalcredentials/vc-status-list/-/vc-status-list-5.0.2.tgz#9de8b23b6d533668a354ff464a689ecc42f24445" - integrity sha512-PI0N7SM0tXpaNLelbCNsMAi34AjOeuhUzMSYTkHdeqRPX7oT2F3ukyOssgr4koEqDxw9shHtxHu3fSJzrzcPMQ== - dependencies: - "@digitalbazaar/vc-status-list-context" "^3.0.1" - "@digitalcredentials/bitstring" "^2.0.1" - "@digitalcredentials/vc" "^4.1.1" - credentials-context "^2.0.0" - -"@digitalcredentials/vc@^4.1.1": - version "4.2.0" - resolved "https://registry.yarnpkg.com/@digitalcredentials/vc/-/vc-4.2.0.tgz#d2197b26547d670965d5969a9e49437f244b5944" - integrity sha512-8Rxpn77JghJN7noBQdcMuzm/tB8vhDwPoFepr3oGd5w+CyJxOk2RnBlgIGlAAGA+mALFWECPv1rANfXno+hdjA== - dependencies: - "@digitalcredentials/jsonld" "^5.2.1" - "@digitalcredentials/jsonld-signatures" "^9.3.1" - credentials-context "^2.0.0" - -"@digitalcredentials/vc@^6.0.1": - version "6.0.1" - resolved "https://registry.yarnpkg.com/@digitalcredentials/vc/-/vc-6.0.1.tgz#e4bdbac37d677c5288f2ad8d9ea59c3b41e0fd78" - integrity sha512-TZgLoi00Jc9uv3b6jStH+G8+bCqpHIqFw9DYODz+fVjNh197ksvcYqSndUDHa2oi0HCcK+soI8j4ba3Sa4Pl4w== - dependencies: - "@digitalbazaar/vc-status-list" "^7.0.0" - "@digitalcredentials/ed25519-signature-2020" "^3.0.2" - "@digitalcredentials/jsonld" "^6.0.0" - "@digitalcredentials/jsonld-signatures" "^9.3.2" + "@digitalcredentials/credentials-v2-context" "^0.0.1-beta.0" + "@digitalcredentials/jsonld" "^9.0.0" + "@digitalcredentials/jsonld-signatures" "^12.0.1" "@digitalcredentials/open-badges-context" "^2.1.0" - "@digitalcredentials/vc-status-list" "^5.0.2" credentials-context "^2.0.0" - fix-esm "^1.0.1" + ed25519-signature-2018-context "^1.1.0" "@emnapi/core@^1.4.3": - version "1.4.5" - resolved "https://registry.yarnpkg.com/@emnapi/core/-/core-1.4.5.tgz#bfbb0cbbbb9f96ec4e2c4fd917b7bbe5495ceccb" - integrity sha512-XsLw1dEOpkSX/WucdqUhPWP7hDxSvZiY+fsUC14h+FtQ2Ifni4znbBt8punRX+Uj2JG/uDb8nEHVKvrVlvdZ5Q== + version "1.7.1" + resolved "https://registry.yarnpkg.com/@emnapi/core/-/core-1.7.1.tgz#3a79a02dbc84f45884a1806ebb98e5746bdfaac4" + integrity sha512-o1uhUASyo921r2XtHYOHy7gdkGLge8ghBEQHMWmyJFoXlpU58kIrhhN3w26lpQb6dspetweapMn2CSNwQ8I4wg== dependencies: - "@emnapi/wasi-threads" "1.0.4" + "@emnapi/wasi-threads" "1.1.0" tslib "^2.4.0" "@emnapi/runtime@^1.4.3": - version "1.4.5" - resolved "https://registry.yarnpkg.com/@emnapi/runtime/-/runtime-1.4.5.tgz#c67710d0661070f38418b6474584f159de38aba9" - integrity sha512-++LApOtY0pEEz1zrd9vy1/zXVaVJJ/EbAF3u0fXIzPJEDtnITsBGbbK0EkM72amhl/R5b+5xx0Y/QhcVOpuulg== + version "1.7.1" + resolved "https://registry.yarnpkg.com/@emnapi/runtime/-/runtime-1.7.1.tgz#a73784e23f5d57287369c808197288b52276b791" + integrity sha512-PVtJr5CmLwYAU9PZDMITZoR5iAOShYREoR45EyyLrbntV50mdePTgUn4AmOw90Ifcj+x2kRjdzr1HP3RrNiHGA== dependencies: tslib "^2.4.0" -"@emnapi/wasi-threads@1.0.4": - version "1.0.4" - resolved "https://registry.yarnpkg.com/@emnapi/wasi-threads/-/wasi-threads-1.0.4.tgz#703fc094d969e273b1b71c292523b2f792862bf4" - integrity sha512-PJR+bOmMOPH8AtcTGAyYNiuJ3/Fcoj2XN/gBEWzDIKh254XO+mM9XoXHk5GNEhodxeMznbg7BlRojVbKN+gC6g== +"@emnapi/wasi-threads@1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@emnapi/wasi-threads/-/wasi-threads-1.1.0.tgz#60b2102fddc9ccb78607e4a3cf8403ea69be41bf" + integrity sha512-WI0DdZ8xFSbgMjR1sFsKABJ/C5OnRrjT06JXbZKexJGrDuPTzZdDYfFlsgcCXCyf+suG5QU2e/y1Wo2V/OapLQ== dependencies: tslib "^2.4.0" -"@eslint-community/eslint-utils@^4.2.0", "@eslint-community/eslint-utils@^4.7.0": - version "4.7.0" - resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.7.0.tgz#607084630c6c033992a082de6e6fbc1a8b52175a" - integrity sha512-dyybb3AcajC7uha6CvhdVRJqaKyn7w2YKqKyAN37NKYgZT36w+iRb0Dymmc5qEJ549c/S31cMMSFd75bteCpCw== +"@eslint-community/eslint-utils@^4.7.0", "@eslint-community/eslint-utils@^4.8.0": + version "4.9.0" + resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.9.0.tgz#7308df158e064f0dd8b8fdb58aa14fa2a7f913b3" + integrity sha512-ayVFHdtZ+hsq1t2Dy24wCmGXGe4q9Gu3smhLYALJrr473ZH27MsnSL+LKUlimp4BWJqMDMLmPpx/Q9R3OAlL4g== dependencies: eslint-visitor-keys "^3.4.3" "@eslint-community/regexpp@^4.10.0", "@eslint-community/regexpp@^4.12.1": - version "4.12.1" - resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.12.1.tgz#cfc6cffe39df390a3841cde2abccf92eaa7ae0e0" - integrity sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ== + version "4.12.2" + resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.12.2.tgz#bccdf615bcf7b6e8db830ec0b8d21c9a25de597b" + integrity sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew== -"@eslint/config-array@^0.21.0": - version "0.21.0" - resolved "https://registry.yarnpkg.com/@eslint/config-array/-/config-array-0.21.0.tgz#abdbcbd16b124c638081766392a4d6b509f72636" - integrity sha512-ENIdc4iLu0d93HeYirvKmrzshzofPw6VkZRKQGe9Nv46ZnWUzcF1xV01dcvEg/1wXUR61OmmlSfyeyO7EvjLxQ== +"@eslint/config-array@^0.21.1": + version "0.21.1" + resolved "https://registry.yarnpkg.com/@eslint/config-array/-/config-array-0.21.1.tgz#7d1b0060fea407f8301e932492ba8c18aff29713" + integrity sha512-aw1gNayWpdI/jSYVgzN5pL0cfzU02GT3NBpeT/DXbx1/1x7ZKxFPd9bwrzygx/qiwIQiJ1sw/zD8qY/kRvlGHA== dependencies: - "@eslint/object-schema" "^2.1.6" + "@eslint/object-schema" "^2.1.7" debug "^4.3.1" minimatch "^3.1.2" -"@eslint/config-helpers@^0.3.1": - version "0.3.1" - resolved "https://registry.yarnpkg.com/@eslint/config-helpers/-/config-helpers-0.3.1.tgz#d316e47905bd0a1a931fa50e669b9af4104d1617" - integrity sha512-xR93k9WhrDYpXHORXpxVL5oHj3Era7wo6k/Wd8/IsQNnZUTzkGS29lyn3nAT05v6ltUuTFVCCYDEGfy2Or/sPA== +"@eslint/config-helpers@^0.4.2": + version "0.4.2" + resolved "https://registry.yarnpkg.com/@eslint/config-helpers/-/config-helpers-0.4.2.tgz#1bd006ceeb7e2e55b2b773ab318d300e1a66aeda" + integrity sha512-gBrxN88gOIf3R7ja5K9slwNayVcZgK6SOUORm2uBzTeIEfeVaIhOpCtTox3P6R7o2jLFwLFTLnC7kU/RGcYEgw== + dependencies: + "@eslint/core" "^0.17.0" -"@eslint/core@^0.15.2": - version "0.15.2" - resolved "https://registry.yarnpkg.com/@eslint/core/-/core-0.15.2.tgz#59386327d7862cc3603ebc7c78159d2dcc4a868f" - integrity sha512-78Md3/Rrxh83gCxoUc0EiciuOHsIITzLy53m3d9UyiW8y9Dj2D29FeETqyKA+BRK76tnTp6RXWb3pCay8Oyomg== +"@eslint/core@^0.17.0": + version "0.17.0" + resolved "https://registry.yarnpkg.com/@eslint/core/-/core-0.17.0.tgz#77225820413d9617509da9342190a2019e78761c" + integrity sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ== dependencies: "@types/json-schema" "^7.0.15" "@eslint/eslintrc@^3.3.1": - version "3.3.1" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-3.3.1.tgz#e55f7f1dd400600dd066dbba349c4c0bac916964" - integrity sha512-gtF186CXhIl1p4pJNGZw8Yc6RlshoePRvE0X91oPGb3vZ8pM3qOS9W9NGPat9LziaBV7XrJWGylNQXkGcnM3IQ== + version "3.3.3" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-3.3.3.tgz#26393a0806501b5e2b6a43aa588a4d8df67880ac" + integrity sha512-Kr+LPIUVKz2qkx1HAMH8q1q6azbqBAsXJUxBl/ODDuVPX45Z9DfwB8tPjTi6nNZ8BuM3nbJxC5zCAg5elnBUTQ== dependencies: ajv "^6.12.4" debug "^4.3.2" @@ -821,26 +667,26 @@ globals "^14.0.0" ignore "^5.2.0" import-fresh "^3.2.1" - js-yaml "^4.1.0" + js-yaml "^4.1.1" minimatch "^3.1.2" strip-json-comments "^3.1.1" -"@eslint/js@9.33.0": - version "9.33.0" - resolved "https://registry.yarnpkg.com/@eslint/js/-/js-9.33.0.tgz#475c92fdddab59b8b8cab960e3de2564a44bf368" - integrity sha512-5K1/mKhWaMfreBGJTwval43JJmkip0RmM+3+IuqupeSKNC/Th2Kc7ucaq5ovTSra/OOKB9c58CGSz3QMVbWt0A== +"@eslint/js@9.39.1": + version "9.39.1" + resolved "https://registry.yarnpkg.com/@eslint/js/-/js-9.39.1.tgz#0dd59c3a9f40e3f1882975c321470969243e0164" + integrity sha512-S26Stp4zCy88tH94QbBv3XCuzRQiZ9yXofEILmglYTh/Ug/a9/umqvgFtYBAo3Lp0nsI/5/qH1CCrbdK3AP1Tw== -"@eslint/object-schema@^2.1.6": - version "2.1.6" - resolved "https://registry.yarnpkg.com/@eslint/object-schema/-/object-schema-2.1.6.tgz#58369ab5b5b3ca117880c0f6c0b0f32f6950f24f" - integrity sha512-RBMg5FRL0I0gs51M/guSAj5/e14VQ4tpZnQNWwuDT66P14I43ItmPfIZRhO9fUVIPOAQXU47atlywZ/czoqFPA== +"@eslint/object-schema@^2.1.7": + version "2.1.7" + resolved "https://registry.yarnpkg.com/@eslint/object-schema/-/object-schema-2.1.7.tgz#6e2126a1347e86a4dedf8706ec67ff8e107ebbad" + integrity sha512-VtAOaymWVfZcmZbp6E2mympDIHvyjXs/12LqWYjVw6qjrfF+VK+fyG33kChz3nnK+SU5/NeHOqrTEHS8sXO3OA== -"@eslint/plugin-kit@^0.3.5": - version "0.3.5" - resolved "https://registry.yarnpkg.com/@eslint/plugin-kit/-/plugin-kit-0.3.5.tgz#fd8764f0ee79c8ddab4da65460c641cefee017c5" - integrity sha512-Z5kJ+wU3oA7MMIqVR9tyZRtjYPr4OC004Q4Rw7pgOKUOKkJfZ3O24nz3WYfGRpMDNmcOi3TwQOmgm7B7Tpii0w== +"@eslint/plugin-kit@^0.4.1": + version "0.4.1" + resolved "https://registry.yarnpkg.com/@eslint/plugin-kit/-/plugin-kit-0.4.1.tgz#9779e3fd9b7ee33571a57435cf4335a1794a6cb2" + integrity sha512-43/qtrDUokr7LJqoF2c3+RInu/t4zfrpYdoSDfYyhg52rwLV6TnOvdG4fXm7IkSB3wErkcmJS9iEhjVtOSEjjA== dependencies: - "@eslint/core" "^0.15.2" + "@eslint/core" "^0.17.0" levn "^0.4.1" "@ethersproject/abi@5.8.0", "@ethersproject/abi@^5.1.2", "@ethersproject/abi@^5.8.0": @@ -1191,21 +1037,21 @@ integrity sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA== "@grpc/grpc-js@^1.7.1": - version "1.13.4" - resolved "https://registry.yarnpkg.com/@grpc/grpc-js/-/grpc-js-1.13.4.tgz#922fbc496e229c5fa66802d2369bf181c1df1c5a" - integrity sha512-GsFaMXCkMqkKIvwCQjCrwH+GHbPKBjhwo/8ZuUkWHqbI73Kky9I+pQltrlT0+MWpedCoosda53lgjYfyEPgxBg== + version "1.14.2" + resolved "https://registry.yarnpkg.com/@grpc/grpc-js/-/grpc-js-1.14.2.tgz#d245069181a1a8057abd35522d6052482730cf19" + integrity sha512-QzVUtEFyu05UNx2xr0fCQmStUO17uVQhGNowtxs00IgTZT6/W2PBLfUkj30s0FKJ29VtTa3ArVNIhNP6akQhqA== dependencies: - "@grpc/proto-loader" "^0.7.13" + "@grpc/proto-loader" "^0.8.0" "@js-sdsl/ordered-map" "^4.4.2" -"@grpc/proto-loader@^0.7.13": - version "0.7.15" - resolved "https://registry.yarnpkg.com/@grpc/proto-loader/-/proto-loader-0.7.15.tgz#4cdfbf35a35461fc843abe8b9e2c0770b5095e60" - integrity sha512-tMXdRCfYVixjuFK+Hk0Q1s38gV9zDiDJfWL3h1rv4Qc39oILCu1TRTDt7+fGUI8K4G1Fj125Hx/ru3azECWTyQ== +"@grpc/proto-loader@^0.8.0": + version "0.8.0" + resolved "https://registry.yarnpkg.com/@grpc/proto-loader/-/proto-loader-0.8.0.tgz#b6c324dd909c458a0e4aa9bfd3d69cf78a4b9bd8" + integrity sha512-rc1hOQtjIWGxcxpb9aHAfLpIctjEnsDehj0DAiVfBlmT84uvR0uUtN2hEi/ecvWVjXUGf5qPF4qEgiLOx1YIMQ== dependencies: lodash.camelcase "^4.3.0" long "^5.0.0" - protobufjs "^7.2.5" + protobufjs "^7.5.3" yargs "^17.7.2" "@hapi/accept@^6.0.3": @@ -1296,9 +1142,9 @@ integrity sha512-w+lKW+yRrLhJu620jT3y+5g2mHqnKfepreykvdOcl9/6up8GrQQn+l3FRTsjHTKbkbfQFkuksHpdv2EcpKcJ4Q== "@hapi/hapi@^21.3.12": - version "21.4.3" - resolved "https://registry.yarnpkg.com/@hapi/hapi/-/hapi-21.4.3.tgz#e829eef35659d7618831f4431382229107a71d07" - integrity sha512-Q7g0ZY4gxU69wabFKH75qR0AFOdiOECj6vGqTHBSO5Lrwe6TwD8r9LkYQIbvtG8N423VDpdVsiZP8MnBwmD6Hw== + version "21.4.4" + resolved "https://registry.yarnpkg.com/@hapi/hapi/-/hapi-21.4.4.tgz#89c239135be1ff2adeb586df157dee7a49593291" + integrity sha512-vI6JPLR99WZDKI1nriD0qXDPp8sKFkZfNVGrDDZafDQ8jU+3ERMwS0vPac5aGae6yyyoGZGOBiYExw4N8ScSTQ== dependencies: "@hapi/accept" "^6.0.3" "@hapi/ammo" "^6.0.1" @@ -1313,9 +1159,9 @@ "@hapi/podium" "^5.0.2" "@hapi/shot" "^6.0.2" "@hapi/somever" "^4.1.1" - "@hapi/statehood" "^8.2.0" + "@hapi/statehood" "^8.2.1" "@hapi/subtext" "^8.1.1" - "@hapi/teamwork" "^6.0.0" + "@hapi/teamwork" "^6.0.1" "@hapi/topo" "^6.0.2" "@hapi/validate" "^2.0.1" @@ -1401,10 +1247,10 @@ "@hapi/bounce" "^3.0.1" "@hapi/hoek" "^11.0.2" -"@hapi/statehood@^8.2.0": - version "8.2.0" - resolved "https://registry.yarnpkg.com/@hapi/statehood/-/statehood-8.2.0.tgz#f9e9367ad1a02a975dc6b24dad728af19962da0f" - integrity sha512-63JlCVIrsmuunWsyc3OeuFO+gH6v56swLCl7OM1w09l/exQKPUxSUDF2Slkuw8k91nIzr0A2/aPvjLOWf9ksrg== +"@hapi/statehood@^8.2.1": + version "8.2.1" + resolved "https://registry.yarnpkg.com/@hapi/statehood/-/statehood-8.2.1.tgz#4435f11f78873f07aa7422a95386ae9802a914e1" + integrity sha512-xf72TG/QINW26jUu+uL5H+crE1o8GplIgfPWwPZhnAGJzetIVAQEQYvzq+C0aEVHg5/lMMtQ+L9UryuSa5Yjkg== dependencies: "@hapi/boom" "^10.0.1" "@hapi/bounce" "^3.0.1" @@ -1427,10 +1273,10 @@ "@hapi/pez" "^6.1.0" "@hapi/wreck" "^18.0.1" -"@hapi/teamwork@^6.0.0": - version "6.0.0" - resolved "https://registry.yarnpkg.com/@hapi/teamwork/-/teamwork-6.0.0.tgz#b3a173cf811ba59fc6ee22318a1b51f4561f06e0" - integrity sha512-05HumSy3LWfXpmJ9cr6HzwhAavrHkJ1ZRCmNE2qJMihdM5YcWreWPfyN0yKT2ZjCM92au3ZkuodjBxOibxM67A== +"@hapi/teamwork@^6.0.0", "@hapi/teamwork@^6.0.1": + version "6.0.1" + resolved "https://registry.yarnpkg.com/@hapi/teamwork/-/teamwork-6.0.1.tgz#2f6496170f47abd8446930447f64e64ba1d57d3f" + integrity sha512-52OXRslUfYwXAOG8k58f2h2ngXYQGP0x5RPOo+eWA/FtyLgHjGMrE3+e9LSXP/0q2YfHAK5wj9aA9DTy1K+kyQ== "@hapi/topo@^5.1.0": version "5.1.0" @@ -1476,24 +1322,19 @@ integrity sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA== "@humanfs/node@^0.16.6": - version "0.16.6" - resolved "https://registry.yarnpkg.com/@humanfs/node/-/node-0.16.6.tgz#ee2a10eaabd1131987bf0488fd9b820174cd765e" - integrity sha512-YuI2ZHQL78Q5HbhDiBA1X4LmYdXCKCMQIfw0pw7piHJwyREFebJUvrQN4cMssyES6x+vfUbx1CIpaQUKYdQZOw== + version "0.16.7" + resolved "https://registry.yarnpkg.com/@humanfs/node/-/node-0.16.7.tgz#822cb7b3a12c5a240a24f621b5a2413e27a45f26" + integrity sha512-/zUx+yOsIrG4Y43Eh2peDeKCxlRt/gET6aHfaKpuq267qXdYDFViVHfMaLyygZOnl0kGWxFIgsBy8QFuTLUXEQ== dependencies: "@humanfs/core" "^0.19.1" - "@humanwhocodes/retry" "^0.3.0" + "@humanwhocodes/retry" "^0.4.0" "@humanwhocodes/module-importer@^1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz#af5b2691a22b44be847b0ca81641c5fb6ad0172c" integrity sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA== -"@humanwhocodes/retry@^0.3.0": - version "0.3.1" - resolved "https://registry.yarnpkg.com/@humanwhocodes/retry/-/retry-0.3.1.tgz#c72a5c76a9fbaf3488e231b13dc52c0da7bab42a" - integrity sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA== - -"@humanwhocodes/retry@^0.4.2": +"@humanwhocodes/retry@^0.4.0", "@humanwhocodes/retry@^0.4.2": version "0.4.3" resolved "https://registry.yarnpkg.com/@humanwhocodes/retry/-/retry-0.4.3.tgz#c2b9d2e374ee62c586d3adbea87199b1d7a7a6ba" integrity sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ== @@ -1768,6 +1609,14 @@ "@jridgewell/sourcemap-codec" "^1.5.0" "@jridgewell/trace-mapping" "^0.3.24" +"@jridgewell/remapping@^2.3.5": + version "2.3.5" + resolved "https://registry.yarnpkg.com/@jridgewell/remapping/-/remapping-2.3.5.tgz#375c476d1972947851ba1e15ae8f123047445aa1" + integrity sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ== + dependencies: + "@jridgewell/gen-mapping" "^0.3.5" + "@jridgewell/trace-mapping" "^0.3.24" + "@jridgewell/resolve-uri@^3.0.3", "@jridgewell/resolve-uri@^3.1.0": version "3.1.2" resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz#7a0ee601f60f99a20c7c7c5ff0c80388c1189bd6" @@ -1787,9 +1636,9 @@ "@jridgewell/sourcemap-codec" "^1.4.10" "@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.18", "@jridgewell/trace-mapping@^0.3.24", "@jridgewell/trace-mapping@^0.3.28": - version "0.3.30" - resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.30.tgz#4a76c4daeee5df09f5d3940e087442fb36ce2b99" - integrity sha512-GQ7Nw5G2lTu/BtHTKfXhKHok2WGetd4XYcVKGx00SjAk8GMwgJM3zr6zORiPGuOE+/vkc90KtTosSSvaCjKb2Q== + version "0.3.31" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz#db15d6781c931f3a251a3dac39501c98a6082fd0" + integrity sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw== dependencies: "@jridgewell/resolve-uri" "^3.1.0" "@jridgewell/sourcemap-codec" "^1.4.14" @@ -1845,12 +1694,12 @@ dependencies: "@noble/hashes" "1.3.2" -"@noble/curves@^1.8.1": - version "1.9.7" - resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.9.7.tgz#79d04b4758a43e4bca2cbdc62e7771352fa6b951" - integrity sha512-gbKGcRUYIjA3/zCCNaWDciTMFI0dCkvou3TL8Zmy5Nc7sJ47a0jtOeZoTaMxkuqRo9cRhjOdZJXegxYE5FN/xw== +"@noble/curves@^2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-2.0.1.tgz#64ba8bd5e8564a02942655602515646df1cdb3ad" + integrity sha512-vs1Az2OOTBiP4q0pwjW5aF0xp9n4MxVrmkFBxc6EKZc6ddYx5gaZiAsZoq0uRRXWbi3AT/sBqn05eRPtn1JCPw== dependencies: - "@noble/hashes" "1.8.0" + "@noble/hashes" "2.0.1" "@noble/hashes@1.3.2": version "1.3.2" @@ -1862,36 +1711,20 @@ resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.6.1.tgz#df6e5943edcea504bac61395926d6fd67869a0d5" integrity sha512-pq5D8h10hHBjyqX+cfBm0i8JUXJ0UhczFc4r74zbuT9XgewFo2E3J1cOaGtdZynILNmQ685YWGzGE1Zv6io50w== -"@noble/hashes@1.8.0", "@noble/hashes@^1.1.5", "@noble/hashes@^1.7.1": +"@noble/hashes@2.0.1", "@noble/hashes@^2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-2.0.1.tgz#fc1a928061d1232b0a52bb754393c37a5216c89e" + integrity sha512-XlOlEbQcE9fmuXxrVTXCTlG2nlRXa9Rj3rr5Ue/+tX+nmkgbX720YHh0VR3hBF9xDvwnb8D2shVGOwNx+ulArw== + +"@noble/hashes@^1.1.5": version "1.8.0" resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.8.0.tgz#cee43d801fcef9644b11b8194857695acd5f815a" integrity sha512-jCs9ldd7NwzpgXDIf6P3+NrHh9/sD6CQdxHyjQI+h/6rDNo88ypBxxz45UDuZHz9r3tNz7N/VInSVoVdtXEI4A== -"@nodelib/fs.scandir@2.1.5": - version "2.1.5" - resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" - integrity sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g== - dependencies: - "@nodelib/fs.stat" "2.0.5" - run-parallel "^1.1.9" - -"@nodelib/fs.stat@2.0.5", "@nodelib/fs.stat@^2.0.2": - version "2.0.5" - resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b" - integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== - -"@nodelib/fs.walk@^1.2.3": - version "1.2.8" - resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz#e95737e8bb6746ddedf69c556953494f196fe69a" - integrity sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg== - dependencies: - "@nodelib/fs.scandir" "2.1.5" - fastq "^1.6.0" - "@nomicfoundation/hardhat-verify@^2.0.3": - version "2.1.1" - resolved "https://registry.yarnpkg.com/@nomicfoundation/hardhat-verify/-/hardhat-verify-2.1.1.tgz#0af5fc4228df860062865fcafb4a01bc0b89f8a3" - integrity sha512-K1plXIS42xSHDJZRkrE2TZikqxp9T4y6jUMUNI/imLgN5uCcEQokmfU0DlyP9zzHncYK92HlT5IWP35UVCLrPw== + version "2.1.3" + resolved "https://registry.yarnpkg.com/@nomicfoundation/hardhat-verify/-/hardhat-verify-2.1.3.tgz#f61a192a792b39f9978cef1450047deaff3ea052" + integrity sha512-danbGjPp2WBhLkJdQy9/ARM3WQIK+7vwzE0urNem1qZJjh9f54Kf5f1xuQv8DvqewUAkuPxVt/7q4Grz5WjqSg== dependencies: "@ethersproject/abi" "^5.1.2" "@ethersproject/address" "^5.0.2" @@ -1903,39 +1736,39 @@ table "^6.8.0" undici "^5.14.0" -"@openid4vc/oauth2@0.3.0-alpha-20250322171044": - version "0.3.0-alpha-20250322171044" - resolved "https://registry.yarnpkg.com/@openid4vc/oauth2/-/oauth2-0.3.0-alpha-20250322171044.tgz#75adec0345f01504c7d9abe16ddc30c72c0132c3" - integrity sha512-NylLLsYhj2239CgQW20WyR5bHfyqm+8VpMeXKrN0b9ds+ViHaNMpwtouYCK2rGzg8lnY7ugacfdo8RmnC49T3Q== +"@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== dependencies: - "@openid4vc/utils" "0.3.0-alpha-20250322171044" - zod "^3.24.1" + "@openid4vc/utils" "0.4.1" + zod "^4.1.13" -"@openid4vc/openid4vci@0.3.0-alpha-20250322171044": - version "0.3.0-alpha-20250322171044" - resolved "https://registry.yarnpkg.com/@openid4vc/openid4vci/-/openid4vci-0.3.0-alpha-20250322171044.tgz#9ac667e56d5e20ff4e71d27cd98a5065923fbccb" - integrity sha512-mhNNuI6xinAX7VOFqnhoUGr9IFQswU/5ZCWNW++INbNAJxgjIDYLwCnpx2F4Nx0B+jbZbUpOwnHnVEIGdQAP8A== +"@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== dependencies: - "@openid4vc/oauth2" "0.3.0-alpha-20250322171044" - "@openid4vc/utils" "0.3.0-alpha-20250322171044" - zod "^3.24.1" + "@openid4vc/oauth2" "0.4.1" + "@openid4vc/utils" "0.4.1" + zod "^4.1.13" -"@openid4vc/openid4vp@0.3.0-alpha-20250322171044": - version "0.3.0-alpha-20250322171044" - resolved "https://registry.yarnpkg.com/@openid4vc/openid4vp/-/openid4vp-0.3.0-alpha-20250322171044.tgz#909bd853463f9f94db29f4af36983f8098c57cf5" - integrity sha512-BkvTegk4hsULPXRf7qOJrcFRevg2fziE79DlmAUa2xOmn+9V9VVZO5PMBfpEp0wKvBNkXyCZ0C6A24U9z75TuA== +"@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== dependencies: - "@openid4vc/oauth2" "0.3.0-alpha-20250322171044" - "@openid4vc/utils" "0.3.0-alpha-20250322171044" - zod "^3.24.1" + "@openid4vc/oauth2" "0.4.1" + "@openid4vc/utils" "0.4.1" + zod "^4.1.13" -"@openid4vc/utils@0.3.0-alpha-20250322171044": - version "0.3.0-alpha-20250322171044" - resolved "https://registry.yarnpkg.com/@openid4vc/utils/-/utils-0.3.0-alpha-20250322171044.tgz#58fa8c83fcdd73fed063cc7b4ddd62a90d1b9a30" - integrity sha512-OBYnixgHR+NA5ssQBUnfyq/9Gq7xaICaJk3OmlAFMfxxhZmkCcSbeCkR2q9DSbmwCucmu6pEqHaSI8A7WGGP9Q== +"@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== dependencies: buffer "^6.0.3" - zod "^3.24.1" + zod "^4.1.13" "@opentelemetry/api-logs@0.202.0": version "0.202.0" @@ -1954,13 +1787,20 @@ resolved "https://registry.yarnpkg.com/@opentelemetry/context-async-hooks/-/context-async-hooks-2.0.1.tgz#4416bc2df780c1dda1129afb9392d55831dd861d" integrity sha512-XuY23lSI3d4PEqKA+7SLtAgwqIfc6E/E9eAQWLN1vlpC53ybO3o6jW4BsXo1xvz9lYyyWItfQDDLzezER01mCw== -"@opentelemetry/core@2.0.1", "@opentelemetry/core@^2.0.0": +"@opentelemetry/core@2.0.1": version "2.0.1" resolved "https://registry.yarnpkg.com/@opentelemetry/core/-/core-2.0.1.tgz#44e1149d5666a4743cde943ef89841db3ce0f8bc" integrity sha512-MaZk9SJIDgo1peKevlbhP6+IwIiNPNmswNL4AF0WaQJLbHXjr9SrZMgS12+iqr9ToV4ZVosCcc0f8Rg67LXjxw== dependencies: "@opentelemetry/semantic-conventions" "^1.29.0" +"@opentelemetry/core@2.2.0", "@opentelemetry/core@^2.0.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/core/-/core-2.2.0.tgz#2f857d7790ff160a97db3820889b5f4cade6eaee" + integrity sha512-FuabnnUm8LflnieVxs6eP7Z383hgQU4W1e3KJS6aOG3RxWxcHyBxH8fDMHNgu/gFx/M2jvTOW/4/PHhLz6bjWw== + dependencies: + "@opentelemetry/semantic-conventions" "^1.29.0" + "@opentelemetry/exporter-logs-otlp-grpc@0.202.0": version "0.202.0" resolved "https://registry.yarnpkg.com/@opentelemetry/exporter-logs-otlp-grpc/-/exporter-logs-otlp-grpc-0.202.0.tgz#f179be218f7acf8ae004c343c718af9958ef9a6a" @@ -2169,7 +2009,7 @@ dependencies: "@opentelemetry/core" "2.0.1" -"@opentelemetry/resources@2.0.1", "@opentelemetry/resources@^2.0.1": +"@opentelemetry/resources@2.0.1": version "2.0.1" resolved "https://registry.yarnpkg.com/@opentelemetry/resources/-/resources-2.0.1.tgz#0365d134291c0ed18d96444a1e21d0e6a481c840" integrity sha512-dZOB3R6zvBwDKnHDTB4X1xtMArB/d324VsbiPkX/Yu0Q8T2xceRthoIVFhJdvgVM2QhGVUyX9tzwiNxGtoBJUw== @@ -2177,6 +2017,14 @@ "@opentelemetry/core" "2.0.1" "@opentelemetry/semantic-conventions" "^1.29.0" +"@opentelemetry/resources@^2.0.1": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/resources/-/resources-2.2.0.tgz#b90a950ad98551295b76ea8a0e7efe45a179badf" + integrity sha512-1pNQf/JazQTMA0BiO5NINUzH0cbLbbl7mntLa4aJNmCCXSj0q03T5ZXXL0zw4G55TjdL9Tz32cznGClf+8zr5A== + dependencies: + "@opentelemetry/core" "2.2.0" + "@opentelemetry/semantic-conventions" "^1.29.0" + "@opentelemetry/sdk-logs@0.202.0", "@opentelemetry/sdk-logs@^0.202.0": version "0.202.0" resolved "https://registry.yarnpkg.com/@opentelemetry/sdk-logs/-/sdk-logs-0.202.0.tgz#7caab8f764d5c95e5809a42f5df3ff1ad5ebd862" @@ -2241,9 +2089,9 @@ "@opentelemetry/sdk-trace-base" "2.0.1" "@opentelemetry/semantic-conventions@^1.27.0", "@opentelemetry/semantic-conventions@^1.29.0", "@opentelemetry/semantic-conventions@^1.30.0", "@opentelemetry/semantic-conventions@^1.34.0": - version "1.36.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/semantic-conventions/-/semantic-conventions-1.36.0.tgz#149449bd4df4d0464220915ad4164121e0d75d4d" - integrity sha512-TtxJSRD8Ohxp6bKkhrm27JRHAxPczQA7idtcTOMYI+wQRRrfgqxHv1cFbCApcSnNjtXkmzFozn6jQtFrOmbjPQ== + version "1.38.0" + 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" @@ -2265,114 +2113,114 @@ tar "^7.4.3" "@paralleldrive/cuid2@^2.2.2": - version "2.2.2" - resolved "https://registry.yarnpkg.com/@paralleldrive/cuid2/-/cuid2-2.2.2.tgz#7f91364d53b89e2c9cb9e02e8dd0f129e834455f" - integrity sha512-ZOBkgDwEdoYVlSeRbYYXs0S9MejQofiVYoTbKzy/6GQa39/q5tQU2IX46+shYnUkpEl3wc+J6wRlar7r2EK2xA== + version "2.3.1" + resolved "https://registry.yarnpkg.com/@paralleldrive/cuid2/-/cuid2-2.3.1.tgz#3d62ea9e7be867d3fa94b9897fab5b0ae187d784" + integrity sha512-XO7cAxhnTZl0Yggq6jOgjiOHhbgcO4NqFqwSmQpjK3b6TEE6Uj/jfSk6wzYyemh3+I0sHirKSetjQwn5cZktFw== dependencies: "@noble/hashes" "^1.1.5" -"@peculiar/asn1-cms@^2.3.15", "@peculiar/asn1-cms@^2.4.0": - version "2.4.0" - resolved "https://registry.yarnpkg.com/@peculiar/asn1-cms/-/asn1-cms-2.4.0.tgz#327c459460d6fa6d3e582208784543a4b7aeaa73" - integrity sha512-TJvw5Tna/txvzzwnKUlCFd6zIz4R7qysHCaU6M2oe/MUT6EkvJDOzGGNY0hdjJYpuuHoqanQbIqEBhSLSWe1Tg== +"@peculiar/asn1-cms@^2.6.0": + version "2.6.0" + resolved "https://registry.yarnpkg.com/@peculiar/asn1-cms/-/asn1-cms-2.6.0.tgz#88267055c460ca806651f916315a934c1b1ac994" + integrity sha512-2uZqP+ggSncESeUF/9Su8rWqGclEfEiz1SyU02WX5fUONFfkjzS2Z/F1Li0ofSmf4JqYXIOdCAZqIXAIBAT1OA== dependencies: - "@peculiar/asn1-schema" "^2.4.0" - "@peculiar/asn1-x509" "^2.4.0" - "@peculiar/asn1-x509-attr" "^2.4.0" + "@peculiar/asn1-schema" "^2.6.0" + "@peculiar/asn1-x509" "^2.6.0" + "@peculiar/asn1-x509-attr" "^2.6.0" asn1js "^3.0.6" tslib "^2.8.1" -"@peculiar/asn1-csr@^2.3.15": - version "2.4.0" - resolved "https://registry.yarnpkg.com/@peculiar/asn1-csr/-/asn1-csr-2.4.0.tgz#2182dd35061b03930bdc10034b3d548c38cf1264" - integrity sha512-9yQz0hQ9ynGr/I1X1v64QQGfRMbviHXyqY07cy69UzXa8s4ayCKx/TncU6lDWcTKs7P/X/AEcuJcG7Xbw0cl1A== +"@peculiar/asn1-csr@^2.6.0": + version "2.6.0" + resolved "https://registry.yarnpkg.com/@peculiar/asn1-csr/-/asn1-csr-2.6.0.tgz#a7eff845b0020720070a12f38f26effb9fdab158" + integrity sha512-BeWIu5VpTIhfRysfEp73SGbwjjoLL/JWXhJ/9mo4vXnz3tRGm+NGm3KNcRzQ9VMVqwYS2RHlolz21svzRXIHPQ== dependencies: - "@peculiar/asn1-schema" "^2.4.0" - "@peculiar/asn1-x509" "^2.4.0" + "@peculiar/asn1-schema" "^2.6.0" + "@peculiar/asn1-x509" "^2.6.0" asn1js "^3.0.6" tslib "^2.8.1" -"@peculiar/asn1-ecc@^2.3.13", "@peculiar/asn1-ecc@^2.3.15": - version "2.4.0" - resolved "https://registry.yarnpkg.com/@peculiar/asn1-ecc/-/asn1-ecc-2.4.0.tgz#e21f87b12a0be3e57d6a914e576b6d10aa4a35d4" - integrity sha512-fJiYUBCJBDkjh347zZe5H81BdJ0+OGIg0X9z06v8xXUoql3MFeENUX0JsjCaVaU9A0L85PefLPGYkIoGpTnXLQ== +"@peculiar/asn1-ecc@^2.6.0": + version "2.6.0" + resolved "https://registry.yarnpkg.com/@peculiar/asn1-ecc/-/asn1-ecc-2.6.0.tgz#4846d39712a1a2b4786c2d6ea27b19a6dcc05ef5" + integrity sha512-FF3LMGq6SfAOwUG2sKpPXblibn6XnEIKa+SryvUl5Pik+WR9rmRA3OCiwz8R3lVXnYnyRkSZsSLdml8H3UiOcw== dependencies: - "@peculiar/asn1-schema" "^2.4.0" - "@peculiar/asn1-x509" "^2.4.0" + "@peculiar/asn1-schema" "^2.6.0" + "@peculiar/asn1-x509" "^2.6.0" asn1js "^3.0.6" tslib "^2.8.1" -"@peculiar/asn1-pfx@^2.4.0": - version "2.4.0" - resolved "https://registry.yarnpkg.com/@peculiar/asn1-pfx/-/asn1-pfx-2.4.0.tgz#654327b736ca24f585e5b687d8a3f661dc60d0b1" - integrity sha512-fhpeoJ6T4nCLWT5tt3Un+BbyM1lLFnGXcRC2Ioe5ra2I0yptdjw05j20rV8BlUVzPIvUYpatq6joMQKe3ibh0w== +"@peculiar/asn1-pfx@^2.6.0": + version "2.6.0" + resolved "https://registry.yarnpkg.com/@peculiar/asn1-pfx/-/asn1-pfx-2.6.0.tgz#4c8ed3050cdd5b3e63ec4192bf8f646d9e06e3f5" + integrity sha512-rtUvtf+tyKGgokHHmZzeUojRZJYPxoD/jaN1+VAB4kKR7tXrnDCA/RAWXAIhMJJC+7W27IIRGe9djvxKgsldCQ== dependencies: - "@peculiar/asn1-cms" "^2.4.0" - "@peculiar/asn1-pkcs8" "^2.4.0" - "@peculiar/asn1-rsa" "^2.4.0" - "@peculiar/asn1-schema" "^2.4.0" + "@peculiar/asn1-cms" "^2.6.0" + "@peculiar/asn1-pkcs8" "^2.6.0" + "@peculiar/asn1-rsa" "^2.6.0" + "@peculiar/asn1-schema" "^2.6.0" asn1js "^3.0.6" tslib "^2.8.1" -"@peculiar/asn1-pkcs8@^2.4.0": - version "2.4.0" - resolved "https://registry.yarnpkg.com/@peculiar/asn1-pkcs8/-/asn1-pkcs8-2.4.0.tgz#53c3c8dd2e99a2499f4a1e1639b8b4284f0b6a46" - integrity sha512-4r2LtsAM0HWXLxetGTYKyBumky7W6C1EuiOctqhl7zFK5MHjiZ+9WOeaoeTPR1g3OEoeG7KEWIkaUOyRH4ojTw== +"@peculiar/asn1-pkcs8@^2.6.0": + version "2.6.0" + resolved "https://registry.yarnpkg.com/@peculiar/asn1-pkcs8/-/asn1-pkcs8-2.6.0.tgz#c426caf81cb49935c553b591e0273b4b44d1696f" + integrity sha512-KyQ4D8G/NrS7Fw3XCJrngxmjwO/3htnA0lL9gDICvEQ+GJ+EPFqldcJQTwPIdvx98Tua+WjkdKHSC0/Km7T+lA== dependencies: - "@peculiar/asn1-schema" "^2.4.0" - "@peculiar/asn1-x509" "^2.4.0" + "@peculiar/asn1-schema" "^2.6.0" + "@peculiar/asn1-x509" "^2.6.0" asn1js "^3.0.6" tslib "^2.8.1" -"@peculiar/asn1-pkcs9@^2.3.15": - version "2.4.0" - resolved "https://registry.yarnpkg.com/@peculiar/asn1-pkcs9/-/asn1-pkcs9-2.4.0.tgz#6ceb3041358b31bd2b3f68545ec1aefa3ad1af43" - integrity sha512-D7paqEVpu9wuWuClMN+vR5cqJWJITNPaMoa9R+FmkJ8ywF9UaS2JFI0RYclKILNoLdLg1N4eUCoJvM+ubsIIZQ== - dependencies: - "@peculiar/asn1-cms" "^2.4.0" - "@peculiar/asn1-pfx" "^2.4.0" - "@peculiar/asn1-pkcs8" "^2.4.0" - "@peculiar/asn1-schema" "^2.4.0" - "@peculiar/asn1-x509" "^2.4.0" - "@peculiar/asn1-x509-attr" "^2.4.0" +"@peculiar/asn1-pkcs9@^2.6.0": + version "2.6.0" + resolved "https://registry.yarnpkg.com/@peculiar/asn1-pkcs9/-/asn1-pkcs9-2.6.0.tgz#96b57122228a0e2e30e81118cd3baa570c13a51d" + integrity sha512-b78OQ6OciW0aqZxdzliXGYHASeCvvw5caqidbpQRYW2mBtXIX2WhofNXTEe7NyxTb0P6J62kAAWLwn0HuMF1Fw== + dependencies: + "@peculiar/asn1-cms" "^2.6.0" + "@peculiar/asn1-pfx" "^2.6.0" + "@peculiar/asn1-pkcs8" "^2.6.0" + "@peculiar/asn1-schema" "^2.6.0" + "@peculiar/asn1-x509" "^2.6.0" + "@peculiar/asn1-x509-attr" "^2.6.0" asn1js "^3.0.6" tslib "^2.8.1" -"@peculiar/asn1-rsa@^2.3.15", "@peculiar/asn1-rsa@^2.4.0": - version "2.4.0" - resolved "https://registry.yarnpkg.com/@peculiar/asn1-rsa/-/asn1-rsa-2.4.0.tgz#da988b4b0a8d97f7f515f1a8f583accb43a475e7" - integrity sha512-6PP75voaEnOSlWR9sD25iCQyLgFZHXbmxvUfnnDcfL6Zh5h2iHW38+bve4LfH7a60x7fkhZZNmiYqAlAff9Img== +"@peculiar/asn1-rsa@^2.6.0": + version "2.6.0" + resolved "https://registry.yarnpkg.com/@peculiar/asn1-rsa/-/asn1-rsa-2.6.0.tgz#49d905ab67ae8aa54e996734f37a391bb7958747" + integrity sha512-Nu4C19tsrTsCp9fDrH+sdcOKoVfdfoQQ7S3VqjJU6vedR7tY3RLkQ5oguOIB3zFW33USDUuYZnPEQYySlgha4w== dependencies: - "@peculiar/asn1-schema" "^2.4.0" - "@peculiar/asn1-x509" "^2.4.0" + "@peculiar/asn1-schema" "^2.6.0" + "@peculiar/asn1-x509" "^2.6.0" asn1js "^3.0.6" tslib "^2.8.1" -"@peculiar/asn1-schema@^2.3.13", "@peculiar/asn1-schema@^2.3.15", "@peculiar/asn1-schema@^2.3.8", "@peculiar/asn1-schema@^2.4.0": - version "2.4.0" - resolved "https://registry.yarnpkg.com/@peculiar/asn1-schema/-/asn1-schema-2.4.0.tgz#e3aa7917d433b4c3fcfa1fcb57eac233b1c38787" - integrity sha512-umbembjIWOrPSOzEGG5vxFLkeM8kzIhLkgigtsOrfLKnuzxWxejAcUX+q/SoZCdemlODOcr5WiYa7+dIEzBXZQ== +"@peculiar/asn1-schema@^2.3.13", "@peculiar/asn1-schema@^2.6.0": + version "2.6.0" + resolved "https://registry.yarnpkg.com/@peculiar/asn1-schema/-/asn1-schema-2.6.0.tgz#0dca1601d5b0fed2a72fed7a5f1d0d7dbe3a6f82" + integrity sha512-xNLYLBFTBKkCzEZIw842BxytQQATQv+lDTCEMZ8C196iJcJJMBUZxrhSTxLaohMyKK8QlzRNTRkUmanucnDSqg== dependencies: asn1js "^3.0.6" pvtsutils "^1.3.6" tslib "^2.8.1" -"@peculiar/asn1-x509-attr@^2.4.0": - version "2.4.0" - resolved "https://registry.yarnpkg.com/@peculiar/asn1-x509-attr/-/asn1-x509-attr-2.4.0.tgz#f68346bf24ee2691682e5e58b5116e81cb91e280" - integrity sha512-Tr5Zi+wcE2sfR0gKRvsPwXoA1U8CuDnwiFbxCS+5Z1Nck9zlHj86+4/EZhwucjKXwPEHk1ekhqb3iwISY/+E/w== +"@peculiar/asn1-x509-attr@^2.6.0": + version "2.6.0" + resolved "https://registry.yarnpkg.com/@peculiar/asn1-x509-attr/-/asn1-x509-attr-2.6.0.tgz#057cb0c3c600a259c9f40582ee5fd7f0114c5be6" + integrity sha512-MuIAXFX3/dc8gmoZBkwJWxUWOSvG4MMDntXhrOZpJVMkYX+MYc/rUAU2uJOved9iJEoiUx7//3D8oG83a78UJA== dependencies: - "@peculiar/asn1-schema" "^2.4.0" - "@peculiar/asn1-x509" "^2.4.0" + "@peculiar/asn1-schema" "^2.6.0" + "@peculiar/asn1-x509" "^2.6.0" asn1js "^3.0.6" tslib "^2.8.1" -"@peculiar/asn1-x509@^2.3.13", "@peculiar/asn1-x509@^2.3.15", "@peculiar/asn1-x509@^2.4.0": - version "2.4.0" - resolved "https://registry.yarnpkg.com/@peculiar/asn1-x509/-/asn1-x509-2.4.0.tgz#ca8ec0d409678e1a47bc324c3dc739085186123f" - integrity sha512-F7mIZY2Eao2TaoVqigGMLv+NDdpwuBKU1fucHPONfzaBS4JXXCNCmfO0Z3dsy7JzKGqtDcYC1mr9JjaZQZNiuw== +"@peculiar/asn1-x509@^2.6.0": + version "2.6.0" + resolved "https://registry.yarnpkg.com/@peculiar/asn1-x509/-/asn1-x509-2.6.0.tgz#9aa0784b455ca34095fdc91a5cc52869e21528dd" + integrity sha512-uzYbPEpoQiBoTq0/+jZtpM6Gq6zADBx+JNFP3yqRgziWBxQ/Dt/HcuvRfm9zJTPdRcBqPNdaRHTVwpyiq6iNMA== dependencies: - "@peculiar/asn1-schema" "^2.4.0" + "@peculiar/asn1-schema" "^2.6.0" asn1js "^3.0.6" pvtsutils "^1.3.6" tslib "^2.8.1" @@ -2384,29 +2232,18 @@ dependencies: tslib "^2.0.0" -"@peculiar/webcrypto@^1.0.22": - version "1.5.0" - resolved "https://registry.yarnpkg.com/@peculiar/webcrypto/-/webcrypto-1.5.0.tgz#9e57174c02c1291051c553600347e12b81469e10" - integrity sha512-BRs5XUAwiyCDQMsVA9IDvDa7UBR9gAvPHgugOeGng3YN6vJ9JYonyDc0lNczErgtCWtucjR5N7VtaonboD/ezg== - dependencies: - "@peculiar/asn1-schema" "^2.3.8" - "@peculiar/json-schema" "^1.1.12" - pvtsutils "^1.3.5" - tslib "^2.6.2" - webcrypto-core "^1.8.0" - -"@peculiar/x509@^1.12.1": - version "1.13.0" - resolved "https://registry.yarnpkg.com/@peculiar/x509/-/x509-1.13.0.tgz#c404d075aac4dfa52320e0a1cb11268efacdb9dd" - integrity sha512-r9BOb1GZ3gx58Pog7u9x70spnHlCQPFm7u/ZNlFv+uBsU7kTDY9QkUD+l+X0awopDuCK1fkH3nEIZeMDSG/jlw== - dependencies: - "@peculiar/asn1-cms" "^2.3.15" - "@peculiar/asn1-csr" "^2.3.15" - "@peculiar/asn1-ecc" "^2.3.15" - "@peculiar/asn1-pkcs9" "^2.3.15" - "@peculiar/asn1-rsa" "^2.3.15" - "@peculiar/asn1-schema" "^2.3.15" - "@peculiar/asn1-x509" "^2.3.15" +"@peculiar/x509@^1.14.2": + version "1.14.2" + resolved "https://registry.yarnpkg.com/@peculiar/x509/-/x509-1.14.2.tgz#635078480a0e4796eab2fb765361dec142af0f3b" + integrity sha512-r2w1Hg6pODDs0zfAKHkSS5HLkOLSeburtcgwvlLLWWCixw+MmW3U6kD5ddyvc2Y2YdbGuVwCF2S2ASoU1cFAag== + dependencies: + "@peculiar/asn1-cms" "^2.6.0" + "@peculiar/asn1-csr" "^2.6.0" + "@peculiar/asn1-ecc" "^2.6.0" + "@peculiar/asn1-pkcs9" "^2.6.0" + "@peculiar/asn1-rsa" "^2.6.0" + "@peculiar/asn1-schema" "^2.6.0" + "@peculiar/asn1-x509" "^2.6.0" pvtsutils "^1.3.6" reflect-metadata "^0.2.2" tslib "^2.8.1" @@ -2485,15 +2322,23 @@ resolved "https://registry.yarnpkg.com/@scarf/scarf/-/scarf-1.4.0.tgz#3bbb984085dbd6d982494538b523be1ce6562972" integrity sha512-xxeapPiUXdZAE3che6f3xogoJPeZgig6omHEy1rIY5WVsB3H2BHNnZH+gHG6x91SCWyQCzWGsuL2Hh3ClO5/qQ== -"@sd-jwt/core@0.7.2", "@sd-jwt/core@^0.7.2": - version "0.7.2" - resolved "https://registry.yarnpkg.com/@sd-jwt/core/-/core-0.7.2.tgz#cfbcd853d507e2c31bf66ea5b2c1748291924ec3" - integrity sha512-vix1GplUFc1A9H42r/yXkg7cKYthggyqZEwlFdsBbn4xdZNE+AHVF4N7kPa1pPxipwN3UIHd4XnQ5MJV15mhsQ== +"@sd-jwt/core@0.17.0", "@sd-jwt/core@^0.17.0": + version "0.17.0" + resolved "https://registry.yarnpkg.com/@sd-jwt/core/-/core-0.17.0.tgz#dec5dacb4f2ec8baabb2651323b0ad265540a712" + integrity sha512-8NM2kZFjBxNT7JE+UukhcXDEiTq/6LSltVx2R2BlL2NlbYaT29Eln+vKyULNDI8FaRbh4lierLguPJGba4E5uA== dependencies: - "@sd-jwt/decode" "0.7.2" - "@sd-jwt/present" "0.7.2" - "@sd-jwt/types" "0.7.2" - "@sd-jwt/utils" "0.7.2" + "@sd-jwt/decode" "0.17.0" + "@sd-jwt/present" "0.17.0" + "@sd-jwt/types" "0.17.0" + "@sd-jwt/utils" "0.17.0" + +"@sd-jwt/decode@0.17.0", "@sd-jwt/decode@^0.17.0": + version "0.17.0" + resolved "https://registry.yarnpkg.com/@sd-jwt/decode/-/decode-0.17.0.tgz#769bb5f16834959865ec5be22941b02cc439d90d" + integrity sha512-1qBA0nfsYdAPb/s+n+uWfeaYRVaiDYBg/cL7iDpPcSS8Zq8rtHFwR86KhQfRk8WR5V4cKO7p+njK/8LweqlHxg== + dependencies: + "@sd-jwt/types" "0.17.0" + "@sd-jwt/utils" "0.17.0" "@sd-jwt/decode@0.7.2", "@sd-jwt/decode@^0.7.2": version "0.7.2" @@ -2511,16 +2356,25 @@ "@sd-jwt/types" "0.9.2" "@sd-jwt/utils" "0.9.2" -"@sd-jwt/jwt-status-list@0.7.2", "@sd-jwt/jwt-status-list@^0.7.2": - version "0.7.2" - resolved "https://registry.yarnpkg.com/@sd-jwt/jwt-status-list/-/jwt-status-list-0.7.2.tgz#13cd1b4abbcb08217a44efb59f0fd2a134fe398a" - integrity sha512-o/Mg/Zg21poFsPXuxtPD9sdXq2b/0L+rb9gxU2k1rp1aT+DWmqD0k8v0Ttr2tlMc8l1xXQNA8FLXbL1AdLRmbQ== +"@sd-jwt/jwt-status-list@0.17.1", "@sd-jwt/jwt-status-list@^0.17.1": + version "0.17.1" + resolved "https://registry.yarnpkg.com/@sd-jwt/jwt-status-list/-/jwt-status-list-0.17.1.tgz#8d108429e48c97378e4ff7cda4941954c69cbe97" + integrity sha512-5vcOQsEmWwCkh7uEU7iwSaZ9aDH7nSNLnt48dTc6X5UrF9qWNFkVf8r/juBfuzSy2JlxRZQitVYGhyactiXxHA== dependencies: - "@sd-jwt/types" "0.7.2" - base64url "^3.0.1" + "@sd-jwt/types" "0.17.0" + "@sd-jwt/utils" "0.17.0" pako "^2.1.0" -"@sd-jwt/present@0.7.2", "@sd-jwt/present@^0.7.2": +"@sd-jwt/present@0.17.0", "@sd-jwt/present@^0.17.0": + version "0.17.0" + resolved "https://registry.yarnpkg.com/@sd-jwt/present/-/present-0.17.0.tgz#23ba9ffbf064f4c25234bdf57fabfe0fe9754155" + integrity sha512-qh226z4H76uMVfFfqvltV9d0oz2N9S2REURy2HcVFKhsa1fSYZXdKkhg4S102iwp9fEELEPyCnLkW26+qwWLcg== + dependencies: + "@sd-jwt/decode" "0.17.0" + "@sd-jwt/types" "0.17.0" + "@sd-jwt/utils" "0.17.0" + +"@sd-jwt/present@^0.7.2": version "0.7.2" resolved "https://registry.yarnpkg.com/@sd-jwt/present/-/present-0.7.2.tgz#23e521cda6adf6ce9f73fcda64502ea7c45f61c3" integrity sha512-mQV85u2+mLLy2VZ9Wx2zpaB6yTDnbhCfWkP7eeCrzJQHBKAAHko8GrylEFmLKewFIcajS/r4lT/zHOsCkp5pZw== @@ -2529,14 +2383,19 @@ "@sd-jwt/types" "0.7.2" "@sd-jwt/utils" "0.7.2" -"@sd-jwt/sd-jwt-vc@^0.7.2": - version "0.7.2" - resolved "https://registry.yarnpkg.com/@sd-jwt/sd-jwt-vc/-/sd-jwt-vc-0.7.2.tgz#565a4fcebfe97915a995fd26b0e3cb1fdd56ff6a" - integrity sha512-rryYmnoJHRSNqHcrs0Atta+bfJzU2yT7mYumR2D4lTfxJKWZd0OHHFq57uZSEm/wXPI6uytUJXYbEboCqLUAtw== +"@sd-jwt/sd-jwt-vc@^0.17.1": + version "0.17.1" + resolved "https://registry.yarnpkg.com/@sd-jwt/sd-jwt-vc/-/sd-jwt-vc-0.17.1.tgz#e77422051342efdc628d440f375b6779951232fd" + integrity sha512-rkbkAfZSJM6gLyOn+eKqzFRrsztfpo+k8odKkXv+psmmZURnOleVvECJHdn2v3ggn6HSqa5uiiH7WkjNiHmGMA== dependencies: - "@sd-jwt/core" "0.7.2" - "@sd-jwt/jwt-status-list" "0.7.2" - "@sd-jwt/utils" "0.7.2" + "@sd-jwt/core" "0.17.0" + "@sd-jwt/jwt-status-list" "0.17.1" + "@sd-jwt/utils" "0.17.0" + +"@sd-jwt/types@0.17.0", "@sd-jwt/types@^0.17.0": + version "0.17.0" + resolved "https://registry.yarnpkg.com/@sd-jwt/types/-/types-0.17.0.tgz#3dde7136de12a56e6b3bbd234593b3cc8488f0a0" + integrity sha512-XMZprAzSst+ze6JXoMttV3zrUNTL9VFAzHWChENTlFuh9tM6gy+/hJjFyTO0RVO0SRRNl2c7eMeYu7byLMj6Jg== "@sd-jwt/types@0.7.2", "@sd-jwt/types@^0.7.2": version "0.7.2" @@ -2548,7 +2407,15 @@ resolved "https://registry.yarnpkg.com/@sd-jwt/types/-/types-0.9.2.tgz#17a9d62e36d9863b2c20a127be22a3e77005a6a8" integrity sha512-eV/MY80ekeTrqaohzPpkrgwPki6Igx69D6RniduV1Ehv6o/zaJQ2F0hY/RqBAkJhQtBQoOzouwKYHme40k1Dlw== -"@sd-jwt/utils@0.7.2", "@sd-jwt/utils@^0.7.2": +"@sd-jwt/utils@0.17.0", "@sd-jwt/utils@^0.17.0": + version "0.17.0" + resolved "https://registry.yarnpkg.com/@sd-jwt/utils/-/utils-0.17.0.tgz#9e3176c53389f26783a27910401c7926903da086" + integrity sha512-Xe6GgO3tzjQrKbwVgtrE4LkB8Prcl0zCX+LDFC0QCzsvrks1jEFSPpcpP5Ge/ESBK6LrNG/srBKOQlFM/RuGsg== + dependencies: + "@sd-jwt/types" "0.17.0" + js-base64 "^3.7.8" + +"@sd-jwt/utils@0.7.2": version "0.7.2" resolved "https://registry.yarnpkg.com/@sd-jwt/utils/-/utils-0.7.2.tgz#4309fa2f5ebe214947de4fb07a1e06a70c29710b" integrity sha512-aMPY7uHRMgyI5PlDvEiIc+eBFGC1EM8OCQRiEjJ8HGN0pajWMYj0qwSw7pS90A49/DsYU1a5Zpvb7nyjgGH0Yg== @@ -2605,11 +2472,6 @@ dependencies: "@sinonjs/commons" "^3.0.0" -"@sovpro/delimited-stream@^1.1.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@sovpro/delimited-stream/-/delimited-stream-1.1.0.tgz#4334bba7ee241036e580fdd99c019377630d26b4" - integrity sha512-kQpk267uxB19X3X2T1mvNMjyvIEonpNSHrMlK5ZaBU6aZxw7wPbpgKJOjHN3+/GPVpXgAV9soVT2oyHpLkLtyw== - "@sphereon/kmp-mdoc-core@0.2.0-SNAPSHOT.26": version "0.2.0-SNAPSHOT.26" resolved "https://registry.yarnpkg.com/@sphereon/kmp-mdoc-core/-/kmp-mdoc-core-0.2.0-SNAPSHOT.26.tgz#fb5372a6b76cccad1d641bbdca72fbeae268a7a2" @@ -2637,53 +2499,53 @@ jwt-decode "^4.0.0" uint8arrays "3.1.1" -"@stablelib/binary@^1.0.1": - version "1.0.1" - resolved "https://registry.yarnpkg.com/@stablelib/binary/-/binary-1.0.1.tgz#c5900b94368baf00f811da5bdb1610963dfddf7f" - integrity sha512-ClJWvmL6UBM/wjkvv/7m5VP3GMr9t0osr4yVgLZsLCOz4hGN9gIAFEqnJ0TsSMAN+n840nf2cHZnA5/KFqHC7Q== +"@stablelib/binary@^2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@stablelib/binary/-/binary-2.0.1.tgz#65c36a24e2c65f375e4c5c4cb340b9112d9badb6" + integrity sha512-U9iAO8lXgEDONsA0zPPSgcf3HUBNAqHiJmSHgZz62OvC3Hi2Bhc5kTnQ3S1/L+sthDTHtCMhcEiklmIly6uQ3w== dependencies: - "@stablelib/int" "^1.0.1" + "@stablelib/int" "^2.0.1" -"@stablelib/ed25519@^1.0.1", "@stablelib/ed25519@^1.0.2": - version "1.0.3" - resolved "https://registry.yarnpkg.com/@stablelib/ed25519/-/ed25519-1.0.3.tgz#f8fdeb6f77114897c887bb6a3138d659d3f35996" - integrity sha512-puIMWaX9QlRsbhxfDc5i+mNPMY+0TmQEskunY1rZEBPi1acBCVQAhnsk/1Hk50DGPtVsZtAWQg4NHGlVaO9Hqg== +"@stablelib/ed25519@^2.0.2": + version "2.0.2" + resolved "https://registry.yarnpkg.com/@stablelib/ed25519/-/ed25519-2.0.2.tgz#f6fed271a53fff607043f2a20ae67ec1dd39e275" + integrity sha512-d/lJ5sgzhtmpMIbKFWfev+i6WebBdIzzBpMzXtZdvUijoksjXosYFNqytoMj7cRshNj+/XTLYnnVMdZfd+penw== dependencies: - "@stablelib/random" "^1.0.2" - "@stablelib/sha512" "^1.0.1" - "@stablelib/wipe" "^1.0.1" + "@stablelib/random" "^2.0.1" + "@stablelib/sha512" "^2.0.1" + "@stablelib/wipe" "^2.0.1" -"@stablelib/hash@^1.0.1": - version "1.0.1" - resolved "https://registry.yarnpkg.com/@stablelib/hash/-/hash-1.0.1.tgz#3c944403ff2239fad8ebb9015e33e98444058bc5" - integrity sha512-eTPJc/stDkdtOcrNMZ6mcMK1e6yBbqRBaNW55XA1jU8w/7QdnCF0CmMmOD1m7VSkBR44PWrMHU2l6r8YEQHMgg== +"@stablelib/hash@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@stablelib/hash/-/hash-2.0.0.tgz#7b74c372dc07187e273844e970a475f1338e92cf" + integrity sha512-u3WPSqGido8lwJuMcrBgM5K54LrPGhkWAdtsyccf7dGsLixAZUds77zOAbu7bvKPwQlmoByH0txBi5rTmEKuHg== -"@stablelib/int@^1.0.1": - version "1.0.1" - resolved "https://registry.yarnpkg.com/@stablelib/int/-/int-1.0.1.tgz#75928cc25d59d73d75ae361f02128588c15fd008" - integrity sha512-byr69X/sDtDiIjIV6m4roLVWnNNlRGzsvxw+agj8CIEazqWGOQp2dTYgQhtyVXV9wpO6WyXRQUzLV/JRNumT2w== +"@stablelib/int@^2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@stablelib/int/-/int-2.0.1.tgz#daf262843b158e6bb99ec029a14378ecdda2230f" + integrity sha512-Ht63fQp3wz/F8U4AlXEPb7hfJOIILs8Lq55jgtD7KueWtyjhVuzcsGLSTAWtZs3XJDZYdF1WcSKn+kBtbzupww== -"@stablelib/random@^1.0.2": - version "1.0.2" - resolved "https://registry.yarnpkg.com/@stablelib/random/-/random-1.0.2.tgz#2dece393636489bf7e19c51229dd7900eddf742c" - integrity sha512-rIsE83Xpb7clHPVRlBj8qNe5L8ISQOzjghYQm/dZ7VaM2KHYwMW5adjQjrzTZCchFnNCNhkwtnOBa9HTMJCI8w== +"@stablelib/random@^2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@stablelib/random/-/random-2.0.1.tgz#b082eee976684a970d5f28ffbdea074a83ad2475" + integrity sha512-W6GAtXEEs7r+dSbuBsvoFmlyL3gLxle41tQkjKu17dDWtDdjhVUbtRfRCQcCUeczwkgjQxMPopgwYEvxXtHXGw== dependencies: - "@stablelib/binary" "^1.0.1" - "@stablelib/wipe" "^1.0.1" + "@stablelib/binary" "^2.0.1" + "@stablelib/wipe" "^2.0.1" -"@stablelib/sha512@^1.0.1": - version "1.0.1" - resolved "https://registry.yarnpkg.com/@stablelib/sha512/-/sha512-1.0.1.tgz#6da700c901c2c0ceacbd3ae122a38ac57c72145f" - integrity sha512-13gl/iawHV9zvDKciLo1fQ8Bgn2Pvf7OV6amaRVKiq3pjQ3UmEpXxWiAfV8tYjUpeZroBxtyrwtdooQT/i3hzw== +"@stablelib/sha512@^2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@stablelib/sha512/-/sha512-2.0.1.tgz#a9411c9db9a7a88ec42b91da9e604e8d7f7967eb" + integrity sha512-DUNe5cbnoH3sSIN+MG04RvTCLXtkbyy/SnQxiNO+GgF/KSXkkUSlF6mUVvCUdZBZ2X3NgogR+tAvaRSn8wxnLw== dependencies: - "@stablelib/binary" "^1.0.1" - "@stablelib/hash" "^1.0.1" - "@stablelib/wipe" "^1.0.1" + "@stablelib/binary" "^2.0.1" + "@stablelib/hash" "^2.0.0" + "@stablelib/wipe" "^2.0.1" -"@stablelib/wipe@^1.0.1": - version "1.0.1" - resolved "https://registry.yarnpkg.com/@stablelib/wipe/-/wipe-1.0.1.tgz#d21401f1d59ade56a62e139462a97f104ed19a36" - integrity sha512-WfqfX/eXGiAd3RJe4VU2snh/ZPwtSjLG4ynQ/vYzvghTh7dHFcI1wl+nrkWG6lGhukOxOsUHfv8dUXr58D0ayg== +"@stablelib/wipe@^2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@stablelib/wipe/-/wipe-2.0.1.tgz#9bc1d20519aa4fc513fe1992cf8061bab33c3049" + integrity sha512-1eU2K9EgOcV4qc9jcP6G72xxZxEm5PfeI5H55l08W95b4oRJaqhmlWRc4xZAm6IVSKhVNxMi66V67hCzzuMTAg== "@szmarczak/http-timer@^4.0.5": version "4.0.6" @@ -2693,9 +2555,9 @@ defer-to-connect "^2.0.0" "@tsconfig/node10@^1.0.7": - version "1.0.11" - resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.11.tgz#6ee46400685f130e278128c7b38b7e031ff5b2f2" - integrity sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw== + version "1.0.12" + resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.12.tgz#be57ceac1e4692b41be9de6be8c32a106636dba4" + integrity sha512-UCYBaeFvM11aU2y3YPZ//O5Rhj+xKyzy7mvcIoAjASbigy8mHMryP5cK7dgjlz2hWxh1g5pLw084E0a/wlUSFQ== "@tsconfig/node12@^1.0.7": version "1.0.11" @@ -2744,9 +2606,9 @@ validator "^13.12.0" "@tybys/wasm-util@^0.10.0": - version "0.10.0" - resolved "https://registry.yarnpkg.com/@tybys/wasm-util/-/wasm-util-0.10.0.tgz#2fd3cd754b94b378734ce17058d0507c45c88369" - integrity sha512-VyyPYFlOMNylG45GoAe0xDoLwWuowvf92F9kySqzYh8vmYm7D2u4iUJKa1tOUpS70Ku13ASrOkS4ScXFsTaCNQ== + version "0.10.1" + resolved "https://registry.yarnpkg.com/@tybys/wasm-util/-/wasm-util-0.10.1.tgz#ecddd3205cf1e2d5274649ff0eedd2991ed7f414" + integrity sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg== dependencies: tslib "^2.4.0" @@ -2826,9 +2688,9 @@ integrity sha512-he+DHOWReW0nghN24E1WUqM0efK4kI9oTqDm6XmK8ZPe2djZ90BSNdGnIyCLzCPw7/pogPlGbzI2wHGGmi4O/Q== "@types/cookies@*": - version "0.9.1" - resolved "https://registry.yarnpkg.com/@types/cookies/-/cookies-0.9.1.tgz#083924ca1266e34ff240ca4d4fd6732ee5b81886" - integrity sha512-E/DPgzifH4sM1UMadJMWd6mO2jOd4g1Ejwzx8/uRCDpJis1IrlyQEcGAYEomtAqRYmD5ORbNXMeI9U0RiVGZbg== + version "0.9.2" + resolved "https://registry.yarnpkg.com/@types/cookies/-/cookies-0.9.2.tgz#ccdf86d782f2dea34531dd32733a25be48177cd4" + integrity sha512-1AvkDdZM2dbyFybL4fxpuNCaWyv//0AwsuUk2DWeXyM1/5ZKm6W3z6mQi24RZ4l2ucY+bkSHzbDVpySqPGuV8A== dependencies: "@types/connect" "*" "@types/express" "*" @@ -2855,44 +2717,24 @@ resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.8.tgz#958b91c991b1867ced318bedea0e215ee050726e" integrity sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w== -"@types/express-serve-static-core@^4.17.33": - version "4.19.6" - resolved "https://registry.yarnpkg.com/@types/express-serve-static-core/-/express-serve-static-core-4.19.6.tgz#e01324c2a024ff367d92c66f48553ced0ab50267" - integrity sha512-N4LZ2xG7DatVqhCZzOGb1Yi5lMbXSZcmdLDe9EzSndPV2HpWYWzRbaerl2n27irrm94EPpprqa8KpskPT085+A== - dependencies: - "@types/node" "*" - "@types/qs" "*" - "@types/range-parser" "*" - "@types/send" "*" - "@types/express-serve-static-core@^5.0.0", "@types/express-serve-static-core@^5.0.6": - version "5.0.7" - resolved "https://registry.yarnpkg.com/@types/express-serve-static-core/-/express-serve-static-core-5.0.7.tgz#2fa94879c9d46b11a5df4c74ac75befd6b283de6" - integrity sha512-R+33OsgWw7rOhD1emjU7dzCDHucJrgJXMA5PYCzJxVil0dsyx5iBEPHqpPfiKNJQb7lZ1vxwoLR4Z87bBUpeGQ== + version "5.1.0" + resolved "https://registry.yarnpkg.com/@types/express-serve-static-core/-/express-serve-static-core-5.1.0.tgz#74f47555b3d804b54cb7030e6f9aa0c7485cfc5b" + integrity sha512-jnHMsrd0Mwa9Cf4IdOzbz543y4XJepXrbia2T4b6+spXC2We3t1y6K44D3mR8XMFSXMCf3/l7rCgddfx7UNVBA== dependencies: "@types/node" "*" "@types/qs" "*" "@types/range-parser" "*" "@types/send" "*" -"@types/express@*", "@types/express@^5.0.2": - version "5.0.3" - resolved "https://registry.yarnpkg.com/@types/express/-/express-5.0.3.tgz#6c4bc6acddc2e2a587142e1d8be0bce20757e956" - integrity sha512-wGA0NX93b19/dZC1J18tKWVIYWyyF2ZjT9vin/NRu0qzzvfVzWjs04iq2rQ3H65vCTQYlRqs3YHfY7zjdV+9Kw== +"@types/express@*", "@types/express@^5.0.2", "@types/express@^5.0.6": + version "5.0.6" + resolved "https://registry.yarnpkg.com/@types/express/-/express-5.0.6.tgz#2d724b2c990dcb8c8444063f3580a903f6d500cc" + integrity sha512-sKYVuV7Sv9fbPIt/442koC7+IIwK5olP1KWeD88e/idgoJqDm3JV/YUiPwkoKK92ylff2MGxSz1CSjsXelx0YA== dependencies: "@types/body-parser" "*" "@types/express-serve-static-core" "^5.0.0" - "@types/serve-static" "*" - -"@types/express@^4.17.23": - version "4.17.23" - resolved "https://registry.yarnpkg.com/@types/express/-/express-4.17.23.tgz#35af3193c640bfd4d7fe77191cd0ed411a433bef" - integrity sha512-Crp6WY9aTYP3qPi2wGDo9iUe/rceX01UMhnF1jmwDcKCFM6cx7YhGP/Mpr3y9AASpfHixIG0E6azCcL5OcDHsQ== - dependencies: - "@types/body-parser" "*" - "@types/express-serve-static-core" "^4.17.33" - "@types/qs" "*" - "@types/serve-static" "*" + "@types/serve-static" "^2" "@types/graceful-fs@^4.1.3": version "4.1.9" @@ -2974,16 +2816,16 @@ "@types/node" "*" "@types/koa-compose@*": - version "3.2.8" - resolved "https://registry.yarnpkg.com/@types/koa-compose/-/koa-compose-3.2.8.tgz#dec48de1f6b3d87f87320097686a915f1e954b57" - integrity sha512-4Olc63RY+MKvxMwVknCUDhRQX1pFQoBZ/lXcRLP69PQkEpze/0cr8LNqJQe5NFb/b19DWi2a5bTi2VAlQzhJuA== + version "3.2.9" + resolved "https://registry.yarnpkg.com/@types/koa-compose/-/koa-compose-3.2.9.tgz#6efb945ee5573be0f4eddb728a2f6826f7a3f395" + integrity sha512-BroAZ9FTvPiCy0Pi8tjD1OfJ7bgU1gQf0eR6e1Vm+JJATy9eKOG3hQMFtMciMawiSOVnLMdmUOC46s7HBhSTsA== dependencies: "@types/koa" "*" "@types/koa@*": - version "3.0.0" - resolved "https://registry.yarnpkg.com/@types/koa/-/koa-3.0.0.tgz#5df2b3b30da902f01b6ec78ef56403e6eb62fa6e" - integrity sha512-MOcVYdVYmkSutVHZZPh8j3+dAjLyR5Tl59CN0eKgpkE1h/LBSmPAsQQuWs+bKu7WtGNn+hKfJH9Gzml+PulmDg== + version "3.0.1" + resolved "https://registry.yarnpkg.com/@types/koa/-/koa-3.0.1.tgz#2c9ace20ecb33d0cf84d63492af231185eb2aefa" + integrity sha512-VkB6WJUQSe0zBpR+Q7/YIUESGp5wPHcaXr0xueU5W0EOUWtlSbblsl+Kl31lyRQ63nIILh0e/7gXjQ09JXJIHw== dependencies: "@types/accepts" "*" "@types/content-disposition" "*" @@ -3013,11 +2855,6 @@ resolved "https://registry.yarnpkg.com/@types/methods/-/methods-1.1.4.tgz#d3b7ac30ac47c91054ea951ce9eed07b1051e547" integrity sha512-ymXWVrDiCxTBE3+RIrrP533E70eA+9qu7zdWoHuOmGujkYtzf4HQF96b8nwHLqhuf4ykX61IGRIB38CC6/sImQ== -"@types/mime@^1": - version "1.3.5" - resolved "https://registry.yarnpkg.com/@types/mime/-/mime-1.3.5.tgz#1ef302e01cf7d2b5a0fa526790c9123bf1d06690" - integrity sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w== - "@types/ms@*": version "2.1.0" resolved "https://registry.yarnpkg.com/@types/ms/-/ms-2.1.0.tgz#052aa67a48eccc4309d7f0191b7e41434b90bb78" @@ -3039,11 +2876,11 @@ form-data "^4.0.4" "@types/node@*", "@types/node@>=13.7.0": - version "24.3.0" - resolved "https://registry.yarnpkg.com/@types/node/-/node-24.3.0.tgz#89b09f45cb9a8ee69466f18ee5864e4c3eb84dec" - integrity sha512-aPTXCrfwnDLj4VvXrm+UUCQjNEvJgNA8s5F1cvwQU+3KNltTOkBm1j30uNLyqqPNe7gE3KFzImYoZEfLhp4Yow== + version "24.10.1" + resolved "https://registry.yarnpkg.com/@types/node/-/node-24.10.1.tgz#91e92182c93db8bd6224fca031e2370cef9a8f01" + integrity sha512-GNWcUTRBgIRJD5zj+Tq0fKOJ5XZajIiBroOF0yvj2bSU1WvNdYS/dn9UxwsujGW4JX06dnHyjV2y9rRaybH0iQ== dependencies: - undici-types "~7.10.0" + undici-types "~7.16.0" "@types/node@22.7.5": version "22.7.5" @@ -3053,9 +2890,9 @@ undici-types "~6.19.2" "@types/node@^20.17.0": - version "20.19.11" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.19.11.tgz#728cab53092bd5f143beed7fbba7ba99de3c16c4" - integrity sha512-uug3FEEGv0r+jrecvUUpbY8lLisvIjg6AAic6a2bSP5OEOLeJsDSnvhCDov7ipFFMXS3orMpzlmi0ZcuGkBbow== + version "20.19.25" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.19.25.tgz#467da94a2fd966b57cc39c357247d68047611190" + integrity sha512-ZsJzA5thDQMSQO788d7IocwwQbI8B5OPzmqNvpf3NY/+MHDAS759Wo0gd2WQeXYt5AAAQjzcrTVC6SKCuYgoCQ== dependencies: undici-types "~6.21.0" @@ -3103,21 +2940,19 @@ "@types/node" "*" "@types/send@*": - version "0.17.5" - resolved "https://registry.yarnpkg.com/@types/send/-/send-0.17.5.tgz#d991d4f2b16f2b1ef497131f00a9114290791e74" - integrity sha512-z6F2D3cOStZvuk2SaP6YrwkNO65iTZcwA2ZkSABegdkAh/lf+Aa/YQndZVfmEXT5vgAp6zv06VQ3ejSVjAny4w== + version "1.2.1" + resolved "https://registry.yarnpkg.com/@types/send/-/send-1.2.1.tgz#6a784e45543c18c774c049bff6d3dbaf045c9c74" + integrity sha512-arsCikDvlU99zl1g69TcAB3mzZPpxgw0UQnaHeC1Nwb015xp8bknZv5rIfri9xTOcMuaVgvabfIRA7PSZVuZIQ== dependencies: - "@types/mime" "^1" "@types/node" "*" -"@types/serve-static@*": - version "1.15.8" - resolved "https://registry.yarnpkg.com/@types/serve-static/-/serve-static-1.15.8.tgz#8180c3fbe4a70e8f00b9f70b9ba7f08f35987877" - integrity sha512-roei0UY3LhpOJvjbIP6ZZFngyLKl5dskOtDhxY5THRSpO+ZI+nzJ+m5yUMzGrp89YRa7lvknKkMYjqQFGwA7Sg== +"@types/serve-static@*", "@types/serve-static@^2": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@types/serve-static/-/serve-static-2.2.0.tgz#d4a447503ead0d1671132d1ab6bd58b805d8de6a" + integrity sha512-8mam4H1NHLtu7nmtalF7eyBH14QyOASmcxHhSfEoRyr0nP/YdoesEtU+uSRvMe96TW/HPTtkoKqQLl53N7UXMQ== dependencies: "@types/http-errors" "*" "@types/node" "*" - "@types/send" "*" "@types/stack-utils@^2.0.0": version "2.0.3" @@ -3165,12 +3000,12 @@ resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-10.0.0.tgz#e9c07fe50da0f53dc24970cca94d619ff03f6f6d" integrity sha512-7gqG38EyHgyP1S+7+xomFtL+ZNHcKv6DwNaCZmJmo1vgMugyF3TCnXVg4t1uk89mLNwnLtnY3TpOpCOyp1/xHQ== -"@types/validator@^13.11.8": - version "13.15.2" - resolved "https://registry.yarnpkg.com/@types/validator/-/validator-13.15.2.tgz#ee533a20ab977df36917a454754c7e0df4aa6f8f" - integrity sha512-y7pa/oEJJ4iGYBxOpfAKn5b9+xuihvzDVnC/OSvlVnGxVg0pOqmjiMafiJ1KVNQEaPZf9HsEp5icEwGg8uIe5Q== +"@types/validator@^13.11.8", "@types/validator@^13.15.3": + version "13.15.10" + resolved "https://registry.yarnpkg.com/@types/validator/-/validator-13.15.10.tgz#742b77ec34d58554b94a76a14cef30d59e3c16b9" + integrity sha512-T8L6i7wCuyoK8A/ZeLYt1+q0ty3Zb9+qbSSvrIVitzT3YjZqkTZ40IbRsPanlB4h1QB3JVL1SYCdR6ngtFYcuA== -"@types/ws@^8.18.1", "@types/ws@^8.5.4": +"@types/ws@^8.18.1": version "8.18.1" resolved "https://registry.yarnpkg.com/@types/ws/-/ws-8.18.1.tgz#48464e4bf2ddfd17db13d845467f6070ffea4aa9" integrity sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg== @@ -3183,9 +3018,9 @@ integrity sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ== "@types/yargs@^17.0.33", "@types/yargs@^17.0.8": - version "17.0.33" - resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-17.0.33.tgz#8c32303da83eec050a84b3c7ae7b9f922d13e32d" - integrity sha512-WpxBCKWPLr4xSsHgz511rFJAM+wS28w2zEO1QDNY5zM/S8ok70NNfztH0xwhqKyaK0OHCbN98LDAZuy1ctxDkA== + version "17.0.35" + resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-17.0.35.tgz#07013e46aa4d7d7d50a49e15604c1c5340d4eb24" + integrity sha512-qUHkeCyQFxMXg79wQfTtfndEC+N9ZZg76HJftDJp+qH2tV7Gj4OJi7l+PiWwJ+pWtW8GwSmqsDj/oymhrTWXjg== dependencies: "@types/yargs-parser" "*" @@ -3197,118 +3032,102 @@ "@types/node" "*" "@typescript-eslint/eslint-plugin@^8.32.1": - version "8.40.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.40.0.tgz#19f959f273b32f5082c891903645e6a85328db4e" - integrity sha512-w/EboPlBwnmOBtRbiOvzjD+wdiZdgFeo17lkltrtn7X37vagKKWJABvyfsJXTlHe6XBzugmYgd4A4nW+k8Mixw== + version "8.48.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.48.1.tgz#c772d1dbdd97cfddf85f5a161a97783233643631" + integrity sha512-X63hI1bxl5ohelzr0LY5coufyl0LJNthld+abwxpCoo6Gq+hSqhKwci7MUWkXo67mzgUK6YFByhmaHmUcuBJmA== dependencies: "@eslint-community/regexpp" "^4.10.0" - "@typescript-eslint/scope-manager" "8.40.0" - "@typescript-eslint/type-utils" "8.40.0" - "@typescript-eslint/utils" "8.40.0" - "@typescript-eslint/visitor-keys" "8.40.0" + "@typescript-eslint/scope-manager" "8.48.1" + "@typescript-eslint/type-utils" "8.48.1" + "@typescript-eslint/utils" "8.48.1" + "@typescript-eslint/visitor-keys" "8.48.1" graphemer "^1.4.0" ignore "^7.0.0" natural-compare "^1.4.0" ts-api-utils "^2.1.0" "@typescript-eslint/parser@^8.26.0": - version "8.40.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-8.40.0.tgz#1bc9f3701ced29540eb76ff2d95ce0d52ddc7e69" - integrity sha512-jCNyAuXx8dr5KJMkecGmZ8KI61KBUhkCob+SD+C+I5+Y1FWI2Y3QmY4/cxMCC5WAsZqoEtEETVhUiUMIGCf6Bw== - dependencies: - "@typescript-eslint/scope-manager" "8.40.0" - "@typescript-eslint/types" "8.40.0" - "@typescript-eslint/typescript-estree" "8.40.0" - "@typescript-eslint/visitor-keys" "8.40.0" + version "8.48.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-8.48.1.tgz#4e3c66d9ec20683ec142417fafeadab61c479c3f" + integrity sha512-PC0PDZfJg8sP7cmKe6L3QIL8GZwU5aRvUFedqSIpw3B+QjRSUZeeITC2M5XKeMXEzL6wccN196iy3JLwKNvDVA== + dependencies: + "@typescript-eslint/scope-manager" "8.48.1" + "@typescript-eslint/types" "8.48.1" + "@typescript-eslint/typescript-estree" "8.48.1" + "@typescript-eslint/visitor-keys" "8.48.1" debug "^4.3.4" -"@typescript-eslint/project-service@8.40.0": - version "8.40.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/project-service/-/project-service-8.40.0.tgz#1b7ba6079ff580c3215882fe75a43e5d3ed166b9" - integrity sha512-/A89vz7Wf5DEXsGVvcGdYKbVM9F7DyFXj52lNYUDS1L9yJfqjW/fIp5PgMuEJL/KeqVTe2QSbXAGUZljDUpArw== +"@typescript-eslint/project-service@8.48.1": + version "8.48.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/project-service/-/project-service-8.48.1.tgz#cfe1741613b9112d85ae766de9e09b27a7d3f2f1" + integrity sha512-HQWSicah4s9z2/HifRPQ6b6R7G+SBx64JlFQpgSSHWPKdvCZX57XCbszg/bapbRsOEv42q5tayTYcEFpACcX1w== dependencies: - "@typescript-eslint/tsconfig-utils" "^8.40.0" - "@typescript-eslint/types" "^8.40.0" + "@typescript-eslint/tsconfig-utils" "^8.48.1" + "@typescript-eslint/types" "^8.48.1" debug "^4.3.4" -"@typescript-eslint/scope-manager@8.40.0": - version "8.40.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-8.40.0.tgz#2fbfcc8643340d8cd692267e61548b946190be8a" - integrity sha512-y9ObStCcdCiZKzwqsE8CcpyuVMwRouJbbSrNuThDpv16dFAj429IkM6LNb1dZ2m7hK5fHyzNcErZf7CEeKXR4w== +"@typescript-eslint/scope-manager@8.48.1": + version "8.48.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-8.48.1.tgz#8bc70643e7cca57864b1ff95dd350fc27756bec0" + integrity sha512-rj4vWQsytQbLxC5Bf4XwZ0/CKd362DkWMUkviT7DCS057SK64D5lH74sSGzhI6PDD2HCEq02xAP9cX68dYyg1w== dependencies: - "@typescript-eslint/types" "8.40.0" - "@typescript-eslint/visitor-keys" "8.40.0" + "@typescript-eslint/types" "8.48.1" + "@typescript-eslint/visitor-keys" "8.48.1" -"@typescript-eslint/tsconfig-utils@8.40.0", "@typescript-eslint/tsconfig-utils@^8.40.0": - version "8.40.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.40.0.tgz#8e8fdb9b988854aedd04abdde3239c4bdd2d26e4" - integrity sha512-jtMytmUaG9d/9kqSl/W3E3xaWESo4hFDxAIHGVW/WKKtQhesnRIJSAJO6XckluuJ6KDB5woD1EiqknriCtAmcw== +"@typescript-eslint/tsconfig-utils@8.48.1", "@typescript-eslint/tsconfig-utils@^8.48.1": + version "8.48.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.48.1.tgz#68139ce2d258f984e2b33a95389158f1212af646" + integrity sha512-k0Jhs4CpEffIBm6wPaCXBAD7jxBtrHjrSgtfCjUvPp9AZ78lXKdTR8fxyZO5y4vWNlOvYXRtngSZNSn+H53Jkw== -"@typescript-eslint/type-utils@8.40.0": - version "8.40.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-8.40.0.tgz#a7e4a1f0815dd0ba3e4eef945cc87193ca32c422" - integrity sha512-eE60cK4KzAc6ZrzlJnflXdrMqOBaugeukWICO2rB0KNvwdIMaEaYiywwHMzA1qFpTxrLhN9Lp4E/00EgWcD3Ow== +"@typescript-eslint/type-utils@8.48.1": + version "8.48.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-8.48.1.tgz#955bd3ddd648450f0a627925ff12ade63fb7516d" + integrity sha512-1jEop81a3LrJQLTf/1VfPQdhIY4PlGDBc/i67EVWObrtvcziysbLN3oReexHOM6N3jyXgCrkBsZpqwH0hiDOQg== dependencies: - "@typescript-eslint/types" "8.40.0" - "@typescript-eslint/typescript-estree" "8.40.0" - "@typescript-eslint/utils" "8.40.0" + "@typescript-eslint/types" "8.48.1" + "@typescript-eslint/typescript-estree" "8.48.1" + "@typescript-eslint/utils" "8.48.1" debug "^4.3.4" ts-api-utils "^2.1.0" -"@typescript-eslint/types@8.40.0", "@typescript-eslint/types@^8.40.0": - version "8.40.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-8.40.0.tgz#0b580fdf643737aa5c01285314b5c6e9543846a9" - integrity sha512-ETdbFlgbAmXHyFPwqUIYrfc12ArvpBhEVgGAxVYSwli26dn8Ko+lIo4Su9vI9ykTZdJn+vJprs/0eZU0YMAEQg== +"@typescript-eslint/types@8.48.1", "@typescript-eslint/types@^8.48.1": + version "8.48.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-8.48.1.tgz#a9ff808f5f798f28767d5c0b015a88fa7ce46bd7" + integrity sha512-+fZ3LZNeiELGmimrujsDCT4CRIbq5oXdHe7chLiW8qzqyPMnn1puNstCrMNVAqwcl2FdIxkuJ4tOs/RFDBVc/Q== -"@typescript-eslint/typescript-estree@8.40.0": - version "8.40.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-8.40.0.tgz#295149440ce7da81c790a4e14e327599a3a1e5c9" - integrity sha512-k1z9+GJReVVOkc1WfVKs1vBrR5MIKKbdAjDTPvIK3L8De6KbFfPFt6BKpdkdk7rZS2GtC/m6yI5MYX+UsuvVYQ== +"@typescript-eslint/typescript-estree@8.48.1": + version "8.48.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-8.48.1.tgz#0d0e31fc47c5796c6463ab50cde19e1718d465b1" + integrity sha512-/9wQ4PqaefTK6POVTjJaYS0bynCgzh6ClJHGSBj06XEHjkfylzB+A3qvyaXnErEZSaxhIo4YdyBgq6j4RysxDg== dependencies: - "@typescript-eslint/project-service" "8.40.0" - "@typescript-eslint/tsconfig-utils" "8.40.0" - "@typescript-eslint/types" "8.40.0" - "@typescript-eslint/visitor-keys" "8.40.0" + "@typescript-eslint/project-service" "8.48.1" + "@typescript-eslint/tsconfig-utils" "8.48.1" + "@typescript-eslint/types" "8.48.1" + "@typescript-eslint/visitor-keys" "8.48.1" debug "^4.3.4" - fast-glob "^3.3.2" - is-glob "^4.0.3" minimatch "^9.0.4" semver "^7.6.0" + tinyglobby "^0.2.15" ts-api-utils "^2.1.0" -"@typescript-eslint/utils@8.40.0": - version "8.40.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-8.40.0.tgz#8d0c6430ed2f5dc350784bb0d8be514da1e54054" - integrity sha512-Cgzi2MXSZyAUOY+BFwGs17s7ad/7L+gKt6Y8rAVVWS+7o6wrjeFN4nVfTpbE25MNcxyJ+iYUXflbs2xR9h4UBg== +"@typescript-eslint/utils@8.48.1": + version "8.48.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-8.48.1.tgz#6cf7b99e0943b33a983ef687b9a86b65578b5c32" + integrity sha512-fAnhLrDjiVfey5wwFRwrweyRlCmdz5ZxXz2G/4cLn0YDLjTapmN4gcCsTBR1N2rWnZSDeWpYtgLDsJt+FpmcwA== dependencies: "@eslint-community/eslint-utils" "^4.7.0" - "@typescript-eslint/scope-manager" "8.40.0" - "@typescript-eslint/types" "8.40.0" - "@typescript-eslint/typescript-estree" "8.40.0" + "@typescript-eslint/scope-manager" "8.48.1" + "@typescript-eslint/types" "8.48.1" + "@typescript-eslint/typescript-estree" "8.48.1" -"@typescript-eslint/visitor-keys@8.40.0": - version "8.40.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-8.40.0.tgz#c1b45196981311fed7256863be4bfb2d3eda332a" - integrity sha512-8CZ47QwalyRjsypfwnbI3hKy5gJDPmrkLjkgMxhi0+DZZ2QNx2naS6/hWoVYUHU7LU2zleF68V9miaVZvhFfTA== +"@typescript-eslint/visitor-keys@8.48.1": + version "8.48.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-8.48.1.tgz#247d4fe6dcc044f45b7f1c15110bf95e5d73b334" + integrity sha512-BmxxndzEWhE4TIEEMBs8lP3MBWN3jFPs/p6gPm/wkv02o41hI6cq9AuSmGAaTTHPtA1FTi2jBre4A9rm5ZmX+Q== dependencies: - "@typescript-eslint/types" "8.40.0" + "@typescript-eslint/types" "8.48.1" eslint-visitor-keys "^4.2.1" -"@unimodules/core@*": - version "7.1.2" - resolved "https://registry.yarnpkg.com/@unimodules/core/-/core-7.1.2.tgz#5181b99586476a5d87afd0958f26a04714c47fa1" - integrity sha512-lY+e2TAFuebD3vshHMIRqru3X4+k7Xkba4Wa7QsDBd+ex4c4N2dHAO61E2SrGD9+TRBD8w/o7mzK6ljbqRnbyg== - dependencies: - compare-versions "^3.4.0" - -"@unimodules/react-native-adapter@*": - version "6.3.9" - resolved "https://registry.yarnpkg.com/@unimodules/react-native-adapter/-/react-native-adapter-6.3.9.tgz#2f4bef6b7532dce5bf9f236e69f96403d0243c30" - integrity sha512-i9/9Si4AQ8awls+YGAKkByFbeAsOPgUNeLoYeh2SQ3ddjxJ5ZJDtq/I74clDnpDcn8zS9pYlcDJ9fgVJa39Glw== - dependencies: - expo-modules-autolinking "^0.0.3" - invariant "^2.2.4" - "@unrs/resolver-binding-android-arm-eabi@1.11.1": version "1.11.1" resolved "https://registry.yarnpkg.com/@unrs/resolver-binding-android-arm-eabi/-/resolver-binding-android-arm-eabi-1.11.1.tgz#9f5b04503088e6a354295e8ea8fe3cb99e43af81" @@ -3416,13 +3235,6 @@ abbrev@1: resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== -abort-controller@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/abort-controller/-/abort-controller-3.0.0.tgz#eaf54d53b62bae4138e809ca225c8439a6efb392" - integrity sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg== - dependencies: - event-target-shim "^5.0.0" - accepts@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/accepts/-/accepts-2.0.0.tgz#bbcf4ba5075467f3f2131eab3cffc73c2f5d7895" @@ -3518,9 +3330,9 @@ ansi-regex@^5.0.1: integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== ansi-regex@^6.0.1: - version "6.2.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-6.2.0.tgz#2f302e7550431b1b7762705fffb52cf1ffa20447" - integrity sha512-TKY5pyBkHyADOPYlRT9Lx6F544mPl0vS5Ew7BJ45hA08Q+t3GjbueLliBWN3sMICk6+y7HdyxSzC4bWS8baBdg== + version "6.2.2" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-6.2.2.tgz#60216eea464d864597ce2832000738a0589650c1" + integrity sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg== ansi-styles@^4.0.0, ansi-styles@^4.1.0: version "4.3.0" @@ -3535,9 +3347,9 @@ ansi-styles@^5.0.0: integrity sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA== ansi-styles@^6.1.0: - version "6.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-6.2.1.tgz#0e62320cf99c21afff3b3012192546aacbfb05c5" - integrity sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug== + version "6.2.3" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-6.2.3.tgz#c044d5dcc521a076413472597a1acb1f103c4041" + integrity sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg== anymatch@^3.0.3, anymatch@~3.1.2: version "3.1.3" @@ -3663,11 +3475,6 @@ asap@^2.0.0: resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46" integrity sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA== -asmcrypto.js@^0.22.0: - version "0.22.0" - resolved "https://registry.yarnpkg.com/asmcrypto.js/-/asmcrypto.js-0.22.0.tgz#38fc1440884d802c7bd37d1d23c2b26a5cd5d2d2" - integrity sha512-usgMoyXjMbx/ZPdzTSXExhMPur2FTdz/Vo5PVx2gIaBcdAAJNOFlsdgqveM8Cff7W0v+xrf9BwjOV26JSAF9qA== - asn1js@^3.0.5, asn1js@^3.0.6: version "3.0.6" resolved "https://registry.yarnpkg.com/asn1js/-/asn1js-3.0.6.tgz#53e002ebe00c5f7fd77c1c047c3557d7c04dce25" @@ -3687,10 +3494,10 @@ async-function@^1.0.0: resolved "https://registry.yarnpkg.com/async-function/-/async-function-1.0.0.tgz#509c9fca60eaf85034c6829838188e4e4c8ffb2b" integrity sha512-hsU18Ae8CDTR6Kgu9DYf0EbCr/a5iGL0rytQDobUcdpYOKokk8LEjVphnXkDkgpi0wYVsqrXuP0bZxJaTqdgoA== -async-mutex@^0.4.0: - version "0.4.1" - resolved "https://registry.yarnpkg.com/async-mutex/-/async-mutex-0.4.1.tgz#bccf55b96f2baf8df90ed798cb5544a1f6ee4c2c" - integrity sha512-WfoBo4E/TbCX1G95XTjbWTE3X2XLG0m1Xbv2cwOtuPdyH9CZvnaA5nCt1ucjaKEgW2A5IF71hxrRhr83Je5xjA== +async-mutex@^0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/async-mutex/-/async-mutex-0.5.0.tgz#353c69a0b9e75250971a64ac203b0ebfddd75482" + integrity sha512-1A94B18jkJ3DYq284ohPxoXbfTA5HsQ7/Mf4DEhcyLx3Bz27Rh59iScbB6EPiP+B+joue6YCxcMXSbFC1tZKwA== dependencies: tslib "^2.4.0" @@ -3699,11 +3506,6 @@ asynckit@^0.4.0: resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== -at-least-node@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/at-least-node/-/at-least-node-1.0.0.tgz#602cd4b46e844ad4effc92a8011a3c46e0238dc2" - integrity sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg== - available-typed-arrays@^1.0.7: version "1.0.7" resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz#a5cc375d6a03c2efc87a553f3e0b1522def14846" @@ -3712,28 +3514,14 @@ available-typed-arrays@^1.0.7: possible-typed-array-names "^1.0.0" axios@^1.6.3, axios@^1.9.0: - version "1.11.0" - resolved "https://registry.yarnpkg.com/axios/-/axios-1.11.0.tgz#c2ec219e35e414c025b2095e8b8280278478fdb6" - integrity sha512-1Lx3WLFQWm3ooKDYZD1eXmoGO9fxYQjrycfHFC8P0sCfQVXyROp0p9PFWBehewBOdCwHc+f/b8I0fMto5eSfwA== + version "1.13.2" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.13.2.tgz#9ada120b7b5ab24509553ec3e40123521117f687" + integrity sha512-VPk9ebNqPcy5lRGuSlKx752IlDatOjT9paPlm8A7yOuW2Fbvp4X3JznJtT4f0GzGLLiWE9W8onz51SqLYwzGaA== dependencies: follow-redirects "^1.15.6" form-data "^4.0.4" proxy-from-env "^1.1.0" -b64-lite@^1.3.1, b64-lite@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/b64-lite/-/b64-lite-1.4.0.tgz#e62442de11f1f21c60e38b74f111ac0242283d3d" - integrity sha512-aHe97M7DXt+dkpa8fHlCcm1CnskAHrJqEfMI0KN7dwqlzml/aUe1AGt6lk51HzrSfVD67xOso84sOpr+0wIe2w== - dependencies: - base-64 "^0.1.0" - -b64u-lite@^1.0.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/b64u-lite/-/b64u-lite-1.1.0.tgz#a581b7df94cbd4bed7cbb19feae816654f0b1bf0" - integrity sha512-929qWGDVCRph7gQVTC6koHqQIpF4vtVaSbwLltFQo44B1bYUquALswZdBKFfrJCPEnsCOvWkJsPdQYZ/Ukhw8A== - dependencies: - b64-lite "^1.4.0" - babel-jest@^29.7.0: version "29.7.0" resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.7.0.tgz#f4369919225b684c56085998ac63dbd05be020d5" @@ -3802,45 +3590,21 @@ balanced-match@^1.0.0: resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== -base-64@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/base-64/-/base-64-0.1.0.tgz#780a99c84e7d600260361511c4877613bf24f6bb" - integrity sha512-Y5gU45svrR5tI2Vt/X9GPd3L0HNIKzGu202EjxrXMpuc2V2CiKgemAbUUsqYmZJvPtCXoUKjNZwBJzsNScUbXA== - -base64-js@*, base64-js@^1.3.0, base64-js@^1.3.1: +base64-js@^1.3.1: version "1.5.1" resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== -base64url-universal@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/base64url-universal/-/base64url-universal-1.1.0.tgz#94da6356c1d43ead55b1d91c045c0a5b09ec8181" - integrity sha512-WyftvZqye29YQ10ZnuiBeEj0lk8SN8xHU9hOznkLc85wS1cLTp6RpzlMrHxMPD9nH7S55gsBqMqgGyz93rqmkA== - dependencies: - base64url "^3.0.0" - -base64url-universal@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/base64url-universal/-/base64url-universal-2.0.0.tgz#6023785c0e349a90de1cf396e8a4519750a4e67b" - integrity sha512-6Hpg7EBf3t148C3+fMzjf+CHnADVDafWzlJUXAqqqbm4MKNXbsoPdOkWeRTjNlkYG7TpyjIpRO1Gk0SnsFD1rw== - dependencies: - base64url "^3.0.1" - -base64url@^3.0.0, base64url@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/base64url/-/base64url-3.0.1.tgz#6399d572e2bc3f90a9a8b22d5dbb0a32d33f788d" - integrity sha512-ir1UPr3dkwexU7FdV8qBBbNDRUhMmIekYMFZfi+C/sLNnRESKPl23nB9b2pltqfOQNnGzsDdId90AEtG5tCx4A== +baseline-browser-mapping@^2.9.0: + version "2.9.4" + resolved "https://registry.yarnpkg.com/baseline-browser-mapping/-/baseline-browser-mapping-2.9.4.tgz#a010e50ea6da48fba78179aef9b6e771d00fff42" + integrity sha512-ZCQ9GEWl73BVm8bu5Fts8nt7MHdbt5vY9bP6WGnUh+r3l8M7CgfyTlwsgCbMC66BNxPr6Xoce3j66Ms5YUQTNA== bech32@1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/bech32/-/bech32-1.1.4.tgz#e38c9f37bf179b8eb16ae3a772b40c356d4832e9" integrity sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ== -bignumber.js@^9.0.0: - version "9.3.1" - resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-9.3.1.tgz#759c5aaddf2ffdc4f154f7b493e1c8770f88c4d7" - integrity sha512-Ko0uX15oIUS7wJ3Rb30Fs6SkVbLmPBAKdlm7q9+ak9bbIeFf0MwuBsQV6z7+X768/cHsfg+WlysDWJcmthjsjQ== - binary-extensions@^2.0.0: version "2.3.0" resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.3.0.tgz#f6e14a97858d327252200242d4ccfe522c445522" @@ -3856,51 +3620,38 @@ bn.js@^5.2.0, bn.js@^5.2.1: resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.2.tgz#82c09f9ebbb17107cd72cb7fd39bd1f9d0aaa566" integrity sha512-v2YAxEmKaBLahNwE1mjp4WON6huMNeuDvagFZW+ASCuA/ku0bXR9hSMw0XpiqMoA3+rmnyck/tPRSFQkoC9Cuw== -body-parser@1.20.3: - version "1.20.3" - resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.20.3.tgz#1953431221c6fb5cd63c4b36d53fab0928e548c6" - integrity sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g== - dependencies: - bytes "3.1.2" - content-type "~1.0.5" - debug "2.6.9" - depd "2.0.0" - destroy "1.2.0" - http-errors "2.0.0" - iconv-lite "0.4.24" - on-finished "2.4.1" - qs "6.13.0" - raw-body "2.5.2" - type-is "~1.6.18" - unpipe "1.0.0" - -body-parser@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-2.2.0.tgz#f7a9656de305249a715b549b7b8fd1ab9dfddcfa" - integrity sha512-02qvAaxv8tp7fBa/mw1ga98OGm+eCbqzJOKoRt70sLmfEEi+jyBYVTDGfCL/k06/4EMk/z01gCe7HoCH/f2LTg== +body-parser@^2.2.0, body-parser@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-2.2.1.tgz#6df606b0eb0a6e3f783dde91dde182c24c82438c" + integrity sha512-nfDwkulwiZYQIGwxdy0RUmowMhKcFVcYXUU7m4QlKYim1rUtg83xm2yjZ40QjDuc291AJjjeSc9b++AWHSgSHw== dependencies: bytes "^3.1.2" content-type "^1.0.5" - debug "^4.4.0" + debug "^4.4.3" http-errors "^2.0.0" - iconv-lite "^0.6.3" + iconv-lite "^0.7.0" on-finished "^2.4.1" qs "^6.14.0" - raw-body "^3.0.0" - type-is "^2.0.0" + raw-body "^3.0.1" + type-is "^2.0.1" -borc@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/borc/-/borc-3.0.0.tgz#49ada1be84de86f57bb1bb89789f34c186dfa4fe" - integrity sha512-ec4JmVC46kE0+layfnwM3l15O70MlFiEbmQHY/vpqIKiUtPVntv4BY4NVnz3N4vb21edV3mY97XVckFvYHWF9g== +body-parser@~1.20.3: + version "1.20.4" + resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.20.4.tgz#f8e20f4d06ca8a50a71ed329c15dccad1cdc547f" + integrity sha512-ZTgYYLMOXY9qKU/57FAo8F+HA2dGX7bqGc71txDRC1rS4frdFI5R7NhluHxH6M0YItAP0sHB4uqAOcYKxO6uGA== dependencies: - bignumber.js "^9.0.0" - buffer "^6.0.3" - commander "^2.15.0" - ieee754 "^1.1.13" - iso-url "^1.1.5" - json-text-sequence "~0.3.0" - readable-stream "^3.6.0" + bytes "~3.1.2" + content-type "~1.0.5" + debug "2.6.9" + depd "2.0.0" + destroy "~1.2.0" + http-errors "~2.0.1" + iconv-lite "~0.4.24" + on-finished "~2.4.1" + qs "~6.14.0" + raw-body "~2.5.3" + type-is "~1.6.18" + unpipe "~1.0.0" brace-expansion@^1.1.7: version "1.1.12" @@ -3930,14 +3681,15 @@ brorand@^1.1.0: integrity sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w== browserslist@^4.24.0: - version "4.25.3" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.25.3.tgz#9167c9cbb40473f15f75f85189290678b99b16c5" - integrity sha512-cDGv1kkDI4/0e5yON9yM5G/0A5u8sf5TnmdX5C9qHzI9PPu++sQ9zjm1k9NiOrf3riY4OkK0zSGqfvJyJsgCBQ== + version "4.28.1" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.28.1.tgz#7f534594628c53c63101079e27e40de490456a95" + integrity sha512-ZC5Bd0LgJXgwGqUknZY/vkUQ04r8NXnJZ3yYi4vDmSiZmC/pdSN0NbNRPxZpbtO4uAfDUAFffO8IZoM3Gj8IkA== dependencies: - caniuse-lite "^1.0.30001735" - electron-to-chromium "^1.5.204" - node-releases "^2.0.19" - update-browserslist-db "^1.1.3" + baseline-browser-mapping "^2.9.0" + caniuse-lite "^1.0.30001759" + electron-to-chromium "^1.5.263" + node-releases "^2.0.27" + update-browserslist-db "^1.2.0" bs-logger@^0.2.6: version "0.2.6" @@ -3976,7 +3728,7 @@ buffer@^6.0.3: base64-js "^1.3.1" ieee754 "^1.2.1" -bytes@3.1.2, bytes@^3.1.2: +bytes@^3.1.2, bytes@~3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.2.tgz#8b0beeb98605adf1b128fa4386403c009e0221a5" integrity sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg== @@ -4040,10 +3792,10 @@ camelcase@^6.2.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== -caniuse-lite@^1.0.30001735: - version "1.0.30001735" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001735.tgz#ba658fd3fd24a4106fd68d5ce472a2c251494dbe" - integrity sha512-EV/laoX7Wq2J9TQlyIXRxTJqIw4sxfXS4OYgudGxBYRuTv0q7AM6yMEpU/Vo1I94thg9U6EZ2NfZx9GJq83u7w== +caniuse-lite@^1.0.30001759: + version "1.0.30001759" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001759.tgz#d569e7b010372c6b0ca3946e30dada0a2e9d5006" + integrity sha512-Pzfx9fOKoKvevQf8oCXoyNRQ5QyxJj+3O0Rqx2V5oxT61KGx8+n6hV/IUyJeifUci2clnmmKVpvtiqRzgiWjSw== canonicalize@^1.0.1: version "1.0.8" @@ -4057,7 +3809,7 @@ cbor@^8.1.0: dependencies: nofilter "^3.1.0" -chalk@^4.0.0, chalk@^4.1.0, chalk@^4.1.2: +chalk@^4.0.0, chalk@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== @@ -4105,7 +3857,7 @@ cjs-module-lexer@^1.0.0, cjs-module-lexer@^1.2.2: resolved "https://registry.yarnpkg.com/cjs-module-lexer/-/cjs-module-lexer-1.4.3.tgz#0f79731eb8cfe1ec72acd4066efac9d61991b00d" integrity sha512-9z8TZaGM1pfswYeXrUpzPrkx8UnWYdhJclsiYMm6x/w5+nN+8Tf/LnAgfLGQCm59qAOxU8WwHEq2vNwF6i4j+Q== -class-transformer@0.5.1, class-transformer@^0.5.1: +class-transformer@0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/class-transformer/-/class-transformer-0.5.1.tgz#24147d5dffd2a6cea930a3250a677addf96ab336" integrity sha512-SQa1Ws6hUbfC98vKGxZH3KFY0Y1lm5Zm0SY8XX9zbK7FJCyVEac3ATW0RIpwzW+oOfmHE5PMPufDG9hCfoEOMw== @@ -4119,6 +3871,15 @@ class-validator@0.14.1: libphonenumber-js "^1.10.53" validator "^13.9.0" +class-validator@^0.14.1: + version "0.14.3" + resolved "https://registry.yarnpkg.com/class-validator/-/class-validator-0.14.3.tgz#834a4caafa8359aed73d7708badb4cf271be50fe" + integrity sha512-rXXekcjofVN1LTOSw+u4u9WXVEUvNBVjORW154q/IdmYWy1nMbOU9aNtZB0t8m+FJQ9q91jlr2f9CwwUFdFMRA== + dependencies: + "@types/validator" "^13.15.3" + libphonenumber-js "^1.11.1" + validator "^13.15.20" + cliui@^8.0.1: version "8.0.1" resolved "https://registry.yarnpkg.com/cliui/-/cliui-8.0.1.tgz#0c04b075db02cbfe60dc8e6cf2f5486b1a3608aa" @@ -4141,9 +3902,9 @@ co@^4.6.0: integrity sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ== collect-v8-coverage@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz#c0b29bcd33bcd0779a1344c2136051e6afd3d9e9" - integrity sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q== + version "1.0.3" + resolved "https://registry.yarnpkg.com/collect-v8-coverage/-/collect-v8-coverage-1.0.3.tgz#cc1f01eb8d02298cbc9a437c74c70ab4e5210b80" + integrity sha512-1L5aqIkwPfiodaMgQunkF1zRhNqifHBmtbbbxcr6yVxxBnliw4TDOW6NxpO8DJLgJ16OT+Y4ztZqP6p/FtXnAw== color-convert@^2.0.1: version "2.0.1" @@ -4169,21 +3930,6 @@ combined-stream@^1.0.8: dependencies: delayed-stream "~1.0.0" -commander@^2.15.0: - version "2.20.3" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" - integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== - -commander@^7.2.0: - version "7.2.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-7.2.0.tgz#a36cb57d0b501ce108e4d20559a150a391d97ab7" - integrity sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw== - -compare-versions@^3.4.0: - version "3.6.0" - resolved "https://registry.yarnpkg.com/compare-versions/-/compare-versions-3.6.0.tgz#1a5689913685e5a87637b8d3ffca75514ec41d62" - integrity sha512-W6Af2Iw1z4CB7q4uU4hv646dW9GQuBM+YpC0UvUCWSD8w90SJjp+ujJuXaEMtAXBtSqGfMPuFOVn4/+FlaqfBA== - compare-versions@^6.1.1: version "6.1.1" resolved "https://registry.yarnpkg.com/compare-versions/-/compare-versions-6.1.1.tgz#7af3cc1099ba37d244b3145a9af5201b629148a9" @@ -4204,20 +3950,18 @@ console-control-strings@^1.0.0, console-control-strings@^1.1.0: resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" integrity sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ== -content-disposition@0.5.4: +content-disposition@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-1.0.1.tgz#a8b7bbeb2904befdfb6787e5c0c086959f605f9b" + integrity sha512-oIXISMynqSqm241k6kcQ5UwttDILMK4BiurCfGEREw6+X9jkkpEe5T9FZaApyLGGOnFuyMWZpdolTXMtvEJ08Q== + +content-disposition@~0.5.4: version "0.5.4" resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.4.tgz#8b82b4efac82512a02bb0b1dcec9d2c5e8eb5bfe" integrity sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ== dependencies: safe-buffer "5.2.1" -content-disposition@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-1.0.0.tgz#844426cb398f934caefcbb172200126bc7ceace2" - integrity sha512-Au9nRL8VNUut/XSzbQA38+M78dzP4D+eqg3gfJHMIHHYa3bg067xj1KxMUWj+VULbiZMowKngFFbKczUrNJ1mg== - dependencies: - safe-buffer "5.2.1" - content-type@^1.0.5, content-type@~1.0.4, content-type@~1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.5.tgz#8b773162656d1d1086784c8f23a54ce6d73d7918" @@ -4228,22 +3972,17 @@ convert-source-map@^2.0.0: resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-2.0.0.tgz#4b560f649fc4e918dd0ab75cf4961e8bc882d82a" integrity sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg== -cookie-signature@1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" - integrity sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ== - cookie-signature@^1.2.1: version "1.2.2" resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.2.2.tgz#57c7fc3cc293acab9fec54d73e15690ebe4a1793" integrity sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg== -cookie@0.7.1: - version "0.7.1" - resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.7.1.tgz#2f73c42142d5d5cf71310a74fc4ae61670e5dbc9" - integrity sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w== +cookie-signature@~1.0.6: + version "1.0.7" + resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.7.tgz#ab5dd7ab757c54e60f37ef6550f481c426d10454" + integrity sha512-NXdYc3dLr47pBkpUCHtKSwIOQXLVn8dZEuywboCOJY/osA0wFSLlSawr3KN8qXJEyX66FcONTH8EIlVuK0yyFA== -cookie@^0.7.1: +cookie@^0.7.1, cookie@~0.7.1: version "0.7.2" resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.7.2.tgz#556369c472a2ba910f2979891b526b3436237ed7" integrity sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w== @@ -4300,11 +4039,6 @@ cross-spawn@^7.0.3, cross-spawn@^7.0.6: shebang-command "^2.0.0" which "^2.0.1" -crypto-ld@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/crypto-ld/-/crypto-ld-6.0.0.tgz#cf8dcf566cb3020bdb27f0279e6cc9b46d031cd7" - integrity sha512-XWL1LslqggNoaCI/m3I7HcvaSt9b2tYzdrXO+jHLUj9G1BvRfvV7ZTFDVY5nifYuIGAPdAGu7unPxLRustw3VA== - d@1, d@^1.0.1, d@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/d/-/d-1.0.2.tgz#2aefd554b81981e7dccf72d6842ae725cb17e5de" @@ -4313,16 +4047,6 @@ d@1, d@^1.0.1, d@^1.0.2: es5-ext "^0.10.64" type "^2.7.2" -data-uri-to-buffer@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/data-uri-to-buffer/-/data-uri-to-buffer-3.0.1.tgz#594b8973938c5bc2c33046535785341abc4f3636" - integrity sha512-WboRycPNsVw3B3TL559F7kuBUM4d8CgMEvk6xEJlOp7OBPjt6G7z8WMWlD2rOFZLk6OYfFIUGsCOWzcQH9K2og== - -data-uri-to-buffer@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz#d8feb2b2881e6a4f58c2e08acfd0e2834e26222e" - integrity sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A== - data-view-buffer@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/data-view-buffer/-/data-view-buffer-1.0.2.tgz#211a03ba95ecaf7798a8c7198d79536211f88570" @@ -4350,12 +4074,12 @@ data-view-byte-offset@^1.0.1: es-errors "^1.3.0" is-data-view "^1.0.1" -dcql@^0.2.20: - version "0.2.22" - resolved "https://registry.yarnpkg.com/dcql/-/dcql-0.2.22.tgz#aeae2f7f47b8bce5fe2c4a8857df8406feb91230" - integrity sha512-4CfuUoJ1/dfj4aOMwCGF3HEHsPpRUyALbst5Dx3qcNkIXNFpVqebKVYd58X9/ZlKN/wWJxPS34S7uQ0fcbzS5A== +dcql@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/dcql/-/dcql-3.0.0.tgz#08d89345f4916bd85ac886cf0a74db54653c4b4a" + integrity sha512-Z1Iq+tDQqPCqWzQVevUVOaYa+NfoplwrwSPvV0JINZpniiN5jq32C4CXsrmELAgSa5Ja7hBKiuYkpZjQFkeHyw== dependencies: - valibot "1.0.0-beta.8" + valibot "1.2.0" debug@2.6.9, debug@^2.2.0: version "2.6.9" @@ -4364,10 +4088,10 @@ debug@2.6.9, debug@^2.2.0: dependencies: ms "2.0.0" -debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.4, debug@^4.3.5, debug@^4.3.7, debug@^4.4.0, debug@^4.4.1: - version "4.4.1" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.4.1.tgz#e5a8bc6cbc4c6cd3e64308b0693a3d4fa550189b" - integrity sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ== +debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.4, debug@^4.3.5, debug@^4.3.7, debug@^4.4.0, debug@^4.4.1, debug@^4.4.3: + version "4.4.3" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.4.3.tgz#c6ae432d9bd9662582fce08709b038c58e9e3d6a" + integrity sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA== dependencies: ms "^2.1.3" @@ -4378,10 +4102,10 @@ debug@^3.1.0, debug@^3.2.7: dependencies: ms "^2.1.1" -decode-uri-component@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.2.tgz#e69dbe25d37941171dd540e024c444cd5188e1e9" - integrity sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ== +decode-uri-component@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.4.1.tgz#2ac4859663c704be22bf7db760a1494a49ab2cc5" + integrity sha512-+8VxcR21HhTy8nOt6jf20w0c9CADrw1O8d+VZ/YzzCt4bJ3uBjw+D1q2osAB8RnpwwaeYBxy0HyKQxD5JBMuuQ== decompress-response@^6.0.0: version "6.0.0" @@ -4391,9 +4115,9 @@ decompress-response@^6.0.0: mimic-response "^3.1.0" dedent@^1.0.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/dedent/-/dedent-1.6.0.tgz#79d52d6389b1ffa67d2bcef59ba51847a9d503b2" - integrity sha512-F1Z+5UCFpmQUzJa11agbyPVMbpgT/qA3/SKyJ1jyBgm7dUcUEa8v9JwDkerSQXfakBwFljIxhOJqGkjUwZ9FSA== + version "1.7.0" + resolved "https://registry.yarnpkg.com/dedent/-/dedent-1.7.0.tgz#c1f9445335f0175a96587be245a282ff451446ca" + integrity sha512-HGFtf8yhuhGhqO07SV79tRp+br4MnbdjeVxotpn1QBl30pcLLCQjX5b2295ll0fv8RKDKsmWYrl05usHM9CewQ== deep-is@^0.1.3, deep-is@~0.1.3: version "0.1.4" @@ -4438,20 +4162,20 @@ delegates@^1.0.0: resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" integrity sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ== -depd@2.0.0, depd@^2.0.0: +depd@2.0.0, depd@^2.0.0, depd@~2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df" integrity sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw== -destroy@1.2.0: +destroy@1.2.0, destroy@~1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.2.0.tgz#4803735509ad8be552934c67df614f94e66fa015" integrity sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg== detect-libc@^2.0.0: - version "2.0.4" - resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-2.0.4.tgz#f04715b8ba815e53b4d8109655b6508a6865a7e8" - integrity sha512-3UDv+G9CsCKO1WKMGw9fwq/SWJYbI0c5Y7LU1AXYoDdbhE2AHQ6N6Nb34sG8Fj7T5APy8qXDCKuuIHd1BR0tVA== + version "2.1.2" + resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-2.1.2.tgz#689c5dcdc1900ef5583a4cb9f6d7b473742074ad" + integrity sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ== detect-newline@^3.0.0: version "3.1.0" @@ -4514,10 +4238,10 @@ eastasianwidth@^0.2.0: resolved "https://registry.yarnpkg.com/eastasianwidth/-/eastasianwidth-0.2.0.tgz#696ce2ec0aa0e6ea93a397ffcf24aa7840c827cb" integrity sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA== -ec-compression@0.0.1-alpha.11: - version "0.0.1-alpha.11" - resolved "https://registry.yarnpkg.com/ec-compression/-/ec-compression-0.0.1-alpha.11.tgz#1dddcebd664c786c5b3459e012d382abded81b63" - integrity sha512-ppznPCx1m/TrjlThndIOZdJPSI9/PGqU1+RTDSHQGaMS66ZWdLM8bTQw8QbdBcseDS+5UV7ZZz8GwqpQhjsZYw== +ec-compression@0.0.1-alpha.12: + version "0.0.1-alpha.12" + resolved "https://registry.yarnpkg.com/ec-compression/-/ec-compression-0.0.1-alpha.12.tgz#f5c496d1775186e3aef5751f9ec003fd44f729f8" + integrity sha512-rfsgHPnS/q8SiiJyaJ5w+qpkLtvtvEFOXoh40VmjH+Xs1pjzCCKwhd9Un3BQV+1+Qg0es5VQnzwZVJ7fjzfN+A== ecdsa-sig-formatter@1.0.11: version "1.0.11" @@ -4531,20 +4255,15 @@ ed25519-signature-2018-context@^1.1.0: resolved "https://registry.yarnpkg.com/ed25519-signature-2018-context/-/ed25519-signature-2018-context-1.1.0.tgz#68002ea7497c32e8170667cfd67468dedf7d220e" integrity sha512-ppDWYMNwwp9bploq0fS4l048vHIq41nWsAbPq6H4mNVx9G/GxW3fwg4Ln0mqctP13MoEpREK7Biz8TbVVdYXqA== -ed25519-signature-2020-context@^1.0.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/ed25519-signature-2020-context/-/ed25519-signature-2020-context-1.1.0.tgz#b2f724f07db154ddf0fd6605410d88736e56fd07" - integrity sha512-dBGSmoUIK6h2vadDctrDnhhTO01PR2hJk0mRNEfrRDPCjaIwrfy4J+eziEQ9Q1m8By4f/CSRgKM1h53ydKfdNg== - ee-first@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" integrity sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow== -electron-to-chromium@^1.5.204: - version "1.5.205" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.205.tgz#02b538ce3d0e6ef2016458b49309fd1f5be2a2a7" - integrity sha512-gBtbT7IgOHu7CwdtIiXwbNRD1l6oG6GAyanmwMCLVqaoGy92Jfe1dSHLiSj8xUEZNxOTIVlXuaAalMMD+S4y0w== +electron-to-chromium@^1.5.263: + version "1.5.266" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.266.tgz#41ed029b3cf641c4ee071de42954b36dca8f5f4e" + integrity sha512-kgWEglXvkEfMH7rxP5OSZZwnaDWT7J9EoZCujhnpLbfi0bbNtRkgdX2E3gt0Uer11c61qCYktB3hwkAS325sJg== elliptic@6.6.1: version "6.6.1" @@ -4592,9 +4311,9 @@ end-of-stream@^1.1.0: once "^1.4.0" error-ex@^1.3.1: - version "1.3.2" - resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" - integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== + version "1.3.4" + resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.4.tgz#b3a8d8bb6f92eecc1629e3e27d3c8607a8a32414" + integrity sha512-sqQamAnR14VgCr1A618A3sGrygcpK+HEbenA/HiEAkkUwcZIIB/tgWqHFxWgOyDh4nB4JCRimh79dR5Ywc9MDQ== dependencies: is-arrayish "^0.2.1" @@ -4854,23 +4573,22 @@ eslint-visitor-keys@^4.2.1: integrity sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ== eslint@^9.27.0: - version "9.33.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-9.33.0.tgz#cc186b3d9eb0e914539953d6a178a5b413997b73" - integrity sha512-TS9bTNIryDzStCpJN93aC5VRSW3uTx9sClUn4B87pwiCaJh220otoI0X8mJKr+VcPtniMdN8GKjlwgWGUv5ZKA== + version "9.39.1" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-9.39.1.tgz#be8bf7c6de77dcc4252b5a8dcb31c2efff74a6e5" + integrity sha512-BhHmn2yNOFA9H9JmmIVKJmd288g9hrVRDkdoIgRCRuSySRUHH7r/DI6aAXW9T1WwUuY3DFgrcaqB+deURBLR5g== dependencies: - "@eslint-community/eslint-utils" "^4.2.0" + "@eslint-community/eslint-utils" "^4.8.0" "@eslint-community/regexpp" "^4.12.1" - "@eslint/config-array" "^0.21.0" - "@eslint/config-helpers" "^0.3.1" - "@eslint/core" "^0.15.2" + "@eslint/config-array" "^0.21.1" + "@eslint/config-helpers" "^0.4.2" + "@eslint/core" "^0.17.0" "@eslint/eslintrc" "^3.3.1" - "@eslint/js" "9.33.0" - "@eslint/plugin-kit" "^0.3.5" + "@eslint/js" "9.39.1" + "@eslint/plugin-kit" "^0.4.1" "@humanfs/node" "^0.16.6" "@humanwhocodes/module-importer" "^1.0.1" "@humanwhocodes/retry" "^0.4.2" "@types/estree" "^1.0.6" - "@types/json-schema" "^7.0.15" ajv "^6.12.4" chalk "^4.0.0" cross-spawn "^7.0.6" @@ -4989,9 +4707,9 @@ ethers@^5.1.0: "@ethersproject/wordlists" "5.8.0" ethers@^6.9.0: - version "6.15.0" - resolved "https://registry.yarnpkg.com/ethers/-/ethers-6.15.0.tgz#2980f2a3baf0509749b7e21f8692fa8a8349c0e3" - integrity sha512-Kf/3ZW54L4UT0pZtsY/rf+EkBU7Qi5nnhonjUb8yTXcxH3cdcWrV2cRyk0Xk/4jK6OoHhxxZHriyhje20If2hQ== + version "6.16.0" + resolved "https://registry.yarnpkg.com/ethers/-/ethers-6.16.0.tgz#fff9b4f05d7a359c774ad6e91085a800f7fccf65" + integrity sha512-U1wulmetNymijEhpSEQ7Ct/P/Jw9/e7R1j5XIbPRydgV2DjLVMsULDlNksq3RQnFgKoLlZf88ijYtWEXcPa07A== dependencies: "@adraffy/ens-normalize" "1.10.1" "@noble/curves" "1.2.0" @@ -5009,11 +4727,6 @@ event-emitter@^0.3.5: d "1" es5-ext "~0.10.14" -event-target-shim@^5.0.0: - version "5.0.1" - resolved "https://registry.yarnpkg.com/event-target-shim/-/event-target-shim-5.0.1.tgz#5d4d3ebdf9583d63a5333ce2deb7480ab2b05789" - integrity sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ== - events@^3.3.0: version "3.3.0" resolved "https://registry.yarnpkg.com/events/-/events-3.3.0.tgz#31a95ad0a924e2d2c419a813aeb2c4e878ea7400" @@ -5050,78 +4763,61 @@ expect@^29.0.0, expect@^29.7.0: jest-message-util "^29.7.0" jest-util "^29.7.0" -expo-modules-autolinking@^0.0.3: - version "0.0.3" - resolved "https://registry.yarnpkg.com/expo-modules-autolinking/-/expo-modules-autolinking-0.0.3.tgz#45ba8cb1798f9339347ae35e96e9cc70eafb3727" - integrity sha512-azkCRYj/DxbK4udDuDxA9beYzQTwpJ5a9QA0bBgha2jHtWdFGF4ZZWSY+zNA5mtU3KqzYt8jWHfoqgSvKyu1Aw== - dependencies: - chalk "^4.1.0" - commander "^7.2.0" - fast-glob "^3.2.5" - find-up "~5.0.0" - fs-extra "^9.1.0" - -expo-random@*: - version "14.0.1" - resolved "https://registry.yarnpkg.com/expo-random/-/expo-random-14.0.1.tgz#aedc6a3b6ff86c74a85989d77d20e0f1762ed669" - integrity sha512-gX2mtR9o+WelX21YizXUCD/y+a4ZL+RDthDmFkHxaYbdzjSYTn8u/igoje/l3WEO+/RYspmqUFa8w/ckNbt6Vg== - dependencies: - base64-js "^1.3.0" - express-rate-limit@^7.5.0: version "7.5.1" resolved "https://registry.yarnpkg.com/express-rate-limit/-/express-rate-limit-7.5.1.tgz#8c3a42f69209a3a1c969890070ece9e20a879dec" integrity sha512-7iN8iPMDzOMHPUYllBEsQdWVB6fPDMPqwjBaFrgr4Jgr/+okjvzAy+UHlYYL/Vs0OsOrMkwS6PJDkFlJwoxUnw== express@^4.21.2: - version "4.21.2" - resolved "https://registry.yarnpkg.com/express/-/express-4.21.2.tgz#cf250e48362174ead6cea4a566abef0162c1ec32" - integrity sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA== + version "4.22.1" + resolved "https://registry.yarnpkg.com/express/-/express-4.22.1.tgz#1de23a09745a4fffdb39247b344bb5eaff382069" + integrity sha512-F2X8g9P1X7uCPZMA3MVf9wcTqlyNp7IhH5qPCI0izhaOIYXaW9L535tGA3qmjRzpH+bZczqq7hVKxTR4NWnu+g== dependencies: accepts "~1.3.8" array-flatten "1.1.1" - body-parser "1.20.3" - content-disposition "0.5.4" + body-parser "~1.20.3" + content-disposition "~0.5.4" content-type "~1.0.4" - cookie "0.7.1" - cookie-signature "1.0.6" + cookie "~0.7.1" + cookie-signature "~1.0.6" debug "2.6.9" depd "2.0.0" encodeurl "~2.0.0" escape-html "~1.0.3" etag "~1.8.1" - finalhandler "1.3.1" - fresh "0.5.2" - http-errors "2.0.0" + finalhandler "~1.3.1" + fresh "~0.5.2" + http-errors "~2.0.0" merge-descriptors "1.0.3" methods "~1.1.2" - on-finished "2.4.1" + on-finished "~2.4.1" parseurl "~1.3.3" - path-to-regexp "0.1.12" + path-to-regexp "~0.1.12" proxy-addr "~2.0.7" - qs "6.13.0" + qs "~6.14.0" range-parser "~1.2.1" safe-buffer "5.2.1" - send "0.19.0" - serve-static "1.16.2" + send "~0.19.0" + serve-static "~1.16.2" setprototypeof "1.2.0" - statuses "2.0.1" + statuses "~2.0.1" type-is "~1.6.18" utils-merge "1.0.1" vary "~1.1.2" -express@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/express/-/express-5.1.0.tgz#d31beaf715a0016f0d53f47d3b4d7acf28c75cc9" - integrity sha512-DT9ck5YIRU+8GYzzU5kT3eHGA5iL+1Zd0EutOmTE9Dtk+Tvuzd23VBU+ec7HPNSTxXYO55gPV/hq4pSBJDjFpA== +express@^5.1.0, express@^5.2.0: + version "5.2.1" + resolved "https://registry.yarnpkg.com/express/-/express-5.2.1.tgz#8f21d15b6d327f92b4794ecf8cb08a72f956ac04" + integrity sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw== dependencies: accepts "^2.0.0" - body-parser "^2.2.0" + body-parser "^2.2.1" content-disposition "^1.0.0" content-type "^1.0.5" cookie "^0.7.1" cookie-signature "^1.2.1" debug "^4.4.0" + depd "^2.0.0" encodeurl "^2.0.0" escape-html "^1.0.3" etag "^1.8.1" @@ -5171,17 +4867,6 @@ fast-diff@^1.1.2: resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.3.0.tgz#ece407fa550a64d638536cd727e129c61616e0f0" integrity sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw== -fast-glob@^3.2.5, fast-glob@^3.3.2: - version "3.3.3" - resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.3.tgz#d06d585ce8dba90a16b0505c543c3ccfb3aeb818" - integrity sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg== - dependencies: - "@nodelib/fs.stat" "^2.0.2" - "@nodelib/fs.walk" "^1.2.3" - glob-parent "^5.1.2" - merge2 "^1.3.0" - micromatch "^4.0.8" - fast-json-stable-stringify@2.x, fast-json-stable-stringify@^2.0.0, fast-json-stable-stringify@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" @@ -5203,16 +4888,9 @@ fast-text-encoding@^1.0.3: integrity sha512-VhXlQgj9ioXCqGstD37E/HBeqEGV/qOD/kmbVG8h5xKBYvM1L3lR1Zn4555cQ8GkYbJa8aJSipLPndE1k6zK2w== fast-uri@^3.0.1: - version "3.0.6" - resolved "https://registry.yarnpkg.com/fast-uri/-/fast-uri-3.0.6.tgz#88f130b77cfaea2378d56bf970dea21257a68748" - integrity sha512-Atfo14OibSv5wAp4VWNsFYE1AchQRTv9cBGWET4pZWHzYshFSS9NQI6I57rdKn9croWVMbYFbLhJ+yJvmZIIHw== - -fastq@^1.6.0: - version "1.19.1" - resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.19.1.tgz#d50eaba803c8846a883c16492821ebcd2cda55f5" - integrity sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ== - dependencies: - reusify "^1.0.4" + version "3.1.0" + resolved "https://registry.yarnpkg.com/fast-uri/-/fast-uri-3.1.0.tgz#66eecff6c764c0df9b762e62ca7edcfb53b4edfa" + integrity sha512-iPeeDKJSWf4IEOasVVrknXpaBV0IApz/gp7S2bb7Z4Lljbl2MGJRqInZiUrQwV16cpzw/D3S5j5Julj/gT52AA== fb-watchman@^2.0.0: version "2.0.2" @@ -5228,24 +4906,11 @@ fd-slicer@~1.1.0: dependencies: pend "~1.2.0" -fdir@^6.4.4: +fdir@^6.5.0: version "6.5.0" resolved "https://registry.yarnpkg.com/fdir/-/fdir-6.5.0.tgz#ed2ab967a331ade62f18d077dae192684d50d350" integrity sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg== -fetch-blob@^2.1.1: - version "2.1.2" - resolved "https://registry.yarnpkg.com/fetch-blob/-/fetch-blob-2.1.2.tgz#a7805db1361bd44c1ef62bb57fb5fe8ea173ef3c" - integrity sha512-YKqtUDwqLyfyMnmbw8XD6Q8j9i/HggKtPEI+pZ1+8bvheBu78biSmNaXWusx1TauGqtUUGx/cBb1mKdq2rLYow== - -fetch-blob@^3.1.2, fetch-blob@^3.1.4: - version "3.2.0" - resolved "https://registry.yarnpkg.com/fetch-blob/-/fetch-blob-3.2.0.tgz#f09b8d4bbd45adc6f0c20b7e787e793e309dcce9" - integrity sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ== - dependencies: - node-domexception "^1.0.0" - web-streams-polyfill "^3.0.3" - file-entry-cache@^8.0.0: version "8.0.0" resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-8.0.0.tgz#7787bddcf1131bffb92636c69457bbc0edd6d81f" @@ -5260,28 +4925,15 @@ fill-range@^7.1.1: dependencies: to-regex-range "^5.0.1" -filter-obj@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/filter-obj/-/filter-obj-1.1.0.tgz#9b311112bc6c6127a16e016c6c5d7f19e0805c5b" - integrity sha512-8rXg1ZnX7xzy2NGDVkBVaAy+lSlPNwad13BtgSlLuxfIslyt5Vg64U7tFcCt4WS1R0hvtnQybT/IyCkGZ3DpXQ== - -finalhandler@1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.3.1.tgz#0c575f1d1d324ddd1da35ad7ece3df7d19088019" - integrity sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ== - dependencies: - debug "2.6.9" - encodeurl "~2.0.0" - escape-html "~1.0.3" - on-finished "2.4.1" - parseurl "~1.3.3" - statuses "2.0.1" - unpipe "~1.0.0" +filter-obj@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/filter-obj/-/filter-obj-5.1.0.tgz#5bd89676000a713d7db2e197f660274428e524ed" + integrity sha512-qWeTREPoT7I0bifpPUXtxkZJ1XJzxWtfoWWkdVGqa+eCr3SHW/Ocp89o8vLvbUuQnadybJpjOKu4V+RwO6sGng== finalhandler@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-2.1.0.tgz#72306373aa89d05a8242ed569ed86a1bff7c561f" - integrity sha512-/t88Ty3d5JWQbWYgaOGCCYfXRwV1+be02WqYYlL6h0lEiUAMPM8o8qKGO01YIkOHzka2up08wvgYD0mDiI+q3Q== + version "2.1.1" + resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-2.1.1.tgz#a2c517a6559852bcdb06d1f8bd7f51b68fad8099" + integrity sha512-S8KoZgRZN+a5rNwqTxlZZePjT/4cnm0ROV70LedRHZ0p8u9fRID0hJUZQpkKLzro8LfmC8sx23bY6tVNxv8pQA== dependencies: debug "^4.4.0" encodeurl "^2.0.0" @@ -5290,6 +4942,19 @@ finalhandler@^2.1.0: parseurl "^1.3.3" statuses "^2.0.1" +finalhandler@~1.3.1: + version "1.3.2" + resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.3.2.tgz#1ebc2228fc7673aac4a472c310cc05b77d852b88" + integrity sha512-aA4RyPcd3badbdABGDuTXCMTtOneUCAYH/gxoYRTZlIJdF0YPWuGqiAsIrhNnnqdXGswYk6dGujem4w80UJFhg== + dependencies: + debug "2.6.9" + encodeurl "~2.0.0" + escape-html "~1.0.3" + on-finished "~2.4.1" + parseurl "~1.3.3" + statuses "~2.0.2" + unpipe "~1.0.0" + find-up@^4.0.0, find-up@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19" @@ -5298,7 +4963,7 @@ find-up@^4.0.0, find-up@^4.1.0: locate-path "^5.0.0" path-exists "^4.0.0" -find-up@^5.0.0, find-up@~5.0.0: +find-up@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== @@ -5313,15 +4978,6 @@ find-yarn-workspace-root@^2.0.0: dependencies: micromatch "^4.0.2" -fix-esm@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/fix-esm/-/fix-esm-1.0.1.tgz#e0e2199d841e43ff7db9b5f5ba7496bc45130ebb" - integrity sha512-EZtb7wPXZS54GaGxaWxMlhd1DUDCnAg5srlYdu/1ZVeW+7wwR3Tp59nu52dXByFs3MBRq+SByx1wDOJpRvLEXw== - dependencies: - "@babel/core" "^7.14.6" - "@babel/plugin-proposal-export-namespace-from" "^7.14.5" - "@babel/plugin-transform-modules-commonjs" "^7.14.5" - flat-cache@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-4.0.1.tgz#0ece39fcb14ee012f4b0410bd33dd9c1f011127c" @@ -5356,9 +5012,9 @@ foreground-child@^3.1.0: signal-exit "^4.0.1" form-data@^4.0.0, form-data@^4.0.4: - version "4.0.4" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.4.tgz#784cdcce0669a9d68e94d11ac4eea98088edd2c4" - integrity sha512-KrGhL9Q4zjj0kiUt5OO4Mr/A/jlI2jDYs5eHBpYHPcBEVSiipAvn2Ko2HnPe20rmcuuvMHNdZFp+4IlGTMF0Ow== + version "4.0.5" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.5.tgz#b49e48858045ff4cbf6b03e1805cebcad3679053" + integrity sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w== dependencies: asynckit "^0.4.0" combined-stream "^1.0.8" @@ -5371,13 +5027,6 @@ format-util@^1.0.5: resolved "https://registry.yarnpkg.com/format-util/-/format-util-1.0.5.tgz#1ffb450c8a03e7bccffe40643180918cc297d271" integrity sha512-varLbTj0e0yVyRpqQhuWV+8hlePAgaoFRhNFj50BNjEIrw1/DphHSObtqwskVCPWNgzwPoQrZAbfa/SBiicNeg== -formdata-polyfill@^4.0.10: - version "4.0.10" - resolved "https://registry.yarnpkg.com/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz#24807c31c9d402e002ab3d8c720144ceb8848423" - integrity sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g== - dependencies: - fetch-blob "^3.1.2" - formidable@^3.5.4: version "3.5.4" resolved "https://registry.yarnpkg.com/formidable/-/formidable-3.5.4.tgz#ac9a593b951e829b3298f21aa9a2243932f32ed9" @@ -5397,7 +5046,7 @@ forwarded@0.2.0: resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.2.0.tgz#2269936428aad4c15c7ebe9779a84bf0b2a81811" integrity sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow== -fresh@0.5.2: +fresh@0.5.2, fresh@~0.5.2: version "0.5.2" resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" integrity sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q== @@ -5407,21 +5056,20 @@ fresh@^2.0.0: resolved "https://registry.yarnpkg.com/fresh/-/fresh-2.0.0.tgz#8dd7df6a1b3a1b3a5cf186c05a5dd267622635a4" integrity sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A== -fs-extra@^11.2.0: - version "11.3.1" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-11.3.1.tgz#ba7a1f97a85f94c6db2e52ff69570db3671d5a74" - integrity sha512-eXvGGwZ5CL17ZSwHWd3bbgk7UUpF6IFHtP57NYYakPvHOs8GDgDe5KJI36jIJzDkJ6eJjuzRA8eBQb6SkKue0g== +fs-extra@^10.0.0: + version "10.1.0" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-10.1.0.tgz#02873cfbc4084dde127eaa5f9905eef2325d1abf" + integrity sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ== dependencies: graceful-fs "^4.2.0" jsonfile "^6.0.1" universalify "^2.0.0" -fs-extra@^9.0.0, fs-extra@^9.1.0: - version "9.1.0" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.1.0.tgz#5954460c764a8da2094ba3554bf839e6b9a7c86d" - integrity sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ== +fs-extra@^11.2.0: + version "11.3.2" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-11.3.2.tgz#c838aeddc6f4a8c74dd15f85e11fe5511bfe02a4" + integrity sha512-Xr9F6z6up6Ws+NjzMCZc6WXg2YFRlrLP9NQDO3VQrWrfiojdhS56TzueT88ze0uBdCTwEIhQ3ptnmKeWGFAe0A== dependencies: - at-least-node "^1.0.0" graceful-fs "^4.2.0" jsonfile "^6.0.1" universalify "^2.0.0" @@ -5480,6 +5128,11 @@ gauge@^3.0.0: strip-ansi "^6.0.1" wide-align "^1.1.2" +generator-function@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/generator-function/-/generator-function-2.0.1.tgz#0e75dd410d1243687a0ba2e951b94eedb8f737a2" + integrity sha512-SFdFmIJi+ybC0vjlHN0ZGVGHc3lgE0DxPAT0djjVg+kjOnSqclqmj0KQ7ykTOLP6YxoqOvuAODGdcHJn+43q3g== + gensync@^1.0.0-beta.2: version "1.0.0-beta.2" resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0" @@ -5511,7 +5164,7 @@ get-package-type@^0.1.0: resolved "https://registry.yarnpkg.com/get-package-type/-/get-package-type-0.1.0.tgz#8de2d803cff44df3bc6c456e6668b36c3926e11a" integrity sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q== -get-proto@^1.0.0, get-proto@^1.0.1: +get-proto@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/get-proto/-/get-proto-1.0.1.tgz#150b3f2743869ef3e851ec0c49d15b1d14d00ee1" integrity sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g== @@ -5546,9 +5199,9 @@ get-symbol-from-current-process-h@^1.0.1, get-symbol-from-current-process-h@^1.0 integrity sha512-syloC6fsCt62ELLrr1VKBM1ggOpMdetX9hTrdW77UQdcApPHLmf7CI7OKcN1c9kYuNxKcDe4iJ4FY9sX3aw2xw== get-tsconfig@^4.10.1: - version "4.10.1" - resolved "https://registry.yarnpkg.com/get-tsconfig/-/get-tsconfig-4.10.1.tgz#d34c1c01f47d65a606c37aa7a177bc3e56ab4b2e" - integrity sha512-auHyJ4AgMz7vgS8Hp3N6HXSmlMdUyhSUrfBF16w153rxtLIEOE+HGqaBppczZvnHLqQJfiHotCYpNhl0lUROFQ== + version "4.13.0" + resolved "https://registry.yarnpkg.com/get-tsconfig/-/get-tsconfig-4.13.0.tgz#fcdd991e6d22ab9a600f00e91c318707a5d9a0d7" + integrity sha512-1VKTZJCwBrvbd+Wn3AOgQP/2Av+TfTCOlE4AcRJE72W1ksZXbAx8PPBR9RzgTeSPzlPMHrbANMH3LbltH73wxQ== dependencies: resolve-pkg-maps "^1.0.0" @@ -5559,13 +5212,6 @@ get-uv-event-loop-napi-h@^1.0.5: dependencies: get-symbol-from-current-process-h "^1.0.1" -glob-parent@^5.1.2, glob-parent@~5.1.2: - version "5.1.2" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" - integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== - dependencies: - is-glob "^4.0.1" - glob-parent@^6.0.2: version "6.0.2" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-6.0.2.tgz#6d237d99083950c79290f24c7642a3de9a28f9e3" @@ -5573,10 +5219,17 @@ glob-parent@^6.0.2: dependencies: is-glob "^4.0.3" +glob-parent@~5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" + integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== + dependencies: + is-glob "^4.0.1" + glob@^10.3.10: - version "10.4.5" - resolved "https://registry.yarnpkg.com/glob/-/glob-10.4.5.tgz#f4d9f0b90ffdbab09c9d77f5f29b4262517b0956" - integrity sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg== + version "10.5.0" + resolved "https://registry.yarnpkg.com/glob/-/glob-10.5.0.tgz#8ec0355919cd3338c28428a23d4f24ecc5fe738c" + integrity sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg== dependencies: foreground-child "^3.1.0" jackspeak "^3.1.2" @@ -5734,7 +5387,7 @@ http-cache-semantics@^4.0.0: resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.2.0.tgz#205f4db64f8562b76a4ff9235aa5279839a09dd5" integrity sha512-dTxcvPXqPvXBQpq5dUr6mEMJX4oIEFv6bwom3FDwKRDsuIjjJGANqhBuoAn9c1RQJIdAKav33ED65E2ys+87QQ== -http-errors@2.0.0, http-errors@^2.0.0: +http-errors@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-2.0.0.tgz#b7774a1486ef73cf7667ac9ae0858c012c57b9d3" integrity sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ== @@ -5745,6 +5398,17 @@ http-errors@2.0.0, http-errors@^2.0.0: statuses "2.0.1" toidentifier "1.0.1" +http-errors@^2.0.0, http-errors@~2.0.0, http-errors@~2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-2.0.1.tgz#36d2f65bc909c8790018dd36fb4d93da6caae06b" + integrity sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ== + dependencies: + depd "~2.0.0" + inherits "~2.0.4" + setprototypeof "~1.2.0" + statuses "~2.0.2" + toidentifier "~1.0.1" + http2-wrapper@^1.0.0-beta.5.2: version "1.0.3" resolved "https://registry.yarnpkg.com/http2-wrapper/-/http2-wrapper-1.0.3.tgz#b8f55e0c1f25d4ebd08b3b0c2c079f9590800b3d" @@ -5766,21 +5430,21 @@ human-signals@^2.1.0: resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0" integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== -iconv-lite@0.4.24: +iconv-lite@^0.7.0, iconv-lite@~0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.7.0.tgz#c50cd80e6746ca8115eb98743afa81aa0e147a3e" + integrity sha512-cf6L2Ds3h57VVmkZe+Pn+5APsT7FpqJtEhhieDCvrE2MK5Qk9MyffgQyuxQTm6BChfeZNtcOLHp9IcWRVcIcBQ== + dependencies: + safer-buffer ">= 2.1.2 < 3.0.0" + +iconv-lite@~0.4.24: version "0.4.24" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== dependencies: safer-buffer ">= 2.1.2 < 3" -iconv-lite@0.6.3, iconv-lite@^0.6.3: - version "0.6.3" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.6.3.tgz#a52f80bf38da1952eb5c681790719871a1a72501" - integrity sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw== - dependencies: - safer-buffer ">= 2.1.2 < 3.0.0" - -ieee754@^1.1.13, ieee754@^1.2.1: +ieee754@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== @@ -5804,9 +5468,9 @@ import-fresh@^3.2.1: resolve-from "^4.0.0" import-in-the-middle@^1.8.1: - version "1.14.2" - resolved "https://registry.yarnpkg.com/import-in-the-middle/-/import-in-the-middle-1.14.2.tgz#283661625a88ff7c0462bd2984f77715c3bc967c" - integrity sha512-5tCuY9BV8ujfOpwtAGgsTx9CGUapcFMEEyByLv1B+v2+6DhAcw+Zr0nhQT7uwaZ7DiourxFEscghOR8e1aPLQw== + version "1.15.0" + resolved "https://registry.yarnpkg.com/import-in-the-middle/-/import-in-the-middle-1.15.0.tgz#9e20827a322bbadaeb5e3bac49ea8f6d4685fdd8" + integrity sha512-bpQy+CrsRmYmoPMAE/0G33iwRqwW4ouqdRg8jgbH3aKuCtOc8lxgmYXg2dMM92CRiGP660EtBcymH/eVUpCSaA== dependencies: acorn "^8.14.0" acorn-import-attributes "^1.9.5" @@ -5834,7 +5498,7 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2, inherits@2.0.4, inherits@^2.0.3, inherits@^2.0.4: +inherits@2, inherits@2.0.4, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== @@ -5848,13 +5512,6 @@ internal-slot@^1.1.0: hasown "^2.0.2" side-channel "^1.1.0" -invariant@^2.2.4: - version "2.2.4" - resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" - integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA== - dependencies: - loose-envify "^1.0.0" - ipaddr.js@1.9.1: version "1.9.1" resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz#bff38543eeb8984825079ff3a2a8e6cbd46781b3" @@ -5919,7 +5576,7 @@ is-callable@^1.2.7: resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.7.tgz#3bc2a85ea742d9e36205dcacdd72ca1fdc51b055" integrity sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA== -is-core-module@^2.13.0, is-core-module@^2.16.0, is-core-module@^2.16.1: +is-core-module@^2.13.0, is-core-module@^2.16.1: version "2.16.1" resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.16.1.tgz#2a98801a849f43e2add644fbb6bc6229b19a4ef4" integrity sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w== @@ -5971,12 +5628,13 @@ is-generator-fn@^2.0.0: integrity sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ== is-generator-function@^1.0.10: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-generator-function/-/is-generator-function-1.1.0.tgz#bf3eeda931201394f57b5dba2800f91a238309ca" - integrity sha512-nPUB5km40q9e8UfN/Zc24eLlzdSf9OfKByBw9CIdw4H1giPMeA0OIJvbchsCu4npfI2QcMVBsGEBHKZ7wLTWmQ== + version "1.1.2" + resolved "https://registry.yarnpkg.com/is-generator-function/-/is-generator-function-1.1.2.tgz#ae3b61e3d5ea4e4839b90bad22b02335051a17d5" + integrity sha512-upqt1SkGkODW9tsGNG5mtXTXtECizwtS2kA161M+gJPc1xdb/Ax629af6YrTwcOeQHbewrPNlE5Dx7kzvXTizA== dependencies: - call-bound "^1.0.3" - get-proto "^1.0.0" + call-bound "^1.0.4" + generator-function "^2.0.0" + get-proto "^1.0.1" has-tostringtag "^1.0.2" safe-regex-test "^1.1.0" @@ -6108,29 +5766,6 @@ isexe@^2.0.0: resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== -iso-url@^1.1.5: - version "1.2.1" - resolved "https://registry.yarnpkg.com/iso-url/-/iso-url-1.2.1.tgz#db96a49d8d9a64a1c889fc07cc525d093afb1811" - integrity sha512-9JPDgCN4B7QPkLtYAAOrEuAWvP9rWvR5offAr0/SeF046wIkglqH3VXgYYP6NcsKslH80UIVgmPqNe3j7tG2ng== - -isomorphic-webcrypto@^2.3.8: - version "2.3.8" - resolved "https://registry.yarnpkg.com/isomorphic-webcrypto/-/isomorphic-webcrypto-2.3.8.tgz#4a7493b486ef072b9f11b6f8fd66adde856e3eec" - integrity sha512-XddQSI0WYlSCjxtm1AI8kWQOulf7hAN3k3DclF1sxDJZqOe0pcsOt675zvWW91cZH9hYs3nlA3Ev8QK5i80SxQ== - dependencies: - "@peculiar/webcrypto" "^1.0.22" - asmcrypto.js "^0.22.0" - b64-lite "^1.3.1" - b64u-lite "^1.0.1" - msrcrypto "^1.5.6" - str2buf "^1.3.0" - webcrypto-shim "^0.1.4" - optionalDependencies: - "@unimodules/core" "*" - "@unimodules/react-native-adapter" "*" - expo-random "*" - react-native-securerandom "^0.1.1" - istanbul-lib-coverage@^3.0.0, istanbul-lib-coverage@^3.2.0: version "3.2.2" resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz#2d166c4b0644d43a39f04bf6c2edd1e585f31756" @@ -6562,7 +6197,7 @@ joi@^17.13.3: "@sideway/formula" "^3.0.1" "@sideway/pinpoint" "^2.0.0" -js-base64@^3.7.6: +js-base64@^3.7.6, js-base64@^3.7.8: version "3.7.8" resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-3.7.8.tgz#af44496bc09fa178ed9c4adf67eb2b46f5c6d2a4" integrity sha512-hNngCeKxIUQiEUN3GPJOkz4wF/YvdUdbNL9hsBcMQTkKzboD7T/q3OYOuuPZLUE6dBxSGpwhk5mwuDud7JVAow== @@ -6572,23 +6207,23 @@ js-sha3@0.8.0: resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.8.0.tgz#b9b7a5da73afad7dedd0f8c463954cbde6818840" integrity sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q== -"js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: +js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== js-yaml@^3.13.1: - version "3.14.1" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537" - integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== + version "3.14.2" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.2.tgz#77485ce1dd7f33c061fd1b16ecea23b55fcb04b0" + integrity sha512-PMSmkqxr106Xa156c2M265Z+FTrPl+oxd/rgOQy2tijQeK5TxQ43psO1ZCwhVOSdnn+RzkzlRz/eY4BgJBYVpg== dependencies: argparse "^1.0.7" esprima "^4.0.0" -js-yaml@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" - integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== +js-yaml@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.1.tgz#854c292467705b699476e1a2decc0c8a3458806b" + integrity sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA== dependencies: argparse "^2.0.1" @@ -6633,13 +6268,6 @@ json-stable-stringify@^1.0.2: jsonify "^0.0.1" object-keys "^1.1.1" -json-text-sequence@~0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/json-text-sequence/-/json-text-sequence-0.3.0.tgz#6603e0ee45da41f949669fd18744b97fb209e6ce" - integrity sha512-7khKIYPKwXQem4lWXfpIN/FEnhztCeRPSxH4qm3fVlqulwujrRDD54xAwDDn/qVKpFtV550+QAkcWJcufzqQuA== - dependencies: - "@sovpro/delimited-stream" "^1.1.0" - json5@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.2.tgz#63d98d60f21b313b77c4d6da18bfa69d80e1d593" @@ -6666,32 +6294,12 @@ jsonify@^0.0.1: resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.1.tgz#2aa3111dae3d34a0f151c63f3a45d995d9420978" integrity sha512-2/Ki0GcmuqSrgFyelQq9M05y7PS0mEwuIzrf3f1fPqkVDVRvZrPZtVSMHxdgo8Aq0sxAOb/cr2aqqA3LeWHVPg== -jsonld-signatures@^11.0.0: - version "11.5.0" - resolved "https://registry.yarnpkg.com/jsonld-signatures/-/jsonld-signatures-11.5.0.tgz#020ad488bd1977c5169de3d2a4cc28a76dec2663" - integrity sha512-Kdto+e8uvY/5u3HYkmAbpy52bplWX9uqS8fmqdCv6oxnCFwCTM0hMt6r4rWqlhw5/aHoCHJIRxwYb4QKGC69Jw== - dependencies: - "@digitalbazaar/security-context" "^1.0.0" - jsonld "^8.0.0" - rdf-canonize "^4.0.1" - serialize-error "^8.1.0" - -jsonld@^8.0.0: - version "8.3.3" - resolved "https://registry.yarnpkg.com/jsonld/-/jsonld-8.3.3.tgz#08cc927833c8684e42319d4697cc8199c0908ffc" - integrity sha512-9YcilrF+dLfg9NTEof/mJLMtbdX1RJ8dbWtJgE00cMOIohb1lIyJl710vFiTaiHTl6ZYODJuBd32xFvUhmv3kg== - dependencies: - "@digitalbazaar/http-client" "^3.4.1" - canonicalize "^1.0.1" - lru-cache "^6.0.0" - rdf-canonize "^3.4.0" - jsonwebtoken@^9.0.2: - version "9.0.2" - resolved "https://registry.yarnpkg.com/jsonwebtoken/-/jsonwebtoken-9.0.2.tgz#65ff91f4abef1784697d40952bb1998c504caaf3" - integrity sha512-PRp66vJ865SSqOlgqS8hujT5U4AOgMfhrwYIuIhfKaoSCZcirrmASQr8CX7cUg+RMih+hgznrjp99o+W4pJLHQ== + version "9.0.3" + resolved "https://registry.yarnpkg.com/jsonwebtoken/-/jsonwebtoken-9.0.3.tgz#6cd57ab01e9b0ac07cb847d53d3c9b6ee31f7ae2" + integrity sha512-MT/xP0CrubFRNLNKvxJ2BYfy53Zkm++5bX9dtuPbqAeQpTVe0MQTFhao8+Cp//EmJp244xt6Drw/GVEGCUj40g== dependencies: - jws "^3.2.2" + jws "^4.0.1" lodash.includes "^4.3.0" lodash.isboolean "^3.0.3" lodash.isinteger "^4.0.4" @@ -6702,21 +6310,21 @@ jsonwebtoken@^9.0.2: ms "^2.1.1" semver "^7.5.4" -jwa@^1.4.1: - version "1.4.2" - resolved "https://registry.yarnpkg.com/jwa/-/jwa-1.4.2.tgz#16011ac6db48de7b102777e57897901520eec7b9" - integrity sha512-eeH5JO+21J78qMvTIDdBXidBd6nG2kZjg5Ohz/1fpa28Z4CcsWUzJ1ZZyFq/3z3N17aZy+ZuBoHljASbL1WfOw== +jwa@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/jwa/-/jwa-2.0.1.tgz#bf8176d1ad0cd72e0f3f58338595a13e110bc804" + integrity sha512-hRF04fqJIP8Abbkq5NKGN0Bbr3JxlQ+qhZufXVr0DvujKy93ZCbXZMHDL4EOtodSbCWxOqR8MS1tXA5hwqCXDg== dependencies: buffer-equal-constant-time "^1.0.1" ecdsa-sig-formatter "1.0.11" safe-buffer "^5.0.1" -jws@^3.2.2: - version "3.2.2" - resolved "https://registry.yarnpkg.com/jws/-/jws-3.2.2.tgz#001099f3639468c9414000e99995fa52fb478304" - integrity sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA== +jws@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/jws/-/jws-4.0.1.tgz#07edc1be8fac20e677b283ece261498bd38f0690" + integrity sha512-EKI/M/yqPncGUUh44xz0PxSidXFr/+r0pA70+gIYhjv+et7yxM+s29Y+VGDkovRofQem0fs7Uvf4+YmAdyRduA== dependencies: - jwa "^1.4.1" + jwa "^2.0.1" safe-buffer "^5.0.1" jwt-decode@^3.1.2: @@ -6766,31 +6374,10 @@ kleur@^3.0.3: resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w== -ky-universal@^0.11.0: - version "0.11.0" - resolved "https://registry.yarnpkg.com/ky-universal/-/ky-universal-0.11.0.tgz#f5edf857865aaaea416a1968222148ad7d9e4017" - integrity sha512-65KyweaWvk+uKKkCrfAf+xqN2/epw1IJDtlyCPxYffFCMR8u1sp2U65NtWpnozYfZxQ6IUzIlvUcw+hQ82U2Xw== - dependencies: - abort-controller "^3.0.0" - node-fetch "^3.2.10" - -ky-universal@^0.8.2: - version "0.8.2" - resolved "https://registry.yarnpkg.com/ky-universal/-/ky-universal-0.8.2.tgz#edc398d54cf495d7d6830aa1ab69559a3cc7f824" - integrity sha512-xe0JaOH9QeYxdyGLnzUOVGK4Z6FGvDVzcXFTdrYA1f33MZdEa45sUDaMBy98xQMcsd2XIBrTXRrRYnegcSdgVQ== - dependencies: - abort-controller "^3.0.0" - node-fetch "3.0.0-beta.9" - -ky@^0.25.1: - version "0.25.1" - resolved "https://registry.yarnpkg.com/ky/-/ky-0.25.1.tgz#0df0bd872a9cc57e31acd5dbc1443547c881bfbc" - integrity sha512-PjpCEWlIU7VpiMVrTwssahkYXX1by6NCT0fhTUX34F3DTinARlgMpriuroolugFPcMgpPWrOW4mTb984Qm1RXA== - -ky@^0.33.3: - version "0.33.3" - resolved "https://registry.yarnpkg.com/ky/-/ky-0.33.3.tgz#bf1ad322a3f2c3428c13cfa4b3af95e6c4a2f543" - integrity sha512-CasD9OCEQSFIam2U8efFK81Yeg8vNMTBUqtMOHlrcWQHqUX3HeCl9Dr31u4toV7emlH8Mymk5+9p0lL6mKb/Xw== +ky@^1.0.1: + version "1.14.1" + resolved "https://registry.yarnpkg.com/ky/-/ky-1.14.1.tgz#16f20b3bf3939abcc04e2a9613f47360fe5f64c9" + integrity sha512-hYje4L9JCmpEQBtudo+v52X5X8tgWXUYyPcxKSuxQNboqufecl9VMWjGiucAFH060AwPXHZuH+WB2rrqfkmafw== leven@^3.1.0: version "3.1.0" @@ -6813,10 +6400,10 @@ levn@~0.3.0: prelude-ls "~1.1.2" type-check "~0.3.2" -libphonenumber-js@^1.10.53: - version "1.12.12" - resolved "https://registry.yarnpkg.com/libphonenumber-js/-/libphonenumber-js-1.12.12.tgz#4715488620178fc81b7082b074a640f95fdc5693" - integrity sha512-aWVR6xXYYRvnK0v/uIwkf5Lthq9Jpn0N8TISW/oDTWlYB2sOimuiLn9Q26aUw4KxkJoiT8ACdiw44Y8VwKFIfQ== +libphonenumber-js@^1.10.53, libphonenumber-js@^1.11.1: + version "1.12.31" + resolved "https://registry.yarnpkg.com/libphonenumber-js/-/libphonenumber-js-1.12.31.tgz#3cdb45641c6b77228dd1238f3d810c3bb5d91199" + integrity sha512-Z3IhgVgrqO1S5xPYM3K5XwbkDasU67/Vys4heW+lfSBALcUZjeIIzI8zCLifY+OCzSq+fpDdywMDa7z+4srJPQ== lines-and-columns@^1.1.6: version "1.2.4" @@ -6902,13 +6489,6 @@ long@^5.0.0: resolved "https://registry.yarnpkg.com/long/-/long-5.3.2.tgz#1d84463095999262d7d7b7f8bfd4a8cc55167f83" integrity sha512-mNAgZ1GmyNhD7AuqnTG3/VQ26o760+ZYBPKjPvugO8+nLbYfX6TVpJPseBvopbdY+qpZ/lKUnmEc1LeZYS3QAA== -loose-envify@^1.0.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" - integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== - dependencies: - js-tokens "^3.0.0 || ^4.0.0" - lowercase-keys@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-2.0.0.tgz#2603e78b7b4b0006cbca2fbcc8a3202558ac9479" @@ -6938,10 +6518,10 @@ lru_map@^0.4.1: resolved "https://registry.yarnpkg.com/lru_map/-/lru_map-0.4.1.tgz#f7b4046283c79fb7370c36f8fca6aee4324b0a98" integrity sha512-I+lBvqMMFfqaV8CJCISjI3wbjmwVu/VyOoU7+qtu9d7ioW5klMgsTTiUOUp+DJvfTTzKXoPbyC6YfgkNcyPSOg== -luxon@^3.5.0: - version "3.7.1" - resolved "https://registry.yarnpkg.com/luxon/-/luxon-3.7.1.tgz#9bd09aa84a56afb00c57ea78a8ec5bd16eb24ec0" - integrity sha512-RkRWjA926cTvz5rAb1BqyWkKbbjzCGchDUIKMCUvNi17j6f6j8uHGDV82Aqcqtzd+icoYpELmG3ksgGiFNNcNg== +luxon@^3.7.2: + version "3.7.2" + resolved "https://registry.yarnpkg.com/luxon/-/luxon-3.7.2.tgz#d697e48f478553cca187a0f8436aff468e3ba0ba" + integrity sha512-vtEhXh/gNjI9Yg1u4jX/0YVPMvxzHuGgCm6tC5kZyb08yjGWGnqAjGJvcXbqQR2P3MyMEFnRbpcdFS6PBcLqew== make-dir@^3.1.0: version "3.1.0" @@ -7006,17 +6586,12 @@ merge-stream@^2.0.0: resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== -merge2@^1.3.0: - version "1.4.1" - resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" - integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== - methods@^1.1.2, methods@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" integrity sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w== -micromatch@^4.0.2, micromatch@^4.0.4, micromatch@^4.0.8: +micromatch@^4.0.2, micromatch@^4.0.4: version "4.0.8" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.8.tgz#d66fa18f3a47076789320b9b1af32bd86d9fa202" integrity sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA== @@ -7042,9 +6617,9 @@ mime-types@^2.1.12, mime-types@~2.1.24, mime-types@~2.1.34: mime-db "1.52.0" mime-types@^3.0.0, mime-types@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-3.0.1.tgz#b1d94d6997a9b32fd69ebaed0db73de8acb519ce" - integrity sha512-xRc4oEhT6eaBpU1XF7AjpOFD+xQmXNB5OVKwp4tqCuBpHLS/ZbBDrc07mYTDqVMg6PfxUjjNp85O6Cd2Z/5HWA== + version "3.0.2" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-3.0.2.tgz#39002d4182575d5af036ffa118100f2524b2e2ab" + integrity sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A== dependencies: mime-db "^1.54.0" @@ -7127,10 +6702,10 @@ minizlib@^2.1.1: minipass "^3.0.0" yallist "^4.0.0" -minizlib@^3.0.1: - version "3.0.2" - resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-3.0.2.tgz#f33d638eb279f664439aa38dc5f91607468cb574" - integrity sha512-oG62iEk+CYt5Xj2YqI5Xi9xWUeZhDI8jjQmC5oThVH5JGCTgIjr7ciJDzC7MBzYd//WvR1OTmP5Q38Q8ShQtVA== +minizlib@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-3.1.0.tgz#6ad76c3a8f10227c9b51d1c9ac8e30b27f5a251c" + integrity sha512-KZxYo1BUkWD2TVFLr0MQoM8vUUigWD3LlD83a/75BqC+4qE0Hb1Vo5v1FgcfaNXvfXzr+5EhQ6ing/CaBijTlw== dependencies: minipass "^7.1.2" @@ -7139,11 +6714,6 @@ mkdirp@^1.0.3, mkdirp@^1.0.4: resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== -mkdirp@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-3.0.1.tgz#e44e4c5607fb279c168241713cc6e0fea9adcb50" - integrity sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg== - module-details-from-path@^1.0.3: version "1.0.4" resolved "https://registry.yarnpkg.com/module-details-from-path/-/module-details-from-path-1.0.4.tgz#b662fdcd93f6c83d3f25289da0ce81c8d9685b94" @@ -7159,11 +6729,6 @@ ms@2.1.3, ms@^2.1.1, ms@^2.1.3: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== -msrcrypto@^1.5.6: - version "1.5.8" - resolved "https://registry.yarnpkg.com/msrcrypto/-/msrcrypto-1.5.8.tgz#be419be4945bf134d8af52e9d43be7fa261f4a1c" - integrity sha512-ujZ0TRuozHKKm6eGbKHfXef7f+esIhEckmThVnz7RNyiOJd7a6MXj2JGBoL9cnPDW+JMG16MoTUh5X+XXjI66Q== - multiformats@^9.4.2: version "9.9.0" resolved "https://registry.yarnpkg.com/multiformats/-/multiformats-9.9.0.tgz#c68354e7d21037a8f1f8833c8ccd68618e8f1d37" @@ -7175,9 +6740,9 @@ nanoid@^3.3.7: integrity sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w== napi-postinstall@^0.3.0: - version "0.3.3" - resolved "https://registry.yarnpkg.com/napi-postinstall/-/napi-postinstall-0.3.3.tgz#93d045c6b576803ead126711d3093995198c6eb9" - integrity sha512-uTp172LLXSxuSYHv/kou+f6KW3SMppU9ivthaVTXian9sOt3XM/zHYHpRZiLgQoxeWfYUnslNWQHF1+G71xcow== + version "0.3.4" + resolved "https://registry.yarnpkg.com/napi-postinstall/-/napi-postinstall-0.3.4.tgz#7af256d6588b5f8e952b9190965d6b019653bbb9" + integrity sha512-PHI5f1O0EP5xJ9gQmFGMS6IZcrVvTjpXjz7Na41gTE7eE2hK11lg04CECCYEEjdc17EV4DO+fkGEtt7TpTaTiQ== natural-compare@^1.4.0: version "1.4.0" @@ -7228,11 +6793,6 @@ node-addon-api@^3.0.0: resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-3.2.1.tgz#81325e0a2117789c0128dab65e7e38f07ceba161" integrity sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A== -node-domexception@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/node-domexception/-/node-domexception-1.0.0.tgz#6888db46a1f71c0b76b3f7555016b63fe64766e5" - integrity sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ== - node-fetch@2, node-fetch@^2.6.7, node-fetch@^2.7.0: version "2.7.0" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d" @@ -7240,23 +6800,6 @@ node-fetch@2, node-fetch@^2.6.7, node-fetch@^2.7.0: dependencies: whatwg-url "^5.0.0" -node-fetch@3.0.0-beta.9: - version "3.0.0-beta.9" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-3.0.0-beta.9.tgz#0a7554cfb824380dd6812864389923c783c80d9b" - integrity sha512-RdbZCEynH2tH46+tj0ua9caUHVWrd/RHnRfvly2EVdqGmI3ndS1Vn/xjm5KuGejDt2RNDQsVRLPNd2QPwcewVg== - dependencies: - data-uri-to-buffer "^3.0.1" - fetch-blob "^2.1.1" - -node-fetch@^3.2.10: - version "3.3.2" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-3.3.2.tgz#d1e889bacdf733b4ff3b2b243eb7a12866a0b78b" - integrity sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA== - dependencies: - data-uri-to-buffer "^4.0.0" - fetch-blob "^3.1.4" - formdata-polyfill "^4.0.10" - node-gyp-build@^4.2.0, node-gyp-build@^4.2.1: version "4.8.4" resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.8.4.tgz#8a70ee85464ae52327772a90d66c6077a900cfc8" @@ -7267,10 +6810,10 @@ node-int64@^0.4.0: resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" integrity sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw== -node-releases@^2.0.19: - version "2.0.19" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.19.tgz#9e445a52950951ec4d177d843af370b411caf314" - integrity sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw== +node-releases@^2.0.27: + version "2.0.27" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.27.tgz#eedca519205cf20f650f61d56b070db111231e4e" + integrity sha512-nmh3lCkYZ3grZvqcCH+fjmQ7X+H0OeZgP40OierEaAptX4XofMh5kwNbWh7lBduUzCcV/8kZ+NDLCwm2iorIlA== nofilter@^3.1.0: version "3.1.0" @@ -7316,7 +6859,7 @@ object-assign@^4, object-assign@^4.1.1: resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" integrity sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg== -object-inspect@^1.10.3, object-inspect@^1.13.3, object-inspect@^1.13.4: +object-inspect@^1.13.3, object-inspect@^1.13.4: version "1.13.4" resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.13.4.tgz#8375265e21bc20d0fa582c22e1b13485d6e00213" integrity sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew== @@ -7367,7 +6910,7 @@ object.values@^1.2.1: define-properties "^1.2.1" es-object-atoms "^1.0.0" -on-finished@2.4.1, on-finished@^2.4.1: +on-finished@2.4.1, on-finished@^2.4.1, on-finished@~2.4.1: version "2.4.1" resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.4.1.tgz#58c8c44116e54845ad57f14ab10b03533184ac3f" integrity sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg== @@ -7420,11 +6963,6 @@ optionator@^0.9.3: type-check "^0.4.0" word-wrap "^1.2.5" -os-tmpdir@~1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" - integrity sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g== - own-keys@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/own-keys/-/own-keys-1.0.1.tgz#e4006910a2bf913585289676eebd6f390cf51358" @@ -7477,7 +7015,7 @@ package-json-from-dist@^1.0.0: resolved "https://registry.yarnpkg.com/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz#4f1471a010827a86f94cfd9b0727e36d267de505" integrity sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw== -pako@^2.0.4, pako@^2.1.0: +pako@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/pako/-/pako-2.1.0.tgz#266cc37f98c7d883545d11335c00fbd4062c9a86" integrity sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug== @@ -7505,24 +7043,23 @@ parseurl@^1.3.3, parseurl@~1.3.3: integrity sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ== patch-package@^8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/patch-package/-/patch-package-8.0.0.tgz#d191e2f1b6e06a4624a0116bcb88edd6714ede61" - integrity sha512-da8BVIhzjtgScwDJ2TtKsfT5JFWz1hYoBl9rUQ1f38MC2HwnEIkK8VN3dKMKcP7P7bvvgzNDbfNHtx3MsQb5vA== + version "8.0.1" + resolved "https://registry.yarnpkg.com/patch-package/-/patch-package-8.0.1.tgz#79d02f953f711e06d1f8949c8a13e5d3d7ba1a60" + integrity sha512-VsKRIA8f5uqHQ7NGhwIna6Bx6D9s/1iXlA1hthBVBEbkq+t4kXD0HHt+rJhf/Z+Ci0F/HCB2hvn0qLdLG+Qxlw== dependencies: "@yarnpkg/lockfile" "^1.1.0" chalk "^4.1.2" ci-info "^3.7.0" cross-spawn "^7.0.3" find-yarn-workspace-root "^2.0.0" - fs-extra "^9.0.0" + fs-extra "^10.0.0" json-stable-stringify "^1.0.2" klaw-sync "^6.0.0" minimist "^1.2.6" open "^7.4.2" - rimraf "^2.6.3" semver "^7.5.3" slash "^2.0.0" - tmp "^0.0.33" + tmp "^0.2.4" yaml "^2.2.2" path-exists@^4.0.0: @@ -7553,16 +7090,16 @@ path-scurry@^1.11.1: lru-cache "^10.2.0" minipass "^5.0.0 || ^6.0.2 || ^7.0.0" -path-to-regexp@0.1.12: +path-to-regexp@^8.0.0: + version "8.3.0" + resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-8.3.0.tgz#aa818a6981f99321003a08987d3cec9c3474cd1f" + integrity sha512-7jdwVIRtsP8MYpdXSwOS0YdD0Du+qOoF/AEPIt88PcCFrZCzx41oxku1jD88hZBwbNUIEfpqvuhjFaMAqMTWnA== + +path-to-regexp@~0.1.12: version "0.1.12" resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.12.tgz#d5e1a12e478a976d432ef3c58d534b9923164bb7" integrity sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ== -path-to-regexp@^8.0.0: - version "8.2.0" - resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-8.2.0.tgz#73990cc29e57a3ff2a0d914095156df5db79e8b4" - integrity sha512-TdrF7fW9Rphjq4RjrW0Kp2AW0Ahwu9sRGTkS6bvDi0SCwZlEZYmcfDbEsTz8RVk0EHIS/Vd1bv3JhG+1xZuAyQ== - pend@~1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/pend/-/pend-1.2.0.tgz#7a57eb550a6783f9115331fcf4663d5c8e007a50" @@ -7578,7 +7115,7 @@ picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.3, picomatch@^2.3.1: resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== -picomatch@^4.0.2: +picomatch@^4.0.3: version "4.0.3" resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-4.0.3.tgz#796c76136d1eead715db1e7bad785dedd695a042" integrity sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q== @@ -7618,9 +7155,9 @@ prettier-linter-helpers@^1.0.0: fast-diff "^1.1.2" prettier@^3.5.3: - version "3.6.2" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.6.2.tgz#ccda02a1003ebbb2bfda6f83a074978f608b9393" - integrity sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ== + version "3.7.4" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.7.4.tgz#d2f8335d4b1cec47e1c8098645411b0c9dff9c0f" + integrity sha512-v6UNi1+3hSlVvv8fSaoUbggEM5VErKmmpGA7Pl3HF8V6uKY7rvClBOJlH6yNwQtfTueNkGVpOv/mtWL9L4bgRA== pretty-format@^29.0.0, pretty-format@^29.7.0: version "29.7.0" @@ -7639,7 +7176,7 @@ prompts@^2.0.1: kleur "^3.0.3" sisteransi "^1.0.5" -protobufjs@^7.2.5, protobufjs@^7.3.0: +protobufjs@^7.3.0, protobufjs@^7.5.3: version "7.5.4" resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-7.5.4.tgz#885d31fe9c4b37f25d1bb600da30b1c5b37d286a" integrity sha512-CvexbZtbov6jW2eXAvLukXjXUW1TzFaivC46BpWc/3BpcCysb5Vffu+B3XHMm8lVEuy2Mm4XGex8hBSg1yapPg== @@ -7696,38 +7233,25 @@ pvtsutils@^1.3.5, pvtsutils@^1.3.6: tslib "^2.8.1" pvutils@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/pvutils/-/pvutils-1.1.3.tgz#f35fc1d27e7cd3dfbd39c0826d173e806a03f5a3" - integrity sha512-pMpnA0qRdFp32b1sJl1wOJNxZLQ2cbQx+k6tjNtZ8CpvVhNqEPRgivZ2WOUev2YMajecdH7ctUPDvEe87nariQ== - -qs@6.13.0: - version "6.13.0" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.13.0.tgz#6ca3bd58439f7e245655798997787b0d88a51906" - integrity sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg== - dependencies: - side-channel "^1.0.6" + version "1.1.5" + resolved "https://registry.yarnpkg.com/pvutils/-/pvutils-1.1.5.tgz#84b0dea4a5d670249aa9800511804ee0b7c2809c" + integrity sha512-KTqnxsgGiQ6ZAzZCVlJH5eOjSnvlyEgx1m8bkRJfOhmGRqfo5KLvmAlACQkrjEtOQ4B7wF9TdSLIs9O90MX9xA== -qs@^6.11.2, qs@^6.14.0: +qs@^6.11.2, qs@^6.14.0, qs@~6.14.0: version "6.14.0" resolved "https://registry.yarnpkg.com/qs/-/qs-6.14.0.tgz#c63fa40680d2c5c941412a0e899c89af60c0a930" integrity sha512-YWWTjgABSKcvs/nWBi9PycY/JiPJqOD4JA6o9Sej2AtvSGarXxKC3OQSk4pAarbdQlKAh5D4FCQkJNkW+GAn3w== dependencies: side-channel "^1.1.0" -query-string@^7.0.1: - version "7.1.3" - resolved "https://registry.yarnpkg.com/query-string/-/query-string-7.1.3.tgz#a1cf90e994abb113a325804a972d98276fe02328" - integrity sha512-hh2WYhq4fi8+b+/2Kg9CEge4fDPvHS534aOOvOZeQ3+Vf2mCFsaFBYj0i+iXcAq6I9Vzp5fjMFBlONvayDC1qg== +query-string@^9.3.1: + version "9.3.1" + resolved "https://registry.yarnpkg.com/query-string/-/query-string-9.3.1.tgz#d0c93e6c7fb7c17bdf04aa09e382114580ede270" + integrity sha512-5fBfMOcDi5SA9qj5jZhWAcTtDfKF5WFdd2uD9nVNlbxVv1baq65aALy6qofpNEGELHvisjjasxQp7BlM9gvMzw== dependencies: - decode-uri-component "^0.2.2" - filter-obj "^1.1.0" - split-on-first "^1.0.0" - strict-uri-encode "^2.0.0" - -queue-microtask@^1.2.2: - version "1.2.3" - resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" - integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== + decode-uri-component "^0.4.1" + filter-obj "^5.1.0" + split-on-first "^3.0.0" quick-lru@^5.1.1: version "5.1.1" @@ -7739,25 +7263,25 @@ range-parser@^1.2.1, range-parser@~1.2.1: resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031" integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg== -raw-body@2.5.2: - version "2.5.2" - resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.5.2.tgz#99febd83b90e08975087e8f1f9419a149366b68a" - integrity sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA== +raw-body@^3.0.1: + version "3.0.2" + resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-3.0.2.tgz#3e3ada5ae5568f9095d84376fd3a49b8fb000a51" + integrity sha512-K5zQjDllxWkf7Z5xJdV0/B0WTNqx6vxG70zJE4N0kBs4LovmEYWJzQGxC9bS9RAKu3bgM40lrd5zoLJ12MQ5BA== dependencies: - bytes "3.1.2" - http-errors "2.0.0" - iconv-lite "0.4.24" - unpipe "1.0.0" + bytes "~3.1.2" + http-errors "~2.0.1" + iconv-lite "~0.7.0" + unpipe "~1.0.0" -raw-body@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-3.0.0.tgz#25b3476f07a51600619dae3fe82ddc28a36e5e0f" - integrity sha512-RmkhL8CAyCRPXCE28MMH0z2PNWQBNk2Q09ZdxM9IOOXwxwZbN+qbWaatPkdkWIKL2ZVDImrN/pK5HTRz2PcS4g== +raw-body@~2.5.3: + version "2.5.3" + resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.5.3.tgz#11c6650ee770a7de1b494f197927de0c923822e2" + integrity sha512-s4VSOf6yN0rvbRZGxs8Om5CWj6seneMwK3oDb4lWDH0UPhWcxwOWw5+qk24bxq87szX1ydrwylIOp2uG1ojUpA== dependencies: - bytes "3.1.2" - http-errors "2.0.0" - iconv-lite "0.6.3" - unpipe "1.0.0" + bytes "~3.1.2" + http-errors "~2.0.1" + iconv-lite "~0.4.24" + unpipe "~1.0.0" rdf-canonize@^3.4.0: version "3.4.0" @@ -7766,25 +7290,11 @@ rdf-canonize@^3.4.0: dependencies: setimmediate "^1.0.5" -rdf-canonize@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/rdf-canonize/-/rdf-canonize-4.0.1.tgz#2b5a37f147d35b484b40ff2140245fc5985a9595" - integrity sha512-B5ynHt4sasbUafzrvYI2GFARgeFcD8Sx9yXPbg7gEyT2EH76rlCv84kyO6tnxzVbxUN/uJDbK1S/MXh+DsnuTA== - dependencies: - setimmediate "^1.0.5" - react-is@^18.0.0: version "18.3.1" resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.3.1.tgz#e83557dc12eae63a99e003a46388b1dcbb44db7e" integrity sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg== -react-native-securerandom@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/react-native-securerandom/-/react-native-securerandom-0.1.1.tgz#f130623a412c338b0afadedbc204c5cbb8bf2070" - integrity sha512-CozcCx0lpBLevxiXEb86kwLRalBCHNjiGPlw3P7Fi27U6ZLdfjOCNRHD1LtBKcvPvI3TvkBXB3GOtLvqaYJLGw== - dependencies: - base64-js "*" - readable-stream@^3.6.0: version "3.6.2" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.2.tgz#56a9b36ea965c00c5a93ef31eb111a0f11056967" @@ -7816,12 +7326,7 @@ ref-struct-di@1.1.1, ref-struct-di@^1.1.0, ref-struct-di@^1.1.1: dependencies: debug "^3.1.0" -reflect-metadata@^0.1.13: - version "0.1.14" - resolved "https://registry.yarnpkg.com/reflect-metadata/-/reflect-metadata-0.1.14.tgz#24cf721fe60677146bb77eeb0e1f9dece3d65859" - integrity sha512-ZhYeb6nRaXCfhnndflDK8qI6ZQ/YcWZCISRAWICW9XYqMUwjZM9Z0DveWX/ABN01oxSHwVxKQmxeYZSsm0jh5A== - -reflect-metadata@^0.2.2: +reflect-metadata@0.2.2, reflect-metadata@^0.2.2: version "0.2.2" resolved "https://registry.yarnpkg.com/reflect-metadata/-/reflect-metadata-0.2.2.tgz#400c845b6cba87a21f2c65c4aeb158f4fa4d9c5b" integrity sha512-urBwgfrvVP/eAyXx4hluJivBKzuEbSQs9rKWCrCkbSxNv8mxPcUZKeuoF3Uy4mJl3Lwprp6yy5/39VWigZ4K6Q== @@ -7904,11 +7409,11 @@ resolve.exports@^2.0.0: integrity sha512-OcXjMsGdhL4XnbShKpAcSqPMzQoYkYyhbEaeSko47MjRP9NfEQMhZkXL1DoFlt9LWQn4YttrdnV6X2OiyzBi+A== resolve@^1.0.0, resolve@^1.20.0, resolve@^1.22.4, resolve@^1.22.8: - version "1.22.10" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.10.tgz#b663e83ffb09bbf2386944736baae803029b8b39" - integrity sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w== + version "1.22.11" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.11.tgz#aad857ce1ffb8bfa9b0b1ac29f1156383f68c262" + integrity sha512-RfqAvLnMl313r7c9oclB1HhUEAezcpLjz95wFH4LVuhk9JF/r22qmVP9AMmOU4vMX7Q8pN8jwNg/CSpdFnMjTQ== dependencies: - is-core-module "^2.16.0" + is-core-module "^2.16.1" path-parse "^1.0.7" supports-preserve-symlinks-flag "^1.0.0" @@ -7919,12 +7424,7 @@ responselike@^2.0.0: dependencies: lowercase-keys "^2.0.0" -reusify@^1.0.4: - version "1.1.0" - resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.1.0.tgz#0fe13b9522e1473f51b558ee796e08f11f9b489f" - integrity sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw== - -rimraf@^2.6.1, rimraf@^2.6.3: +rimraf@^2.6.1: version "2.7.1" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w== @@ -7949,14 +7449,7 @@ router@^2.2.0: parseurl "^1.3.3" path-to-regexp "^8.0.0" -run-parallel@^1.1.9: - version "1.2.0" - resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee" - integrity sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA== - dependencies: - queue-microtask "^1.2.2" - -rxjs@^7.8.0, rxjs@^7.8.2: +rxjs@^7.8.2: version "7.8.2" resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.8.2.tgz#955bc473ed8af11a002a2be52071bf475638607b" integrity sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA== @@ -8011,10 +7504,10 @@ semver@^6.0.0, semver@^6.3.0, semver@^6.3.1: resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== -semver@^7.3.5, semver@^7.5.3, semver@^7.5.4, semver@^7.6.0, semver@^7.7.1, semver@^7.7.2: - version "7.7.2" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.7.2.tgz#67d99fdcd35cec21e6f8b87a7fd515a33f982b58" - integrity sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA== +semver@^7.3.5, semver@^7.5.3, semver@^7.5.4, semver@^7.6.0, semver@^7.7.1, semver@^7.7.3: + version "7.7.3" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.7.3.tgz#4b5f4143d007633a8dc671cd0a6ef9147b8bb946" + integrity sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q== send@0.19.0: version "0.19.0" @@ -8052,23 +7545,32 @@ send@^1.1.0, send@^1.2.0: range-parser "^1.2.1" statuses "^2.0.1" -serialize-error@^8.0.1, serialize-error@^8.1.0: +send@~0.19.0: + version "0.19.1" + resolved "https://registry.yarnpkg.com/send/-/send-0.19.1.tgz#1c2563b2ee4fe510b806b21ec46f355005a369f9" + integrity sha512-p4rRk4f23ynFEfcD9LA0xRYngj+IyGiEYyqqOak8kaN0TvNmuxC2dcVeBn62GpCeR2CpWqyHCNScTP91QbAVFg== + dependencies: + debug "2.6.9" + depd "2.0.0" + destroy "1.2.0" + encodeurl "~2.0.0" + escape-html "~1.0.3" + etag "~1.8.1" + fresh "0.5.2" + http-errors "2.0.0" + mime "1.6.0" + ms "2.1.3" + on-finished "2.4.1" + range-parser "~1.2.1" + statuses "2.0.1" + +serialize-error@^8.0.1: version "8.1.0" resolved "https://registry.yarnpkg.com/serialize-error/-/serialize-error-8.1.0.tgz#3a069970c712f78634942ddd50fbbc0eaebe2f67" integrity sha512-3NnuWfM6vBYoy5gZFvHiYsVbafvI9vZv/+jlIigFn4oP4zjNPK3LhcY0xSCgeb1a5L8jO71Mit9LlNoi2UfDDQ== dependencies: type-fest "^0.20.2" -serve-static@1.16.2: - version "1.16.2" - resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.16.2.tgz#b6a5343da47f6bdd2673848bf45754941e803296" - integrity sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw== - dependencies: - encodeurl "~2.0.0" - escape-html "~1.0.3" - parseurl "~1.3.3" - send "0.19.0" - serve-static@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-2.2.0.tgz#9c02564ee259bdd2251b82d659a2e7e1938d66f9" @@ -8079,6 +7581,16 @@ serve-static@^2.2.0: parseurl "^1.3.3" send "^1.2.0" +serve-static@~1.16.2: + version "1.16.2" + resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.16.2.tgz#b6a5343da47f6bdd2673848bf45754941e803296" + integrity sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw== + dependencies: + encodeurl "~2.0.0" + escape-html "~1.0.3" + parseurl "~1.3.3" + send "0.19.0" + set-blocking@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" @@ -8120,7 +7632,7 @@ setimmediate@^1.0.5: resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" integrity sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA== -setprototypeof@1.2.0: +setprototypeof@1.2.0, setprototypeof@~1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424" integrity sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw== @@ -8166,7 +7678,7 @@ side-channel-weakmap@^1.0.2: object-inspect "^1.13.3" side-channel-map "^1.0.1" -side-channel@^1.0.6, side-channel@^1.1.0: +side-channel@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.1.0.tgz#c3fcff9c4da932784873335ec9765fa94ff66bc9" integrity sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw== @@ -8232,10 +7744,10 @@ source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== -split-on-first@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/split-on-first/-/split-on-first-1.1.0.tgz#f610afeee3b12bce1d0c30425e76398b78249a5f" - integrity sha512-43ZssAJaMusuKWL8sKUBQXHWOpq8d6CfN/u1p4gUzfJkM05C8rxTmYrkIPTXapZpORA6LkkzcUulJ8FqA7Uudw== +split-on-first@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/split-on-first/-/split-on-first-3.0.0.tgz#f04959c9ea8101b9b0bbf35a61b9ebea784a23e7" + integrity sha512-qxQJTx2ryR0Dw0ITYyekNQWpz6f8dGd7vffGNflQQ3Iqj9NJ6qiZ7ELpZsJ/QBhIVAiDfXdag3+Gp8RvWa62AA== sprintf-js@~1.0.2: version "1.0.3" @@ -8266,7 +7778,7 @@ statuses@2.0.1: resolved "https://registry.yarnpkg.com/statuses/-/statuses-2.0.1.tgz#55cb000ccf1d48728bd23c685a063998cf1a1b63" integrity sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ== -statuses@^2.0.1: +statuses@^2.0.1, statuses@~2.0.1, statuses@~2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/statuses/-/statuses-2.0.2.tgz#8f75eecef765b5e1cfcdc080da59409ed424e382" integrity sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw== @@ -8279,16 +7791,6 @@ stop-iteration-iterator@^1.1.0: es-errors "^1.3.0" internal-slot "^1.1.0" -str2buf@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/str2buf/-/str2buf-1.3.0.tgz#a4172afff4310e67235178e738a2dbb573abead0" - integrity sha512-xIBmHIUHYZDP4HyoXGHYNVmxlXLXDrtFHYT0eV6IOdEj3VO9ccaF1Ejl9Oq8iFjITllpT8FhaXb4KsNmw+3EuA== - -strict-uri-encode@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz#b9c7330c7042862f6b142dc274bbcc5866ce3546" - integrity sha512-QwiXZgpRcKkhTj2Scnn++4PKtWsH0kpzZ62L2R6c/LUVYv7hVnZqcg2+sMuT6R7Jusu1vviK/MFsu6kNJfWlEQ== - string-length@^4.0.1: version "4.0.2" resolved "https://registry.yarnpkg.com/string-length/-/string-length-4.0.2.tgz#a8a8dc7bd5c1a82b9b3c8b87e125f66871b6e57a" @@ -8378,9 +7880,9 @@ strip-ansi@^6.0.0, strip-ansi@^6.0.1: ansi-regex "^5.0.1" strip-ansi@^7.0.1: - version "7.1.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45" - integrity sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ== + version "7.1.2" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.1.2.tgz#132875abde678c7ea8d691533f2e7e22bb744dba" + integrity sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA== dependencies: ansi-regex "^6.0.1" @@ -8452,9 +7954,9 @@ supports-preserve-symlinks-flag@^1.0.0: integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== swagger-ui-dist@>=4.11.0: - version "5.27.1" - resolved "https://registry.yarnpkg.com/swagger-ui-dist/-/swagger-ui-dist-5.27.1.tgz#556e77c659752e99621ac61ad5ef6cb0832279e7" - integrity sha512-oGtpYO3lnoaqyGtlJalvryl7TwzgRuxpOVWqEHx8af0YXI+Kt+4jMpLdgMtMcmWmuQ0QTCHLKExwrBFMSxvAUA== + version "5.30.3" + resolved "https://registry.yarnpkg.com/swagger-ui-dist/-/swagger-ui-dist-5.30.3.tgz#b65d1b689193ded72e6f12692c63e87d7d657b21" + integrity sha512-giQl7/ToPxCqnUAx2wpnSnDNGZtGzw1LyUw6ZitIpTmdrvpxKFY/94v1hihm0zYNpgp1/VY0jTDk//R0BBgnRQ== dependencies: "@scarf/scarf" "=1.4.0" @@ -8496,15 +7998,14 @@ tar@^6.1.11: yallist "^4.0.0" tar@^7.4.3: - version "7.4.3" - resolved "https://registry.yarnpkg.com/tar/-/tar-7.4.3.tgz#88bbe9286a3fcd900e94592cda7a22b192e80571" - integrity sha512-5S7Va8hKfV7W5U6g3aYxXmlPoZVAwUMy9AOKyF2fVuZa2UD3qZjg578OrLRt8PcNN1PleVaL/5/yYATNL0ICUw== + version "7.5.2" + resolved "https://registry.yarnpkg.com/tar/-/tar-7.5.2.tgz#115c061495ec51ff3c6745ff8f6d0871c5b1dedc" + integrity sha512-7NyxrTE4Anh8km8iEy7o0QYPs+0JKBTj5ZaqHg6B39erLg0qYXN3BijtShwbsNSvQ+LN75+KV+C4QR/f6Gwnpg== dependencies: "@isaacs/fs-minipass" "^4.0.0" chownr "^3.0.0" minipass "^7.1.2" - minizlib "^3.0.1" - mkdirp "^3.0.1" + minizlib "^3.1.0" yallist "^5.0.0" test-exclude@^6.0.0: @@ -8516,20 +8017,18 @@ test-exclude@^6.0.0: glob "^7.1.4" minimatch "^3.0.4" -tinyglobby@^0.2.14: - version "0.2.14" - resolved "https://registry.yarnpkg.com/tinyglobby/-/tinyglobby-0.2.14.tgz#5280b0cf3f972b050e74ae88406c0a6a58f4079d" - integrity sha512-tX5e7OM1HnYr2+a2C/4V0htOcSQcoSTH9KgJnVvNm5zm/cyEWKJ7j7YutsH9CxMdtOkkLFy2AHrMci9IM8IPZQ== +tinyglobby@^0.2.14, tinyglobby@^0.2.15: + version "0.2.15" + resolved "https://registry.yarnpkg.com/tinyglobby/-/tinyglobby-0.2.15.tgz#e228dd1e638cea993d2fdb4fcd2d4602a79951c2" + integrity sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ== dependencies: - fdir "^6.4.4" - picomatch "^4.0.2" + fdir "^6.5.0" + picomatch "^4.0.3" -tmp@^0.0.33: - version "0.0.33" - resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" - integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw== - dependencies: - os-tmpdir "~1.0.2" +tmp@^0.2.4: + version "0.2.5" + resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.2.5.tgz#b06bcd23f0f3c8357b426891726d16015abfd8f8" + integrity sha512-voyz6MApa1rQGUxT3E+BK7/ROe8itEx7vD8/HEvt4xwXucvQ5G5oeEiHkmHZJuBO21RpOf+YYm9MOivj709jow== tmpl@1.0.5: version "1.0.5" @@ -8543,7 +8042,7 @@ to-regex-range@^5.0.1: dependencies: is-number "^7.0.0" -toidentifier@1.0.1: +toidentifier@1.0.1, toidentifier@~1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.1.tgz#3be34321a88a820ed1bd80dfaa33e479fbb8dd35" integrity sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA== @@ -8569,9 +8068,9 @@ ts-deepmerge@^7.0.2: integrity sha512-Du/ZW2RfwV/D4cmA5rXafYjBQVuvu4qGiEEla4EmEHVHgRdx68Gftx7i66jn2bzHPwSVZY36Ae6OuDn9el4ZKA== ts-jest@^29.3.4: - version "29.4.1" - resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-29.4.1.tgz#42d33beb74657751d315efb9a871fe99e3b9b519" - integrity sha512-SaeUtjfpg9Uqu8IbeDKtdaS0g8lS6FT6OzM3ezrDfErPJPHNDo/Ey+VFGP1bQIDfagYDLyRpd7O15XpG1Es2Uw== + version "29.4.6" + resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-29.4.6.tgz#51cb7c133f227396818b71297ad7409bb77106e9" + integrity sha512-fSpWtOO/1AjSNQguk43hb/JCo16oJDnMJf3CdEGNkqsEX3t0KX96xvyX1D7PfLCpVoKu4MfVrqUkFyblYoY4lA== dependencies: bs-logger "^0.2.6" fast-json-stable-stringify "^2.1.0" @@ -8579,7 +8078,7 @@ ts-jest@^29.3.4: json5 "^2.2.3" lodash.memoize "^4.1.2" make-error "^1.3.6" - semver "^7.7.2" + semver "^7.7.3" type-fest "^4.41.0" yargs-parser "^21.1.1" @@ -8648,7 +8147,7 @@ tslib@^1.9.3: resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== -tslib@^2.0.0, tslib@^2.1.0, tslib@^2.4.0, tslib@^2.6.2, tslib@^2.7.0, tslib@^2.8.1: +tslib@^2.0.0, tslib@^2.1.0, tslib@^2.4.0, tslib@^2.7.0, tslib@^2.8.1: version "2.8.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.8.1.tgz#612efe4ed235d567e8aba5f2a5fab70280ade83f" integrity sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w== @@ -8709,7 +8208,7 @@ type-fest@^4.41.0: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-4.41.0.tgz#6ae1c8e5731273c2bf1f58ad39cbae2c91a46c58" integrity sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA== -type-is@^2.0.0, type-is@^2.0.1: +type-is@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/type-is/-/type-is-2.0.1.tgz#64f6cf03f92fce4015c2b224793f6bdd4b068c97" integrity sha512-OZs6gsjF4vMp32qrCbiVSkrFmXtG/AZhY3t0iAMrMBiAZyV9oALtXO8hsrHbMXF9x6L3grlFuwW2oAz7cav+Gw== @@ -8777,9 +8276,9 @@ typed-array-length@^1.0.7: reflect.getprototypeof "^1.0.6" typescript@^5.7.2, typescript@^5.8.3: - version "5.9.2" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.9.2.tgz#d93450cddec5154a2d5cabe3b8102b83316fb2a6" - integrity sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A== + version "5.9.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.9.3.tgz#5b4f59e15310ab17a216f5d6cf53ee476ede670f" + integrity sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw== uglify-js@^3.1.4: version "3.19.3" @@ -8813,24 +8312,29 @@ undici-types@~6.21.0: resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.21.0.tgz#691d00af3909be93a7faa13be61b3a5b50ef12cb" integrity sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ== -undici-types@~7.10.0: - version "7.10.0" - resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-7.10.0.tgz#4ac2e058ce56b462b056e629cc6a02393d3ff350" - integrity sha512-t5Fy/nfn+14LuOc2KNYg75vZqClpAiqscVvMygNnlsHBFpSXdJaYtXMcdNLpl/Qvc3P2cB3s6lOV51nqsFq4ag== +undici-types@~7.16.0: + version "7.16.0" + resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-7.16.0.tgz#ffccdff36aea4884cbfce9a750a0580224f58a46" + integrity sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw== -undici@^5.14.0, undici@^5.21.2: +undici@^5.14.0: version "5.29.0" resolved "https://registry.yarnpkg.com/undici/-/undici-5.29.0.tgz#419595449ae3f2cdcba3580a2e8903399bd1f5a3" integrity sha512-raqeBD6NQK4SkWhQzeYKd1KmIG6dllBOTt55Rmkt4HtI9mwdWtJljnrXjAFUBLTSN67HWrOIZ3EPF4kjUw80Bg== dependencies: "@fastify/busboy" "^2.0.0" +undici@^6.6.2: + version "6.22.0" + resolved "https://registry.yarnpkg.com/undici/-/undici-6.22.0.tgz#281adbc157af41da8e75393c9d75a1b788811bc3" + integrity sha512-hU/10obOIu62MGYjdskASR3CUAiYaFTtC9Pa6vHyf//mAipSvSQg6od2CnJswq7fvzNS3zJhxoRkgNVaHurWKw== + universalify@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.1.tgz#168efc2180964e6386d061e094df61afe239b18d" integrity sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw== -unpipe@1.0.0, unpipe@~1.0.0: +unpipe@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" integrity sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ== @@ -8862,10 +8366,10 @@ unrs-resolver@^1.7.11: "@unrs/resolver-binding-win32-ia32-msvc" "1.11.1" "@unrs/resolver-binding-win32-x64-msvc" "1.11.1" -update-browserslist-db@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.1.3.tgz#348377dd245216f9e7060ff50b15a1b740b75420" - integrity sha512-UxhIZQ+QInVdunkDAaiazvvT/+fXL5Osr0JZlJulepYu6Jd7qJtDZjlur0emRlT71EN3ScPoE7gvsuIKKNavKw== +update-browserslist-db@^1.2.0: + version "1.2.2" + resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.2.2.tgz#cfb4358afa08b3d5731a2ecd95eebf4ddef8033e" + integrity sha512-E85pfNzMQ9jpKkA7+TJAi4TJN+tBCuWh5rUcS/sv6cFi+1q9LYDwDI5dpUL0u/73EElyQ8d3TEaeW4sPedBqYA== dependencies: escalade "^3.2.0" picocolors "^1.1.1" @@ -8887,12 +8391,17 @@ utils-merge@1.0.1: resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" integrity sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA== +uuid@^13.0.0: + version "13.0.0" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-13.0.0.tgz#263dc341b19b4d755eb8fe36b78d95a6b65707e8" + integrity sha512-XQegIaBTVUjSHliKqcnFqYypAd4S+WCYt5NIeRs6w/UAry7z8Y9j5ZwRRL4kzq9U3sD6v+85er9FvkEaBpji2w== + "uuid@^7.0.0 || ^8.0.0": version "8.3.2" resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== -uuid@^9.0.0, uuid@^9.0.1: +uuid@^9.0.1: version "9.0.1" resolved "https://registry.yarnpkg.com/uuid/-/uuid-9.0.1.tgz#e188d4c8853cc722220392c424cd637f32293f30" integrity sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA== @@ -8911,15 +8420,15 @@ v8-to-istanbul@^9.0.1: "@types/istanbul-lib-coverage" "^2.0.1" convert-source-map "^2.0.0" -valibot@1.0.0-beta.8: - version "1.0.0-beta.8" - resolved "https://registry.yarnpkg.com/valibot/-/valibot-1.0.0-beta.8.tgz#670bbdef4affd58bb71a5e5bd2fe4d1ea535770f" - integrity sha512-OPAwJZtowb0j91b+bd77+ny7D1VVzsCzD7Jl9waLUlMprTsfI9Y3HHbW3hAQD7wKDKHsmGEesuiYWaYvcZL2wg== +valibot@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/valibot/-/valibot-1.2.0.tgz#8fc720d9e4082ba16e30a914064a39619b2f1d6f" + integrity sha512-mm1rxUsmOxzrwnX5arGS+U4T25RdvpPjPN4yR0u9pUBov9+zGVtO84tif1eY4r6zWxVxu3KzIyknJy3rxfRZZg== -validator@^13.12.0, validator@^13.9.0: - version "13.15.15" - resolved "https://registry.yarnpkg.com/validator/-/validator-13.15.15.tgz#246594be5671dc09daa35caec5689fcd18c6e7e4" - integrity sha512-BgWVbCI72aIQy937xbawcs+hrVaN/CZ2UwutgaJ36hGqRrLNM+f5LUT/YPRbo8IV/ASeFzXszezV+y2+rq3l8A== +validator@^13.12.0, validator@^13.15.20, validator@^13.9.0: + version "13.15.23" + resolved "https://registry.yarnpkg.com/validator/-/validator-13.15.23.tgz#59a874f84e4594588e3409ab1edbe64e96d0c62d" + integrity sha512-4yoz1kEWqUjzi5zsPbAS/903QXSYp0UOtHsPpp7p9rHAw/W+dkInskAE386Fat3oKRROwO98d9ZB0G4cObgUyw== varint@^6.0.0: version "6.0.0" @@ -8938,20 +8447,15 @@ walker@^1.0.8: dependencies: makeerror "1.0.12" -web-did-resolver@^2.0.21: - version "2.0.30" - resolved "https://registry.yarnpkg.com/web-did-resolver/-/web-did-resolver-2.0.30.tgz#5556d9c495b4705055c737dcdff0c9256aebfb51" - integrity sha512-lsv0T+y/zD1bEVkcNfcppk4hQXBlqqoXfYcRG4183Yv53FkY29HNPGErwkNI/AG+lxxsUIR77JqS6pn9uHw/Vw== +web-did-resolver@^2.0.31: + version "2.0.32" + resolved "https://registry.yarnpkg.com/web-did-resolver/-/web-did-resolver-2.0.32.tgz#6c86c1797cd651620aa311a94660e0a51131b334" + integrity sha512-L91/ApTmDjgzS0UDstTKn3kN/1hlQBnVcUN8K29e3xhVBpPktHYC6uvVAQ8ohbIg9D6wrrbaBQvfRArDxgJG2g== dependencies: cross-fetch "^4.1.0" did-resolver "^4.1.0" -web-streams-polyfill@^3.0.3: - version "3.3.3" - resolved "https://registry.yarnpkg.com/web-streams-polyfill/-/web-streams-polyfill-3.3.3.tgz#2073b91a2fdb1fbfbd401e7de0ac9f8214cecb4b" - integrity sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw== - -webcrypto-core@^1.8.0: +webcrypto-core@^1.8.1: version "1.8.1" resolved "https://registry.yarnpkg.com/webcrypto-core/-/webcrypto-core-1.8.1.tgz#09d5bd8a9c48e9fbcaf412e06b1ff1a57514ce86" integrity sha512-P+x1MvlNCXlKbLSOY4cYrdreqPG5hbzkmawbcXLKN/mf6DZW0SdNNkZ+sjwsqVkI4A4Ko2sPZmkZtCKY58w83A== @@ -8962,11 +8466,6 @@ webcrypto-core@^1.8.0: pvtsutils "^1.3.5" tslib "^2.7.0" -webcrypto-shim@^0.1.4: - version "0.1.7" - resolved "https://registry.yarnpkg.com/webcrypto-shim/-/webcrypto-shim-0.1.7.tgz#da8be23061a0451cf23b424d4a9b61c10f091c12" - integrity sha512-JAvAQR5mRNRxZW2jKigWMjCMkjSdmP5cColRP1U/pTg69VgHXEi1orv5vVpJ55Zc5MIaPc1aaurzd9pjv2bveg== - webidl-conversions@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" @@ -9107,7 +8606,7 @@ ws@8.18.0: resolved "https://registry.yarnpkg.com/ws/-/ws-8.18.0.tgz#0d7505a6eafe2b0e712d232b42279f53bc289bbc" integrity sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw== -ws@^8.18.2: +ws@^8.18.2, ws@^8.18.3: version "8.18.3" resolved "https://registry.yarnpkg.com/ws/-/ws-8.18.3.tgz#b56b88abffde62791c639170400c93dcb0c95472" integrity sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg== @@ -9143,9 +8642,9 @@ yaml@^1.10.0: integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg== yaml@^2.2.2, yaml@^2.6.1: - version "2.8.1" - resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.8.1.tgz#1870aa02b631f7e8328b93f8bc574fac5d6c4d79" - integrity sha512-lcYcMxX2PO9XMGvAJkJ3OsNMw+/7FKes7/hgerGUYWIoWu5j/+YQqcZr5JnPZWzOsEBgMbSbiSTn/dv/69Mkpw== + version "2.8.2" + resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.8.2.tgz#5694f25eca0ce9c3e7a9d9e00ce0ddabbd9e35c5" + integrity sha512-mplynKqc1C2hTVYxd0PU2xQAc22TI1vShAYGksCCfxbn/dFwnHTNi1bvYsBTkhdUNtGIf5xNOg938rrSSYvS9A== yargs-parser@^21.1.1: version "21.1.1" @@ -9183,7 +8682,7 @@ yocto-queue@^0.1.0: resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== -zod@^3.23.8, zod@^3.24.1: - version "3.25.76" - resolved "https://registry.yarnpkg.com/zod/-/zod-3.25.76.tgz#26841c3f6fd22a6a2760e7ccb719179768471e34" - integrity sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ== +zod@^4.1.12, zod@^4.1.13: + version "4.1.13" + resolved "https://registry.yarnpkg.com/zod/-/zod-4.1.13.tgz#93699a8afe937ba96badbb0ce8be6033c0a4b6b1" + integrity sha512-AvvthqfqrAhNH9dnfmrfKzX5upOdjUVJYFqNSlkmGf64gRaTzlPwz99IHYnVs28qYAybvAlBV+H7pn0saFY4Ig== From 4d34c2304436081a55dc5fdccf8503b1058c0347 Mon Sep 17 00:00:00 2001 From: Krishna Waske Date: Thu, 11 Dec 2025 12:20:30 +0530 Subject: [PATCH 040/152] fix!: controller types (credo version updates) (#335) * fix: controller for oob, connection and QnA Signed-off-by: Krishna Waske * fix: update to version 0.6.1 Signed-off-by: Krishna Waske * fix: remove unwanted var Signed-off-by: Krishna Waske * fix: static types Signed-off-by: Krishna Waske * fix: remove legacy connection invitation Signed-off-by: Krishna Waske --------- Signed-off-by: Krishna Waske --- package.json | 20 +-- .../connections/ConnectionController.ts | 26 ++-- .../didcomm/outofband/OutOfBandController.ts | 123 ++++++------------ .../QuestionAnswerController.ts | 2 +- src/utils/constant.ts | 2 +- 5 files changed, 62 insertions(+), 111 deletions(-) diff --git a/package.json b/package.json index a89e5d93..c871e74b 100644 --- a/package.json +++ b/package.json @@ -40,15 +40,15 @@ }, "dependencies": { "@ayanworks/credo-polygon-w3c-module": "1.0.1-alpha.1", - "@credo-ts/anoncreds": "0.6.0", - "@credo-ts/askar": "0.6.0", - "@credo-ts/core": "0.6.0", - "@credo-ts/indy-vdr": "0.6.0", - "@credo-ts/node": "^0.6.0", - "@credo-ts/openid4vc": "0.6.0", + "@credo-ts/anoncreds": "0.6.1", + "@credo-ts/askar": "0.6.1", + "@credo-ts/core": "0.6.1", + "@credo-ts/indy-vdr": "0.6.1", + "@credo-ts/node": "0.6.1", + "@credo-ts/openid4vc": "0.6.1", "@credo-ts/push-notifications": "^0.7.1", - "@credo-ts/question-answer": "0.6.0", - "@credo-ts/tenants": "0.6.0", + "@credo-ts/question-answer": "0.6.1", + "@credo-ts/tenants": "0.6.1", "@hyperledger/anoncreds-nodejs": "0.3.1", "@hyperledger/indy-vdr-nodejs": "0.2.2", "@opentelemetry/api": "^1.9.0", @@ -117,7 +117,7 @@ "typescript": "^5.8.3" }, "resolutions": { - "@credo-ts/core": "0.6.0", - "@credo-ts/askar": "0.6.0" + "@credo-ts/core": "0.6.1", + "@credo-ts/askar": "0.6.1" } } diff --git a/src/controllers/didcomm/connections/ConnectionController.ts b/src/controllers/didcomm/connections/ConnectionController.ts index ce6c0ac9..7c6fa5c2 100644 --- a/src/controllers/didcomm/connections/ConnectionController.ts +++ b/src/controllers/didcomm/connections/ConnectionController.ts @@ -1,6 +1,6 @@ -import type { ConnectionRecordProps } from '@credo-ts/didcomm' +import type { DidCommConnectionRecordProps } from '@credo-ts/didcomm' -import { DidExchangeState } from '@credo-ts/didcomm' +import { DidCommDidExchangeState } from '@credo-ts/didcomm' import { Request as Req } from 'express' import { Controller, Delete, Example, Get, Path, Post, Query, Route, Tags, Security, Request } from 'tsoa' import { injectable } from 'tsyringe' @@ -23,20 +23,20 @@ export class ConnectionController extends Controller { * @param theirLabel Their label * @returns ConnectionRecord[] */ - @Example([ConnectionRecordExample]) + @Example([ConnectionRecordExample]) @Security('jwt', [SCOPES.TENANT_AGENT, SCOPES.DEDICATED_AGENT]) @Get('/didcomm/connections') public async getAllConnections( @Request() request: Req, @Query('outOfBandId') outOfBandId?: string, @Query('alias') alias?: string, - @Query('state') state?: DidExchangeState, + @Query('state') state?: DidCommDidExchangeState, @Query('myDid') myDid?: string, @Query('theirDid') theirDid?: string, @Query('theirLabel') theirLabel?: string, ) { try { - const connections = await request.agent.modules.connections.findAllByQuery({ + const connections = await request.agent.modules.didcomm.connections.findAllByQuery({ outOfBandId, alias, myDid, @@ -56,12 +56,12 @@ export class ConnectionController extends Controller { * @param connectionId Connection identifier * @returns ConnectionRecord */ - @Example(ConnectionRecordExample) + @Example(ConnectionRecordExample) @Security('jwt', [SCOPES.TENANT_AGENT, SCOPES.DEDICATED_AGENT]) @Get('/didcomm/connections/:connectionId') public async getConnectionById(@Request() request: Req, @Path('connectionId') connectionId: RecordId) { try { - const connection = await request.agent.modules.connections.findById(connectionId) + const connection = await request.agent.modules.didcomm.connections.findById(connectionId) if (!connection) throw new NotFoundError(`Connection with connection id "${connectionId}" not found.`) @@ -81,7 +81,7 @@ export class ConnectionController extends Controller { public async deleteConnection(@Request() request: Req, @Path('connectionId') connectionId: RecordId) { try { this.setStatus(204) - await request.agent.modules.connections.deleteById(connectionId) + await request.agent.modules.didcomm.connections.deleteById(connectionId) } catch (error) { throw ErrorHandlingService.handle(error) } @@ -96,12 +96,12 @@ export class ConnectionController extends Controller { * @param connectionId Connection identifier * @returns ConnectionRecord */ - @Example(ConnectionRecordExample) + @Example(ConnectionRecordExample) @Security('jwt', [SCOPES.TENANT_AGENT, SCOPES.DEDICATED_AGENT]) @Post('/didcomm/connections/:connectionId/accept-request') public async acceptRequest(@Request() request: Req, @Path('connectionId') connectionId: RecordId) { try { - const connection = await request.agent.modules.connections.acceptRequest(connectionId) + const connection = await request.agent.modules.didcomm.connections.acceptRequest(connectionId) return connection.toJSON() } catch (error) { throw ErrorHandlingService.handle(error) @@ -117,12 +117,12 @@ export class ConnectionController extends Controller { * @param connectionId Connection identifier * @returns ConnectionRecord */ - @Example(ConnectionRecordExample) + @Example(ConnectionRecordExample) @Security('jwt', [SCOPES.TENANT_AGENT, SCOPES.DEDICATED_AGENT]) @Post('/didcomm/connections/:connectionId/accept-response') public async acceptResponse(@Request() request: Req, @Path('connectionId') connectionId: RecordId) { try { - const connection = await request.agent.modules.connections.acceptResponse(connectionId) + const connection = await request.agent.modules.didcomm.connections.acceptResponse(connectionId) return connection.toJSON() } catch (error) { throw ErrorHandlingService.handle(error) @@ -132,7 +132,7 @@ export class ConnectionController extends Controller { @Get('/didcomm/url/:invitationId') public async getInvitation(@Request() request: Req, @Path('invitationId') invitationId: string) { try { - const outOfBandRecord = await request.agent.modules.connections.findByInvitationDid(invitationId) + const outOfBandRecord = await request.agent.modules.didcomm.connections.findByInvitationDid(invitationId) if (!outOfBandRecord) throw new NotFoundError(`connection with invitationId "${invitationId}" not found.`) diff --git a/src/controllers/didcomm/outofband/OutOfBandController.ts b/src/controllers/didcomm/outofband/OutOfBandController.ts index 8af9eea9..22aab3d6 100644 --- a/src/controllers/didcomm/outofband/OutOfBandController.ts +++ b/src/controllers/didcomm/outofband/OutOfBandController.ts @@ -1,28 +1,23 @@ import type { OutOfBandInvitationProps, OutOfBandRecordWithInvitationProps } from '../../examples' -import type { AgentMessageType, RecipientKeyOption, CreateInvitationOptions } from '../../types' +import type { RecipientKeyOption, CreateInvitationOptions, AgentMessageType } from '../../types' import type { PeerDidNumAlgo2CreateOptions, } from '@credo-ts/core' import { - JsonTransformer, - Key, - KeyType, createPeerDidDocumentFromServices, + JsonTransformer, PeerDidNumAlgo, } from '@credo-ts/core' import { - ConnectionRecordProps, - CreateLegacyInvitationConfig, - Routing, - OutOfBandInvitation, - AgentMessage -} from '@credo-ts/didcomm' + DidCommConnectionRecordProps, + DidCommRouting, + DidCommOutOfBandInvitation, + DidCommMessage} from '@credo-ts/didcomm' import { Request as Req } from 'express' import { Body, Controller, Delete, Example, Get, Path, Post, Query, Route, Tags, Security, Request } from 'tsoa' import { injectable } from 'tsyringe' - import { SCOPES } from '../../../enums' import ErrorHandlingService from '../../../errorHandlingService' import { InternalServerError, NotFoundError } from '../../../errors' @@ -48,9 +43,9 @@ export class OutOfBandController extends Controller { invitationId: invitationId, } : {} - const outOfBandRecords = await request.agent.modules.oob.findAllByQuery(query) + const outOfBandRecords = await request.agent.modules.didcomm.oob.findAllByQuery(query) - return outOfBandRecords.map((c) => c.toJSON()) + return outOfBandRecords.map((c: { toJSON: () => any }) => c.toJSON()) } catch (error) { throw ErrorHandlingService.handle(error) } @@ -65,7 +60,7 @@ export class OutOfBandController extends Controller { @Get('/:outOfBandId') public async getOutOfBandRecordById(@Request() request: Req, @Path('outOfBandId') outOfBandId: RecordId) { try { - const outOfBandRecord = await request.agent.modules.oob.findById(outOfBandId) + const outOfBandRecord = await request.agent.modules.didcomm.oob.findById(outOfBandId) if (!outOfBandRecord) throw new NotFoundError(`Out of band record with id "${outOfBandId}" not found.`) @@ -99,21 +94,26 @@ export class OutOfBandController extends Controller { let invitationDid: string | undefined if (config?.invitationDid) { invitationDid = config?.invitationDid - } else { - const didRouting = await request.agent.modules.mediationRecipient.getRouting({}) - const didDocument = createPeerDidDocumentFromServices([ - { - id: 'didcomm', - recipientKeys: [didRouting.recipientKey], - routingKeys: didRouting.routingKeys, - serviceEndpoint: didRouting.endpoints[0], - }, - ]) + } + else { + const didRouting = await request.agent.modules.didcomm.mediationRecipient.getRouting({}) + const { didDocument, keys } = createPeerDidDocumentFromServices( + [ + { + id: 'didcomm', + recipientKeys: [didRouting.recipientKey], + routingKeys: didRouting.routingKeys, + serviceEndpoint: didRouting.endpoints[0], + }, + ], + true, + ) const did = await request.agent.dids.create({ didDocument, method: 'peer', options: { numAlgo: PeerDidNumAlgo.MultipleInceptionKeyWithoutDoc, + keys }, }) @@ -124,7 +124,7 @@ export class OutOfBandController extends Controller { } } - const outOfBandRecord = await request.agent.modules.oob.createInvitation({ ...config, invitationDid }) + const outOfBandRecord = await request.agent.modules.didcomm.oob.createInvitation({ ...config, invitationDid }) return { invitationUrl: outOfBandRecord.outOfBandInvitation.toUrl({ domain: request.agent.modules.didcomm.config.endpoints[0], @@ -140,55 +140,6 @@ export class OutOfBandController extends Controller { } } - /** - * Creates an outbound out-of-band record in the same way how `createInvitation` method does it, - * but it also converts out-of-band invitation message to an "legacy" invitation message defined - * in RFC 0160: Connection Protocol and returns it together with out-of-band record. - * - * @param config configuration of how a invitation should be created - * @returns out-of-band record and invitation - */ - @Example<{ invitation: OutOfBandInvitationProps; outOfBandRecord: OutOfBandRecordWithInvitationProps }>({ - invitation: outOfBandInvitationExample, - outOfBandRecord: outOfBandRecordExample, - }) - @Post('/create-legacy-invitation') - public async createLegacyInvitation( - @Request() request: Req, - @Body() config?: Omit & RecipientKeyOption, - ) { - try { - let routing: Routing - if (config?.recipientKey) { - routing = { - endpoints: request.agent.modules.didcomm.config.endpoints, - routingKeys: [], - recipientKey: Key.fromPublicKeyBase58(config.recipientKey, KeyType.Ed25519), - mediatorId: undefined, - } - } else { - routing = await request.agent.modules.mediationRecipient.getRouting({}) - } - const { outOfBandRecord, invitation } = await request.agent.modules.oob.createLegacyInvitation({ - ...config, - routing, - }) - return { - invitationUrl: invitation.toUrl({ - domain: request.agent.modules.didcomm.config.endpoints[0], - useDidSovPrefixWhereAllowed: request.agent.modules.didcomm.config.useDidSovPrefixWhereAllowed, - }), - invitation: invitation.toJSON({ - useDidSovPrefixWhereAllowed: request.agent.modules.didcomm.config.useDidSovPrefixWhereAllowed, - }), - outOfBandRecord: outOfBandRecord.toJSON(), - ...(config?.recipientKey ? {} : { recipientKey: routing.recipientKey.publicKeyBase58 }), - } - } catch (error) { - throw ErrorHandlingService.handle(error) - } - } - /** * Creates a new connectionless legacy invitation. * @@ -210,13 +161,13 @@ export class OutOfBandController extends Controller { recordId: string message: Record; domain: string, - routing?: Routing; + routing?: DidCommRouting; }, ) { try { - const agentMessage = JsonTransformer.fromJSON(config.message, AgentMessage) as AgentMessage + const agentMessage = JsonTransformer.fromJSON(config.message, DidCommMessage) as DidCommMessage - return await request.agent.modules.oob.createLegacyConnectionlessInvitation({ + return await request.agent.modules.didcomm.oob.createLegacyConnectionlessInvitation({ ...config, message: agentMessage, }) @@ -229,11 +180,11 @@ export class OutOfBandController extends Controller { * Creates inbound out-of-band record and assigns out-of-band invitation message to it if the * message is valid. * - * @param invitation either OutOfBandInvitation or ConnectionInvitationMessage + * @param invitation either DidCommOutOfBandInvitation or ConnectionInvitationMessage * @param config config for handling of invitation * @returns out-of-band record and connection record if one has been created. */ - @Example<{ outOfBandRecord: OutOfBandRecordWithInvitationProps; connectionRecord: ConnectionRecordProps }>({ + @Example<{ outOfBandRecord: OutOfBandRecordWithInvitationProps; connectionRecord: DidCommConnectionRecordProps }>({ outOfBandRecord: outOfBandRecordExample, connectionRecord: ConnectionRecordExample, }) @@ -242,8 +193,8 @@ export class OutOfBandController extends Controller { const { invitation, ...config } = invitationRequest try { - const invite = new OutOfBandInvitation({ ...invitation, handshakeProtocols: invitation.handshake_protocols }) - const { outOfBandRecord, connectionRecord } = await request.agent.modules.oob.receiveInvitation(invite, config) + const invite = new DidCommOutOfBandInvitation({ ...invitation, handshakeProtocols: invitation.handshake_protocols }) + const { outOfBandRecord, connectionRecord } = await request.agent.modules.didcomm.oob.receiveInvitation(invite, config) return { outOfBandRecord: outOfBandRecord.toJSON(), @@ -262,7 +213,7 @@ export class OutOfBandController extends Controller { * @param config config for handling of invitation * @returns out-of-band record and connection record if one has been created. */ - @Example<{ outOfBandRecord: OutOfBandRecordWithInvitationProps; connectionRecord: ConnectionRecordProps }>({ + @Example<{ outOfBandRecord: OutOfBandRecordWithInvitationProps; connectionRecord: DidCommConnectionRecordProps }>({ outOfBandRecord: outOfBandRecordExample, connectionRecord: ConnectionRecordExample, }) @@ -278,7 +229,7 @@ export class OutOfBandController extends Controller { // if (linkSecretIds.length === 0) { // await request.agent.modules.anoncreds.createLinkSecret() // } - const { outOfBandRecord, connectionRecord } = await request.agent.modules.oob.receiveInvitationFromUrl( + const { outOfBandRecord, connectionRecord } = await request.agent.modules.didcomm.oob.receiveInvitationFromUrl( invitationUrl, config, ) @@ -295,7 +246,7 @@ export class OutOfBandController extends Controller { * Accept a connection invitation as invitee (by sending a connection request message) for the connection with the specified connection id. * This is not needed when auto accepting of connections is enabled. */ - @Example<{ outOfBandRecord: OutOfBandRecordWithInvitationProps; connectionRecord: ConnectionRecordProps }>({ + @Example<{ outOfBandRecord: OutOfBandRecordWithInvitationProps; connectionRecord: DidCommConnectionRecordProps }>({ outOfBandRecord: outOfBandRecordExample, connectionRecord: ConnectionRecordExample, }) @@ -306,7 +257,7 @@ export class OutOfBandController extends Controller { @Body() acceptInvitationConfig: AcceptInvitationConfig, ) { try { - const { outOfBandRecord, connectionRecord } = await request.agent.modules.oob.acceptInvitation( + const { outOfBandRecord, connectionRecord } = await request.agent.modules.didcomm.oob.acceptInvitation( outOfBandId, acceptInvitationConfig, ) @@ -329,7 +280,7 @@ export class OutOfBandController extends Controller { public async deleteOutOfBandRecord(@Request() request: Req, @Path('outOfBandId') outOfBandId: RecordId) { try { this.setStatus(204) - await request.agent.modules.oob.deleteById(outOfBandId) + await request.agent.modules.didcomm.oob.deleteById(outOfBandId) } catch (error) { throw ErrorHandlingService.handle(error) } diff --git a/src/controllers/didcomm/question-answer/QuestionAnswerController.ts b/src/controllers/didcomm/question-answer/QuestionAnswerController.ts index 5f812efe..845f8d98 100644 --- a/src/controllers/didcomm/question-answer/QuestionAnswerController.ts +++ b/src/controllers/didcomm/question-answer/QuestionAnswerController.ts @@ -39,7 +39,7 @@ export class QuestionAnswerController extends Controller { state, threadId, }) - return questionAnswerRecords.map((record) => record.toJSON()) + return questionAnswerRecords.map((record: { toJSON: () => any }) => record.toJSON()) } catch (error) { throw ErrorHandlingService.handle(error) } diff --git a/src/utils/constant.ts b/src/utils/constant.ts index 643be69a..03741d0a 100644 --- a/src/utils/constant.ts +++ b/src/utils/constant.ts @@ -1 +1 @@ -export const X509_CERTIFICATE_RECORD = 'X509_CERTIFICATE' \ No newline at end of file +export const X509_CERTIFICATE_RECORD = 'X509_CERTIFICATE' From f277ec1cd389e453f1d74fcc6c8d33d31081070f Mon Sep 17 00:00:00 2001 From: Krishna Waske Date: Thu, 11 Dec 2025 17:57:03 +0530 Subject: [PATCH 041/152] fix: agent initialization Signed-off-by: Krishna Waske --- src/cli.ts | 2 +- src/cliAgent.ts | 233 ++++++++++++++++------------------ src/events/WebSocketEvents.ts | 4 +- src/index.ts | 4 +- src/utils/agent.ts | 136 ++++++++++---------- 5 files changed, 181 insertions(+), 198 deletions(-) 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 3121c913..5a9ef7a8 100644 --- a/src/cliAgent.ts +++ b/src/cliAgent.ts @@ -1,18 +1,17 @@ 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 +25,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 +42,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' @@ -66,16 +58,16 @@ import { CustomDocumentLoader } from './utils/customDocumentLoader' 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 = { @@ -84,13 +76,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 { @@ -99,14 +91,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[] @@ -145,20 +137,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({ @@ -167,78 +164,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: isCustomDocumentLoaderEnabled() - ? new W3cCredentialsModule({ - documentLoader: CustomDocumentLoader, - }) - : new W3cCredentialsModule(), + w3cCredentials: new W3cCredentialsModule(), didcomm: new DidCommModule({ - processDidCommMessagesConcurrently: true + processDidCommMessagesConcurrently: true, + anoncreds: new AnonCredsModule({ + registries: [new IndyVdrAnonCredsRegistry()], + anoncreds, + }), + oob: true, + mediationRecipient: true, + messagePickup: true, + 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(), + discovery: new DidCommDiscoverFeaturesModule(), 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({ @@ -246,13 +242,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({ @@ -275,9 +271,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, @@ -290,6 +287,7 @@ const getWithTenantModules = ( autoAcceptCredentials, autoAcceptProofs, walletScheme, + walletConfig ) return { tenants: new TenantsModule({ @@ -344,17 +342,12 @@ 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, + // 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 @@ -424,9 +417,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, @@ -436,9 +430,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, @@ -459,12 +454,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] @@ -472,7 +461,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, @@ -481,8 +470,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/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/utils/agent.ts b/src/utils/agent.ts index 4acfabf7..1cadedfc 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,68 +81,68 @@ 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() From 4e30a5973b25747a4fb3e1d414e27a15dccad30d Mon Sep 17 00:00:00 2001 From: Krishna Waske Date: Thu, 11 Dec 2025 18:01:17 +0530 Subject: [PATCH 042/152] fix: remove unwanted agent backup config Signed-off-by: Krishna Waske --- src/cliAgent.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/cliAgent.ts b/src/cliAgent.ts index 5a9ef7a8..f476cd15 100644 --- a/src/cliAgent.ts +++ b/src/cliAgent.ts @@ -345,9 +345,6 @@ export async function runRestAgent(restConfig: AriesRestConfig) { ...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 From abb255607490cbedcf76ad855555adeb3082ff24 Mon Sep 17 00:00:00 2001 From: Krishna Waske Date: Thu, 11 Dec 2025 18:10:22 +0530 Subject: [PATCH 043/152] fix: oob invitation Signed-off-by: Krishna Waske --- src/utils/agent.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/agent.ts b/src/utils/agent.ts index 1cadedfc..582ff80b 100644 --- a/src/utils/agent.ts +++ b/src/utils/agent.ts @@ -145,7 +145,7 @@ export const setupAgent = async ({ name, endpoints, port }: { name: string; endp 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' })) } From a42b3c203fb941bc6047439f084217f000aa78c0 Mon Sep 17 00:00:00 2001 From: Krishna Waske Date: Mon, 15 Dec 2025 12:14:04 +0530 Subject: [PATCH 044/152] fix: some package version update Signed-off-by: Krishna Waske --- package.json | 4 +- yarn.lock | 170 +++++++++++++++++++++++++-------------------------- 2 files changed, 86 insertions(+), 88 deletions(-) diff --git a/package.json b/package.json index c871e74b..797dd3f6 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/yarn.lock b/yarn.lock index 32efea90..f9bc587c 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", "@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" From 213d3598aeeb36a22c49e3f2413ff84d4dcbc2a9 Mon Sep 17 00:00:00 2001 From: Krishna Waske Date: Mon, 15 Dec 2025 12:16:10 +0530 Subject: [PATCH 045/152] fix: some type changes Signed-off-by: Krishna Waske --- src/controllers/agent/AgentController.ts | 203 +++++++++++------------ src/controllers/types.ts | 27 +-- 2 files changed, 111 insertions(+), 119 deletions(-) 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/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 From 82b612662071143bcbf9ca6cdddda03481f43ef0 Mon Sep 17 00:00:00 2001 From: Krishna Waske Date: Mon, 15 Dec 2025 12:18:52 +0530 Subject: [PATCH 046/152] fix: comment controller for agent to start Signed-off-by: Krishna Waske --- .../CredentialDefinitionController.ts | 258 ++--- .../EndorserTransactionController.ts | 380 +++---- .../anoncreds/schema/SchemaController.ts | 222 ++-- src/controllers/did/DidController.ts | 957 ++++++++++-------- .../basic-messages/BasicMessageController.ts | 108 +- .../credentials/CredentialController.ts | 606 +++++------ .../didcomm/proofs/ProofController.ts | 520 +++++----- .../openid4vc/holder/holder.Controller.ts | 172 ++-- .../openid4vc/holder/holder.service.ts | 501 ++++----- .../issuance-sessions.Controller.ts | 198 ++-- .../issuance-sessions.service.ts | 276 ++--- .../openid4vc/issuers/issuer.Controller.ts | 202 ++-- .../openid4vc/issuers/issuer.service.ts | 114 +-- .../verification-sessions.Controller.ts | 166 +-- .../verification-sessions.service.ts | 416 ++++---- .../verifiers/verifier.Controller.ts | 112 +- .../openid4vc/verifiers/verifier.service.ts | 114 +-- src/controllers/polygon/PolygonController.ts | 274 ++--- src/controllers/x509/x509.Controller.ts | 144 +-- src/controllers/x509/x509.service.ts | 439 ++++---- src/controllers/x509/x509.types.ts | 6 +- 21 files changed, 3156 insertions(+), 3029 deletions(-) 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..193ee075 100644 --- a/src/controllers/did/DidController.ts +++ b/src/controllers/did/DidController.ts @@ -3,13 +3,13 @@ import type { PolygonDidCreateOptions } from '@ayanworks/credo-polygon-w3c-modul import type { DidDocument, KeyDidCreateOptions, PeerDidNumAlgo2CreateOptions } from '@credo-ts/core' import { - KeyType, - TypedArrayEncoder, - DidDocumentBuilder, - getEd25519VerificationKey2018, - getBls12381G2Key2020, - createPeerDidDocumentFromServices, - PeerDidNumAlgo, + TypedArrayEncoder, + DidDocumentBuilder, + getEd25519VerificationKey2018, + createPeerDidDocumentFromServices, + PeerDidNumAlgo, + Kms, + Hasher, } from '@credo-ts/core' import axios from 'axios' import { Request as Req } from 'express' @@ -22,463 +22,586 @@ import { BadRequestError, InternalServerError } from '../../errors' import { AgentType } from '../../types' import { CreateDidResponse, Did, DidRecordExample } from '../examples' import { DidCreate } from '../types' +import { KeyAlgorithm,askar } from '@openwallet-foundation/askar-nodejs' +import { transformPrivateKeyToPrivateJwk, transformSeedToPrivateJwk } from '@credo-ts/askar' + @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') + /** + * 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) + } } - 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, + /** + * Did nym registration + * @body DidCreateOptions + * @returns DidResolutionResult + */ + // @Example(DidRecordExample) + @Example(CreateDidResponse) + @Post('/write') + public async writeDid(@Request() request: Req, @Body() createDidOptions: DidCreate) { + let didRes + + console.log("dsajsa", 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) + } } - return didResponse - } - private async handleIndy(agent: AgentType, createDidOptions: DidCreate) { - let result - if (!createDidOptions.keyType) { - throw new BadRequestError('keyType is required') - } + private async handleDidPeer(agent: AgentType, createDidOptions: DidCreate) { + let didResponse + let did - if (!createDidOptions.network) { - throw new BadRequestError('For indy method network is required') - } - - 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)) + // const did = `did:indy:${endorserNamespace}:${namespaceIdentifier + + 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 }) + + const publicJwk = Kms.PublicJwk.fromPublicJwk(key.publicJwk) + await agent.dids.import({ + did, + keys: [ + { + kmsKeyId: key.keyId, + // TODO: Find what to add here + didDocumentRelativeKeyId: '' + } + ] + }) } - if (didOptions.keyType !== KeyType.Ed25519 && didOptions.keyType !== KeyType.Bls12381g2) { - throw new BadRequestError('Only ed25519 and bls12381g2 key type supported') - } + public async handleKey(agent: AgentType, didOptions: DidCreate) { + let did + let didResponse + let didDocument - 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 - } + 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 !== KeyAlgorithm.Ed25519) { + throw new BadRequestError('Only ed25519 and bls12381g2 key type supported') + } - await agent.dids.import({ - did, - overwrite: true, - didDocument, - }) - return { did, didDocument } - } + if (!didOptions.did) { + console.log("This is inside if") + // Transform seed to private JWK and + // const { privateJwk } = transformSeedToPrivateJwk({ + // type: { + // kty: 'OKP', + // crv: 'Ed25519', + // }, + // seed: TypedArrayEncoder.fromString(didOptions.seed), + // }) + // console.log("This is privateJwk::::::", JSON.stringify(privateJwk)) + + // // Import the key using KMS + // const { keyId } = await agent.kms.importKey({ privateJwk }) + // console.log("This is keyId", keyId) + + // // Create DID using the imported key + // const didResponse = await agent.dids.create({ + // method: 'key', + // options: { + // keyId, + // }, + // }) + const privateJwk = transformPrivateKeyToPrivateJwk({ + privateKey: TypedArrayEncoder.fromString('96213c3d7fc8d4d6754c7a0fd969598e'), + type: { + kty: 'OKP', + crv: 'Ed25519', + }, + }).privateJwk + + const { keyId } = await agent.kms.importKey({ + privateJwk, + }) + + const didResponse = await agent.dids.create({ + method: 'key', + options: { + keyId, + }, + }) + console.log("This is didResponse::::::", JSON.stringify(didResponse)) + + did = `${didResponse.didState.did}` + didDocument = didResponse.didState.didDocument + + // await agent.kms.createKey({ + // keyType: didOptions.keyType, + // seed: TypedArrayEncoder.fromString(didOptions.seed), + // }) + + // didResponse = await agent.dids.create({ + // method: DidMethod.Key, + // options: { + // keyType: KeyAlgorithm.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 + } - public async handlePolygon(agent: AgentType, createDidOptions: DidCreate) { - // need to discuss try catch logic - const { endpoint, network, privatekey } = createDidOptions + console.log('This is did', did) + console.log('This is didDocument', didDocument) - if (!network) { - throw new BadRequestError('Network is required for Polygon method') + await agent.dids.import({ + did, + overwrite: true, + didDocument, + }) + return { did: did, didDocument: didDocument } } - const networkName = network?.split(':')[1] + public async handleWeb(agent: AgentType, didOptions: DidCreate) { + let didDocument: DidDocument + if (!didOptions.domain) { + throw new BadRequestError('For create did:web, domain is required') + } - 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') + 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/x509/x509.Controller.ts b/src/controllers/x509/x509.Controller.ts index 61a412eb..a8e3e4bb 100644 --- a/src/controllers/x509/x509.Controller.ts +++ b/src/controllers/x509/x509.Controller.ts @@ -1,78 +1,78 @@ -import { injectable } from '@credo-ts/core' -import { Request as Req } from 'express' -import { Body, Controller, Post, Route, Tags, Security, Request, Get } from 'tsoa' +// import { injectable } from '@credo-ts/core' +// import { Request as Req } from 'express' +// import { Body, Controller, Post, Route, Tags, Security, Request, Get } from 'tsoa' -import { SCOPES } from '../../enums' -import ErrorHandlingService from '../../errorHandlingService' -import { X509ImportCertificateOptionsDto } from '../types' -import { x509ServiceT } from './x509.service' -import { X509CreateCertificateOptionsDto } from './x509.types' +// import { SCOPES } from '../../enums' +// import ErrorHandlingService from '../../errorHandlingService' +// import { X509ImportCertificateOptionsDto } from '../types' +// import { x509ServiceT } from './x509.service' +// import { X509CreateCertificateOptionsDto } from './x509.types' -@Tags('x509') -@Security('jwt', [SCOPES.TENANT_AGENT, SCOPES.DEDICATED_AGENT]) -@Route('/x509') -@injectable() -export class X509Controller extends Controller { - @Post('/') - public async createX509Certificate( - @Request() request: Req, - @Body() createX509Options: X509CreateCertificateOptionsDto, - ) { - try { - return await x509ServiceT.createCertificate(request, createX509Options) - } catch (error) { - throw ErrorHandlingService.handle(error) - } - } +// @Tags('x509') +// @Security('jwt', [SCOPES.TENANT_AGENT, SCOPES.DEDICATED_AGENT]) +// @Route('/x509') +// @injectable() +// export class X509Controller extends Controller { +// @Post('/') +// public async createX509Certificate( +// @Request() request: Req, +// @Body() createX509Options: X509CreateCertificateOptionsDto, +// ) { +// try { +// return await x509ServiceT.createCertificate(request, createX509Options) +// } catch (error) { +// throw ErrorHandlingService.handle(error) +// } +// } - @Post('/import') - public async ImportX509Certificates( - @Request() request: Req, - @Body() importX509Options: X509ImportCertificateOptionsDto, - ) { - try { - return await x509ServiceT.ImportX509Certificates(request, importX509Options) - } catch (error) { - throw ErrorHandlingService.handle(error) - } - } +// @Post('/import') +// public async ImportX509Certificates( +// @Request() request: Req, +// @Body() importX509Options: X509ImportCertificateOptionsDto, +// ) { +// try { +// return await x509ServiceT.ImportX509Certificates(request, importX509Options) +// } catch (error) { +// throw ErrorHandlingService.handle(error) +// } +// } - @Post('/trusted') - public async addTrustedCertificate( - @Request() request: Req, - @Body() - options: { - certificate: string - }, - ) { - try { - return await x509ServiceT.addTrustedCertificate(request, options) - } catch (error) { - throw ErrorHandlingService.handle(error) - } - } +// @Post('/trusted') +// public async addTrustedCertificate( +// @Request() request: Req, +// @Body() +// options: { +// certificate: string +// }, +// ) { +// try { +// return await x509ServiceT.addTrustedCertificate(request, options) +// } catch (error) { +// throw ErrorHandlingService.handle(error) +// } +// } - @Get('/trusted') - public async getTrustedCertificates(@Request() request: Req) { - try { - return await x509ServiceT.getTrustedCertificates(request) - } catch (error) { - throw ErrorHandlingService.handle(error) - } - } +// @Get('/trusted') +// public async getTrustedCertificates(@Request() request: Req) { +// try { +// return await x509ServiceT.getTrustedCertificates(request) +// } catch (error) { +// throw ErrorHandlingService.handle(error) +// } +// } - @Post('/decode') - public async decodeCertificate( - @Request() request: Req, - @Body() - options: { - certificate: string - }, - ) { - try { - return await x509ServiceT.decodeCertificate(request, options) - } catch (error) { - throw ErrorHandlingService.handle(error) - } - } -} +// @Post('/decode') +// public async decodeCertificate( +// @Request() request: Req, +// @Body() +// options: { +// certificate: string +// }, +// ) { +// try { +// return await x509ServiceT.decodeCertificate(request, options) +// } catch (error) { +// throw ErrorHandlingService.handle(error) +// } +// } +// } diff --git a/src/controllers/x509/x509.service.ts b/src/controllers/x509/x509.service.ts index 94d7d7a6..6bdef914 100644 --- a/src/controllers/x509/x509.service.ts +++ b/src/controllers/x509/x509.service.ts @@ -1,220 +1,219 @@ -import type { X509CreateCertificateOptionsDto } from './x509.types' -import type { BasicX509CreateCertificateConfig, X509ImportCertificateOptionsDto } from '../types' -import type { CredoError, Key } from '@credo-ts/core' -import type { Request as Req } from 'express' - -import { - KeyType, - TypedArrayEncoder, - WalletKeyExistsError, - X509Certificate, - X509ExtendedKeyUsage, - X509KeyUsage, - X509ModuleConfig, - X509Service, - type Agent, -} from '@credo-ts/core' - -import { generateSecretKey, getCertificateValidityForSystem } from '../../utils/helpers' - -import { pemToRawEd25519PrivateKey } from './crypto-util' - -class x509Service { - public async createSelfSignedDCS(createX509Options: BasicX509CreateCertificateConfig, agentReq: Req) { - const agent = agentReq.agent - - const authorityKey = await createKey(agent as Agent, createX509Options.keyType) - const AGENT_HOST = createX509Options.issuerAlternativeNameURL - const AGENT_DNS = AGENT_HOST.replace('https://', '') - const selfSignedx509certificate = await X509Service.createCertificate(agent.context, { - authorityKey: authorityKey, //createX509Options.subjectKey, - issuer: { countryName: createX509Options.countryName, commonName: createX509Options.commonName }, - validity: getCertificateValidityForSystem(false), - extensions: { - subjectKeyIdentifier: { - include: true, - }, - keyUsage: { - usages: [X509KeyUsage.KeyCertSign, X509KeyUsage.CrlSign, X509KeyUsage.DigitalSignature], - markAsCritical: true, - }, - subjectAlternativeName: { - name: [ - { type: 'dns', value: AGENT_DNS }, - { type: 'url', value: AGENT_HOST }, - ], - }, - issuerAlternativeName: { - // biome-ignore lint/style/noNonNullAssertion: - //name: rootCertificate.issuerAlternativeNames!, - name: [ - { type: 'dns', value: AGENT_DNS }, - { type: 'url', value: AGENT_HOST }, - ], - }, - extendedKeyUsage: { - usages: [X509ExtendedKeyUsage.MdlDs], - markAsCritical: true, - }, - basicConstraints: { - ca: true, - pathLenConstraint: 0, - markAsCritical: true, - }, - // TODO: Create revocation list and add URL here - store this in platform - // crlDistributionPoints: { - // urls: [`${"AGENT_HOST"}/crl`], - // }, - }, - }) - - agent.config.logger.info('======= X.509 IACA Self Signed Certificate ===========') - const selfSignedx509certificateBase64 = selfSignedx509certificate.toString('base64') - agent.config.logger.debug('selfSignedx509certificateBase64', { selfSignedx509certificateBase64 }) - return { publicCertificateBase64: selfSignedx509certificateBase64 } - } - - public async createCertificate(agentReq: Req, options: X509CreateCertificateOptionsDto) { - const agent = agentReq.agent - - let authorityKeyID, subjectPublicKeyID - - 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), - }) - } else { - authorityKeyID = await agent.context.wallet.createKey({ - keyType: KeyType.P256, - }) - } - - 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), - }) - } else { - subjectPublicKeyID = await agent.context.wallet.createKey({ - keyType: KeyType.P256, - }) - } - } - - const certificate = await agent.x509.createCertificate({ - authorityKey: authorityKeyID as Key, - subjectPublicKey: (subjectPublicKeyID as Key) ?? undefined, - serialNumber: options.serialNumber, - issuer: options.issuer, - extensions: options.extensions, - subject: options.subject, - validity: options.validity, - }) - - const issuerCertificate = certificate.toString('base64') - return { publicCertificateBase64: issuerCertificate } - } - - public async ImportX509Certificates(agentReq: Req, options: X509ImportCertificateOptionsDto) { - const agent = agentReq.agent - agent.config.logger.debug(`Start validating keys`) - const secretHexKey = await pemToRawEd25519PrivateKey(options.privateKey ?? '') - const privateKey = TypedArrayEncoder.fromHex(secretHexKey) - - agent.config.logger.debug(`Decode certificate`) - const parsedCertificate = X509Service.parseCertificate(agent.context, { - encodedCertificate: options.certificate, - }) - const issuerCertficicate = parsedCertificate.toString('base64') - - try { - const documentSignerKey = await agent.wallet.createKey({ - privateKey: privateKey, - keyType: options.keyType, - }) - - if ( - parsedCertificate.publicKey.keyType !== options.keyType || - !Buffer.from(parsedCertificate.publicKey.publicKey).equals(Buffer.from(documentSignerKey.publicKey)) - ) { - throw new Error(`Key mismatched in provided X509_CERTIFICATE to import`) - } - console.log(`Keys matched with certificate`) - } catch (error) { - // 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, - ) - } else { - agent.config.logger.error(`${JSON.stringify(error)}`) - throw error - } - } - - return { issuerCertficicate } - } - - public addTrustedCertificate( - agentReq: Req, - options: { - certificate: string - }, - ) { - const agent = agentReq.agent - return agent.x509.addTrustedCertificate(options.certificate) - } - - public getTrustedCertificates(agentReq: Req) { - const trustedCertificates = agentReq.agent.context.dependencyManager - .resolve(X509ModuleConfig) - .trustedCertificates?.map((cert) => X509Certificate.fromEncodedCertificate(cert).toString('base64')) // as [string, ...string[]] - - return trustedCertificates - } - - /** - * Parses a base64-encoded X.509 certificate into a X509Certificate - * - * @param issuerAgent {Agent} - * @param options {x509Input} - * @returns - */ - public decodeCertificate( - agentReq: Req, - options: { - certificate: string - }, - ) { - const parsedCertificate = X509Service.parseCertificate(agentReq.agent.context, { - encodedCertificate: options.certificate, - }) - - return parsedCertificate - } -} - -export const x509ServiceT = new x509Service() - -export async function createKey(agent: Agent, keyType: KeyType) { - try { - const seed = await generateSecretKey(keyType === KeyType.P256 ? 64 : 32) - - agent.config.logger.debug(`createKey: got seed ${seed}`) - - const authorityKey = await agent.wallet.createKey({ - keyType: keyType, - seed: TypedArrayEncoder.fromString(seed), - }) - - return authorityKey - } catch (error) { - agent.config.logger.debug(`Error while creating authorityKey`, { message: (error as CredoError).message }) - throw error - } -} +// import type { X509CreateCertificateOptionsDto } from './x509.types' +// import type { BasicX509CreateCertificateConfig, X509ImportCertificateOptionsDto } from '../types' +// import type { CredoError } from '@credo-ts/core' +// import type { Request as Req } from 'express' + +// import { +// TypedArrayEncoder, +// X509Certificate, +// X509ExtendedKeyUsage, +// X509KeyUsage, +// X509ModuleConfig, +// X509Service, +// type Agent, +// } from '@credo-ts/core' + +// import { generateSecretKey, getCertificateValidityForSystem } from '../../utils/helpers' + +// import { pemToRawEd25519PrivateKey } from './crypto-util' +// import { KeyAlgorithm } from '@openwallet-foundation/askar-nodejs' + +// class x509Service { +// public async createSelfSignedDCS(createX509Options: BasicX509CreateCertificateConfig, agentReq: Req) { +// const agent = agentReq.agent + +// const authorityKey = await createKey(agent as Agent, createX509Options.keyType) +// const AGENT_HOST = createX509Options.issuerAlternativeNameURL +// const AGENT_DNS = AGENT_HOST.replace('https://', '') +// const selfSignedx509certificate = await X509Service.createCertificate(agent.context, { +// authorityKey: authorityKey, //createX509Options.subjectKey, +// issuer: { countryName: createX509Options.countryName, commonName: createX509Options.commonName }, +// validity: getCertificateValidityForSystem(false), +// extensions: { +// subjectKeyIdentifier: { +// include: true, +// }, +// keyUsage: { +// usages: [X509KeyUsage.KeyCertSign, X509KeyUsage.CrlSign, X509KeyUsage.DigitalSignature], +// markAsCritical: true, +// }, +// subjectAlternativeName: { +// name: [ +// { type: 'dns', value: AGENT_DNS }, +// { type: 'url', value: AGENT_HOST }, +// ], +// }, +// issuerAlternativeName: { +// // biome-ignore lint/style/noNonNullAssertion: +// //name: rootCertificate.issuerAlternativeNames!, +// name: [ +// { type: 'dns', value: AGENT_DNS }, +// { type: 'url', value: AGENT_HOST }, +// ], +// }, +// extendedKeyUsage: { +// usages: [X509ExtendedKeyUsage.MdlDs], +// markAsCritical: true, +// }, +// basicConstraints: { +// ca: true, +// pathLenConstraint: 0, +// markAsCritical: true, +// }, +// // TODO: Create revocation list and add URL here - store this in platform +// // crlDistributionPoints: { +// // urls: [`${"AGENT_HOST"}/crl`], +// // }, +// }, +// }) + +// agent.config.logger.info('======= X.509 IACA Self Signed Certificate ===========') +// const selfSignedx509certificateBase64 = selfSignedx509certificate.toString('base64') +// agent.config.logger.debug('selfSignedx509certificateBase64', { selfSignedx509certificateBase64 }) +// return { publicCertificateBase64: selfSignedx509certificateBase64 } +// } + +// public async createCertificate(agentReq: Req, options: X509CreateCertificateOptionsDto) { +// const agent = agentReq.agent + +// let authorityKeyID, subjectPublicKeyID + +// agent.config.logger.debug(`createCertificate options:`, options) + +// if (options.authorityKey && options?.authorityKey?.seed) { +// authorityKeyID = await agent.context.wallet.createKey({ +// keyType: options.authorityKey.keyType ?? KeyAlgorithm.EcSecp256r1, +// seed: TypedArrayEncoder.fromString(options.authorityKey.seed), +// }) +// } else { +// authorityKeyID = await agent.context.wallet.createKey({ +// keyType: KeyAlgorithm.EcSecp256r1, +// }) +// } + +// if (options.subjectPublicKey) { +// if (options?.subjectPublicKey?.seed) { +// subjectPublicKeyID = await agent.context.wallet.createKey({ +// keyType: options.subjectPublicKey.keyType ?? KeyAlgorithm.EcSecp256r1, +// seed: TypedArrayEncoder.fromString(options.subjectPublicKey.seed), +// }) +// } else { +// subjectPublicKeyID = await agent.context.wallet.createKey({ +// keyType: KeyAlgorithm.EcSecp256r1, +// }) +// } +// } + +// const certificate = await agent.x509.createCertificate({ +// authorityKey: authorityKeyID as Key, +// subjectPublicKey: (subjectPublicKeyID as Key) ?? undefined, +// serialNumber: options.serialNumber, +// issuer: options.issuer, +// extensions: options.extensions, +// subject: options.subject, +// validity: options.validity, +// }) + +// const issuerCertificate = certificate.toString('base64') +// return { publicCertificateBase64: issuerCertificate } +// } + +// public async ImportX509Certificates(agentReq: Req, options: X509ImportCertificateOptionsDto) { +// const agent = agentReq.agent +// agent.config.logger.debug(`Start validating keys`) +// const secretHexKey = await pemToRawEd25519PrivateKey(options.privateKey ?? '') +// const privateKey = TypedArrayEncoder.fromHex(secretHexKey) + +// agent.config.logger.debug(`Decode certificate`) +// const parsedCertificate = X509Service.parseCertificate(agent.context, { +// encodedCertificate: options.certificate, +// }) +// const issuerCertficicate = parsedCertificate.toString('base64') + +// try { +// const documentSignerKey = await agent.wallet.createKey({ +// privateKey: privateKey, +// keyType: options.keyType, +// }) + +// if ( +// parsedCertificate.publicKey.keyType !== options.keyType || +// !Buffer.from(parsedCertificate.publicKey.publicKey).equals(Buffer.from(documentSignerKey.publicKey)) +// ) { +// throw new Error(`Key mismatched in provided X509_CERTIFICATE to import`) +// } +// console.log(`Keys matched with certificate`) +// } catch (error) { +// // 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, +// ) +// } else { +// agent.config.logger.error(`${JSON.stringify(error)}`) +// throw error +// } +// } + +// return { issuerCertficicate } +// } + +// public addTrustedCertificate( +// agentReq: Req, +// options: { +// certificate: string +// }, +// ) { +// const agent = agentReq.agent +// return agent.x509.addTrustedCertificate(options.certificate) +// } + +// public getTrustedCertificates(agentReq: Req) { +// const trustedCertificates = agentReq.agent.context.dependencyManager +// .resolve(X509ModuleConfig) +// .trustedCertificates?.map((cert) => X509Certificate.fromEncodedCertificate(cert).toString('base64')) // as [string, ...string[]] + +// return trustedCertificates +// } + +// /** +// * Parses a base64-encoded X.509 certificate into a X509Certificate +// * +// * @param issuerAgent {Agent} +// * @param options {x509Input} +// * @returns +// */ +// public decodeCertificate( +// agentReq: Req, +// options: { +// certificate: string +// }, +// ) { +// const parsedCertificate = X509Service.parseCertificate(agentReq.agent.context, { +// encodedCertificate: options.certificate, +// }) + +// return parsedCertificate +// } +// } + +// export const x509ServiceT = new x509Service() + +// export async function createKey(agent: Agent, keyType: KeyAlgorithm) { +// try { +// const seed = await generateSecretKey(keyType === KeyAlgorithm.EcSecp256r1 ? 64 : 32) + +// agent.config.logger.debug(`createKey: got seed ${seed}`) + +// const authorityKey = await agent.kms.createKey({ +// algorithm: keyType, +// seed: TypedArrayEncoder.fromString(seed), +// }) + +// return authorityKey +// } 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..9a0f2f9e 100644 --- a/src/controllers/x509/x509.types.ts +++ b/src/controllers/x509/x509.types.ts @@ -1,4 +1,5 @@ -import type { KeyType, X509ExtendedKeyUsage, X509KeyUsage } from '@credo-ts/core' +import type { X509ExtendedKeyUsage, X509KeyUsage } from '@credo-ts/core' +import { KeyAlgorithm } from '@openwallet-foundation/askar-nodejs' import { Extension, Example } from 'tsoa' @@ -31,7 +32,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?: KeyAlgorithm } export interface NameDto { From 593f5831ee094bfd7657f3e5b8dda2de5211c9ee Mon Sep 17 00:00:00 2001 From: Krishna Waske Date: Mon, 15 Dec 2025 12:21:21 +0530 Subject: [PATCH 047/152] fix: oidc4vc agent changes for building agent Signed-off-by: Krishna Waske --- src/utils/oid4vc-agent.ts | 364 +++++++------------------------------- 1 file changed, 66 insertions(+), 298 deletions(-) diff --git a/src/utils/oid4vc-agent.ts b/src/utils/oid4vc-agent.ts index 672bdf5e..f9a8053d 100644 --- a/src/utils/oid4vc-agent.ts +++ b/src/utils/oid4vc-agent.ts @@ -1,4 +1,7 @@ +// 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 { SdJwtVcHolderBinding } from '@credo-ts/core' import type { OpenId4VcCredentialHolderBinding, OpenId4VcCredentialHolderDidBinding, @@ -8,7 +11,7 @@ import type { OpenId4VciSignW3cCredentials, } from '@credo-ts/openid4vc' -import { DidsApi, X509Service } from '@credo-ts/core' +import { DidsApi, Kms, MdocApi, X509Certificate, X509Service } from '@credo-ts/core' import { ClaimFormat, CredoError, @@ -24,183 +27,31 @@ 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 - }) => { - const issuanceMetadata = issuanceSession.issuanceMetadata - const issuerDid = issuanceMetadata?.['issuerDid'] as string | undefined - const issuerx509certificate = issuanceMetadata?.['issuerx509certificate'] as string[] | undefined - - if (!issuerDid && !issuerx509certificate) { - throw new Error('Either issuerDid or issuerx509certificate must be provided') - } - - let issuerDidUrl: string | undefined = '' - if (issuerDid) { - const didsApi = await agentContext.dependencyManager.resolve(DidsApi) - const didDocument = await didsApi.resolveDidDocument(issuerDid) - - // Set the first verificationMethod as backup, in case we won't find a match - if (!issuerDidUrl && didDocument.verificationMethod?.[0].id) { - issuerDidUrl = didDocument.verificationMethod?.[0].id - } - } - - if (!issuerDidUrl && !issuerx509certificate) { - throw new Error('No matching verification method found') - } - - 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) => c.credentialSupportedId === credentialConfigurationId) - : [] - const credentialConfiguration = supported[credentialConfigurationId] - - 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: issuerDidUrl ?? '', - } - : { method: 'x5c', x5c: trustedCertificates, issuer: 'ISSUER_HOST ' }, - })), - } satisfies OpenId4VciSignSdJwtCredentials - } - - if (credentialConfiguration.format === OpenId4VciCredentialFormatProfile.JwtVcJson) { - for (const holderBinding of holderBindings) { - assertDidBasedHolderBinding(holderBinding) - } - - 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, + holderBinding, issuanceSession, verification, - credentialConfigurationIds, - credentialConfigurationsSupported, + credentialConfigurationId, + credentialConfiguration, 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] - + if (credentialPayload.length === 0) { + throw new Error(`No credential payload found for credentialConfigurationId: ${credentialConfigurationId}`) + } const credential = credentialPayload[0] - let issuerDidVerificationMethod: string | undefined = '' let issuerx509certificate: string[] | undefined @@ -208,14 +59,13 @@ export function getMixedCredentialRequestToCredentialMapper(): OpenId4VciCredent 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') + throw new Error('DID must be provided when using Did as signer method') } } } else if (credential.signerOptions.method === SignerMethod.X5c) { @@ -235,22 +85,25 @@ export function getMixedCredentialRequestToCredentialMapper(): OpenId4VciCredent } 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 } @@ -261,83 +114,53 @@ export function getMixedCredentialRequestToCredentialMapper(): OpenId4VciCredent ) if (!credentialConfiguration.doctype) { - throw new Error( - `'doctype' not found in credential configuration, ${JSON.stringify(credentialConfiguration, null, 2)}`, - ) + throw new Error(`'doctype' not found in credential configuration,`) } - // national id and ICAO default - const namespace = credentialConfiguration.doctype - + const parsedCertificate = X509Service.parseCertificate(agentContext, { + encodedCertificate: issuerx509certificate[0], + }) + parsedCertificate.publicJwk.keyId = credential.signerOptions.keyId return { - credentialConfigurationId, + type: 'credentials', format: ClaimFormat.MsoMdoc, - credentials: holderBindings.map((holderBinding) => ({ - issuerCertificate: issuerx509certificate[0], - holderKey: holderBinding.key, + credentials: holderBinding.keys.map((holderBindingDetails) => ({ + issuerCertificate: parsedCertificate, + holderKey: holderBindingDetails.jwk, ...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) { + if (credentialConfiguration.format === OpenId4VciCredentialFormatProfile.SdJwtDc) { const disclosureFramePayload = credential.disclosureFrame && Object.keys(credential.disclosureFrame).length > 0 ? credential.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) { + if (!issuerDidVerificationMethod && issuerx509certificate && issuerx509certificate.length > 0) { parsedCertificate = X509Service.parseCertificate(agentContext, { encodedCertificate: issuerx509certificate[0], }) + parsedCertificate.publicJwk.keyId = credential.signerOptions.keyId } 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, + format: ClaimFormat.SdJwtDc, + credentials: holderBinding.keys.map((binding) => ({ + payload: credentialPayload[0]?.payload, + holder: + binding.method === 'did' + ? ({ + method: 'did' as const, + didUrl: binding.didUrl, + } as SdJwtVcHolderBinding) + : ({ + method: 'jwk' as const, + jwk: binding.method === 'jwk' ? binding.jwk : {}, + } as SdJwtVcHolderBinding), issuer: issuerDidVerificationMethod ? { method: 'did', @@ -345,11 +168,13 @@ export function getMixedCredentialRequestToCredentialMapper(): OpenId4VciCredent } : { method: 'x5c', - x5c: issuerx509certificate ?? [], - issuer: parsedCertificate.sanUriNames[0], + x5c: [parsedCertificate], + // TODO: Need to check validation for issuer value + // issuer: process.env.AGENT_HOST ?? 'http://localhost:4001', }, disclosureFrame: disclosureFramePayload, })), + type: 'credentials', } satisfies OpenId4VciSignSdJwtCredentials } @@ -357,81 +182,24 @@ export function getMixedCredentialRequestToCredentialMapper(): OpenId4VciCredent } } -function assertDidBasedHolderBinding( - holderBinding: OpenId4VcCredentialHolderBinding, -): asserts holderBinding is OpenId4VcCredentialHolderDidBinding { - if (holderBinding.method !== 'did') { - throw new CredoError('Only did based holder bindings supported for this credential type') - } -} - -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 -} +// function assertDidBasedHolderBinding( +// holderBinding: OpenId4VcCredentialHolderBinding, +// ): asserts holderBinding is OpenId4VcCredentialHolderDidBinding { +// if (holderBinding.method !== 'did') { +// throw new CredoError('Only did based holder bindings supported for this credential type') +// } +// } export async function getTrustedCerts() { try { const response = await fetch(`${process.env.TRUST_LIST_URL}`) - if (!response.ok) { throw new Error(`HTTP error! status: ${response.status}`) } - const data = await response.json() return data as string[] } catch (error) { + // eslint-disable-next-line no-console console.error('Error fetching data:', error) return [] } From 7f72144f37f38269cd33c701efaf35b3c4290231 Mon Sep 17 00:00:00 2001 From: Krishna Waske Date: Mon, 15 Dec 2025 12:21:49 +0530 Subject: [PATCH 048/152] fix: auto generated file changes Signed-off-by: Krishna Waske --- src/routes/routes.ts | 6063 -------------------- src/routes/swagger.json | 11779 +++++++------------------------------- 2 files changed, 2032 insertions(+), 15810 deletions(-) diff --git a/src/routes/routes.ts b/src/routes/routes.ts index b0c9e188..e69de29b 100644 --- a/src/routes/routes.ts +++ b/src/routes/routes.ts @@ -1,6063 +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 - "DisclosureFrame": { - "dataType": "refObject", - "properties": { - "_sd": {"dataType":"array","array":{"dataType":"string"}}, - }, - "additionalProperties": {"dataType":"union","subSchemas":[{"ref":"DisclosureFrame"},{"dataType":"array","array":{"dataType":"string"}},{"dataType":"undefined"}]}, - }, - // WARNING: This 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":"DisclosureFrame"}, - }, - "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":"union","subSchemas":[{"dataType":"nestedObjectLiteral","nestedProperties":{"input_mode":{"dataType":"union","subSchemas":[{"dataType":"enum","enums":["numeric"]},{"dataType":"enum","enums":["text"]}]},"length":{"dataType":"double"},"description":{"dataType":"string"}}},{"dataType":"undefined"}]},"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 - "DcqlDefinition": { - "dataType": "refObject", - "properties": { - "query": {"dataType":"any","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 7c35d65b..5f991327 100644 --- a/src/routes/swagger.json +++ b/src/routes/swagger.json @@ -7,532 +7,359 @@ "requestBodies": {}, "responses": {}, "schemas": { - "KeyType": { + "QuestionAnswerRole": { "enum": [ - "ed25519", - "bls12381g1g2", - "bls12381g1", - "bls12381g2", - "x25519", - "p256", - "p384", - "p521", - "k256" + "questioner", + "responder" ], "type": "string" }, - "AuthorityAndSubjectKeyDto": { - "properties": { - "seed": { - "type": "string", - "example": "my-seed-12345" - }, - "publicKeyBase58": { - "type": "string", - "example": "3yPQbnk6WwLgX8K3JZ4t7vBnJ8XqY2mMpRcD9fNvGtHw" - }, - "keyType": { - "$ref": "#/components/schemas/KeyType", - "example": "p256" - } - }, + "QuestionAnswerState": { + "description": "QuestionAnswer states inferred from RFC 0113.", + "enum": [ + "question-sent", + "question-received", + "answer-received", + "answer-sent" + ], + "type": "string" + }, + "Record_string.unknown_": { + "properties": {}, "type": "object", - "additionalProperties": false + "description": "Construct a type with a set of properties K of type T" + }, + "RecordId": { + "type": "string", + "example": "821f9b26-ad04-4f56-89b6-e2ef9c72b36e" }, - "X509CertificateIssuerAndSubjectOptionsDto": { + "ValidResponse": { "properties": { - "countryName": { - "type": "string", - "example": "US" - }, - "stateOrProvinceName": { - "type": "string", - "example": "California" - }, - "organizationalUnit": { - "type": "string", - "example": "IT Department" - }, - "commonName": { - "type": "string", - "example": "Example Corporation" + "text": { + "type": "string" } }, + "required": [ + "text" + ], "type": "object", "additionalProperties": false }, - "ValidityDto": { + "Record_response.string_": { "properties": { - "notBefore": { - "type": "string", - "format": "date-time", - "example": "2024-01-01T00:00:00.000Z" - }, - "notAfter": { - "type": "string", - "format": "date-time", - "example": "2025-01-01T00:00:00.000Z" + "response": { + "type": "string" } }, - "type": "object", - "additionalProperties": false - }, - "X509KeyUsage": { - "enum": [ - 1, - 2, - 4, - 8, - 16, - 32, - 64, - 128, - 256 + "required": [ + "response" ], - "type": "number" + "type": "object", + "description": "Construct a type with a set of properties K of type T" }, - "KeyUsageDto": { + "DidCommPlaintextMessage": { "properties": { - "usages": { - "items": { - "$ref": "#/components/schemas/X509KeyUsage" - }, - "type": "array", - "example": [ - "digitalSignature", - "keyEncipherment", - "crlSign" - ] + "@type": { + "type": "string" }, - "markAsCritical": { - "type": "boolean", - "example": true + "@id": { + "type": "string" + }, + "~thread": { + "properties": { + "pthid": { + "type": "string" + }, + "thid": { + "type": "string" + } + }, + "type": "object" } }, "required": [ - "usages" + "@type", + "@id" ], "type": "object", - "additionalProperties": false + "additionalProperties": {} }, - "X509ExtendedKeyUsage": { + "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": [ - "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" + "https://didcomm.org/didexchange/1.x", + "https://didcomm.org/connections/1.x" ], "type": "string" }, - "ExtendedKeyUsageDto": { + "DidCommMessage": { + "$ref": "#/components/schemas/DidCommPlaintextMessage" + }, + "PublicJwk_Ed25519PublicJwk_": { + "properties": {}, + "type": "object", + "additionalProperties": false + }, + "DidCommRouting": { "properties": { - "usages": { + "endpoints": { "items": { - "$ref": "#/components/schemas/X509ExtendedKeyUsage" + "type": "string" }, - "type": "array", - "example": [ - "MdlDs", - "ServerAuth", - "ClientAuth" - ] + "type": "array" }, - "markAsCritical": { - "type": "boolean", - "example": true + "recipientKey": { + "$ref": "#/components/schemas/PublicJwk_Ed25519PublicJwk_" + }, + "routingKeys": { + "items": { + "$ref": "#/components/schemas/PublicJwk_Ed25519PublicJwk_" + }, + "type": "array" + }, + "mediatorId": { + "type": "string" } }, "required": [ - "usages" + "endpoints", + "recipientKey", + "routingKeys" ], "type": "object", "additionalProperties": false }, - "AuthorityAndSubjectKeyIdentifierDto": { - "properties": { - "include": { - "type": "boolean", - "example": true + "JsonValue": { + "anyOf": [ + { + "type": "string" }, - "markAsCritical": { - "type": "boolean", - "example": true + { + "type": "number", + "format": "double" + }, + { + "type": "boolean" + }, + { + "$ref": "#/components/schemas/JsonObject" + }, + { + "$ref": "#/components/schemas/JsonArray" } - }, - "required": [ - "include" ], + "nullable": true + }, + "JsonObject": { + "properties": {}, "type": "object", - "additionalProperties": false + "additionalProperties": { + "$ref": "#/components/schemas/JsonValue" + } }, - "GeneralNameType": { - "enum": [ - "dns", - "dn", - "email", - "guid", - "ip", - "url", - "upn", - "id" - ], - "type": "string" + "JsonArray": { + "items": { + "$ref": "#/components/schemas/JsonValue" + }, + "type": "array" }, - "NameDto": { + "Pick_JwsGeneralFormat.Exclude_keyofJwsGeneralFormat.payload__": { "properties": { - "type": { - "$ref": "#/components/schemas/GeneralNameType", - "example": "dns" + "header": { + "$ref": "#/components/schemas/Record_string.unknown_", + "description": "unprotected header" + }, + "signature": { + "type": "string", + "description": "Base64url encoded signature" }, - "value": { + "protected": { "type": "string", - "example": "example.com" + "description": "Base64url encoded protected header" } }, "required": [ - "type", - "value" + "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_" }, - "NameListDto": { + "JwsFlattenedDetachedFormat": { "properties": { - "name": { + "signatures": { "items": { - "$ref": "#/components/schemas/NameDto" + "$ref": "#/components/schemas/JwsDetachedFormat" }, - "type": "array", - "example": [ - { - "type": "dns", - "value": "example.com" - }, - { - "type": "email", - "value": "admin@example.com" - } - ] - }, - "markAsCritical": { - "type": "boolean", - "example": true + "type": "array" } }, "required": [ - "name" + "signatures" ], "type": "object", "additionalProperties": false }, - "BasicConstraintsDto": { + "DidCommAttachmentData": { + "description": "A JSON object that gives access to the actual content of the attachment", "properties": { - "ca": { - "type": "boolean", - "example": false + "base64": { + "type": "string", + "description": "Base64-encoded data, when representing arbitrary content inline instead of via links. Optional." }, - "pathLenConstraint": { - "type": "number", - "format": "double", - "example": 0 + "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." }, - "markAsCritical": { - "type": "boolean", - "example": true - } - }, - "required": [ - "ca" - ], - "type": "object", - "additionalProperties": false - }, - "CrlDistributionPointsDto": { - "properties": { - "urls": { + "links": { "items": { "type": "string" }, "type": "array", - "example": [ - "http://crl.example.com/ca.crl" - ] + "description": "A list of zero or more locations at which the content may be fetched. Optional." }, - "markAsCritical": { - "type": "boolean", - "example": true + "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": [ - "urls" - ], "type": "object", "additionalProperties": false }, - "X509CertificateExtensionsOptionsDto": { + "DidCommAttachment": { + "description": "Represents DIDComm attachment\nhttps://github.com/hyperledger/aries-rfcs/blob/master/concepts/0017-attachments/README.md", "properties": { - "keyUsage": { - "$ref": "#/components/schemas/KeyUsageDto" - }, - "extendedKeyUsage": { - "$ref": "#/components/schemas/ExtendedKeyUsageDto" + "id": { + "type": "string" }, - "authorityKeyIdentifier": { - "$ref": "#/components/schemas/AuthorityAndSubjectKeyIdentifierDto" + "description": { + "type": "string", + "description": "An optional human-readable description of the content." }, - "subjectKeyIdentifier": { - "$ref": "#/components/schemas/AuthorityAndSubjectKeyIdentifierDto" + "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." }, - "issuerAlternativeName": { - "$ref": "#/components/schemas/NameListDto" + "mimeType": { + "type": "string", + "description": "Describes the MIME type of the attached content. Optional but recommended." }, - "subjectAlternativeName": { - "$ref": "#/components/schemas/NameListDto" + "lastmodTime": { + "type": "string", + "format": "date-time", + "description": "A hint about when the content in this attachment was last modified." }, - "basicConstraints": { - "$ref": "#/components/schemas/BasicConstraintsDto" + "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." }, - "crlDistributionPoints": { - "$ref": "#/components/schemas/CrlDistributionPointsDto" + "data": { + "$ref": "#/components/schemas/DidCommAttachmentData" } }, + "required": [ + "id", + "data" + ], "type": "object", "additionalProperties": false }, - "X509CreateCertificateOptionsDto": { + "CreateInvitationOptions": { "properties": { - "authorityKey": { - "$ref": "#/components/schemas/AuthorityAndSubjectKeyDto" + "label": { + "type": "string" }, - "subjectPublicKey": { - "$ref": "#/components/schemas/AuthorityAndSubjectKeyDto" + "alias": { + "type": "string" }, - "serialNumber": { - "type": "string", - "example": "1234567890" + "imageUrl": { + "type": "string" }, - "issuer": { - "anyOf": [ - { - "$ref": "#/components/schemas/X509CertificateIssuerAndSubjectOptionsDto" - }, - { - "type": "string" - } - ] + "goalCode": { + "type": "string" }, - "subject": { - "anyOf": [ - { - "$ref": "#/components/schemas/X509CertificateIssuerAndSubjectOptionsDto" - }, - { - "type": "string" - } - ] + "goal": { + "type": "string" }, - "validity": { - "$ref": "#/components/schemas/ValidityDto" + "handshake": { + "type": "boolean" }, - "extensions": { - "$ref": "#/components/schemas/X509CertificateExtensionsOptionsDto" - } - }, - "required": [ - "issuer" - ], - "type": "object", - "additionalProperties": false - }, - "X509ImportCertificateOptionsDto": { - "properties": { - "certificate": { - "type": "string" + "handshakeProtocols": { + "items": { + "$ref": "#/components/schemas/DidCommHandshakeProtocol" + }, + "type": "array" }, - "privateKey": { - "type": "string" + "messages": { + "items": { + "$ref": "#/components/schemas/DidCommMessage" + }, + "type": "array" }, - "keyType": { - "$ref": "#/components/schemas/KeyType" - } - }, - "required": [ - "certificate", - "keyType" - ], - "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.", - "properties": {}, - "type": "object", - "additionalProperties": false - }, - "Key": { - "properties": { - "publicKey": { - "$ref": "#/components/schemas/Uint8Array" + "multiUseInvitation": { + "type": "boolean" }, - "keyType": { - "$ref": "#/components/schemas/KeyType" - } - }, - "required": [ - "publicKey", - "keyType" - ], - "type": "object", - "additionalProperties": false - }, - "X509Certificate": { - "properties": { - "publicKey": { - "$ref": "#/components/schemas/Key" + "autoAcceptConnection": { + "type": "boolean" + }, + "routing": { + "$ref": "#/components/schemas/DidCommRouting" + }, + "appendedAttachments": { + "items": { + "$ref": "#/components/schemas/DidCommAttachment" + }, + "type": "array" }, - "privateKey": { - "$ref": "#/components/schemas/Uint8Array" + "invitationDid": { + "type": "string" } }, - "required": [ - "publicKey" - ], "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": { - "enum": [ - "createDID" - ], - "type": "string" - }, - "CreateDidOperationOptions": { + "RecipientKeyOption": { "properties": { - "serviceEndpoint": { + "recipientKey": { "type": "string" - }, - "operation": { - "$ref": "#/components/schemas/DidOperation.Create" } }, - "required": [ - "operation" - ], - "type": "object" - }, - "DidOperation.Update": { - "enum": [ - "updateDIDDoc" - ], - "type": "string" - }, - "Record_string.any_": { - "properties": {}, - "additionalProperties": {}, "type": "object", - "description": "Construct a type with a set of properties K of type T" - }, - "DidDocument": { - "$ref": "#/components/schemas/Record_string.any_" - }, - "UpdateDidOperationOptions": { - "properties": { - "did": { - "type": "string" - }, - "didDocument": { - "$ref": "#/components/schemas/DidDocument" - }, - "operation": { - "$ref": "#/components/schemas/DidOperation.Update" - } - }, - "required": [ - "did", - "didDocument", - "operation" - ], - "type": "object" - }, - "DidOperation.Deactivate": { - "enum": [ - "deactivate" - ], - "type": "string" + "additionalProperties": false }, - "DeactivateDidOperationOptions": { - "properties": { - "did": { - "type": "string" - }, - "operation": { - "$ref": "#/components/schemas/DidOperation.Deactivate" - } - }, - "required": [ - "did", - "operation" - ], - "type": "object" + "DidCommOutOfBandRecord": { + "$ref": "#/components/schemas/Record_string.unknown_" }, - "DidOperation.AddResource": { + "CustomHandshakeProtocol": { "enum": [ - "addResource" + "https://didcomm.org/didexchange/1.1", + "https://didcomm.org/connections/1.0" ], "type": "string" }, - "AddResourceDidOperationOptions": { - "properties": { - "did": { - "type": "string" - }, - "resource": { - "additionalProperties": false, - "type": "object" - }, - "resourceId": { - "type": "string" - }, - "operation": { - "$ref": "#/components/schemas/DidOperation.AddResource" - } - }, - "required": [ - "did", - "resource", - "resourceId", - "operation" - ], - "type": "object" - }, - "DidOperationOptions": { + "SingleOrArray_string-or-Record_string.unknown__": { "anyOf": [ { - "$ref": "#/components/schemas/CreateDidOperationOptions" - }, - { - "$ref": "#/components/schemas/UpdateDidOperationOptions" - }, - { - "$ref": "#/components/schemas/DeactivateDidOperationOptions" - }, - { - "$ref": "#/components/schemas/AddResourceDidOperationOptions" - } - ] - }, - "EndorserTransaction": { - "properties": { - "transaction": { "anyOf": [ { "type": "string" @@ -542,566 +369,325 @@ } ] }, - "endorserDid": { - "type": "string" + { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/components/schemas/Record_string.unknown_" + } + ] + }, + "type": "array" } - }, - "required": [ - "transaction", - "endorserDid" - ], - "type": "object", - "additionalProperties": false - }, - "DidRegistrationSecretOptions": { - "$ref": "#/components/schemas/Record_string.unknown_" + ] }, - "DidOperationStateWait": { + "OutOfBandDidCommService": { "properties": { - "state": { - "type": "string", - "enum": [ - "wait" - ], - "nullable": false + "id": { + "type": "string" }, - "did": { + "serviceEndpoint": { "type": "string" }, - "secret": { - "$ref": "#/components/schemas/DidRegistrationSecretOptions" + "type": { + "type": "string" }, - "didDocument": { - "$ref": "#/components/schemas/DidDocument" + "recipientKeys": { + "items": { + "type": "string" + }, + "type": "array" + }, + "routingKeys": { + "items": { + "type": "string" + }, + "type": "array" + }, + "accept": { + "items": { + "type": "string" + }, + "type": "array" } }, "required": [ - "state" + "id", + "serviceEndpoint", + "type", + "recipientKeys" ], "type": "object", "additionalProperties": false }, - "DidOperationStateActionBase": { + "OutOfBandInvitationSchema": { "properties": { - "state": { - "type": "string", - "enum": [ - "action" - ], - "nullable": false - }, - "action": { + "@id": { "type": "string" }, - "did": { + "@type": { "type": "string" }, - "secret": { - "$ref": "#/components/schemas/DidRegistrationSecretOptions" + "label": { + "type": "string" }, - "didDocument": { - "$ref": "#/components/schemas/DidDocument" - } - }, - "required": [ - "state", - "action" - ], - "type": "object", - "additionalProperties": false - }, - "DidOperationStateFinished": { - "properties": { - "state": { - "type": "string", - "enum": [ - "finished" - ], - "nullable": false + "goalCode": { + "type": "string" }, - "did": { + "goal": { "type": "string" }, - "secret": { - "$ref": "#/components/schemas/DidRegistrationSecretOptions" + "accept": { + "items": { + "type": "string" + }, + "type": "array" }, - "didDocument": { - "$ref": "#/components/schemas/DidDocument" + "handshake_protocols": { + "items": { + "$ref": "#/components/schemas/CustomHandshakeProtocol" + }, + "type": "array" + }, + "services": { + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/OutOfBandDidCommService" + }, + { + "type": "string" + } + ] + }, + "type": "array" + }, + "imageUrl": { + "type": "string" } }, "required": [ - "state", - "did", - "didDocument" + "@type", + "label", + "services" ], "type": "object", "additionalProperties": false }, - "DidOperationStateFailed": { + "Pick_ReceiveOutOfBandInvitationConfig.Exclude_keyofReceiveOutOfBandInvitationConfig.routing__": { "properties": { - "state": { - "type": "string", - "enum": [ - "failed" - ], - "nullable": false + "alias": { + "type": "string" }, - "did": { + "label": { "type": "string" }, - "secret": { - "$ref": "#/components/schemas/DidRegistrationSecretOptions" + "imageUrl": { + "type": "string" }, - "didDocument": { - "$ref": "#/components/schemas/DidDocument" + "autoAcceptInvitation": { + "type": "boolean" + }, + "autoAcceptConnection": { + "type": "boolean" + }, + "reuseConnection": { + "type": "boolean" + }, + "acceptInvitationTimeoutMs": { + "type": "number", + "format": "double" }, - "reason": { + "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" }, - "DidRegistrationMetadata": { - "$ref": "#/components/schemas/Record_string.unknown_" + "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." }, - "DidResolutionMetadata": { + "ReceiveInvitationProps": { "properties": { - "contentType": { + "alias": { "type": "string" }, - "error": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "string", - "enum": [ - "invalidDid", - "notFound", - "representationNotSupported", - "unsupportedDidMethod" - ] - } - ] + "label": { + "type": "string" }, - "message": { + "imageUrl": { "type": "string" }, - "servedFromCache": { - "type": "boolean", - "description": "Whether the did document was served from the cache" + "autoAcceptInvitation": { + "type": "boolean" }, - "servedFromDidRecord": { - "type": "boolean", - "description": "Whether the did document was served from a local did record" - } - }, - "type": "object", - "additionalProperties": false - }, - "DidCreateResult_DidOperationStateActionBase_": { - "properties": { - "jobId": { - "type": "string" + "autoAcceptConnection": { + "type": "boolean" }, - "didState": { - "anyOf": [ - { - "$ref": "#/components/schemas/DidOperationStateWait" - }, - { - "$ref": "#/components/schemas/DidOperationStateActionBase" - }, - { - "$ref": "#/components/schemas/DidOperationStateFinished" - }, - { - "$ref": "#/components/schemas/DidOperationStateFailed" - } - ] + "reuseConnection": { + "type": "boolean" }, - "didRegistrationMetadata": { - "$ref": "#/components/schemas/DidRegistrationMetadata" + "acceptInvitationTimeoutMs": { + "type": "number", + "format": "double" }, - "didDocumentMetadata": { - "$ref": "#/components/schemas/DidResolutionMetadata" - } - }, - "required": [ - "didState", - "didRegistrationMetadata", - "didDocumentMetadata" - ], - "type": "object", - "additionalProperties": false - }, - "DidNymTransaction": { - "properties": { - "did": { + "ourDid": { "type": "string" }, - "nymRequest": { - "type": "string" + "invitation": { + "$ref": "#/components/schemas/OutOfBandInvitationSchema" } }, "required": [ - "did", - "nymRequest" + "label", + "invitation" ], "type": "object", "additionalProperties": false }, - "AnonCredsSchema": { + "ReceiveInvitationByUrlProps": { "properties": { - "issuerId": { + "alias": { "type": "string" }, - "name": { + "label": { "type": "string" }, - "version": { + "imageUrl": { "type": "string" }, - "attrNames": { - "items": { - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "issuerId", - "name", - "version", - "attrNames" - ], - "type": "object", - "additionalProperties": false - }, - "RegisterSchemaReturnStateWait": { - "properties": { - "state": { - "type": "string", - "enum": [ - "wait" - ], - "nullable": false + "autoAcceptInvitation": { + "type": "boolean" + }, + "autoAcceptConnection": { + "type": "boolean" + }, + "reuseConnection": { + "type": "boolean" + }, + "acceptInvitationTimeoutMs": { + "type": "number", + "format": "double" }, - "schema": { - "$ref": "#/components/schemas/AnonCredsSchema" + "ourDid": { + "type": "string" }, - "schemaId": { + "invitationUrl": { "type": "string" } }, "required": [ - "state" + "label", + "invitationUrl" ], "type": "object", "additionalProperties": false }, - "RegisterSchemaReturnStateAction": { + "AcceptInvitationConfig": { "properties": { - "state": { - "type": "string", - "enum": [ - "action" - ], - "nullable": false + "autoAcceptConnection": { + "type": "boolean" + }, + "reuseConnection": { + "type": "boolean" + }, + "label": { + "type": "string" }, - "action": { + "alias": { "type": "string" }, - "schema": { - "$ref": "#/components/schemas/AnonCredsSchema" + "imageUrl": { + "type": "string" }, - "schemaId": { + "mediatorId": { "type": "string" } }, "required": [ - "state", - "action", - "schema", - "schemaId" + "label" ], "type": "object", "additionalProperties": false }, - "RegisterSchemaReturnStateFinished": { - "properties": { - "state": { - "type": "string", - "enum": [ - "finished" - ], - "nullable": false - }, - "schema": { - "$ref": "#/components/schemas/AnonCredsSchema" - }, - "schemaId": { - "type": "string" - } - }, - "required": [ - "state", - "schema", - "schemaId" + "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", - "additionalProperties": false + "description": "Construct a type with a set of properties K of type T" }, - "RegisterSchemaReturnStateFailed": { + "DidResolutionMetadata": { "properties": { - "state": { - "type": "string", - "enum": [ - "failed" - ], - "nullable": false - }, - "reason": { + "contentType": { "type": "string" }, - "schema": { - "$ref": "#/components/schemas/AnonCredsSchema" + "error": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "string", + "enum": [ + "invalidDid", + "notFound", + "representationNotSupported", + "unsupportedDidMethod" + ] + } + ] }, - "schemaId": { + "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": [ - "state", - "reason" - ], "type": "object", "additionalProperties": false }, - "AnonCredsCredentialDefinition": { + "DIDDocumentMetadata": { + "description": "Represents metadata about the DID document resulting from a {@link Resolvable.resolve} operation.", "properties": { - "issuerId": { + "created": { "type": "string" }, - "schemaId": { + "updated": { "type": "string" }, - "type": { - "type": "string", - "enum": [ - "CL" - ], - "nullable": false - }, - "tag": { - "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 - }, - "credentialDefinition": { - "$ref": "#/components/schemas/AnonCredsCredentialDefinition" - }, - "credentialDefinitionId": { - "type": "string" - } - }, - "required": [ - "state" - ], - "type": "object", - "additionalProperties": false - }, - "RegisterCredentialDefinitionReturnStateAction": { - "properties": { - "state": { - "type": "string", - "enum": [ - "action" - ], - "nullable": false - }, - "action": { - "type": "string" - }, - "credentialDefinitionId": { - "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 - }, - "credentialDefinition": { - "$ref": "#/components/schemas/AnonCredsCredentialDefinition" - }, - "credentialDefinitionId": { - "type": "string" - } - }, - "required": [ - "state", - "credentialDefinition", - "credentialDefinitionId" - ], - "type": "object", - "additionalProperties": false - }, - "RegisterCredentialDefinitionReturnStateFailed": { - "properties": { - "state": { - "type": "string", - "enum": [ - "failed" - ], - "nullable": false - }, - "reason": { - "type": "string" - }, - "credentialDefinition": { - "$ref": "#/components/schemas/AnonCredsCredentialDefinition" - }, - "credentialDefinitionId": { - "type": "string" - } - }, - "required": [ - "state", - "reason" - ], - "type": "object", - "additionalProperties": false - }, - "WriteTransaction": { - "properties": { - "endorsedTransaction": { - "type": "string" - }, - "endorserDid": { - "type": "string" - }, - "schema": { - "properties": { - "attributes": { - "items": { - "type": "string" - }, - "type": "array" - }, - "version": { - "type": "string" - }, - "name": { - "type": "string" - }, - "issuerId": { - "type": "string" - } - }, - "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" - } - }, - "required": [ - "endorsedTransaction" - ], - "type": "object", - "additionalProperties": false - }, - "DIDDocumentMetadata": { - "description": "Represents metadata about the DID document resulting from a {@link Resolvable.resolve} operation.", - "properties": { - "created": { - "type": "string" - }, - "updated": { - "type": "string" - }, - "deactivated": { - "type": "boolean" + "deactivated": { + "type": "boolean" }, "versionId": { "type": "string" @@ -1126,10 +712,33 @@ "type": "string", "example": "did:key:z6Mkk7yqnGF3YwTrLpqrW6PGsKci7dNqh1CjnvMbzrMerSeL" }, + "KeyAlgorithm": { + "enum": [ + "a128gcm", + "a256gcm", + "a128cbchs256", + "a256cbchs512", + "a128kw", + "a256kw", + "bls12381g1", + "bls12381g2", + "c20p", + "xc20p", + "ed25519", + "x25519", + "k256", + "p256", + "p384" + ], + "type": "string" + }, + "DidDocument": { + "$ref": "#/components/schemas/Record_string.any_" + }, "DidCreate": { "properties": { "keyType": { - "$ref": "#/components/schemas/KeyType" + "$ref": "#/components/schemas/KeyAlgorithm" }, "seed": { "type": "string" @@ -1171,8015 +780,707 @@ "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" + "OpenId4VcIssuanceSessionRecord": { + "$ref": "#/components/schemas/Record_string.unknown_" }, - "RegisterCredentialDefinitionReturn": { - "properties": { - "jobId": { - "type": "string" - }, - "credentialDefinitionState": { - "anyOf": [ - { - "$ref": "#/components/schemas/RegisterCredentialDefinitionReturnStateWait" - }, - { - "$ref": "#/components/schemas/RegisterCredentialDefinitionReturnStateAction" - }, - { - "$ref": "#/components/schemas/RegisterCredentialDefinitionReturnStateFinished" - }, - { - "$ref": "#/components/schemas/RegisterCredentialDefinitionReturnStateFailed" - } - ] - }, - "credentialDefinitionMetadata": { - "$ref": "#/components/schemas/CredoExtensible" - }, - "registrationMetadata": { - "$ref": "#/components/schemas/CredoExtensible" - } - }, - "required": [ - "credentialDefinitionState", - "credentialDefinitionMetadata", - "registrationMetadata" - ], + "Record_string.boolean_": { + "properties": {}, "type": "object", - "additionalProperties": false + "description": "Construct a type with a set of properties K of type T" }, - "AgentInfo": { - "properties": { - "label": { - "type": "string" - }, - "endpoints": { - "items": { - "type": "string" + "Record_string.boolean-or-Record_string.boolean__": { + "properties": {}, + "additionalProperties": { + "anyOf": [ + { + "type": "boolean" }, - "type": "array" - }, - "isInitialized": { - "type": "boolean" - }, - "publicDid": {} + { + "$ref": "#/components/schemas/Record_string.boolean_" + } + ] }, - "required": [ - "label", - "endpoints", - "isInitialized", - "publicDid" - ], "type": "object", - "additionalProperties": false + "description": "Construct a type with a set of properties K of type T" }, - "AgentToken": { + "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": { - "token": { + "type": { "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": [ - "token" + "credentialSupportedId", + "format", + "signerOptions", + "payload" ], "type": "object", "additionalProperties": false }, - "VerifyDataOptions": { + "Partial_ValidityInfo_": { "properties": { - "signature": { - "type": "string" + "signed": { + "type": "string", + "format": "date-time" }, - "publicKeyBase58": { - "type": "string" + "validFrom": { + "type": "string", + "format": "date-time" }, - "keyType": { - "$ref": "#/components/schemas/KeyType" + "validUntil": { + "type": "string", + "format": "date-time" }, - "data": { - "type": "string" + "expectedUpdate": { + "type": "string", + "format": "date-time" } }, - "required": [ - "signature", - "publicKeyBase58", - "keyType", - "data" - ], - "type": "object" - }, - "W3cCredentialRecord": { - "$ref": "#/components/schemas/Record_string.unknown_" + "type": "object", + "description": "Make all properties in T optional" }, - "JsonObject": { + "Record_string.Record_string.unknown__": { "properties": {}, - "type": "object", "additionalProperties": { - "$ref": "#/components/schemas/JsonValue" - } + "$ref": "#/components/schemas/Record_string.unknown_" + }, + "type": "object", + "description": "Construct a type with a set of properties K of type T" }, - "JsonValue": { - "anyOf": [ - { + "MdocNameSpaces": { + "$ref": "#/components/schemas/Record_string.Record_string.unknown__" + }, + "OpenId4VciOfferMdocCredential": { + "properties": { + "credentialSupportedId": { "type": "string" }, - { - "type": "number", - "format": "double" + "challenge": { + "type": "string" }, - { - "type": "boolean" + "nonce": { + "type": "string" }, - { - "$ref": "#/components/schemas/JsonObject" + "created": { + "type": "string" }, - { - "$ref": "#/components/schemas/JsonArray" - } - ], - "nullable": true - }, - "JsonArray": { - "items": { - "$ref": "#/components/schemas/JsonValue" - }, - "type": "array" - }, - "W3cIssuer": { - "properties": { - "id": { + "expires": { "type": "string" - } - }, - "required": [ - "id" - ], - "type": "object", - "additionalProperties": false - }, - "W3cCredentialSubject": { - "properties": { - "id": { + }, + "proofValue": { "type": "string" }, - "claims": { - "$ref": "#/components/schemas/Record_string.unknown_" + "previousProof": { + "type": "string" } }, + "required": [ + "type", + "cryptosuite", + "verificationMethod", + "proofPurpose" + ], "type": "object", "additionalProperties": false }, - "SingleOrArray_W3cCredentialSubject_": { + "SingleOrArray_any-or-DataIntegrityProofOptions_": { "anyOf": [ { - "$ref": "#/components/schemas/W3cCredentialSubject" + "anyOf": [ + {}, + { + "$ref": "#/components/schemas/DataIntegrityProofOptions" + } + ] }, { "items": { - "$ref": "#/components/schemas/W3cCredentialSubject" + "anyOf": [ + {}, + { + "$ref": "#/components/schemas/DataIntegrityProofOptions" + } + ] }, "type": "array" } ] }, - "W3cCredentialSchema": { + "LinkedDataProof": { + "description": "Linked Data Proof", "properties": { - "id": { + "type": { "type": "string" }, - "type": { + "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": [ - "id", - "type" + "type", + "proofPurpose", + "verificationMethod", + "created" ], "type": "object", "additionalProperties": false }, - "SingleOrArray_W3cCredentialSchema_": { - "anyOf": [ - { - "$ref": "#/components/schemas/W3cCredentialSchema" - }, - { - "items": { - "$ref": "#/components/schemas/W3cCredentialSchema" - }, - "type": "array" - } - ] - }, - "W3cCredentialStatus": { + "DataIntegrityProof": { + "description": "Linked Data Proof", "properties": { - "id": { - "type": "string" - }, "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" } }, "required": [ - "id", - "type" + "type", + "cryptosuite", + "proofPurpose", + "verificationMethod" ], "type": "object", "additionalProperties": false }, - "W3cCredential": { - "properties": { - "context": { + "SingleOrArray_LinkedDataProof-or-DataIntegrityProof_": { + "anyOf": [ + { + "anyOf": [ + { + "$ref": "#/components/schemas/LinkedDataProof" + }, + { + "$ref": "#/components/schemas/DataIntegrityProof" + } + ] + }, + { "items": { "anyOf": [ { - "type": "string" + "$ref": "#/components/schemas/LinkedDataProof" }, { - "$ref": "#/components/schemas/JsonObject" + "$ref": "#/components/schemas/DataIntegrityProof" } ] }, "type": "array" - }, + } + ] + }, + "W3cIssuer": { + "properties": { "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" } }, "required": [ - "context", - "type", - "issuer", - "issuanceDate", - "credentialSubject" + "id" ], "type": "object", "additionalProperties": false }, - "Pick_W3cJsonLdSignCredentialOptions.Exclude_keyofW3cJsonLdSignCredentialOptions.format__": { + "W3cCredentialSubject": { "properties": { - "credential": { - "$ref": "#/components/schemas/W3cCredential", - "description": "The credential to be signed." + "id": { + "type": "string" }, - "proofType": { - "type": "string", - "description": "The proofType to be used for signing the credential.\n\nMust be a valid Linked Data Signature suite." + "claims": { + "$ref": "#/components/schemas/Record_string.unknown_" + } + }, + "type": "object", + "additionalProperties": false + }, + "SingleOrArray_W3cCredentialSubject_": { + "anyOf": [ + { + "$ref": "#/components/schemas/W3cCredentialSubject" }, - "proofPurpose": {}, - "created": { + { + "items": { + "$ref": "#/components/schemas/W3cCredentialSubject" + }, + "type": "array" + } + ] + }, + "W3cCredentialSchema": { + "properties": { + "id": { "type": "string" }, - "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." + "type": { + "type": "string" } }, "required": [ - "credential", - "proofType", - "verificationMethod" + "id", + "type" ], "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." + "additionalProperties": false }, - "CustomW3cJsonLdSignCredentialOptions": { - "allOf": [ + "SingleOrArray_W3cCredentialSchema_": { + "anyOf": [ { - "$ref": "#/components/schemas/Omit_W3cJsonLdSignCredentialOptions.format_" + "$ref": "#/components/schemas/W3cCredentialSchema" }, { - "properties": {}, - "additionalProperties": {}, - "type": "object" + "items": { + "$ref": "#/components/schemas/W3cCredentialSchema" + }, + "type": "array" } ] }, - "SignDataOptions": { + "W3cCredentialStatus": { "properties": { - "method": { + "id": { "type": "string" }, - "did": { + "type": { "type": "string" + } + }, + "required": [ + "id", + "type" + ], + "type": "object", + "additionalProperties": false + }, + "W3cJsonLdVerifiableCredential": { + "properties": { + "context": { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/components/schemas/JsonObject" + } + ] + }, + "type": "array" }, - "publicKeyBase58": { + "id": { "type": "string" }, - "keyType": { - "$ref": "#/components/schemas/KeyType" + "type": { + "items": { + "type": "string" + }, + "type": "array" }, - "data": { - "type": "string" + "input_descriptors": { + "items": { + "$ref": "#/components/schemas/InputDescriptorV2Model" + }, + "type": "array" + }, + "frame": { + "additionalProperties": false, + "type": "object" } }, "required": [ - "publicKeyBase58", - "keyType", - "data" + "id", + "input_descriptors" ], - "type": "object" - }, - "Partial_W3cCredentialValidations_": { - "properties": {}, "type": "object", - "description": "Make all properties in T optional" + "additionalProperties": false }, - "Error": { + "PresentationDefinition": { "properties": { - "name": { - "type": "string" - }, - "message": { - "type": "string" - }, - "stack": { - "type": "string" + "definition": { + "$ref": "#/components/schemas/DifPresentationExchangeDefinitionV2Model" } }, "required": [ - "name", - "message" + "definition" ], "type": "object", "additionalProperties": false }, - "W3cVerifyResult_W3cCredentialValidations_": { + "DcqlClaim": { "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" + "path": { + "items": { + "type": "string" + }, + "type": "array" }, - "error": { - "$ref": "#/components/schemas/Error", - "description": "Error that was caught during verification not related to\nany of the specific validations that are performed" + "intent_to_retain": { + "type": "boolean" } }, "required": [ - "isValid", - "validations" + "path" ], "type": "object", "additionalProperties": false }, - "W3cVerifyCredentialResult": { - "$ref": "#/components/schemas/W3cVerifyResult_W3cCredentialValidations_" - }, - "Pick_LinkedDataProofOptions.Exclude_keyofLinkedDataProofOptions.cryptosuite__": { + "DcqlCredential": { "properties": { - "proofPurpose": { - "type": "string" - }, - "created": { - "type": "string" - }, - "verificationMethod": { - "type": "string" - }, - "type": { - "type": "string" - }, - "domain": { + "id": { "type": "string" }, - "challenge": { + "format": { "type": "string" }, - "jws": { - "type": "string" + "meta": { + "$ref": "#/components/schemas/Record_string.any_" }, - "proofValue": { - "type": "string" + "require_cryptographic_holder_binding": { + "type": "boolean" }, - "nonce": { - "type": "string" + "claims": { + "items": { + "$ref": "#/components/schemas/DcqlClaim" + }, + "type": "array" } }, "required": [ - "proofPurpose", - "created", - "verificationMethod", - "type" + "id", + "format", + "claims" ], "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__", - "description": "Construct a type with the properties of T except for those in type K." + "additionalProperties": false }, - "DataIntegrityProofOptions": { + "DcqlQuery": { "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" + "combine": { + "type": "string", + "enum": [ + "all", + "any" + ] }, - "previousProof": { - "type": "string" + "credentials": { + "items": { + "$ref": "#/components/schemas/DcqlCredential" + }, + "type": "array" } }, "required": [ - "type", - "cryptosuite", - "verificationMethod", - "proofPurpose" + "credentials" ], "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", + "DcqlDefinition": { "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" + "query": { + "$ref": "#/components/schemas/DcqlQuery" } }, "required": [ - "type", - "proofPurpose", - "verificationMethod", - "created" + "credential", + "proof" ], "type": "object", "additionalProperties": false }, - "DataIntegrityProof": { - "description": "Linked Data Proof", + "TenantConfig": { "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": { + "label": { "type": "string" } }, "required": [ - "type", - "cryptosuite", - "proofPurpose", - "verificationMethod" + "label" ], - "type": "object", - "additionalProperties": false + "type": "object" }, - "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" + "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 }, - "W3cJsonLdVerifiableCredential": { + "Pick_CustomTenantConfig.Exclude_keyofCustomTenantConfig.walletConfig__": { "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": { + "label": { "type": "string" }, - "expirationDate": { + "connectionImageUrl": { "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" + "label" ], "type": "object", - "additionalProperties": false + "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." }, - "ProofPurpose": {}, - "SafeW3cJsonLdVerifyCredentialOptions": { + "CreateTenantOptions": { "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_" + "config": { + "$ref": "#/components/schemas/Omit_CustomTenantConfig.walletConfig_" } }, "required": [ - "credential", - "proof" + "config" ], "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_" - }, - "DisclosureFrame": { - "properties": { - "_sd": { - "items": { - "type": "string" - }, - "type": "array" - } - }, - "type": "object", - "additionalProperties": { - "anyOf": [ - { - "$ref": "#/components/schemas/DisclosureFrame" - }, - { - "items": { - "type": "string" - }, - "type": "array" - } - ] - } - }, - "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/DisclosureFrame" - } - }, - "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 - }, - "DcqlDefinition": { - "properties": { - "query": {} - }, - "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" - } - } - } - } - } - }, - "/didcomm/credentials/accept-credential": { - "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", - "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" - } - } - } - } - } - } - }, - "description": "Retrieve connection record by connection id", - "tags": [ - "DIDComm - Connections" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [ - { - "description": "Connection identifier", - "in": "path", - "name": "connectionId", - "required": true, - "schema": { - "$ref": "#/components/schemas/RecordId" - } - } - ] - }, - "delete": { - "operationId": "DeleteConnection", - "responses": { - "204": { - "description": "No content" - } - }, - "description": "Deletes a connection record from the connection repository.", - "tags": [ - "DIDComm - Connections" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [ - { - "description": "Connection identifier", - "in": "path", - "name": "connectionId", - "required": true, - "schema": { - "$ref": "#/components/schemas/RecordId" - } - } - ] - } - }, - "/didcomm/connections/{connectionId}/accept-request": { - "post": { - "operationId": "AcceptRequest", - "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" - } - } - } - } - } - } - }, - "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" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [ - { - "description": "Connection identifier", - "in": "path", - "name": "connectionId", - "required": true, - "schema": { - "$ref": "#/components/schemas/RecordId" - } - } - ] - } - }, - "/didcomm/connections/{connectionId}/accept-response": { - "post": { - "operationId": "AcceptResponse", - "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" - } - } - } - } - } - } - }, - "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" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [ - { - "description": "Connection identifier", - "in": "path", - "name": "connectionId", - "required": true, - "schema": { - "$ref": "#/components/schemas/RecordId" - } - } - ] } }, - "/didcomm/url/{invitationId}": { - "get": { - "operationId": "GetInvitation", - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": { - "items": { - "$ref": "#/components/schemas/ConnectionRecord" - }, - "type": "array" - } - } - } - } - }, - "tags": [ - "DIDComm - Connections" - ], - "security": [], - "parameters": [ - { - "in": "path", - "name": "invitationId", - "required": true, - "schema": { - "type": "string" - } - } - ] + "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" }, - "/didcomm/basic-messages/{connectionId}": { + "contact": {} + }, + "paths": { + "/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": [ { @@ -9192,48 +1493,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": [ { @@ -9259,331 +1576,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": [ { @@ -9595,72 +2005,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": [ { @@ -9670,443 +2079,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" } } } @@ -10115,9 +2199,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": [ { @@ -10133,71 +2217,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": [ { @@ -10207,116 +2322,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": [ { @@ -10329,74 +2436,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": [ { @@ -10409,39 +2509,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" @@ -10450,24 +2563,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": [ { @@ -10479,31 +2611,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": [ { @@ -10515,37 +2642,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": [ { @@ -10555,58 +2699,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": [ { @@ -10616,80 +2758,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": [ { @@ -10699,35 +2894,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": [ { @@ -10743,29 +2963,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": [ { @@ -10775,114 +2999,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": [ { @@ -10898,45 +3092,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" ] } ], @@ -10946,46 +3178,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" } @@ -10993,116 +3256,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" From e71906003f6dc885cba616368b941776fbc9fecb Mon Sep 17 00:00:00 2001 From: Krishna Waske Date: Mon, 15 Dec 2025 19:10:20 +0530 Subject: [PATCH 049/152] fix: cliagent issues Signed-off-by: Krishna Waske --- src/cliAgent.ts | 9 ++++++--- yarn.lock | 4 ++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/cliAgent.ts b/src/cliAgent.ts index f476cd15..b25d8025 100644 --- a/src/cliAgent.ts +++ b/src/cliAgent.ts @@ -1,3 +1,6 @@ +// 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 { IndyVdrPoolConfig } from '@credo-ts/indy-vdr' @@ -183,9 +186,10 @@ const getModules = ( registries: [new IndyVdrAnonCredsRegistry()], anoncreds, }), - oob: true, mediationRecipient: true, messagePickup: true, + mediator: false, + basicMessages: true, connections: { autoAcceptConnections: autoAcceptConnections || true, @@ -200,7 +204,7 @@ const getModules = ( proofFormats: [legacyIndyProofFormat, anonCredsProofFormatService, presentationExchangeProofFormatService], }), ], - }, + }, credentials: { autoAcceptCredentials: autoAcceptCredentials || DidCommAutoAcceptCredential.Always, credentialProtocols: [ @@ -213,7 +217,6 @@ const getModules = ( ], }, }), - discovery: new DidCommDiscoverFeaturesModule(), cache: new CacheModule({ cache: new InMemoryLruCache({ limit: Number(process.env.INMEMORY_LRU_CACHE_LIMIT) || Infinity }), }), diff --git a/yarn.lock b/yarn.lock index f9bc587c..f4ef7485 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2102,7 +2102,7 @@ ref-array-di "^1.2.2" ref-struct-di "^1.1.1" -"@openwallet-foundation/askar-shared@0.4.3", "@openwallet-foundation/askar-shared@^0.4.3": +"@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== @@ -8165,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== From b7cec2b3600dc136fafd0c655b1ce64258259119 Mon Sep 17 00:00:00 2001 From: Krishna Waske Date: Tue, 23 Dec 2025 17:53:38 +0530 Subject: [PATCH 050/152] fix: x509 controller (#338) * fix: x509 controller Signed-off-by: Krishna Waske * fix: x509 import fix Signed-off-by: Krishna Waske * fix/added dynamic implementation for keyType of x509 Signed-off-by: sujitaw * fix/sonarqube issue Signed-off-by: sujitaw * fix/sonarqube issue Signed-off-by: sujitaw * fix/sonar cube issue Signed-off-by: sujitaw * fix/code rabbit comments Signed-off-by: sujitaw * fix/pr comments Signed-off-by: sujitaw --------- Signed-off-by: Krishna Waske Signed-off-by: sujitaw Co-authored-by: sujitaw --- src/controllers/did/DidController.ts | 93 ++-- src/controllers/x509/x509.Controller.ts | 144 +++--- src/controllers/x509/x509.service.ts | 463 +++++++++--------- src/controllers/x509/x509.types.ts | 64 ++- src/enums/enum.ts | 11 +- src/routes/routes.ts | 0 src/routes/swagger.json | 623 +++++++++++++++++++++++- src/utils/constant.ts | 23 + src/utils/helpers.ts | 41 +- 9 files changed, 1086 insertions(+), 376 deletions(-) delete mode 100644 src/routes/routes.ts diff --git a/src/controllers/did/DidController.ts b/src/controllers/did/DidController.ts index 193ee075..1bc214ea 100644 --- a/src/controllers/did/DidController.ts +++ b/src/controllers/did/DidController.ts @@ -1,7 +1,9 @@ + 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 { TypedArrayEncoder, DidDocumentBuilder, @@ -10,20 +12,27 @@ import { 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 { KeyAlgorithm,askar } from '@openwallet-foundation/askar-nodejs' -import { transformPrivateKeyToPrivateJwk, transformSeedToPrivateJwk } from '@credo-ts/askar' +import { supportedKeyTypesDID } from '../x509/x509.types' +import { container } from 'tsyringe' +import { RestMultiTenantAgentModules } from '../../cliAgent' + @Tags('Dids') @@ -36,6 +45,8 @@ export class DidController extends Controller { * @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) { @@ -66,7 +77,7 @@ export class DidController extends Controller { public async writeDid(@Request() request: Req, @Body() createDidOptions: DidCreate) { let didRes - console.log("dsajsa", askar.version()) + this.agent.config.logger.info(`askar version ${askar.version()}`) try { if (!createDidOptions.method) { throw new BadRequestError('Method is required') @@ -324,7 +335,6 @@ export class DidController extends Controller { const buffer = Hasher.hash(verificationKey.publicKey.publicKey, 'sha-256') const did = TypedArrayEncoder.toBase58(buffer.slice(0, 16)) - // const did = `did:indy:${endorserNamespace}:${namespaceIdentifier let body if (createDidOptions.network === Network.Indicio_Testnet) { @@ -369,13 +379,14 @@ export class DidController extends Controller { const key = await agent.kms.importKey({ privateJwk }) const publicJwk = Kms.PublicJwk.fromPublicJwk(key.publicJwk) + const completeDid = `${didMethod}:${did}` await agent.dids.import({ - did, + did: completeDid, keys: [ { kmsKeyId: key.keyId, - // TODO: Find what to add here - didDocumentRelativeKeyId: '' + didDocumentRelativeKeyId: verkey, + } ] }) @@ -395,72 +406,34 @@ export class DidController extends Controller { if (didOptions.keyType === KeyAlgorithm.Bls12381G2) { throw new BadRequestError('didOptions.keyType for type "bls12381g2" has been deprecated') } - if (didOptions.keyType !== KeyAlgorithm.Ed25519) { - throw new BadRequestError('Only ed25519 and bls12381g2 key type supported') + 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 (!didOptions.did) { - console.log("This is inside if") - // Transform seed to private JWK and - // const { privateJwk } = transformSeedToPrivateJwk({ - // type: { - // kty: 'OKP', - // crv: 'Ed25519', - // }, - // seed: TypedArrayEncoder.fromString(didOptions.seed), - // }) - // console.log("This is privateJwk::::::", JSON.stringify(privateJwk)) - - // // Import the key using KMS - // const { keyId } = await agent.kms.importKey({ privateJwk }) - // console.log("This is keyId", keyId) - - // // Create DID using the imported key - // const didResponse = await agent.dids.create({ - // method: 'key', - // options: { - // keyId, - // }, - // }) const privateJwk = transformPrivateKeyToPrivateJwk({ - privateKey: TypedArrayEncoder.fromString('96213c3d7fc8d4d6754c7a0fd969598e'), - type: { - kty: 'OKP', - crv: 'Ed25519', - }, + 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: 'key', + method: DidMethod.Key, options: { keyId, }, }) - console.log("This is didResponse::::::", JSON.stringify(didResponse)) + this.agent.config.logger.info(`This is didResponse:::::: ${JSON.stringify(didResponse)}`) did = `${didResponse.didState.did}` didDocument = didResponse.didState.didDocument - - // await agent.kms.createKey({ - // keyType: didOptions.keyType, - // seed: TypedArrayEncoder.fromString(didOptions.seed), - // }) - - // didResponse = await agent.dids.create({ - // method: DidMethod.Key, - // options: { - // keyType: KeyAlgorithm.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({ @@ -470,8 +443,8 @@ export class DidController extends Controller { didDocument = createdDid[0]?.didDocument } - console.log('This is did', did) - console.log('This is didDocument', didDocument) + this.agent.config.logger.info(`This is did ${did}` ) + this.agent.config.logger.info(`This is didDocument ${didDocument}` ) await agent.dids.import({ did, diff --git a/src/controllers/x509/x509.Controller.ts b/src/controllers/x509/x509.Controller.ts index a8e3e4bb..61a412eb 100644 --- a/src/controllers/x509/x509.Controller.ts +++ b/src/controllers/x509/x509.Controller.ts @@ -1,78 +1,78 @@ -// import { injectable } from '@credo-ts/core' -// import { Request as Req } from 'express' -// import { Body, Controller, Post, Route, Tags, Security, Request, Get } from 'tsoa' +import { injectable } from '@credo-ts/core' +import { Request as Req } from 'express' +import { Body, Controller, Post, Route, Tags, Security, Request, Get } from 'tsoa' -// import { SCOPES } from '../../enums' -// import ErrorHandlingService from '../../errorHandlingService' -// import { X509ImportCertificateOptionsDto } from '../types' -// import { x509ServiceT } from './x509.service' -// import { X509CreateCertificateOptionsDto } from './x509.types' +import { SCOPES } from '../../enums' +import ErrorHandlingService from '../../errorHandlingService' +import { X509ImportCertificateOptionsDto } from '../types' +import { x509ServiceT } from './x509.service' +import { X509CreateCertificateOptionsDto } from './x509.types' -// @Tags('x509') -// @Security('jwt', [SCOPES.TENANT_AGENT, SCOPES.DEDICATED_AGENT]) -// @Route('/x509') -// @injectable() -// export class X509Controller extends Controller { -// @Post('/') -// public async createX509Certificate( -// @Request() request: Req, -// @Body() createX509Options: X509CreateCertificateOptionsDto, -// ) { -// try { -// return await x509ServiceT.createCertificate(request, createX509Options) -// } catch (error) { -// throw ErrorHandlingService.handle(error) -// } -// } +@Tags('x509') +@Security('jwt', [SCOPES.TENANT_AGENT, SCOPES.DEDICATED_AGENT]) +@Route('/x509') +@injectable() +export class X509Controller extends Controller { + @Post('/') + public async createX509Certificate( + @Request() request: Req, + @Body() createX509Options: X509CreateCertificateOptionsDto, + ) { + try { + return await x509ServiceT.createCertificate(request, createX509Options) + } catch (error) { + throw ErrorHandlingService.handle(error) + } + } -// @Post('/import') -// public async ImportX509Certificates( -// @Request() request: Req, -// @Body() importX509Options: X509ImportCertificateOptionsDto, -// ) { -// try { -// return await x509ServiceT.ImportX509Certificates(request, importX509Options) -// } catch (error) { -// throw ErrorHandlingService.handle(error) -// } -// } + @Post('/import') + public async ImportX509Certificates( + @Request() request: Req, + @Body() importX509Options: X509ImportCertificateOptionsDto, + ) { + try { + return await x509ServiceT.ImportX509Certificates(request, importX509Options) + } catch (error) { + throw ErrorHandlingService.handle(error) + } + } -// @Post('/trusted') -// public async addTrustedCertificate( -// @Request() request: Req, -// @Body() -// options: { -// certificate: string -// }, -// ) { -// try { -// return await x509ServiceT.addTrustedCertificate(request, options) -// } catch (error) { -// throw ErrorHandlingService.handle(error) -// } -// } + @Post('/trusted') + public async addTrustedCertificate( + @Request() request: Req, + @Body() + options: { + certificate: string + }, + ) { + try { + return await x509ServiceT.addTrustedCertificate(request, options) + } catch (error) { + throw ErrorHandlingService.handle(error) + } + } -// @Get('/trusted') -// public async getTrustedCertificates(@Request() request: Req) { -// try { -// return await x509ServiceT.getTrustedCertificates(request) -// } catch (error) { -// throw ErrorHandlingService.handle(error) -// } -// } + @Get('/trusted') + public async getTrustedCertificates(@Request() request: Req) { + try { + return await x509ServiceT.getTrustedCertificates(request) + } catch (error) { + throw ErrorHandlingService.handle(error) + } + } -// @Post('/decode') -// public async decodeCertificate( -// @Request() request: Req, -// @Body() -// options: { -// certificate: string -// }, -// ) { -// try { -// return await x509ServiceT.decodeCertificate(request, options) -// } catch (error) { -// throw ErrorHandlingService.handle(error) -// } -// } -// } + @Post('/decode') + public async decodeCertificate( + @Request() request: Req, + @Body() + options: { + certificate: string + }, + ) { + try { + return await x509ServiceT.decodeCertificate(request, options) + } catch (error) { + throw ErrorHandlingService.handle(error) + } + } +} diff --git a/src/controllers/x509/x509.service.ts b/src/controllers/x509/x509.service.ts index 6bdef914..8e0ca051 100644 --- a/src/controllers/x509/x509.service.ts +++ b/src/controllers/x509/x509.service.ts @@ -1,219 +1,244 @@ -// import type { X509CreateCertificateOptionsDto } from './x509.types' -// import type { BasicX509CreateCertificateConfig, X509ImportCertificateOptionsDto } from '../types' -// import type { CredoError } from '@credo-ts/core' -// import type { Request as Req } from 'express' - -// import { -// TypedArrayEncoder, -// X509Certificate, -// X509ExtendedKeyUsage, -// X509KeyUsage, -// X509ModuleConfig, -// X509Service, -// type Agent, -// } from '@credo-ts/core' - -// import { generateSecretKey, getCertificateValidityForSystem } from '../../utils/helpers' - -// import { pemToRawEd25519PrivateKey } from './crypto-util' -// import { KeyAlgorithm } from '@openwallet-foundation/askar-nodejs' - -// class x509Service { -// public async createSelfSignedDCS(createX509Options: BasicX509CreateCertificateConfig, agentReq: Req) { -// const agent = agentReq.agent - -// const authorityKey = await createKey(agent as Agent, createX509Options.keyType) -// const AGENT_HOST = createX509Options.issuerAlternativeNameURL -// const AGENT_DNS = AGENT_HOST.replace('https://', '') -// const selfSignedx509certificate = await X509Service.createCertificate(agent.context, { -// authorityKey: authorityKey, //createX509Options.subjectKey, -// issuer: { countryName: createX509Options.countryName, commonName: createX509Options.commonName }, -// validity: getCertificateValidityForSystem(false), -// extensions: { -// subjectKeyIdentifier: { -// include: true, -// }, -// keyUsage: { -// usages: [X509KeyUsage.KeyCertSign, X509KeyUsage.CrlSign, X509KeyUsage.DigitalSignature], -// markAsCritical: true, -// }, -// subjectAlternativeName: { -// name: [ -// { type: 'dns', value: AGENT_DNS }, -// { type: 'url', value: AGENT_HOST }, -// ], -// }, -// issuerAlternativeName: { -// // biome-ignore lint/style/noNonNullAssertion: -// //name: rootCertificate.issuerAlternativeNames!, -// name: [ -// { type: 'dns', value: AGENT_DNS }, -// { type: 'url', value: AGENT_HOST }, -// ], -// }, -// extendedKeyUsage: { -// usages: [X509ExtendedKeyUsage.MdlDs], -// markAsCritical: true, -// }, -// basicConstraints: { -// ca: true, -// pathLenConstraint: 0, -// markAsCritical: true, -// }, -// // TODO: Create revocation list and add URL here - store this in platform -// // crlDistributionPoints: { -// // urls: [`${"AGENT_HOST"}/crl`], -// // }, -// }, -// }) - -// agent.config.logger.info('======= X.509 IACA Self Signed Certificate ===========') -// const selfSignedx509certificateBase64 = selfSignedx509certificate.toString('base64') -// agent.config.logger.debug('selfSignedx509certificateBase64', { selfSignedx509certificateBase64 }) -// return { publicCertificateBase64: selfSignedx509certificateBase64 } -// } - -// public async createCertificate(agentReq: Req, options: X509CreateCertificateOptionsDto) { -// const agent = agentReq.agent - -// let authorityKeyID, subjectPublicKeyID - -// agent.config.logger.debug(`createCertificate options:`, options) - -// if (options.authorityKey && options?.authorityKey?.seed) { -// authorityKeyID = await agent.context.wallet.createKey({ -// keyType: options.authorityKey.keyType ?? KeyAlgorithm.EcSecp256r1, -// seed: TypedArrayEncoder.fromString(options.authorityKey.seed), -// }) -// } else { -// authorityKeyID = await agent.context.wallet.createKey({ -// keyType: KeyAlgorithm.EcSecp256r1, -// }) -// } - -// if (options.subjectPublicKey) { -// if (options?.subjectPublicKey?.seed) { -// subjectPublicKeyID = await agent.context.wallet.createKey({ -// keyType: options.subjectPublicKey.keyType ?? KeyAlgorithm.EcSecp256r1, -// seed: TypedArrayEncoder.fromString(options.subjectPublicKey.seed), -// }) -// } else { -// subjectPublicKeyID = await agent.context.wallet.createKey({ -// keyType: KeyAlgorithm.EcSecp256r1, -// }) -// } -// } - -// const certificate = await agent.x509.createCertificate({ -// authorityKey: authorityKeyID as Key, -// subjectPublicKey: (subjectPublicKeyID as Key) ?? undefined, -// serialNumber: options.serialNumber, -// issuer: options.issuer, -// extensions: options.extensions, -// subject: options.subject, -// validity: options.validity, -// }) - -// const issuerCertificate = certificate.toString('base64') -// return { publicCertificateBase64: issuerCertificate } -// } - -// public async ImportX509Certificates(agentReq: Req, options: X509ImportCertificateOptionsDto) { -// const agent = agentReq.agent -// agent.config.logger.debug(`Start validating keys`) -// const secretHexKey = await pemToRawEd25519PrivateKey(options.privateKey ?? '') -// const privateKey = TypedArrayEncoder.fromHex(secretHexKey) - -// agent.config.logger.debug(`Decode certificate`) -// const parsedCertificate = X509Service.parseCertificate(agent.context, { -// encodedCertificate: options.certificate, -// }) -// const issuerCertficicate = parsedCertificate.toString('base64') - -// try { -// const documentSignerKey = await agent.wallet.createKey({ -// privateKey: privateKey, -// keyType: options.keyType, -// }) - -// if ( -// parsedCertificate.publicKey.keyType !== options.keyType || -// !Buffer.from(parsedCertificate.publicKey.publicKey).equals(Buffer.from(documentSignerKey.publicKey)) -// ) { -// throw new Error(`Key mismatched in provided X509_CERTIFICATE to import`) -// } -// console.log(`Keys matched with certificate`) -// } catch (error) { -// // 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, -// ) -// } else { -// agent.config.logger.error(`${JSON.stringify(error)}`) -// throw error -// } -// } - -// return { issuerCertficicate } -// } - -// public addTrustedCertificate( -// agentReq: Req, -// options: { -// certificate: string -// }, -// ) { -// const agent = agentReq.agent -// return agent.x509.addTrustedCertificate(options.certificate) -// } - -// public getTrustedCertificates(agentReq: Req) { -// const trustedCertificates = agentReq.agent.context.dependencyManager -// .resolve(X509ModuleConfig) -// .trustedCertificates?.map((cert) => X509Certificate.fromEncodedCertificate(cert).toString('base64')) // as [string, ...string[]] - -// return trustedCertificates -// } - -// /** -// * Parses a base64-encoded X.509 certificate into a X509Certificate -// * -// * @param issuerAgent {Agent} -// * @param options {x509Input} -// * @returns -// */ -// public decodeCertificate( -// agentReq: Req, -// options: { -// certificate: string -// }, -// ) { -// const parsedCertificate = X509Service.parseCertificate(agentReq.agent.context, { -// encodedCertificate: options.certificate, -// }) - -// return parsedCertificate -// } -// } - -// export const x509ServiceT = new x509Service() - -// export async function createKey(agent: Agent, keyType: KeyAlgorithm) { -// try { -// const seed = await generateSecretKey(keyType === KeyAlgorithm.EcSecp256r1 ? 64 : 32) - -// agent.config.logger.debug(`createKey: got seed ${seed}`) - -// const authorityKey = await agent.kms.createKey({ -// algorithm: keyType, -// seed: TypedArrayEncoder.fromString(seed), -// }) - -// return authorityKey -// } catch (error) { -// agent.config.logger.debug(`Error while creating authorityKey`, { message: (error as CredoError).message }) -// throw error -// } -// } + +import type { BasicX509CreateCertificateConfig, X509ImportCertificateOptionsDto } from '../types' +import type { CredoError } from '@credo-ts/core' +import type { Request as Req } from 'express' + +import { transformPrivateKeyToPrivateJwk, transformSeedToPrivateJwk } from '@credo-ts/askar' +import { + Kms, + TypedArrayEncoder, + X509Certificate, + X509ExtendedKeyUsage, + X509KeyUsage, + X509ModuleConfig, + X509Service, + type Agent, +} from '@credo-ts/core' +import { KeyAlgorithm } from '@openwallet-foundation/askar-nodejs' + +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) { + const agent = agentReq.agent + + const authorityKey = await createKey(agent as Agent, createX509Options.keyType) + const AGENT_HOST = createX509Options.issuerAlternativeNameURL + const AGENT_DNS = AGENT_HOST.replace('https://', '') + const selfSignedx509certificate = await X509Service.createCertificate(agent.context, { + authorityKey: Kms.PublicJwk.fromPublicJwk(authorityKey.publicJwk), //createX509Options.subjectKey, + issuer: { countryName: createX509Options.countryName, commonName: createX509Options.commonName }, + validity: getCertificateValidityForSystem(false), + extensions: { + subjectKeyIdentifier: { + include: true, + }, + keyUsage: { + usages: [X509KeyUsage.KeyCertSign, X509KeyUsage.CrlSign, X509KeyUsage.DigitalSignature], + markAsCritical: true, + }, + subjectAlternativeName: { + name: [ + { type: 'dns', value: AGENT_DNS }, + { type: 'url', value: AGENT_HOST }, + ], + }, + issuerAlternativeName: { + name: [ + { type: 'dns', value: AGENT_DNS }, + { type: 'url', value: AGENT_HOST }, + ], + }, + extendedKeyUsage: { + usages: [X509ExtendedKeyUsage.MdlDs], + markAsCritical: true, + }, + basicConstraints: { + ca: true, + pathLenConstraint: 0, + markAsCritical: true, + }, + // TODO: Create revocation list and add URL here - store this in platform + // crlDistributionPoints: { + // urls: [`${"AGENT_HOST"}/crl`], + // }, + }, + }) + + agent.config.logger.info('======= X.509 IACA Self Signed Certificate ===========') + const selfSignedx509certificateBase64 = selfSignedx509certificate.toString('base64') + agent.config.logger.debug('selfSignedx509certificateBase64', { selfSignedx509certificateBase64 }) + return { publicCertificateBase64: selfSignedx509certificateBase64 } + } + + public async createCertificate(agentReq: Req, options: X509CreateCertificateOptionsDto) { + const agent = agentReq.agent + + let authorityKeyID, subjectPublicKeyID + + agent.config.logger.debug(`createCertificate options:`, options) + + + if (options.authorityKey && 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 { + const { publicJwk } = await agent.kms.createKey({ + type: getTypeFromCurve(options.authorityKey?.keyType ?? 'P-256') + }) + authorityKeyID = publicJwk + } + + if (options.subjectPublicKey) { + if (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 { + 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, + 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 } + } + + public async ImportX509Certificates(agentReq: Req, options: X509ImportCertificateOptionsDto) { + const agent = agentReq.agent + agent.config.logger.debug(`Start validating keys`) + const secretHexKey = await pemToRawEd25519PrivateKey(options.privateKey ?? '') + const privateKey = TypedArrayEncoder.fromHex(secretHexKey) + + agent.config.logger.debug(`Decode certificate`) + const parsedCertificate = X509Service.parseCertificate(agent.context, { + encodedCertificate: options.certificate, + }) + const issuerCertificate = parsedCertificate.toString('base64') + + try { + const keyTypeInfo = getTypeFromCurve(options.keyType) + const { privateJwk } = transformPrivateKeyToPrivateJwk({ + type: keyTypeInfo, + privateKey, + }) + + const key = await agent.kms.importKey({ + privateJwk, + }) + if ( + 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`) + } + 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 Kms.KeyManagementKeyExistsError) { + console.error( 'key already exists while importing certificate') + } else { + agent.config.logger.error(`${JSON.stringify(error)}`) + throw error + } + } + + return { issuerCertificate } + } + + public addTrustedCertificate( + agentReq: Req, + options: { + certificate: string + }, + ) { + const agent = agentReq.agent + return agent.x509.config.addTrustedCertificate(options.certificate) + } + + public getTrustedCertificates(agentReq: Req) { + const trustedCertificates = agentReq.agent.context.dependencyManager + .resolve(X509ModuleConfig) + .trustedCertificates?.map((cert) => X509Certificate.fromEncodedCertificate(cert).toString('base64')) // as [string, ...string[]] + + return trustedCertificates + } + + /** + * Parses a base64-encoded X.509 certificate into a X509Certificate + * + * @param issuerAgent {Agent} + * @param options {x509Input} + * @returns + */ + public decodeCertificate( + agentReq: Req, + options: { + certificate: string + }, + ) { + const parsedCertificate = X509Service.parseCertificate(agentReq.agent.context, { + encodedCertificate: options.certificate, + }) + + return parsedCertificate + } +} + +export const x509ServiceT = new x509Service() + +export async function createKey(agent: Agent, keyType: KeyAlgorithm) { + try { + const seed = await generateSecretKey(keyType === KeyAlgorithm.EcSecp256r1 ? 64 : 32) + + agent.config.logger.debug(`createKey: got seed ${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 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 9a0f2f9e..311f6697 100644 --- a/src/controllers/x509/x509.types.ts +++ b/src/controllers/x509/x509.types.ts @@ -1,8 +1,10 @@ import type { X509ExtendedKeyUsage, X509KeyUsage } from '@credo-ts/core' -import { KeyAlgorithm } from '@openwallet-foundation/askar-nodejs' +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', @@ -33,7 +35,7 @@ export interface AuthorityAndSubjectKeyDto { * @description Type of the key used for signing the X.509 Certificate (default is p256) */ // FIXME: Check type - keyType?: KeyAlgorithm + keyType?: Curve } export interface NameDto { @@ -204,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/routes/routes.ts b/src/routes/routes.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/src/routes/swagger.json b/src/routes/swagger.json index 5f991327..1525c153 100644 --- a/src/routes/swagger.json +++ b/src/routes/swagger.json @@ -7,6 +7,398 @@ "requestBodies": {}, "responses": {}, "schemas": { + "KeyAlgorithm": { + "enum": [ + "a128gcm", + "a256gcm", + "a128cbchs256", + "a256cbchs512", + "a128kw", + "a256kw", + "bls12381g1", + "bls12381g2", + "c20p", + "xc20p", + "ed25519", + "x25519", + "k256", + "p256", + "p384" + ], + "type": "string" + }, + "AuthorityAndSubjectKeyDto": { + "properties": { + "seed": { + "type": "string", + "example": "my-seed-12345" + }, + "publicKeyBase58": { + "type": "string", + "example": "3yPQbnk6WwLgX8K3JZ4t7vBnJ8XqY2mMpRcD9fNvGtHw" + }, + "keyType": { + "$ref": "#/components/schemas/KeyAlgorithm", + "example": "p256" + } + }, + "type": "object", + "additionalProperties": false + }, + "X509CertificateIssuerAndSubjectOptionsDto": { + "properties": { + "countryName": { + "type": "string", + "example": "US" + }, + "stateOrProvinceName": { + "type": "string", + "example": "California" + }, + "organizationalUnit": { + "type": "string", + "example": "IT Department" + }, + "commonName": { + "type": "string", + "example": "Example Corporation" + } + }, + "type": "object", + "additionalProperties": false + }, + "ValidityDto": { + "properties": { + "notBefore": { + "type": "string", + "format": "date-time", + "example": "2024-01-01T00:00:00.000Z" + }, + "notAfter": { + "type": "string", + "format": "date-time", + "example": "2025-01-01T00:00:00.000Z" + } + }, + "type": "object", + "additionalProperties": false + }, + "X509KeyUsage": { + "enum": [ + 1, + 2, + 4, + 8, + 16, + 32, + 64, + 128, + 256 + ], + "type": "number" + }, + "KeyUsageDto": { + "properties": { + "usages": { + "items": { + "$ref": "#/components/schemas/X509KeyUsage" + }, + "type": "array", + "example": [ + "digitalSignature", + "keyEncipherment", + "crlSign" + ] + }, + "markAsCritical": { + "type": "boolean", + "example": true + } + }, + "required": [ + "usages" + ], + "type": "object", + "additionalProperties": false + }, + "X509ExtendedKeyUsage": { + "enum": [ + "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" + ], + "type": "string" + }, + "ExtendedKeyUsageDto": { + "properties": { + "usages": { + "items": { + "$ref": "#/components/schemas/X509ExtendedKeyUsage" + }, + "type": "array", + "example": [ + "MdlDs", + "ServerAuth", + "ClientAuth" + ] + }, + "markAsCritical": { + "type": "boolean", + "example": true + } + }, + "required": [ + "usages" + ], + "type": "object", + "additionalProperties": false + }, + "AuthorityAndSubjectKeyIdentifierDto": { + "properties": { + "include": { + "type": "boolean", + "example": true + }, + "markAsCritical": { + "type": "boolean", + "example": true + } + }, + "required": [ + "include" + ], + "type": "object", + "additionalProperties": false + }, + "GeneralNameType": { + "enum": [ + "dns", + "dn", + "email", + "guid", + "ip", + "url", + "upn", + "id" + ], + "type": "string" + }, + "NameDto": { + "properties": { + "type": { + "$ref": "#/components/schemas/GeneralNameType", + "example": "dns" + }, + "value": { + "type": "string", + "example": "example.com" + } + }, + "required": [ + "type", + "value" + ], + "type": "object", + "additionalProperties": false + }, + "NameListDto": { + "properties": { + "name": { + "items": { + "$ref": "#/components/schemas/NameDto" + }, + "type": "array", + "example": [ + { + "type": "dns", + "value": "example.com" + }, + { + "type": "email", + "value": "admin@example.com" + } + ] + }, + "markAsCritical": { + "type": "boolean", + "example": true + } + }, + "required": [ + "name" + ], + "type": "object", + "additionalProperties": false + }, + "BasicConstraintsDto": { + "properties": { + "ca": { + "type": "boolean", + "example": false + }, + "pathLenConstraint": { + "type": "number", + "format": "double", + "example": 0 + }, + "markAsCritical": { + "type": "boolean", + "example": true + } + }, + "required": [ + "ca" + ], + "type": "object", + "additionalProperties": false + }, + "CrlDistributionPointsDto": { + "properties": { + "urls": { + "items": { + "type": "string" + }, + "type": "array", + "example": [ + "http://crl.example.com/ca.crl" + ] + }, + "markAsCritical": { + "type": "boolean", + "example": true + } + }, + "required": [ + "urls" + ], + "type": "object", + "additionalProperties": false + }, + "X509CertificateExtensionsOptionsDto": { + "properties": { + "keyUsage": { + "$ref": "#/components/schemas/KeyUsageDto" + }, + "extendedKeyUsage": { + "$ref": "#/components/schemas/ExtendedKeyUsageDto" + }, + "authorityKeyIdentifier": { + "$ref": "#/components/schemas/AuthorityAndSubjectKeyIdentifierDto" + }, + "subjectKeyIdentifier": { + "$ref": "#/components/schemas/AuthorityAndSubjectKeyIdentifierDto" + }, + "issuerAlternativeName": { + "$ref": "#/components/schemas/NameListDto" + }, + "subjectAlternativeName": { + "$ref": "#/components/schemas/NameListDto" + }, + "basicConstraints": { + "$ref": "#/components/schemas/BasicConstraintsDto" + }, + "crlDistributionPoints": { + "$ref": "#/components/schemas/CrlDistributionPointsDto" + } + }, + "type": "object", + "additionalProperties": false + }, + "X509CreateCertificateOptionsDto": { + "properties": { + "authorityKey": { + "$ref": "#/components/schemas/AuthorityAndSubjectKeyDto" + }, + "subjectPublicKey": { + "$ref": "#/components/schemas/AuthorityAndSubjectKeyDto" + }, + "serialNumber": { + "type": "string", + "example": "1234567890" + }, + "issuer": { + "anyOf": [ + { + "$ref": "#/components/schemas/X509CertificateIssuerAndSubjectOptionsDto" + }, + { + "type": "string" + } + ] + }, + "subject": { + "anyOf": [ + { + "$ref": "#/components/schemas/X509CertificateIssuerAndSubjectOptionsDto" + }, + { + "type": "string" + } + ] + }, + "validity": { + "$ref": "#/components/schemas/ValidityDto" + }, + "extensions": { + "$ref": "#/components/schemas/X509CertificateExtensionsOptionsDto" + } + }, + "required": [ + "issuer" + ], + "type": "object", + "additionalProperties": false + }, + "X509ImportCertificateOptionsDto": { + "properties": { + "certificate": { + "type": "string" + }, + "privateKey": { + "type": "string" + }, + "keyType": {} + }, + "required": [ + "certificate", + "keyType" + ], + "type": "object", + "additionalProperties": false + }, + "PublicJwk": { + "properties": {}, + "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.", + "properties": {}, + "type": "object", + "additionalProperties": false + }, + "AnyUint8Array": { + "$ref": "#/components/schemas/Uint8Array" + }, + "X509Certificate": { + "properties": { + "publicJwk": { + "$ref": "#/components/schemas/PublicJwk" + }, + "privateKey": { + "$ref": "#/components/schemas/AnyUint8Array" + } + }, + "required": [ + "publicJwk" + ], + "type": "object", + "additionalProperties": false + }, "QuestionAnswerRole": { "enum": [ "questioner", @@ -712,26 +1104,6 @@ "type": "string", "example": "did:key:z6Mkk7yqnGF3YwTrLpqrW6PGsKci7dNqh1CjnvMbzrMerSeL" }, - "KeyAlgorithm": { - "enum": [ - "a128gcm", - "a256gcm", - "a128cbchs256", - "a256cbchs512", - "a128kw", - "a256kw", - "bls12381g1", - "bls12381g2", - "c20p", - "xc20p", - "ed25519", - "x25519", - "k256", - "p256", - "p384" - ], - "type": "string" - }, "DidDocument": { "$ref": "#/components/schemas/Record_string.any_" }, @@ -1462,6 +1834,217 @@ "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" + } + } + } + } + } + }, "/didcomm/question-answer": { "get": { "operationId": "GetQuestionAnswerRecords", 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 +} From c70738db16fef0ae358ebb27ea62b11995a7fb82 Mon Sep 17 00:00:00 2001 From: shitrerohit Date: Tue, 16 Dec 2025 11:57:54 +0530 Subject: [PATCH 051/152] WIP: bug fixing from issuer and verifier session Signed-off-by: shitrerohit --- package.json | 1 + src/cliAgent.ts | 122 +- .../issuance-sessions.Controller.ts | 198 +-- .../issuance-sessions.service.ts | 287 +++-- .../verification-sessions.Controller.ts | 167 +-- .../verification-sessions.service.ts | 415 +++--- src/routes/swagger.json | 1133 +++++++++++++++-- 7 files changed, 1625 insertions(+), 698 deletions(-) diff --git a/package.json b/package.json index 797dd3f6..13c2b362 100644 --- a/package.json +++ b/package.json @@ -43,6 +43,7 @@ "@credo-ts/anoncreds": "0.6.1", "@credo-ts/askar": "0.6.1", "@credo-ts/core": "0.6.1", + "@credo-ts/didcomm": "0.6.1", "@credo-ts/indy-vdr": "0.6.1", "@credo-ts/node": "0.6.1", "@credo-ts/openid4vc": "0.6.1", diff --git a/src/cliAgent.ts b/src/cliAgent.ts index b25d8025..9e63e9c4 100644 --- a/src/cliAgent.ts +++ b/src/cliAgent.ts @@ -14,7 +14,7 @@ import { DidCommCredentialV1Protocol, DidCommProofV1Protocol, } from '@credo-ts/anoncreds' -import { AskarModule, AskarModuleConfigStoreOptions, AskarMultiWalletDatabaseScheme } from '@credo-ts/askar' +import { AskarModule, AskarMultiWalletDatabaseScheme } from '@credo-ts/askar' import { DidsModule, W3cCredentialsModule, @@ -46,12 +46,20 @@ import { IndyVdrIndyDidRegistrar, } from '@credo-ts/indy-vdr' import { agentDependencies, DidCommHttpInboundTransport, DidCommWsInboundTransport } from '@credo-ts/node' +import { + // OpenId4VcHolderModule, + // OpenId4VcIssuerModule, + OpenId4VcModule, + // OpenId4VcVerifierModule, +} from '@credo-ts/openid4vc' import { QuestionAnswerModule } from '@credo-ts/question-answer' import { TenantsModule } from '@credo-ts/tenants' import { anoncreds } from '@hyperledger/anoncreds-nodejs' -import { askar } from '@openwallet-foundation/askar-nodejs' import { indyVdr } from '@hyperledger/indy-vdr-nodejs' +import { askar } from '@openwallet-foundation/askar-nodejs' import axios from 'axios' +import bodyParser from 'body-parser' +import express from 'express' import { readFile } from 'fs/promises' import { IndicioAcceptanceMechanism, IndicioTransactionAuthorAgreement, Network, NetworkName } from './enums' @@ -60,14 +68,7 @@ import { isCustomDocumentLoaderEnabled } from './utils/config' import { CustomDocumentLoader } from './utils/customDocumentLoader' import { generateSecretKey } from './utils/helpers' import { TsLogger } from './utils/logger' -import { OpenId4VcHolderModule, OpenId4VcIssuerModule, OpenId4VcVerifierModule } from '@credo-ts/openid4vc' -import { - getCredentialRequestToCredentialMapper, - getTrustedCerts, -} from './utils/oid4vc-agent' -import bodyParser from 'body-parser' - -import express from 'express' +import { getCredentialRequestToCredentialMapper, getTrustedCerts } from './utils/oid4vc-agent' const openId4VpApp = express() const openId4VcApp = express() @@ -143,7 +144,7 @@ const getModules = ( autoAcceptCredentials: DidCommAutoAcceptCredential, autoAcceptProofs: DidCommAutoAcceptProof, walletScheme: AskarMultiWalletDatabaseScheme, - storeOptions: AskarModuleConfigStoreOptions + storeOptions: AskarModuleConfigStoreOptions, ) => { const legacyIndyCredentialFormat = new LegacyIndyDidCommCredentialFormatService() const legacyIndyProofFormat = new LegacyIndyDidCommProofFormatService() @@ -155,10 +156,9 @@ const getModules = ( askar: new AskarModule({ askar, store: { - ...storeOptions + ...storeOptions, }, multiWalletDatabaseScheme: walletScheme || AskarMultiWalletDatabaseScheme.ProfilePerWallet, - }), indyVdr: new IndyVdrModule({ @@ -167,10 +167,15 @@ const getModules = ( }), dids: new DidsModule({ - registrars: [new IndyVdrIndyDidRegistrar(), new KeyDidRegistrar() + registrars: [ + new IndyVdrIndyDidRegistrar(), + new KeyDidRegistrar(), // , new PolygonDidRegistrar() ], - resolvers: [new IndyVdrIndyDidResolver(), new KeyDidResolver(), new WebDidResolver() + resolvers: [ + new IndyVdrIndyDidResolver(), + new KeyDidResolver(), + new WebDidResolver(), // , new PolygonDidResolver() ], }), @@ -212,7 +217,11 @@ const getModules = ( indyCredentialFormat: legacyIndyCredentialFormat, }), new DidCommCredentialV2Protocol({ - credentialFormats: [legacyIndyCredentialFormat, jsonLdCredentialFormatService, anonCredsCredentialFormatService], + credentialFormats: [ + legacyIndyCredentialFormat, + jsonLdCredentialFormatService, + anonCredsCredentialFormatService, + ], }), ], }, @@ -222,6 +231,7 @@ const getModules = ( }), questionAnswer: new QuestionAnswerModule(), + openid4vc: new OpenId4VcModule({}), // polygon: new PolygonModule({ // didContractAddress: didRegistryContractAddress // ? didRegistryContractAddress @@ -232,28 +242,52 @@ const getModules = ( // 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`, - app: openId4VpApp, - authorizationRequestExpirationInSeconds: Number(process.env.OID4VP_AUTH_REQUEST_PROOF_REQUEST_EXPIRY) || 3600, - }), - openId4VcIssuer: new OpenId4VcIssuerModule({ - baseUrl: - process.env.NODE_ENV === 'PROD' - ? `https://${process.env.APP_URL}/oid4vci` - : `${process.env.AGENT_HTTP_URL}/oid4vci`, - 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) => getCredentialRequestToCredentialMapper()(...args), - }), - openId4VcHolderModule: new OpenId4VcHolderModule(), + // openid4vc: new OpenId4VcModule({ + // // app: openId4VcApp, + // issuer: { + // baseUrl: + // process.env.NODE_ENV === 'PROD' + // ? `https://${process.env.APP_URL}/oid4vci` + // : `${process.env.AGENT_HTTP_URL}/oid4vci`, + // 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) => getCredentialRequestToCredentialMapper()(...args), + // }, + // verifier: { + // baseUrl: + // process.env.NODE_ENV === 'PROD' + // ? `https://${process.env.APP_URL}/oid4vp` + // : `${process.env.AGENT_HTTP_URL}/oid4vp`, + // app: openId4VpApp, + // authorizationRequestExpirationInSeconds: Number(process.env.OID4VP_AUTH_REQUEST_PROOF_REQUEST_EXPIRY) || 3600, + // }, + // }), + // openId4VcVerifier: new OpenId4VcVerifierModule({ + // baseUrl: + // process.env.NODE_ENV === 'PROD' + // ? `https://${process.env.APP_URL}/oid4vp` + // : `${process.env.AGENT_HTTP_URL}/oid4vp`, + // app: openId4VpApp, + // authorizationRequestExpirationInSeconds: Number(process.env.OID4VP_AUTH_REQUEST_PROOF_REQUEST_EXPIRY) || 3600, + // }), + // openId4VcIssuer: new OpenId4VcIssuerModule({ + // baseUrl: + // process.env.NODE_ENV === 'PROD' + // ? `https://${process.env.APP_URL}/oid4vci` + // : `${process.env.AGENT_HTTP_URL}/oid4vci`, + // 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) => getCredentialRequestToCredentialMapper()(...args), + // }), + // openId4VcHolderModule: new OpenId4VcHolderModule(), x509: new X509Module({ getTrustedCertificatesForVerification: async (_agentContext, { certificateChain, verification }) => { //TODO: We need to trust the certificate tenant wise, for that we need to fetch those details from platform @@ -277,7 +311,7 @@ const getWithTenantModules = ( autoAcceptCredentials: DidCommAutoAcceptCredential, autoAcceptProofs: DidCommAutoAcceptProof, walletScheme: AskarMultiWalletDatabaseScheme, - walletConfig: AskarModuleConfigStoreOptions + walletConfig: AskarModuleConfigStoreOptions, ) => { const modules = getModules( networkConfig, @@ -290,7 +324,7 @@ const getWithTenantModules = ( autoAcceptCredentials, autoAcceptProofs, walletScheme, - walletConfig + walletConfig, ) return { tenants: new TenantsModule({ @@ -420,7 +454,7 @@ export async function runRestAgent(restConfig: AriesRestConfig) { autoAcceptCredentials || DidCommAutoAcceptCredential.Always, autoAcceptProofs || DidCommAutoAcceptProof.ContentApproved, walletScheme || AskarMultiWalletDatabaseScheme.ProfilePerWallet, - walletConfig + walletConfig, ) const modules = getModules( networkConfig, @@ -433,7 +467,7 @@ export async function runRestAgent(restConfig: AriesRestConfig) { autoAcceptCredentials || DidCommAutoAcceptCredential.Always, autoAcceptProofs || DidCommAutoAcceptProof.ContentApproved, walletScheme || AskarMultiWalletDatabaseScheme.ProfilePerWallet, - walletConfig + walletConfig, ) const agent = new Agent({ config: agentConfig, @@ -470,8 +504,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.app) - transport.app.use('/oid4vp', modules.openId4VcVerifier.config.app) + transport.app.use('/oid4vci', modules.openid4vc.issuer?.config.app ?? express.Router()) + transport.app.use('/oid4vp', modules.openid4vc.verifier?.config.app ?? express.Router()) } } diff --git a/src/controllers/openid4vc/issuance-sessions/issuance-sessions.Controller.ts b/src/controllers/openid4vc/issuance-sessions/issuance-sessions.Controller.ts index f49e3d0f..792e58b4 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 ffd2cf17..772cbfff 100644 --- a/src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts +++ b/src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts @@ -1,138 +1,149 @@ -// 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() +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.openid4vc.issuer?.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, + // }) + + const { credentialOffer, issuanceSession } = (await agentReq.agent.modules.openid4vc.issuer?.createCredentialOffer({ + issuerId: publicIssuerId, + issuanceMetadata: options.issuanceMetadata, + credentialConfigurationIds: credentials.map((c) => c.credentialSupportedId), + preAuthorizedCodeFlowConfig: options.preAuthorizedCodeFlowConfig, + authorizationCodeFlowConfig: options.authorizationCodeFlowConfig, + })) as { + credentialOffer: unknown + issuanceSession: unknown + } + + return { credentialOffer, issuanceSession } + } + + public async getIssuanceSessionsById(agentReq: Req, sessionId: string) { + return agentReq.agent.modules.openid4vc.issuer?.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/verifier-sessions/verification-sessions.Controller.ts b/src/controllers/openid4vc/verifier-sessions/verification-sessions.Controller.ts index 83dd01c6..603cd542 100644 --- a/src/controllers/openid4vc/verifier-sessions/verification-sessions.Controller.ts +++ b/src/controllers/openid4vc/verifier-sessions/verification-sessions.Controller.ts @@ -1,87 +1,88 @@ -// 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 { Request as Req } from 'express' +import { Controller, Get, Path, Query, Route, Request, Security, Tags, Post, Body } from 'tsoa' +import { injectable } from 'tsyringe' -// import { verificationSessionService } from './verification-sessions.service' -// import { SCOPES } from '../../../enums' -// import { Request as Req } from 'express' -// import { CreateAuthorizationRequest } from '../types/verifier.types' +import { SCOPES } from '../../../enums' +import ErrorHandlingService from '../../../errorHandlingService' +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) -// } -// } +import { verificationSessionService } from './verification-sessions.service' -// /** -// * 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) -// } -// } +@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) + } + } -// /** -// * 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) -// } -// } -// } + /** + * 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) + } + } +} diff --git a/src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts b/src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts index 1a648246..b5cd628c 100644 --- a/src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts +++ b/src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts @@ -1,209 +1,206 @@ -// 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() +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 { Request as Req } from 'express' +import { injectable } from 'tsyringe' + +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.openid4vc.verifier?.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.openid4vc.verifier?.findVerificationSessionsByQuery({ + verifierId: publicVerifierId, + payloadState, + state, + authorizationRequestUri, + nonce, + }) + } + + public async getVerificationSessionsById(agentReq: Req, verificationSessionId: string) { + return await agentReq.agent.modules.openid4vc.verifier?.getVerificationSessionById(verificationSessionId) + } + + public async getVerifiedAuthorizationResponse(request: Req, verificationSessionId: string) { + const verificationSession = + await request.agent.modules.openid4vc.verifier?.getVerificationSessionById(verificationSessionId) + const verified = await request.agent.modules.openid4vc.verifier?.getVerifiedAuthorizationResponse( + verificationSession!.id, + ) + + const presentations = await Promise.all( + (verified!.presentationExchange?.presentations ?? Object.values(verified!.dcql?.presentations ?? {})) + .flat() + .map(async (presentation: 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 + + 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/routes/swagger.json b/src/routes/swagger.json index 1525c153..1dccfa78 100644 --- a/src/routes/swagger.json +++ b/src/routes/swagger.json @@ -416,11 +416,6 @@ ], "type": "string" }, - "Record_string.unknown_": { - "properties": {}, - "type": "object", - "description": "Construct a type with a set of properties K of type T" - }, "RecordId": { "type": "string", "example": "821f9b26-ad04-4f56-89b6-e2ef9c72b36e" @@ -521,40 +516,6 @@ "type": "object", "additionalProperties": false }, - "JsonValue": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "number", - "format": "double" - }, - { - "type": "boolean" - }, - { - "$ref": "#/components/schemas/JsonObject" - }, - { - "$ref": "#/components/schemas/JsonArray" - } - ], - "nullable": true - }, - "JsonObject": { - "properties": {}, - "type": "object", - "additionalProperties": { - "$ref": "#/components/schemas/JsonValue" - } - }, - "JsonArray": { - "items": { - "$ref": "#/components/schemas/JsonValue" - }, - "type": "array" - }, "Pick_JwsGeneralFormat.Exclude_keyofJwsGeneralFormat.payload__": { "properties": { "header": { @@ -1527,111 +1488,799 @@ } ] }, - "W3cIssuer": { + "W3cJsonLdVerifiableCredential": { "properties": { + "context": { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/components/schemas/JsonObject" + } + ] + }, + "type": "array" + }, "id": { "type": "string" + }, + "type": { + "items": { + "type": "string" + }, + "type": "array" + }, + "input_descriptors": { + "items": { + "$ref": "#/components/schemas/InputDescriptorV2Model" + }, + "type": "array" + }, + "frame": { + "additionalProperties": false, + "type": "object" } }, "required": [ - "id" + "id", + "input_descriptors" ], "type": "object", "additionalProperties": false }, - "W3cCredentialSubject": { + "PresentationDefinition": { "properties": { - "id": { - "type": "string" - }, - "claims": { - "$ref": "#/components/schemas/Record_string.unknown_" + "definition": { + "$ref": "#/components/schemas/DifPresentationExchangeDefinitionV2Model" } }, + "required": [ + "definition" + ], "type": "object", "additionalProperties": false }, - "SingleOrArray_W3cCredentialSubject_": { - "anyOf": [ - { - "$ref": "#/components/schemas/W3cCredentialSubject" - }, - { + "DcqlClaim": { + "properties": { + "path": { "items": { - "$ref": "#/components/schemas/W3cCredentialSubject" + "type": "string" }, "type": "array" + }, + "intent_to_retain": { + "type": "boolean" } - ] + }, + "required": [ + "path" + ], + "type": "object", + "additionalProperties": false }, - "W3cCredentialSchema": { + "DcqlCredential": { "properties": { "id": { "type": "string" }, - "type": { + "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", - "type" + "format", + "claims" ], "type": "object", "additionalProperties": false }, - "SingleOrArray_W3cCredentialSchema_": { - "anyOf": [ - { - "$ref": "#/components/schemas/W3cCredentialSchema" + "DcqlQuery": { + "properties": { + "combine": { + "type": "string", + "enum": [ + "all", + "any" + ] }, - { + "credentials": { "items": { - "$ref": "#/components/schemas/W3cCredentialSchema" + "$ref": "#/components/schemas/DcqlCredential" }, "type": "array" } - ] + }, + "required": [ + "credentials" + ], + "type": "object", + "additionalProperties": false }, - "W3cCredentialStatus": { + "DcqlDefinition": { "properties": { - "id": { + "query": { + "$ref": "#/components/schemas/DcqlQuery" + } + }, + "required": [ + "credential", + "proof" + ], + "type": "object", + "additionalProperties": false + }, + "TenantConfig": { + "properties": { + "label": { + "type": "string" + } + }, + "required": [ + "label" + ], + "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" }, - "type": { + "connectionImageUrl": { "type": "string" } }, "required": [ - "id", - "type" + "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 }, - "W3cJsonLdVerifiableCredential": { + "JwtObject": { "properties": { - "context": { + "alg": { "items": { - "anyOf": [ - { - "type": "string" - }, - { - "$ref": "#/components/schemas/JsonObject" - } - ] + "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" }, - "id": { - "type": "string" - }, - "type": { + "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": { @@ -1739,76 +2388,123 @@ } }, "required": [ - "credential", - "proof" + "query" ], "type": "object", "additionalProperties": false }, - "TenantConfig": { + "ResponseModeEnum": { + "enum": [ + "direct_post", + "direct_post.jwt", + "dc_api", + "dc_api.jwt" + ], + "type": "string" + }, + "OpenId4VcJwtIssuerDid": { "properties": { - "label": { + "didUrl": { "type": "string" + }, + "method": { + "type": "string", + "enum": [ + "did" + ], + "nullable": false } }, "required": [ - "label" + "didUrl", + "method" ], "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", + "OpenId4VcIssuerX5c": { "properties": { - "data": { - "$ref": "#/components/schemas/MetadataBase" + "alg": { + "type": "string" + }, + "x5c": { + "items": { + "type": "string" + }, + "type": "array" + }, + "issuer": { + "type": "string" + }, + "method": { + "type": "string", + "enum": [ + "x5c" + ], + "nullable": false } }, "required": [ - "data" + "x5c", + "method" ], - "type": "object", - "additionalProperties": false + "type": "object" }, - "Pick_CustomTenantConfig.Exclude_keyofCustomTenantConfig.walletConfig__": { + "CreateAuthorizationRequest": { "properties": { - "label": { + "verifierId": { "type": "string" }, - "connectionImageUrl": { - "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": [ - "label" + "verifierId", + "requestSigner" ], "type": "object", - "description": "From T, pick a set of properties whose keys are in the union K" + "additionalProperties": false }, - "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." + "OpenId4VcVerificationSessionRecord": { + "$ref": "#/components/schemas/Record_string.unknown_" }, - "CreateTenantOptions": { - "properties": { - "config": { - "$ref": "#/components/schemas/Omit_CustomTenantConfig.walletConfig_" - } - }, - "required": [ - "config" + "OpenId4VcVerificationSessionState": { + "enum": [ + "RequestCreated", + "RequestUriRetrieved", + "ResponseVerified", + "Error" ], - "type": "object", - "additionalProperties": false + "type": "string" } }, "securitySchemes": { @@ -3978,6 +4674,193 @@ } ] } + }, + "/openid4vc/verification-sessions/create-presentation-request": { + "post": { + "operationId": "CreateProofRequest", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": {} + } + } + } + }, + "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" + } + } + } + } + } + }, + "/openid4vc/verification-sessions": { + "get": { + "operationId": "GetAllVerificationSessions", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/OpenId4VcVerificationSessionRecord" + }, + "type": "array" + } + } + } + } + }, + "description": "Retrieve all verification session records", + "tags": [ + "oid4vc verification sessions" + ], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } + ], + "parameters": [ + { + "in": "query", + "name": "publicVerifierId", + "required": false, + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "payloadState", + "required": false, + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "state", + "required": false, + "schema": { + "$ref": "#/components/schemas/OpenId4VcVerificationSessionState" + } + }, + { + "in": "query", + "name": "authorizationRequestUri", + "required": false, + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "nonce", + "required": false, + "schema": { + "type": "string" + } + } + ] + } + }, + "/openid4vc/verification-sessions/{verificationSessionId}": { + "get": { + "operationId": "GetVerificationSessionsById", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenId4VcVerificationSessionRecord" + } + } + } + } + }, + "description": "Get verification session by ID", + "tags": [ + "oid4vc verification sessions" + ], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } + ], + "parameters": [ + { + "in": "path", + "name": "verificationSessionId", + "required": true, + "schema": { + "type": "string" + } + } + ] + } + }, + "/openid4vc/verification-sessions/response/{verificationSessionId}": { + "get": { + "operationId": "GetVerifiedAuthorizationResponse", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": {} + } + } + } + }, + "tags": [ + "oid4vc verification sessions" + ], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } + ], + "parameters": [ + { + "in": "path", + "name": "verificationSessionId", + "required": true, + "schema": { + "type": "string" + } + } + ] + } } }, "servers": [ From 4b8fb913e8b10c5e9546bf4ca5777b6ea41f920a Mon Sep 17 00:00:00 2001 From: shitrerohit Date: Tue, 16 Dec 2025 12:27:58 +0530 Subject: [PATCH 052/152] fix:changes on cli agent file Signed-off-by: shitrerohit --- src/cliAgent.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/cliAgent.ts b/src/cliAgent.ts index 9e63e9c4..f6cb383c 100644 --- a/src/cliAgent.ts +++ b/src/cliAgent.ts @@ -1,6 +1,7 @@ // 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 { AskarModuleConfigStoreOptions } from '@credo-ts/askar' import type { InitConfig } from '@credo-ts/core' import type { IndyVdrPoolConfig } from '@credo-ts/indy-vdr' From a4391dd6bbb974c78ea02de76d80869a74b6b554 Mon Sep 17 00:00:00 2001 From: shitrerohit Date: Tue, 16 Dec 2025 18:22:21 +0530 Subject: [PATCH 053/152] WIP:changes in create issuer work flow Signed-off-by: shitrerohit --- src/cliAgent.ts | 63 +++--- .../openid4vc/issuers/issuer.Controller.ts | 187 ++++++++---------- .../openid4vc/issuers/issuer.service.ts | 114 +++++------ .../openid4vc/types/issuer.types.ts | 5 +- 4 files changed, 182 insertions(+), 187 deletions(-) diff --git a/src/cliAgent.ts b/src/cliAgent.ts index f6cb383c..73c762f8 100644 --- a/src/cliAgent.ts +++ b/src/cliAgent.ts @@ -132,7 +132,13 @@ export async function readRestConfig(path: string) { export type RestMultiTenantAgentModules = Awaited> export type RestAgentModules = Awaited> - +function requireEnv(name: string): string { + const value = process.env[name] + if (!value) { + throw new Error(`Missing environment variable: ${name}`) + } + return value +} // TODO: add object const getModules = ( networkConfig: [IndyVdrPoolConfig, ...IndyVdrPoolConfig[]], @@ -232,7 +238,8 @@ const getModules = ( }), questionAnswer: new QuestionAnswerModule(), - openid4vc: new OpenId4VcModule({}), + // openid4vc: new OpenId4VcModule({}), + // Todo: We can remove this polygon module for time being // polygon: new PolygonModule({ // didContractAddress: didRegistryContractAddress // ? didRegistryContractAddress @@ -243,30 +250,30 @@ const getModules = ( // rpcUrl: rpcUrl ? rpcUrl : (process.env.RPC_URL as string), // serverUrl: fileServerUrl ? fileServerUrl : (process.env.SERVER_URL as string), // }), - // openid4vc: new OpenId4VcModule({ - // // app: openId4VcApp, - // issuer: { - // baseUrl: - // process.env.NODE_ENV === 'PROD' - // ? `https://${process.env.APP_URL}/oid4vci` - // : `${process.env.AGENT_HTTP_URL}/oid4vci`, - // 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) => getCredentialRequestToCredentialMapper()(...args), - // }, - // verifier: { - // baseUrl: - // process.env.NODE_ENV === 'PROD' - // ? `https://${process.env.APP_URL}/oid4vp` - // : `${process.env.AGENT_HTTP_URL}/oid4vp`, - // app: openId4VpApp, - // authorizationRequestExpirationInSeconds: Number(process.env.OID4VP_AUTH_REQUEST_PROOF_REQUEST_EXPIRY) || 3600, - // }, - // }), + openid4vc: new OpenId4VcModule({ + // app: openId4VcApp, + issuer: { + baseUrl: + process.env.NODE_ENV === 'PROD' + ? `https://${requireEnv('APP_URL')}/oid4vci` + : `${requireEnv('AGENT_HTTP_URL')}/oid4vci`, + 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) => getCredentialRequestToCredentialMapper()(...args), + }, + verifier: { + baseUrl: + process.env.NODE_ENV === 'PROD' + ? `https://${requireEnv('APP_URL')}/oid4vp` + : `${requireEnv('AGENT_HTTP_URL')}/oid4vp`, + app: openId4VpApp, + authorizationRequestExpirationInSeconds: Number(process.env.OID4VP_AUTH_REQUEST_PROOF_REQUEST_EXPIRY) || 3600, + }, + }), // openId4VcVerifier: new OpenId4VcVerifierModule({ // baseUrl: // process.env.NODE_ENV === 'PROD' @@ -505,8 +512,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.openid4vc.issuer?.config.app ?? express.Router()) - transport.app.use('/oid4vp', modules.openid4vc.verifier?.config.app ?? express.Router()) + transport.app.use('/oid4vci', modules.openid4vc.issuer?.config.app._router ?? express.Router()) + transport.app.use('/oid4vp', modules.openid4vc.verifier?.config.app._router ?? express.Router()) } } diff --git a/src/controllers/openid4vc/issuers/issuer.Controller.ts b/src/controllers/openid4vc/issuers/issuer.Controller.ts index 149ed0b8..8e6bfea4 100644 --- a/src/controllers/openid4vc/issuers/issuer.Controller.ts +++ b/src/controllers/openid4vc/issuers/issuer.Controller.ts @@ -1,108 +1,93 @@ -// import { -// Controller, -// Delete, -// Get, -// Post, -// Put, -// Route, -// Tags, -// Path, -// Query, -// Body, -// Security, -// Request, -// Example -// } from 'tsoa' -// import { injectable } from 'tsyringe' +import { Request as Req } from 'express' +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 { SCOPES } from '../../../enums' +import ErrorHandlingService from '../../../errorHandlingService' +import { OpenId4VcUpdateIssuerRecordOptionsExample } from '../examples/issuer.examples' +import { CreateIssuerOptions, UpdateIssuerRecordOptions } from '../types/issuer.types' -// 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' -// /** -// * 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) -// } -// } +@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) + } + } -// /** -// * 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) -// } -// } + /** + * 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) + } + } -// /** -// * 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 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 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) -// } -// } + /** + * 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) + } + } -// /** -// * 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) -// } -// } -// } + /** + * 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) + // } + // } +} diff --git a/src/controllers/openid4vc/issuers/issuer.service.ts b/src/controllers/openid4vc/issuers/issuer.service.ts index f1552097..416f4d77 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 { 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() +import type { RestAgentModules } from '../../../cliAgent' +import type { Agent } from '@credo-ts/core' +import type { Request as Req } from 'express' + +// import { OpenId4VcIssuerRepository } from '@credo-ts/openid4vc/build/openid4vc-issuer/repository/OpenId4VcIssuerRepository.mjs' + +export class IssuerService { + public async createIssuerAgent( + agentReq: Req, + createIssuerOptions: any, //TODO: Replace with OpenId4VciCreateIssuerOptions, + ) { + console.log('Creating issuer agent with options:', JSON.stringify(createIssuerOptions)) + const issuerRecord = await agentReq.agent.modules.openid4vc.issuer?.createIssuer(createIssuerOptions) + console.log('Created issuer record:', JSON.stringify(issuerRecord, null, 2)) + const issuerMetadata = await agentReq.agent.modules.openid4vc.issuer?.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.openid4vc.issuer?.updateIssuerMetadata({ + issuerId: publicIssuerId, + ...updateIssuerRecordOptions, + }) + return await this.getIssuer(agentReq, publicIssuerId) + } + + public async getIssuersByQuery(agentReq: Req, publicIssuerId?: string) { + const result = publicIssuerId + ? (agentReq.agent as Agent).openid4vc.issuer.getIssuerByIssuerId(publicIssuerId) // .dependencyManager.resolve(OpenId4VcIssuerRepository) + : (agentReq.agent as Agent).openid4vc.issuer.getAllIssuers() + return result + } + + public async getIssuer(agentReq: Req, publicIssuerId: string) { + return await agentReq.agent.modules.openid4vc.issuer?.getIssuerByIssuerId(publicIssuerId) + } + + // public async deleteIssuer(agentReq: Req, issuerId: string) { + // const result = (agentReq.agent as Agent).openid4vc.config.issuer. + // return result + // } + + 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/types/issuer.types.ts b/src/controllers/openid4vc/types/issuer.types.ts index 9c37ea52..9411dd1f 100644 --- a/src/controllers/openid4vc/types/issuer.types.ts +++ b/src/controllers/openid4vc/types/issuer.types.ts @@ -1,6 +1,9 @@ import type { MdocNameSpaces, W3cCredential } from '@credo-ts/core' import type { OpenId4VciCredentialFormatProfile } from '@credo-ts/openid4vc' +import { Kms } from '@credo-ts/core' +import { OpenId4VciCreateCredentialOfferOptions, OpenId4VciSignCredentials } from '@credo-ts/openid4vc' + export enum SignerMethod { Did = 'did', X5c = 'x5c', @@ -141,7 +144,7 @@ export interface CredentialConfigurationSupportedWithFormats { } export interface CreateIssuerOptions { issuerId?: string - accessTokenSignerKeyType?: string + accessTokenSignerKeyType?: any display?: CredentialDisplay[] authorizationServerConfigs?: AuthorizationServerConfig[] dpopSigningAlgValuesSupported?: string[] From fcc89d974dce50c0c6caa76b96038c7321aaf9d1 Mon Sep 17 00:00:00 2001 From: shitrerohit Date: Fri, 19 Dec 2025 20:13:16 +0530 Subject: [PATCH 054/152] WIP:Resolving the issues from issue credential workflow. Signed-off-by: shitrerohit --- src/cliAgent.ts | 23 +- .../holder/credentialBindingResolver.ts | 130 ++++ .../openid4vc/holder/holder.Controller.ts | 172 +++--- .../openid4vc/holder/holder.service.ts | 560 ++++++++++-------- .../openid4vc/issuers/issuer.service.ts | 7 +- .../openid4vc/types/issuer.types.ts | 26 +- 6 files changed, 563 insertions(+), 355 deletions(-) create mode 100644 src/controllers/openid4vc/holder/credentialBindingResolver.ts diff --git a/src/cliAgent.ts b/src/cliAgent.ts index 73c762f8..838a39f2 100644 --- a/src/cliAgent.ts +++ b/src/cliAgent.ts @@ -48,6 +48,7 @@ import { } from '@credo-ts/indy-vdr' import { agentDependencies, DidCommHttpInboundTransport, DidCommWsInboundTransport } from '@credo-ts/node' import { + OpenId4VcHolderModule, // OpenId4VcHolderModule, // OpenId4VcIssuerModule, OpenId4VcModule, @@ -69,10 +70,7 @@ import { isCustomDocumentLoaderEnabled } from './utils/config' import { CustomDocumentLoader } from './utils/customDocumentLoader' import { generateSecretKey } from './utils/helpers' import { TsLogger } from './utils/logger' -import { getCredentialRequestToCredentialMapper, getTrustedCerts } from './utils/oid4vc-agent' - -const openId4VpApp = express() -const openId4VcApp = express() +import { getMixedCredentialRequestToCredentialMapper, getTrustedCerts } from './utils/oid4vc-agent' export type Transports = 'ws' | 'http' export type InboundTransport = { @@ -139,6 +137,7 @@ function requireEnv(name: string): string { } return value } +const expressApp = express() // TODO: add object const getModules = ( networkConfig: [IndyVdrPoolConfig, ...IndyVdrPoolConfig[]], @@ -159,6 +158,7 @@ const getModules = ( const anonCredsCredentialFormatService = new AnonCredsDidCommCredentialFormatService() const anonCredsProofFormatService = new AnonCredsDidCommProofFormatService() const presentationExchangeProofFormatService = new DidCommDifPresentationExchangeProofFormatService() + return { askar: new AskarModule({ askar, @@ -251,26 +251,26 @@ const getModules = ( // serverUrl: fileServerUrl ? fileServerUrl : (process.env.SERVER_URL as string), // }), openid4vc: new OpenId4VcModule({ - // app: openId4VcApp, + app: expressApp, issuer: { baseUrl: process.env.NODE_ENV === 'PROD' ? `https://${requireEnv('APP_URL')}/oid4vci` : `${requireEnv('AGENT_HTTP_URL')}/oid4vci`, - app: openId4VcApp, + app: expressApp, 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) => getCredentialRequestToCredentialMapper()(...args), + credentialRequestToCredentialMapper: (...args) => getMixedCredentialRequestToCredentialMapper()(...args), }, verifier: { baseUrl: process.env.NODE_ENV === 'PROD' ? `https://${requireEnv('APP_URL')}/oid4vp` : `${requireEnv('AGENT_HTTP_URL')}/oid4vp`, - app: openId4VpApp, + // app: openId4VpApp, authorizationRequestExpirationInSeconds: Number(process.env.OID4VP_AUTH_REQUEST_PROOF_REQUEST_EXPIRY) || 3600, }, }), @@ -295,7 +295,7 @@ const getModules = ( // dpopRequired: false, // credentialRequestToCredentialMapper: (...args) => getCredentialRequestToCredentialMapper()(...args), // }), - // openId4VcHolderModule: new OpenId4VcHolderModule(), + openId4VcHolderModule: new OpenId4VcHolderModule(), x509: new X509Module({ getTrustedCertificatesForVerification: async (_agentContext, { certificateChain, verification }) => { //TODO: We need to trust the certificate tenant wise, for that we need to fetch those details from platform @@ -512,8 +512,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.openid4vc.issuer?.config.app._router ?? express.Router()) - transport.app.use('/oid4vp', modules.openid4vc.verifier?.config.app._router ?? express.Router()) + // transport.app.use('/oid4vci', modules.openid4vc.issuer?.config.app.routes ?? express.Router()) + // transport.app.use('/oid4vp', modules.openid4vc.verifier?.config.app.routes ?? express.Router()) } } @@ -549,6 +549,7 @@ export async function runRestAgent(restConfig: AriesRestConfig) { webhookUrl, port: adminPort, schemaFileServerURL, + app: expressApp, }, apiKey, ) diff --git a/src/controllers/openid4vc/holder/credentialBindingResolver.ts b/src/controllers/openid4vc/holder/credentialBindingResolver.ts new file mode 100644 index 00000000..1875c4cc --- /dev/null +++ b/src/controllers/openid4vc/holder/credentialBindingResolver.ts @@ -0,0 +1,130 @@ +import { DidJwk, DidKey, DidsApi, type JwkDidCreateOptions, type KeyDidCreateOptions, Kms } from '@credo-ts/core' +import { type OpenId4VciCredentialBindingResolver, OpenId4VciCredentialFormatProfile } from '@credo-ts/openid4vc' + +export function getCredentialBindingResolver({ + pidSchemes, + requestBatch, +}: { + pidSchemes?: { sdJwtVcVcts: Array; msoMdocDoctypes: Array } + requestBatch?: boolean | number +}): OpenId4VciCredentialBindingResolver { + return async ({ + supportedDidMethods, + credentialConfiguration, + issuerMaxBatchSize, + proofTypes, + supportsAllDidMethods, + supportsJwk, + credentialFormat, + agentContext, + }) => { + const kms = agentContext.resolve(Kms.KeyManagementApi) + + // First, we try to pick a did method + // Prefer did:jwk, otherwise use did:key, otherwise use undefined + let didMethod: 'key' | 'jwk' | undefined = + supportsAllDidMethods || supportedDidMethods?.includes('did:jwk') + ? 'jwk' + : supportedDidMethods?.includes('did:key') + ? 'key' + : undefined + + // If supportedDidMethods is undefined, and supportsJwk is false, we will default to did:key + // this is important as part of MATTR launchpad support which MUST use did:key but doesn't + // define which did methods they support + if (!supportedDidMethods && !supportsJwk) { + didMethod = 'key' + } + + const shouldKeyBeHardwareBackedForMsoMdoc = + credentialConfiguration?.format === OpenId4VciCredentialFormatProfile.MsoMdoc && + pidSchemes?.msoMdocDoctypes.includes(credentialConfiguration.doctype) + + const shouldKeyBeHardwareBackedForSdJwtVc = + (credentialConfiguration?.format === 'vc+sd-jwt' || credentialConfiguration.format === 'dc+sd-jwt') && + credentialConfiguration.vct && + pidSchemes?.sdJwtVcVcts.includes(credentialConfiguration.vct) + + const shouldKeyBeHardwareBacked = shouldKeyBeHardwareBackedForSdJwtVc || shouldKeyBeHardwareBackedForMsoMdoc + + // We don't want to request more than 10 credentials + const batchSize = + requestBatch === true + ? Math.min(issuerMaxBatchSize, 10) + : typeof requestBatch === 'number' + ? Math.min(issuerMaxBatchSize, requestBatch) + : 1 + console.log('proofTypes', JSON.stringify(proofTypes)) + // TODO: support key attestations + if (!proofTypes.jwt || proofTypes.jwt.keyAttestationsRequired) { + throw new Error('Unable to request credentials. Only jwt proof type without key attestations supported') + } + + const signatureAlgorithm = proofTypes.jwt?.supportedSignatureAlgorithms[0] + const keys = await Promise.all( + new Array(batchSize).fill(0).map(() => + kms + .createKeyForSignatureAlgorithm({ + algorithm: signatureAlgorithm!, + // FIXME: what should happen with already existing keys created in the secure environment? + backend: shouldKeyBeHardwareBacked ? 'secureEnvironment' : 'askar', + }) + .then((key) => Kms.PublicJwk.fromUnknown(key.publicJwk)), + ), + ) + + if (didMethod) { + const dm = didMethod + const didsApi = agentContext.dependencyManager.resolve(DidsApi) + const didResults = await Promise.all( + keys.map(async (key) => { + const didResult = await didsApi.create({ + method: dm, + options: { + keyId: key.keyId, + }, + }) + + if (didResult.didState.state !== 'finished') { + throw new Error('DID creation failed.') + } + + let verificationMethodId: string + if (didMethod === 'jwk') { + const didJwk = DidJwk.fromDid(didResult.didState.did) + verificationMethodId = didJwk.verificationMethodId + } else { + const didKey = DidKey.fromDid(didResult.didState.did) + verificationMethodId = `${didKey.did}#${didKey.publicJwk.fingerprint}` + } + + return verificationMethodId + }), + ) + + return { + method: 'did', + didUrls: didResults, + } + } + + // Otherwise we also support plain jwk for sd-jwt only + if ( + supportsJwk && + (credentialFormat === OpenId4VciCredentialFormatProfile.SdJwtVc || + credentialFormat === OpenId4VciCredentialFormatProfile.SdJwtDc || + credentialFormat === OpenId4VciCredentialFormatProfile.MsoMdoc) + ) { + return { + method: 'jwk', + keys, + } + } + + throw new Error( + `No supported binding method could be found. Supported methods are did:key and did:jwk, or plain jwk for sd-jwt/mdoc. Issuer supports ${ + supportsJwk ? 'jwk, ' : '' + }${supportedDidMethods?.join(', ') ?? 'Unknown'}`, + ) + } +} diff --git a/src/controllers/openid4vc/holder/holder.Controller.ts b/src/controllers/openid4vc/holder/holder.Controller.ts index 30f92ad1..8e976112 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) + } +} diff --git a/src/controllers/openid4vc/holder/holder.service.ts b/src/controllers/openid4vc/holder/holder.service.ts index bb2adbc5..555f778f 100644 --- a/src/controllers/openid4vc/holder/holder.service.ts +++ b/src/controllers/openid4vc/holder/holder.service.ts @@ -1,280 +1,338 @@ -// 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 type { Request as Req } from 'express' -// 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, + Mdoc, + W3cJsonLdVerifiableCredential, + W3cJwtVerifiableCredential, +} from '@credo-ts/core' +import { + OpenId4VciAuthorizationFlow, + authorizationCodeGrantIdentifier, + preAuthorizedCodeGrantIdentifier, +} from '@credo-ts/openid4vc' -// public async getSdJwtCredentials(agentReq: Req) { -// return await agentReq.agent.sdJwtVc.getAll() -// } +import { getCredentialBindingResolver } from './credentialBindingResolver' +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 getMdocCredentials(agentReq: Req) { -// return await agentReq.agent.mdoc.getAll() -// } + public async getSdJwtCredentials(agentReq: Req) { + return await agentReq.agent.sdJwtVc.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 getMdocCredentials(agentReq: Req) { + return await agentReq.agent.mdoc.getAll() + } -// public async resolveCredentialOffer(agentReq: Req, body: ResolveCredentialOfferBody) { -// return (await agentReq.agent.modules.openId4VcHolderModule.resolveCredentialOffer(body.credentialOfferUri)) 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 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 resolveCredentialOffer(agentReq: Req, body: ResolveCredentialOfferBody) { + return (await agentReq.agent.modules.openid4vc.holder.resolveCredentialOffer(body.credentialOfferUri)) as any + } -// let actionToTake = '' -// let authorizationRequestUrl: string | undefined = undefined -// let codeVerifier: string | undefined = undefined -// console.log('Resolved authorization', resolvedAuthorization) + public async requestAuthorizationForCredential(agentReq: Req, body: AuthorizeRequestCredentialOffer) { + const resolvedCredentialOffer = await agentReq.agent.modules.openid4vc.holder.resolveCredentialOffer( + body.credentialOfferUri, + ) + const resolvedAuthorization = await this.initiateAuthorization( + agentReq, + resolvedCredentialOffer, + body.credentialsToRequest, + ) -// 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 -// } + let actionToTake = '' + let authorizationRequestUrl: string | undefined = undefined + let codeVerifier: string | undefined = undefined -// return { actionToTake, authorizationRequestUrl, codeVerifier } as any -// } + 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 + } -// public async requestCredential(agentReq: Req, body: RequestCredentialBody) { -// const resolvedCredentialOffer = await agentReq.agent.modules.openId4VcHolderModule.resolveCredentialOffer( -// body.credentialOfferUri, -// ) + return { actionToTake, authorizationRequestUrl, codeVerifier } as any + } -// 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 -// } + public async requestCredential(agentReq: Req, body: RequestCredentialBody) { + const resolvedCredentialOffer = await agentReq.agent.modules.openid4vc.holder.resolveCredentialOffer( + body.credentialOfferUri, + ) -// // return (await this.requestAndStoreCredentials(agentReq, resolvedCredentialOffer, options)) as any -// return {} as any -// } + 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 + } -// // 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, -// // }) + 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, + // // }) -// // 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 requestAndStoreCredentials( + agentReq: Req, + resolvedCredentialOffer: OpenId4VciResolvedCredentialOffer, + options: OpenId4VciTokenRequestOptions, + ) { + const tokenResponse = await agentReq.agent.modules.openid4vc.holder.requestToken({ ...options }) + const credentialResponse = await agentReq.agent.modules.openid4vc.holder.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) } + // }, + credentialBindingResolver: getCredentialBindingResolver({ + pidSchemes: undefined, + requestBatch: false, + }), + ...tokenResponse, + }) + // const credentialResponse = await agentReq.agent.modules.openid4vc.holder.requestCredentials({ + // ...options, + // credentialConfigurationIds: resolvedCredentialOffer.credentialOfferPayload.credential_configuration_ids, + // credentialBindingResolver: async (options) => { + // const { keyId, publicJwk } = await agentReq.agent.kms.createKey({ + // type: { + // crv: 'Ed25519', + // kty: 'OKP', + // }, + // }) + // if (options.supportsAllDidMethods || options.supportedDidMethods?.includes('did:key')) { + // const didKey = new DidKey(key) + // return { method: 'did', didUrls: [`${didKey.did}#${didKey.key.fingerprint}`] } + // } + // if (options.supportedDidMethods?.includes('did:jwk')) { + // const didJwk = DidJwk.fromKey(key) + // return { method: 'did', didUrls: [`${didJwk.did}#0`] } + // } + // return { method: 'jwk', jwk: key } + // }, + // }) -// private async initiateAuthorization( -// agentReq: Req, -// resolvedCredentialOffer: OpenId4VciResolvedCredentialOffer, -// credentialsToRequest: string[], -// ) { -// console.log('Initiating authorization with resolvedCredentialOffer:', resolvedCredentialOffer) -// console.log('Credentials to request:', credentialsToRequest) + 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({ record: credential }) + // } + return await agentReq.agent.sdJwtVc.store(credential.compact) + }), + ) -// const grants = resolvedCredentialOffer.credentialOfferPayload.grants -// console.log('Grants:', grants) + return storedCredentials as any + } -// // 👉 Handle Pre-Authorized Code Grant -// if (grants?.[preAuthorizedCodeGrantIdentifier]) { -// const preAuthorizedCode = grants[preAuthorizedCodeGrantIdentifier]['pre-authorized_code'] -// return { -// authorizationFlow: 'PreAuthorized' as const, -// preAuthorizedCode, -// } -// } + private async initiateAuthorization( + agentReq: Req, + resolvedCredentialOffer: OpenId4VciResolvedCredentialOffer, + credentialsToRequest: string[], + ) { + const grants = resolvedCredentialOffer.credentialOfferPayload.grants -// // 👉 Handle Authorization Code Grant -// if (grants?.[authorizationCodeGrantIdentifier]) { -// console.log('Using authorization code grant flow') + // 👉 Handle Pre-Authorized Code Grant + if (grants?.[preAuthorizedCodeGrantIdentifier]) { + const preAuthorizedCode = grants[preAuthorizedCodeGrantIdentifier]['pre-authorized_code'] + return { + authorizationFlow: 'PreAuthorized' as const, + preAuthorizedCode, + } + } -// const scope = Object.entries(resolvedCredentialOffer.offeredCredentialConfigurations) -// .map(([id, val]) => (credentialsToRequest.includes(id) ? val.scope : undefined)) -// .filter((v): v is string => Boolean(v)) + // 👉 Handle Authorization Code Grant + if (grants?.[authorizationCodeGrantIdentifier]) { + 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.openid4vc.holder.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.openid4vc.holder.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.openid4vc.holder.resolveOpenId4VpAuthorizationRequest( + body.proofRequestUri, + ) + // 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') + // + let dcqlCredentials + try { + dcqlCredentials = await agentReq.agent.modules.openid4vc.holder.selectCredentialsForDcqlRequest( + resolved.dcql.queryResult, + ) + } catch (error) { + throw error + } + const submissionResult = await agentReq.agent.modules.openid4vc.holder.acceptOpenId4VpAuthorizationRequest({ + authorizationRequestPayload: resolved.authorizationRequestPayload, + dcql: { + credentials: dcqlCredentials as DcqlCredentialsForRequest, + }, + }) + 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.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() + 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/issuers/issuer.service.ts b/src/controllers/openid4vc/issuers/issuer.service.ts index 416f4d77..0d0ba61d 100644 --- a/src/controllers/openid4vc/issuers/issuer.service.ts +++ b/src/controllers/openid4vc/issuers/issuer.service.ts @@ -1,4 +1,5 @@ import type { RestAgentModules } from '../../../cliAgent' +import type { CreateIssuerOptions } from '../types/issuer.types' import type { Agent } from '@credo-ts/core' import type { Request as Req } from 'express' @@ -9,9 +10,7 @@ export class IssuerService { agentReq: Req, createIssuerOptions: any, //TODO: Replace with OpenId4VciCreateIssuerOptions, ) { - console.log('Creating issuer agent with options:', JSON.stringify(createIssuerOptions)) const issuerRecord = await agentReq.agent.modules.openid4vc.issuer?.createIssuer(createIssuerOptions) - console.log('Created issuer record:', JSON.stringify(issuerRecord, null, 2)) const issuerMetadata = await agentReq.agent.modules.openid4vc.issuer?.getIssuerMetadata( issuerRecord?.issuerId ?? '', ) @@ -49,8 +48,8 @@ export class IssuerService { // } public async getIssuerAgentMetaData(agentReq: Req, issuerId: string) { - // return await agent.modules.openId4VcIssuer.getIssuerMetadata(issuerId) - return 0 + return (await agentReq.agent.modules.openid4vc.issuer?.getIssuerMetadata(issuerId)) as any + // return 0 } } diff --git a/src/controllers/openid4vc/types/issuer.types.ts b/src/controllers/openid4vc/types/issuer.types.ts index 9411dd1f..1f9cf4ad 100644 --- a/src/controllers/openid4vc/types/issuer.types.ts +++ b/src/controllers/openid4vc/types/issuer.types.ts @@ -55,6 +55,7 @@ export interface OpenId4VciOfferW3cCredential extends OpenId4VciOfferCredentials } export interface OpenId4VcIssuanceSessionsCreateOffer { + //extends OpenId4VciCreateCredentialOfferOptions { publicIssuerId: string credentials: Array authorizationCodeFlowConfig?: { @@ -111,8 +112,13 @@ export interface BatchCredentialIssuanceOptions { batchSize: number } +export interface KeyAttestationRequiredRecords { + key_storage: string[] + user_authentication: string[] +} export interface ProofTypeConfig { proof_signing_alg_values_supported: string[] + key_attestations_required?: KeyAttestationRequiredRecords } export interface CredentialConfigurationDisplay { @@ -130,17 +136,31 @@ export interface CredentialDefinition { [key: string]: any } +export interface Claim { + path: string[] + display?: ClaimDisplay[] + mandatory?: boolean +} + +export interface ClaimDisplay { + name: string + locale: string +} +export interface CredentialMetadata { + display: CredentialDisplay[] + claims: Claim[] +} + export interface CredentialConfigurationSupportedWithFormats { format: 'vc+sd-jwt' | 'mso_mdoc' | 'jwt_vc_json' | string vct?: string doctype?: string scope?: string - claims?: any cryptographic_binding_methods_supported?: string[] - credential_signing_alg_values_supported?: string[] + credential_signing_alg_values_supported?: string[] | number[] proof_types_supported?: Record credential_definition?: CredentialDefinition - display?: CredentialConfigurationDisplay[] + credential_metadata?: CredentialMetadata } export interface CreateIssuerOptions { issuerId?: string From b254b9f73a4ba2bc572b1ba7e60bfcb5d97312e2 Mon Sep 17 00:00:00 2001 From: shitrerohit Date: Tue, 23 Dec 2025 15:56:01 +0530 Subject: [PATCH 055/152] fix:sd-jwt store credential Signed-off-by: shitrerohit --- src/controllers/openid4vc/holder/holder.service.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/controllers/openid4vc/holder/holder.service.ts b/src/controllers/openid4vc/holder/holder.service.ts index 555f778f..bdb80422 100644 --- a/src/controllers/openid4vc/holder/holder.service.ts +++ b/src/controllers/openid4vc/holder/holder.service.ts @@ -20,6 +20,7 @@ import { Mdoc, W3cJsonLdVerifiableCredential, W3cJwtVerifiableCredential, + SdJwtVcRecord, } from '@credo-ts/core' import { OpenId4VciAuthorizationFlow, @@ -222,15 +223,21 @@ export class HolderService { // }) const storedCredentials = await Promise.all( - credentialResponse.credentials.map(async (response: any) => { - const credential = response.credentials[0] + credentialResponse.credentials.map(async (response) => { + // console.log('response', JSON.stringify(response)) + // 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({ record: credential }) // } - return await agentReq.agent.sdJwtVc.store(credential.compact) + const credentialRecord = response.record + if (credentialRecord instanceof SdJwtVcRecord) { + return await agentReq.agent.sdJwtVc.store({ + record: credentialRecord, + }) + } }), ) From 1b986b40f53cb2f2e92c05766ace05d321b7d7c7 Mon Sep 17 00:00:00 2001 From: shitrerohit Date: Wed, 31 Dec 2025 15:51:32 +0530 Subject: [PATCH 056/152] WIP: store mDoc credential Signed-off-by: shitrerohit --- src/cliAgent.ts | 6 +++++- .../openid4vc/holder/credentialBindingResolver.ts | 14 +------------- src/controllers/openid4vc/holder/holder.service.ts | 11 +++++------ src/utils/oid4vc-agent.ts | 3 +++ 4 files changed, 14 insertions(+), 20 deletions(-) diff --git a/src/cliAgent.ts b/src/cliAgent.ts index 838a39f2..d2aca384 100644 --- a/src/cliAgent.ts +++ b/src/cliAgent.ts @@ -27,6 +27,8 @@ import { LogLevel, Agent, X509Module, + JwkDidRegistrar, + JwkDidResolver, } from '@credo-ts/core' import { DidCommHttpOutboundTransport, @@ -172,17 +174,19 @@ const getModules = ( indyVdr, networks: networkConfig, }), - dids: new DidsModule({ registrars: [ new IndyVdrIndyDidRegistrar(), new KeyDidRegistrar(), + new JwkDidRegistrar(), // , new PolygonDidRegistrar() ], resolvers: [ new IndyVdrIndyDidResolver(), new KeyDidResolver(), new WebDidResolver(), + new JwkDidResolver(), + new KeyDidResolver(), // , new PolygonDidResolver() ], }), diff --git a/src/controllers/openid4vc/holder/credentialBindingResolver.ts b/src/controllers/openid4vc/holder/credentialBindingResolver.ts index 1875c4cc..d414899d 100644 --- a/src/controllers/openid4vc/holder/credentialBindingResolver.ts +++ b/src/controllers/openid4vc/holder/credentialBindingResolver.ts @@ -36,17 +36,6 @@ export function getCredentialBindingResolver({ didMethod = 'key' } - const shouldKeyBeHardwareBackedForMsoMdoc = - credentialConfiguration?.format === OpenId4VciCredentialFormatProfile.MsoMdoc && - pidSchemes?.msoMdocDoctypes.includes(credentialConfiguration.doctype) - - const shouldKeyBeHardwareBackedForSdJwtVc = - (credentialConfiguration?.format === 'vc+sd-jwt' || credentialConfiguration.format === 'dc+sd-jwt') && - credentialConfiguration.vct && - pidSchemes?.sdJwtVcVcts.includes(credentialConfiguration.vct) - - const shouldKeyBeHardwareBacked = shouldKeyBeHardwareBackedForSdJwtVc || shouldKeyBeHardwareBackedForMsoMdoc - // We don't want to request more than 10 credentials const batchSize = requestBatch === true @@ -54,7 +43,6 @@ export function getCredentialBindingResolver({ : typeof requestBatch === 'number' ? Math.min(issuerMaxBatchSize, requestBatch) : 1 - console.log('proofTypes', JSON.stringify(proofTypes)) // TODO: support key attestations if (!proofTypes.jwt || proofTypes.jwt.keyAttestationsRequired) { throw new Error('Unable to request credentials. Only jwt proof type without key attestations supported') @@ -67,7 +55,7 @@ export function getCredentialBindingResolver({ .createKeyForSignatureAlgorithm({ algorithm: signatureAlgorithm!, // FIXME: what should happen with already existing keys created in the secure environment? - backend: shouldKeyBeHardwareBacked ? 'secureEnvironment' : 'askar', + backend: 'askar', }) .then((key) => Kms.PublicJwk.fromUnknown(key.publicJwk)), ), diff --git a/src/controllers/openid4vc/holder/holder.service.ts b/src/controllers/openid4vc/holder/holder.service.ts index bdb80422..d7d275fd 100644 --- a/src/controllers/openid4vc/holder/holder.service.ts +++ b/src/controllers/openid4vc/holder/holder.service.ts @@ -21,6 +21,7 @@ import { W3cJsonLdVerifiableCredential, W3cJwtVerifiableCredential, SdJwtVcRecord, + MdocRecord, } from '@credo-ts/core' import { OpenId4VciAuthorizationFlow, @@ -224,15 +225,13 @@ export class HolderService { const storedCredentials = await Promise.all( credentialResponse.credentials.map(async (response) => { - // console.log('response', JSON.stringify(response)) - // const credential = response.credentials[0] + const credentialRecord = response.record // if (credential instanceof W3cJwtVerifiableCredential || credential instanceof W3cJsonLdVerifiableCredential) { // return await agentReq.agent.w3cCredentials.storeCredential({ credential }) // } - // if (credential instanceof Mdoc) { - // return await agentReq.agent.mdoc.store({ record: credential }) - // } - const credentialRecord = response.record + if (credentialRecord instanceof MdocRecord) { + return await agentReq.agent.mdoc.store({ record: credentialRecord }) + } if (credentialRecord instanceof SdJwtVcRecord) { return await agentReq.agent.sdJwtVc.store({ record: credentialRecord, diff --git a/src/utils/oid4vc-agent.ts b/src/utils/oid4vc-agent.ts index f9a8053d..a1ba9b6b 100644 --- a/src/utils/oid4vc-agent.ts +++ b/src/utils/oid4vc-agent.ts @@ -198,6 +198,9 @@ export async function getTrustedCerts() { } const data = await response.json() return data as string[] + // return [ + // 'MIICBjCCAbigAwIBAgIQYq0k0aKF8v8XKMTnyD2q6TAFBgMrZXAwKzEcMBoGA1UEAxMTRXhhbXBsZSBDb3Jwb3JhdGlvbjELMAkGA1UEBhMCVVMwHhcNMjUwMTAxMDAwMDAwWhcNMjYwMTAxMDAwMDAwWjArMRwwGgYDVQQDExNFeGFtcGxlIENvcnBvcmF0aW9uMQswCQYDVQQGEwJVUzAqMAUGAytlcAMhAC4Bjw5RcVKyweVaiL3B3zzz7mx/4Xs4qfL8qaMtAJVao4HxMIHuMB0GA1UdDgQWBBTGsKAg3mtQAAMMBnS792uyT2pUyDAOBgNVHQ8BAf8EBAMCAaIwFQYDVR0lAQH/BAswCQYHKIGMXQUBAjAiBgNVHSMBAf8EGDAWgBTGsKAg3mtQAAMMBnS792uyT2pUyDBABgNVHRIBAf8ENjA0ggtleGFtcGxlLmNvbYYSaHR0cDovL2V4YW1wbGUuY29tgRFhZG1pbkBleGFtcGxlLmNvbTAsBgNVHREBAf8EIjAgggtleGFtcGxlLmNvbYERYWRtaW5AZXhhbXBsZS5jb20wEgYDVR0TAQH/BAgwBgEB/wIBADAFBgMrZXADQQASLPWxqJ1JmneTQDOGQz0Bk1t71M29IkRx+Eytmf4ZrxYL3qlbUl+fhXQGDwvTjl0Dl5bSDgEVbOMPs3Ul1QYA', + // ] } catch (error) { // eslint-disable-next-line no-console console.error('Error fetching data:', error) From 4b71be72f8adfe4f53962c457f6e067e609d37ad Mon Sep 17 00:00:00 2001 From: shitrerohit Date: Wed, 31 Dec 2025 16:05:16 +0530 Subject: [PATCH 057/152] fix:sonar cloud issue Signed-off-by: shitrerohit --- src/cliAgent.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/cliAgent.ts b/src/cliAgent.ts index d2aca384..5c449c37 100644 --- a/src/cliAgent.ts +++ b/src/cliAgent.ts @@ -140,6 +140,7 @@ function requireEnv(name: string): string { return value } const expressApp = express() +expressApp.disable('x-powered-by') // TODO: add object const getModules = ( networkConfig: [IndyVdrPoolConfig, ...IndyVdrPoolConfig[]], From 2007c22903302013e1bed74813eeeebbe481bd32 Mon Sep 17 00:00:00 2001 From: shitrerohit Date: Mon, 5 Jan 2026 12:21:36 +0530 Subject: [PATCH 058/152] fix:completed flow changes for mdoc Signed-off-by: shitrerohit --- .../openid4vc/types/issuer.types.ts | 1 + src/controllers/x509/x509.service.ts | 44 +++++++++---------- src/utils/oid4vc-agent.ts | 2 +- 3 files changed, 23 insertions(+), 24 deletions(-) diff --git a/src/controllers/openid4vc/types/issuer.types.ts b/src/controllers/openid4vc/types/issuer.types.ts index 1f9cf4ad..8c07cead 100644 --- a/src/controllers/openid4vc/types/issuer.types.ts +++ b/src/controllers/openid4vc/types/issuer.types.ts @@ -16,6 +16,7 @@ export interface OpenId4VciOfferCredentials { method: SignerMethod did?: string x5c?: string[] + keyId: string } } diff --git a/src/controllers/x509/x509.service.ts b/src/controllers/x509/x509.service.ts index 8e0ca051..efad9ae8 100644 --- a/src/controllers/x509/x509.service.ts +++ b/src/controllers/x509/x509.service.ts @@ -1,11 +1,10 @@ - import type { BasicX509CreateCertificateConfig, X509ImportCertificateOptionsDto } from '../types' import type { CredoError } from '@credo-ts/core' import type { Request as Req } from 'express' import { transformPrivateKeyToPrivateJwk, transformSeedToPrivateJwk } from '@credo-ts/askar' import { - Kms, + Kms, TypedArrayEncoder, X509Certificate, X509ExtendedKeyUsage, @@ -15,13 +14,13 @@ import { type Agent, } from '@credo-ts/core' import { KeyAlgorithm } from '@openwallet-foundation/askar-nodejs' +import { error } from 'console' 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) { @@ -79,24 +78,24 @@ class x509Service { public async createCertificate(agentReq: Req, options: X509CreateCertificateOptionsDto) { const agent = agentReq.agent - let authorityKeyID, subjectPublicKeyID + let authorityKeyID, subjectPublicKeyID, authorityKeyKmsId - agent.config.logger.debug(`createCertificate options:`, options) + agent.config.logger.debug(`createCertificate options:`, options) - if (options.authorityKey && options?.authorityKey?.seed) { - const { privateJwk } = transformSeedToPrivateJwk({ - type: getTypeFromCurve(options.authorityKey.keyType ?? 'P-256'), - 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 { - const { publicJwk } = await agent.kms.createKey({ - type: getTypeFromCurve(options.authorityKey?.keyType ?? 'P-256') - }) - authorityKeyID = publicJwk + const { publicJwk, keyId } = await agent.kms.createKey({ + type: getTypeFromCurve(options.authorityKey?.keyType ?? 'P-256'), + }) + authorityKeyID = publicJwk + authorityKeyKmsId = keyId } if (options.subjectPublicKey) { @@ -109,19 +108,17 @@ class x509Service { }) subjectPublicKeyID = importedKey.publicJwk - } else { const { keyId, publicJwk } = await agent.kms.createKey({ - type: getTypeFromCurve(options.subjectPublicKey?.keyType ?? 'P-256') + 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, + // authorityKey: authorityKeyID as Key, authorityKey: Kms.PublicJwk.fromPublicJwk(authorityKeyID), // subjectPublicKey: Kms.PublicJwk.fromPublicJwk(subjectPublicKeyID!), serialNumber: options.serialNumber, @@ -130,10 +127,10 @@ class x509Service { subject: options.subject, validity: options.validity, }) - agent.config.logger.info("Result") const issuerCertificate = certificate.toString('base64') - return { publicCertificateBase64: issuerCertificate } + + return { publicCertificateBase64: issuerCertificate, keyId: authorityKeyKmsId } } public async ImportX509Certificates(agentReq: Req, options: X509ImportCertificateOptionsDto) { @@ -169,8 +166,9 @@ class x509Service { agent.config.logger.error(`Error caught`) // If the key already exists, we assume the self-signed certificate is already created - if (error instanceof Kms.KeyManagementKeyExistsError) { - console.error( 'key already exists while importing certificate') + if (error instanceof Kms.KeyManagementKeyExistsError) { + // eslint-disable-next-line no-console + console.error('key already exists while importing certificate') } else { agent.config.logger.error(`${JSON.stringify(error)}`) throw error diff --git a/src/utils/oid4vc-agent.ts b/src/utils/oid4vc-agent.ts index a1ba9b6b..fa881a38 100644 --- a/src/utils/oid4vc-agent.ts +++ b/src/utils/oid4vc-agent.ts @@ -199,7 +199,7 @@ export async function getTrustedCerts() { const data = await response.json() return data as string[] // return [ - // 'MIICBjCCAbigAwIBAgIQYq0k0aKF8v8XKMTnyD2q6TAFBgMrZXAwKzEcMBoGA1UEAxMTRXhhbXBsZSBDb3Jwb3JhdGlvbjELMAkGA1UEBhMCVVMwHhcNMjUwMTAxMDAwMDAwWhcNMjYwMTAxMDAwMDAwWjArMRwwGgYDVQQDExNFeGFtcGxlIENvcnBvcmF0aW9uMQswCQYDVQQGEwJVUzAqMAUGAytlcAMhAC4Bjw5RcVKyweVaiL3B3zzz7mx/4Xs4qfL8qaMtAJVao4HxMIHuMB0GA1UdDgQWBBTGsKAg3mtQAAMMBnS792uyT2pUyDAOBgNVHQ8BAf8EBAMCAaIwFQYDVR0lAQH/BAswCQYHKIGMXQUBAjAiBgNVHSMBAf8EGDAWgBTGsKAg3mtQAAMMBnS792uyT2pUyDBABgNVHRIBAf8ENjA0ggtleGFtcGxlLmNvbYYSaHR0cDovL2V4YW1wbGUuY29tgRFhZG1pbkBleGFtcGxlLmNvbTAsBgNVHREBAf8EIjAgggtleGFtcGxlLmNvbYERYWRtaW5AZXhhbXBsZS5jb20wEgYDVR0TAQH/BAgwBgEB/wIBADAFBgMrZXADQQASLPWxqJ1JmneTQDOGQz0Bk1t71M29IkRx+Eytmf4ZrxYL3qlbUl+fhXQGDwvTjl0Dl5bSDgEVbOMPs3Ul1QYA', + // 'MIICBjCCAbigAwIBAgIQSHpmUFWPGbA9FmUtsjRy/jAFBgMrZXAwKzEcMBoGA1UEAxMTRXhhbXBsZSBDb3Jwb3JhdGlvbjELMAkGA1UEBhMCVVMwHhcNMjUwMTAxMDAwMDAwWhcNMjcwMTAxMDAwMDAwWjArMRwwGgYDVQQDExNFeGFtcGxlIENvcnBvcmF0aW9uMQswCQYDVQQGEwJVUzAqMAUGAytlcAMhAORuQWdVPZvmsAlBHqXy+HN6dfhAmZOWhdDJ81JzWqlVo4HxMIHuMB0GA1UdDgQWBBR8qFPBWwY2OSWF4CkBVk37XwubzjAOBgNVHQ8BAf8EBAMCAaIwFQYDVR0lAQH/BAswCQYHKIGMXQUBAjAiBgNVHSMBAf8EGDAWgBR8qFPBWwY2OSWF4CkBVk37XwubzjBABgNVHRIBAf8ENjA0ggtleGFtcGxlLmNvbYYSaHR0cDovL2V4YW1wbGUuY29tgRFhZG1pbkBleGFtcGxlLmNvbTAsBgNVHREBAf8EIjAgggtleGFtcGxlLmNvbYERYWRtaW5AZXhhbXBsZS5jb20wEgYDVR0TAQH/BAgwBgEB/wIBADAFBgMrZXADQQCcqIaYQ95Z7uJu1rfFfe1GP9/fyfqw0LFX3PVC2TSNlXZTJL/Hea4mJRkFtVthcAMAfUAV1tmisyviJP+5x18A', // ] } catch (error) { // eslint-disable-next-line no-console From 44930f02639e0b8f167380d6eaf077c998abc58d Mon Sep 17 00:00:00 2001 From: shitrerohit Date: Mon, 5 Jan 2026 15:03:08 +0530 Subject: [PATCH 059/152] fix:resolved code rabit related issues Signed-off-by: shitrerohit --- .../holder/credentialBindingResolver.ts | 6 +++++- .../openid4vc/holder/holder.service.ts | 1 + .../issuance-sessions.service.ts | 20 +++++++------------ src/utils/oid4vc-agent.ts | 18 ++++++++--------- 4 files changed, 22 insertions(+), 23 deletions(-) diff --git a/src/controllers/openid4vc/holder/credentialBindingResolver.ts b/src/controllers/openid4vc/holder/credentialBindingResolver.ts index d414899d..7f330e73 100644 --- a/src/controllers/openid4vc/holder/credentialBindingResolver.ts +++ b/src/controllers/openid4vc/holder/credentialBindingResolver.ts @@ -48,7 +48,11 @@ export function getCredentialBindingResolver({ throw new Error('Unable to request credentials. Only jwt proof type without key attestations supported') } - const signatureAlgorithm = proofTypes.jwt?.supportedSignatureAlgorithms[0] + const signatureAlgorithm = proofTypes.jwt?.supportedSignatureAlgorithms?.[0] + + if (!signatureAlgorithm) { + throw new Error('No supported signature algorithms found for JWT proof type') + } const keys = await Promise.all( new Array(batchSize).fill(0).map(() => kms diff --git a/src/controllers/openid4vc/holder/holder.service.ts b/src/controllers/openid4vc/holder/holder.service.ts index d7d275fd..1d80b09d 100644 --- a/src/controllers/openid4vc/holder/holder.service.ts +++ b/src/controllers/openid4vc/holder/holder.service.ts @@ -237,6 +237,7 @@ export class HolderService { record: credentialRecord, }) } + throw new Error(`Unsupported credential record type`) }), ) diff --git a/src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts b/src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts index 772cbfff..8dd7027b 100644 --- a/src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts +++ b/src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts @@ -57,24 +57,18 @@ class IssuanceSessionsService { 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, - // }) - - const { credentialOffer, issuanceSession } = (await agentReq.agent.modules.openid4vc.issuer?.createCredentialOffer({ + const issuerModule = agentReq.agent.modules.openid4vc.issuer + + if (!issuerModule) { + throw new Error('OID4VC issuer module not initialized') + } + const { credentialOffer, issuanceSession } = await issuerModule.createCredentialOffer({ issuerId: publicIssuerId, issuanceMetadata: options.issuanceMetadata, credentialConfigurationIds: credentials.map((c) => c.credentialSupportedId), preAuthorizedCodeFlowConfig: options.preAuthorizedCodeFlowConfig, authorizationCodeFlowConfig: options.authorizationCodeFlowConfig, - })) as { - credentialOffer: unknown - issuanceSession: unknown - } + }) return { credentialOffer, issuanceSession } } diff --git a/src/utils/oid4vc-agent.ts b/src/utils/oid4vc-agent.ts index fa881a38..54e94ac2 100644 --- a/src/utils/oid4vc-agent.ts +++ b/src/utils/oid4vc-agent.ts @@ -192,15 +192,15 @@ export function getMixedCredentialRequestToCredentialMapper(): OpenId4VciCredent export async function getTrustedCerts() { try { - const response = await fetch(`${process.env.TRUST_LIST_URL}`) - if (!response.ok) { - throw new Error(`HTTP error! status: ${response.status}`) - } - const data = await response.json() - return data as string[] - // return [ - // 'MIICBjCCAbigAwIBAgIQSHpmUFWPGbA9FmUtsjRy/jAFBgMrZXAwKzEcMBoGA1UEAxMTRXhhbXBsZSBDb3Jwb3JhdGlvbjELMAkGA1UEBhMCVVMwHhcNMjUwMTAxMDAwMDAwWhcNMjcwMTAxMDAwMDAwWjArMRwwGgYDVQQDExNFeGFtcGxlIENvcnBvcmF0aW9uMQswCQYDVQQGEwJVUzAqMAUGAytlcAMhAORuQWdVPZvmsAlBHqXy+HN6dfhAmZOWhdDJ81JzWqlVo4HxMIHuMB0GA1UdDgQWBBR8qFPBWwY2OSWF4CkBVk37XwubzjAOBgNVHQ8BAf8EBAMCAaIwFQYDVR0lAQH/BAswCQYHKIGMXQUBAjAiBgNVHSMBAf8EGDAWgBR8qFPBWwY2OSWF4CkBVk37XwubzjBABgNVHRIBAf8ENjA0ggtleGFtcGxlLmNvbYYSaHR0cDovL2V4YW1wbGUuY29tgRFhZG1pbkBleGFtcGxlLmNvbTAsBgNVHREBAf8EIjAgggtleGFtcGxlLmNvbYERYWRtaW5AZXhhbXBsZS5jb20wEgYDVR0TAQH/BAgwBgEB/wIBADAFBgMrZXADQQCcqIaYQ95Z7uJu1rfFfe1GP9/fyfqw0LFX3PVC2TSNlXZTJL/Hea4mJRkFtVthcAMAfUAV1tmisyviJP+5x18A', - // ] + // const response = await fetch(`${process.env.TRUST_LIST_URL}`) + // if (!response.ok) { + // throw new Error(`HTTP error! status: ${response.status}`) + // } + // const data = await response.json() + // return data as string[] + return [ + 'MIICBzCCAbmgAwIBAgIRAMEUex+GR2GZKusP/izv/oswBQYDK2VwMCsxHDAaBgNVBAMTE0V4YW1wbGUgQ29ycG9yYXRpb24xCzAJBgNVBAYTAlVTMB4XDTI1MDEwMTAwMDAwMFoXDTI3MDEwMTAwMDAwMFowKzEcMBoGA1UEAxMTRXhhbXBsZSBDb3Jwb3JhdGlvbjELMAkGA1UEBhMCVVMwKjAFBgMrZXADIQC5RNVbJCX2L/z/PLbvaxLqi7+hA4fUUStWcmAo/qkX2aOB8TCB7jAdBgNVHQ4EFgQUkog6trQXXfsjb472jybLCBixSAMwDgYDVR0PAQH/BAQDAgGiMBUGA1UdJQEB/wQLMAkGByiBjF0FAQIwIgYDVR0jAQH/BBgwFoAUkog6trQXXfsjb472jybLCBixSAMwQAYDVR0SAQH/BDYwNIILZXhhbXBsZS5jb22GEmh0dHA6Ly9leGFtcGxlLmNvbYERYWRtaW5AZXhhbXBsZS5jb20wLAYDVR0RAQH/BCIwIIILZXhhbXBsZS5jb22BEWFkbWluQGV4YW1wbGUuY29tMBIGA1UdEwEB/wQIMAYBAf8CAQAwBQYDK2VwA0EAPjHj2keDv8BN3FGkOqG36VQKaYvb9Ena+1BI7hb+sBJ+QgBTlj1sK/+I7LMUfu/K3oCyZxT1CZpYRZkh7GEWAw==', + ] } catch (error) { // eslint-disable-next-line no-console console.error('Error fetching data:', error) From 45486ccff7d5b878f4e77d9d8ef5f11ee6bfa768 Mon Sep 17 00:00:00 2001 From: shitrerohit Date: Mon, 5 Jan 2026 15:33:26 +0530 Subject: [PATCH 060/152] fix:removed commented code Signed-off-by: shitrerohit --- src/cliAgent.ts | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/cliAgent.ts b/src/cliAgent.ts index 5c449c37..fa8eab15 100644 --- a/src/cliAgent.ts +++ b/src/cliAgent.ts @@ -49,13 +49,7 @@ import { IndyVdrIndyDidRegistrar, } from '@credo-ts/indy-vdr' import { agentDependencies, DidCommHttpInboundTransport, DidCommWsInboundTransport } from '@credo-ts/node' -import { - OpenId4VcHolderModule, - // OpenId4VcHolderModule, - // OpenId4VcIssuerModule, - OpenId4VcModule, - // OpenId4VcVerifierModule, -} from '@credo-ts/openid4vc' +import { OpenId4VcHolderModule, OpenId4VcModule } from '@credo-ts/openid4vc' import { QuestionAnswerModule } from '@credo-ts/question-answer' import { TenantsModule } from '@credo-ts/tenants' import { anoncreds } from '@hyperledger/anoncreds-nodejs' From a13b68a31bcc5ecdd09bc0228e6fc7c8036bfca2 Mon Sep 17 00:00:00 2001 From: shitrerohit Date: Mon, 5 Jan 2026 15:46:26 +0530 Subject: [PATCH 061/152] fix: resolved PR comments Signed-off-by: shitrerohit --- .../openid4vc/issuers/issuer.service.ts | 4 ++-- src/utils/oid4vc-agent.ts | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/controllers/openid4vc/issuers/issuer.service.ts b/src/controllers/openid4vc/issuers/issuer.service.ts index 0d0ba61d..b1f093de 100644 --- a/src/controllers/openid4vc/issuers/issuer.service.ts +++ b/src/controllers/openid4vc/issuers/issuer.service.ts @@ -33,8 +33,8 @@ export class IssuerService { public async getIssuersByQuery(agentReq: Req, publicIssuerId?: string) { const result = publicIssuerId - ? (agentReq.agent as Agent).openid4vc.issuer.getIssuerByIssuerId(publicIssuerId) // .dependencyManager.resolve(OpenId4VcIssuerRepository) - : (agentReq.agent as Agent).openid4vc.issuer.getAllIssuers() + ? (agentReq.agent as Agent).openid4vc.issuer?.getIssuerByIssuerId(publicIssuerId) // .dependencyManager.resolve(OpenId4VcIssuerRepository) + : (agentReq.agent as Agent).openid4vc.issuer?.getAllIssuers() return result } diff --git a/src/utils/oid4vc-agent.ts b/src/utils/oid4vc-agent.ts index 54e94ac2..9336b0b1 100644 --- a/src/utils/oid4vc-agent.ts +++ b/src/utils/oid4vc-agent.ts @@ -192,15 +192,15 @@ export function getMixedCredentialRequestToCredentialMapper(): OpenId4VciCredent export async function getTrustedCerts() { try { - // const response = await fetch(`${process.env.TRUST_LIST_URL}`) - // if (!response.ok) { - // throw new Error(`HTTP error! status: ${response.status}`) - // } - // const data = await response.json() - // return data as string[] - return [ - 'MIICBzCCAbmgAwIBAgIRAMEUex+GR2GZKusP/izv/oswBQYDK2VwMCsxHDAaBgNVBAMTE0V4YW1wbGUgQ29ycG9yYXRpb24xCzAJBgNVBAYTAlVTMB4XDTI1MDEwMTAwMDAwMFoXDTI3MDEwMTAwMDAwMFowKzEcMBoGA1UEAxMTRXhhbXBsZSBDb3Jwb3JhdGlvbjELMAkGA1UEBhMCVVMwKjAFBgMrZXADIQC5RNVbJCX2L/z/PLbvaxLqi7+hA4fUUStWcmAo/qkX2aOB8TCB7jAdBgNVHQ4EFgQUkog6trQXXfsjb472jybLCBixSAMwDgYDVR0PAQH/BAQDAgGiMBUGA1UdJQEB/wQLMAkGByiBjF0FAQIwIgYDVR0jAQH/BBgwFoAUkog6trQXXfsjb472jybLCBixSAMwQAYDVR0SAQH/BDYwNIILZXhhbXBsZS5jb22GEmh0dHA6Ly9leGFtcGxlLmNvbYERYWRtaW5AZXhhbXBsZS5jb20wLAYDVR0RAQH/BCIwIIILZXhhbXBsZS5jb22BEWFkbWluQGV4YW1wbGUuY29tMBIGA1UdEwEB/wQIMAYBAf8CAQAwBQYDK2VwA0EAPjHj2keDv8BN3FGkOqG36VQKaYvb9Ena+1BI7hb+sBJ+QgBTlj1sK/+I7LMUfu/K3oCyZxT1CZpYRZkh7GEWAw==', - ] + const response = await fetch(`${process.env.TRUST_LIST_URL}`) + if (!response.ok) { + throw new Error(`HTTP error! status: ${response.status}`) + } + const data = await response.json() + return data as string[] + // return [ + // 'MIICBzCCAbmgAwIBAgIRAMEUex+GR2GZKusP/izv/oswBQYDK2VwMCsxHDAaBgNVBAMTE0V4YW1wbGUgQ29ycG9yYXRpb24xCzAJBgNVBAYTAlVTMB4XDTI1MDEwMTAwMDAwMFoXDTI3MDEwMTAwMDAwMFowKzEcMBoGA1UEAxMTRXhhbXBsZSBDb3Jwb3JhdGlvbjELMAkGA1UEBhMCVVMwKjAFBgMrZXADIQC5RNVbJCX2L/z/PLbvaxLqi7+hA4fUUStWcmAo/qkX2aOB8TCB7jAdBgNVHQ4EFgQUkog6trQXXfsjb472jybLCBixSAMwDgYDVR0PAQH/BAQDAgGiMBUGA1UdJQEB/wQLMAkGByiBjF0FAQIwIgYDVR0jAQH/BBgwFoAUkog6trQXXfsjb472jybLCBixSAMwQAYDVR0SAQH/BDYwNIILZXhhbXBsZS5jb22GEmh0dHA6Ly9leGFtcGxlLmNvbYERYWRtaW5AZXhhbXBsZS5jb20wLAYDVR0RAQH/BCIwIIILZXhhbXBsZS5jb22BEWFkbWluQGV4YW1wbGUuY29tMBIGA1UdEwEB/wQIMAYBAf8CAQAwBQYDK2VwA0EAPjHj2keDv8BN3FGkOqG36VQKaYvb9Ena+1BI7hb+sBJ+QgBTlj1sK/+I7LMUfu/K3oCyZxT1CZpYRZkh7GEWAw==', + // ] } catch (error) { // eslint-disable-next-line no-console console.error('Error fetching data:', error) From a490181aa529691f11e16b922e1b397935222bcb Mon Sep 17 00:00:00 2001 From: shitrerohit Date: Fri, 9 Jan 2026 19:37:10 +0530 Subject: [PATCH 062/152] feat/oidv4vc issuance and verification changes Signed-off-by: shitrerohit --- src/controllers/did/DidController.ts | 1022 +++++++++-------- .../openid4vc/types/issuer.types.ts | 2 +- .../openid4vc/types/verifier.types.ts | 6 +- .../verification-sessions.service.ts | 15 +- .../verifiers/verifier.Controller.ts | 115 +- .../openid4vc/verifiers/verifier.service.ts | 99 +- src/utils/oid4vc-agent.ts | 1 + 7 files changed, 636 insertions(+), 624 deletions(-) diff --git a/src/controllers/did/DidController.ts b/src/controllers/did/DidController.ts index 1bc214ea..b13279a5 100644 --- a/src/controllers/did/DidController.ts +++ b/src/controllers/did/DidController.ts @@ -1,26 +1,28 @@ - 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 { - TypedArrayEncoder, - DidDocumentBuilder, - getEd25519VerificationKey2018, - createPeerDidDocumentFromServices, - PeerDidNumAlgo, - Kms, - Hasher, - LogLevel, - Agent, + TypedArrayEncoder, + DidDocumentBuilder, + getEd25519VerificationKey2018, + createPeerDidDocumentFromServices, + PeerDidNumAlgo, + Kms, + Hasher, + LogLevel, + Agent, + DidKey, } from '@credo-ts/core' -import { Key, KeyAlgorithm,askar } from '@openwallet-foundation/askar-nodejs' +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 { container } from 'tsyringe' +import { RestMultiTenantAgentModules } from '../../cliAgent' import { DidMethod, KeyAlgorithmCurve, Network, Role, SCOPES } from '../../enums' import ErrorHandlingService from '../../errorHandlingService' import { BadRequestError, InternalServerError } from '../../errors' @@ -30,551 +32,573 @@ 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 - */ - 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) - } + /** + * 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) + } + } + + /** + * 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) } + } - /** - * 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) - } + private async handleDidPeer(agent: AgentType, createDidOptions: DidCreate) { + let didResponse + let did + + if (!createDidOptions.keyType) { + throw Error('keyType is required') } - private async handleDidPeer(agent: AgentType, createDidOptions: DidCreate) { - let didResponse - let did + 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, + }, + }) + + did = didPeerResponse.didState.did + didResponse = { + did, + } + return didResponse + } - if (!createDidOptions.keyType) { - throw Error('keyType is required') - } + private async handleIndy(agent: AgentType, createDidOptions: DidCreate) { + let result + if (!createDidOptions.keyType) { + throw new BadRequestError('keyType is required') + } - 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 - }, - }) + if (!createDidOptions.network) { + throw new BadRequestError('For indy method network is required') + } - did = didPeerResponse.didState.did - didResponse = { - did, - } - return didResponse + if (createDidOptions.keyType !== KeyAlgorithm.Ed25519) { + throw new BadRequestError('Only ed25519 key type supported') } - private async handleIndy(agent: AgentType, createDidOptions: DidCreate) { - let result - if (!createDidOptions.keyType) { - throw new BadRequestError('keyType is required') - } + if (!Network.Bcovrin_Testnet && !Network.Indicio_Demonet && !Network.Indicio_Testnet) { + throw new BadRequestError(`Invalid network for 'indy' method: ${createDidOptions.network}`) + } - if (!createDidOptions.network) { - throw new BadRequestError('For indy method network 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.keyType !== KeyAlgorithm.Ed25519) { - throw new BadRequestError('Only ed25519 key type supported') + 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 } - if (!Network.Bcovrin_Testnet && !Network.Indicio_Demonet && !Network.Indicio_Testnet) { - throw new BadRequestError(`Invalid network for 'indy' method: ${createDidOptions.network}`) + 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}`, + }) - 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`) + if (didRecord.length > 0) { + didDocument = didRecord[0].didDocument } - 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 - } - - 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}:${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 } } + } - private async handleIndicio(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 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 - } + private async handleIndicio(agent: AgentType, createDidOptions: DidCreate, didMethod: string) { + let didDocument + if (!createDidOptions.seed) { + throw new BadRequestError('Seed is required') } - - private async createEndorserDid(agent: AgentType, endorserDid: string) { - return agent.dids.create({ - method: 'indy', - options: { - endorserMode: 'external', - endorserDid: endorserDid || '', - }, + 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}`, }) - } - private async createIndicioKey(agent: AgentType, createDidOptions: DidCreate) { - if (!createDidOptions.seed) { - throw new BadRequestError('Seed is required') + if (didRecord.length > 0) { + didDocument = didRecord[0].didDocument + } + + return { + did: `${didMethod}:${createDidOptions.did}`, + didDocument: didDocument, } - // 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') + } 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, + } } - return body + } + } 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') + } + // 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 + } + + 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), + }) + + const key = await agent.kms.importKey({ privateJwk }) + + const publicJwk = Kms.PublicJwk.fromPublicJwk(key.publicJwk) + const completeDid = `${didMethod}:${did}` + await agent.dids.import({ + did: completeDid, + keys: [ + { + kmsKeyId: key.keyId, + didDocumentRelativeKeyId: verkey, + }, + ], + }) + } + public async handleKey(agent: AgentType, didOptions: DidCreate) { + let did + let didResponse + let didDocument + + 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') } - 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), - }) + const normalizedCurve = keyAlgorithmToCurve[didOptions.keyType as KeyAlgorithm] + if (!(normalizedCurve && supportedKeyTypesDID[DidMethod.Key]?.some((kt) => kt.crv === normalizedCurve))) { + throw new BadRequestError(`Invalid keyType: ${didOptions.keyType}`) + } - const key = await agent.kms.importKey({ privateJwk }) + if (!didOptions.did) { + if (didOptions.seed) { + this.agent.config.logger.info('Creating DID:key with provided seed') + const privateJwk = transformPrivateKeyToPrivateJwk({ + privateKey: TypedArrayEncoder.fromString(didOptions.seed), + type: getTypeFromCurve(didOptions.keyType ?? KeyAlgorithm.Ed25519), + }).privateJwk - const publicJwk = Kms.PublicJwk.fromPublicJwk(key.publicJwk) - const completeDid = `${didMethod}:${did}` - await agent.dids.import({ - did: completeDid, - keys: [ - { - kmsKeyId: key.keyId, - didDocumentRelativeKeyId: verkey, - - } - ] + const { keyId, publicJwk } = await agent.kms.importKey({ + privateJwk, }) - } - - 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 === 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}`) - } + this.agent.config.logger.info(`This is keyId:::::: ${keyId}`) + const publicKey = Kms.PublicJwk.fromPublicJwk(publicJwk) + const didKey = new DidKey(publicKey) + didDocument = didKey.didDocument + did = didDocument.id - 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 - } + const verificationMethodId = didDocument.verificationMethod?.[0]?.id + const relativeKeyId = verificationMethodId?.split('#')[1] - this.agent.config.logger.info(`This is did ${did}` ) - this.agent.config.logger.info(`This is didDocument ${didDocument}` ) + this.agent.config.logger.info(`This is did:::::: ${did}`) + this.agent.config.logger.info(`This is verificationMethodId:::::: ${verificationMethodId}`) await agent.dids.import({ - did, - overwrite: true, - didDocument, + did, + didDocument, + overwrite: true, + keys: [ + { + didDocumentRelativeKeyId: `#${relativeKeyId}`, + kmsKeyId: keyId, + }, + ], }) - return { did: did, didDocument: didDocument } + } else { + this.agent.config.logger.info('Creating DID:key without seed') + const { keyId } = await agent.kms.createKey({ + type: getTypeFromCurve(didOptions.keyType ?? KeyAlgorithm.Ed25519), + }) + this.agent.config.logger.info(`This is did:::::: ${did}`) + const didCreateResult = await agent.dids.create({ + method: 'key', + options: { keyId }, + }) + didDocument = didCreateResult.didState.didDocument + did = didCreateResult.didState.did + } + } else { + did = didOptions.did + const createdDid = await agent.dids.getCreatedDids({ + method: DidMethod.Key, + did: didOptions.did, + }) + didDocument = createdDid[0]?.didDocument + + await agent.dids.import({ + did, + overwrite: true, + didDocument, + }) } - public async handleWeb(agent: AgentType, didOptions: DidCreate) { - let didDocument: DidDocument - if (!didOptions.domain) { - throw new BadRequestError('For create did:web, domain is required') - } + this.agent.config.logger.info(`This is did ${did}`) + this.agent.config.logger.info(`This is didDocument ${JSON.stringify(didDocument)}`) - if (!didOptions.seed) { - throw new BadRequestError('Seed is required') - } + return { did: did, didDocument: didDocument } + } - if (!didOptions.keyType) { - throw new BadRequestError('keyType is required') - } + 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.keyType !== KeyAlgorithm.Ed25519 && didOptions.keyType !== KeyAlgorithm.Bls12381G2) { - throw new BadRequestError('Only ed25519 and bls12381g2 key type supported') - } + if (!didOptions.seed) { + throw new BadRequestError('Seed is required') + } - 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 - } + if (!didOptions.keyType) { + throw new BadRequestError('keyType is required') + } - await agent.dids.import({ - did, - overwrite: true, - didDocument, - }) - return { did, didDocument } + if (didOptions.keyType !== KeyAlgorithm.Ed25519 && didOptions.keyType !== KeyAlgorithm.Bls12381G2) { + throw new BadRequestError('Only ed25519 and bls12381g2 key type supported') } - public async handlePolygon(agent: AgentType, createDidOptions: DidCreate) { - // need to discuss try catch logic - const { endpoint, network, privatekey } = createDidOptions + 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 + } - if (!network) { - throw new BadRequestError('Network is required for Polygon method') - } + await agent.dids.import({ + did, + overwrite: true, + didDocument, + }) + return { did, didDocument } + } - const networkName = network?.split(':')[1] + public async handlePolygon(agent: AgentType, createDidOptions: DidCreate) { + // need to discuss try catch logic + const { endpoint, network, privatekey } = createDidOptions - 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') - } + if (!network) { + throw new BadRequestError('Network is required for Polygon method') + } - 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 + 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') } - @Get('/') - public async getDids(@Request() request: Req) { - try { - const createdDids = await request.agent.dids.getCreatedDids() - return createdDids - } catch (error) { - throw ErrorHandlingService.handle(error) - } + 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 + } + + @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/openid4vc/types/issuer.types.ts b/src/controllers/openid4vc/types/issuer.types.ts index 8c07cead..a8f35491 100644 --- a/src/controllers/openid4vc/types/issuer.types.ts +++ b/src/controllers/openid4vc/types/issuer.types.ts @@ -16,7 +16,7 @@ export interface OpenId4VciOfferCredentials { method: SignerMethod did?: string x5c?: string[] - keyId: string + keyId?: string } } diff --git a/src/controllers/openid4vc/types/verifier.types.ts b/src/controllers/openid4vc/types/verifier.types.ts index 61ea0b95..e0ad7cd7 100644 --- a/src/controllers/openid4vc/types/verifier.types.ts +++ b/src/controllers/openid4vc/types/verifier.types.ts @@ -6,7 +6,7 @@ export enum ResponseModeEnum { DIRECT_POST = 'direct_post', DIRECT_POST_JWT = 'direct_post.jwt', DC_API = 'dc_api', - DC_API_JWT = 'dc_api.jwt' + DC_API_JWT = 'dc_api.jwt', } /* -------------------------------------------------------------------------- */ @@ -69,6 +69,7 @@ export type OpenId4VcIssuerX5c = { issuer?: string x5c: string[] alg?: string + keyId?: string } export interface CreateAuthorizationRequest { @@ -79,7 +80,7 @@ export interface CreateAuthorizationRequest { responseMode?: ResponseModeEnum requestSigner: OpenId4VcJwtIssuerDid | OpenId4VcIssuerX5c - expectedOrigins?: string [] + expectedOrigins?: string[] } /* -------------------------------------------------------------------------- */ @@ -97,6 +98,5 @@ export class OpenId4VcSiopCreateVerifierOptions { } export class OpenId4VcUpdateVerifierRecordOptions { - verifierId?: string clientMetadata?: OpenId4VcSiopVerifierClientMetadata } diff --git a/src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts b/src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts index b5cd628c..53834ded 100644 --- a/src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts +++ b/src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts @@ -23,8 +23,6 @@ import { injectable } from 'tsyringe' 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) { @@ -62,10 +60,6 @@ class VerificationSessionsService { }) requestSigner.issuer = parsedCertificate.sanUriNames[0] } - - if (!requestSigner) { - } else if (requestSigner.method === 'did') { - } const options: any = { requestSigner, verifierId: dto.verifierId, @@ -77,11 +71,16 @@ class VerificationSessionsService { if (dto.responseMode) options.responseMode = dto.responseMode if (dto.presentationExchange) { - options.presentationExchange = dto.presentationExchange + // options.presentationExchange = dto.presentationExchange + throw new Error('Presentation Exchange is not supported for now') } else if (dto.dcql) { + const parsedCertificate = X509Service.parseCertificate(agentReq.agent.context, { + encodedCertificate: requestSigner.x5c[0], + }) + parsedCertificate.publicJwk.keyId = requestSigner.keyId + options.requestSigner.x5c = [parsedCertificate] options.dcql = dto.dcql } - return (await agentReq.agent.modules.openid4vc.verifier?.createAuthorizationRequest(options)) as any } catch (error) { throw error diff --git a/src/controllers/openid4vc/verifiers/verifier.Controller.ts b/src/controllers/openid4vc/verifiers/verifier.Controller.ts index 3dd6006e..4f081c6a 100644 --- a/src/controllers/openid4vc/verifiers/verifier.Controller.ts +++ b/src/controllers/openid4vc/verifiers/verifier.Controller.ts @@ -1,64 +1,67 @@ -// 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 { Request as Req } from 'express' +import { Body, Delete, Get, Path, Post, Put, Query, Route, Request, Security, Tags } from 'tsoa' -// import { OpenId4VcSiopCreateVerifierOptions, OpenId4VcUpdateVerifierRecordOptions } from '../types/verifier.types' -// import { VerifierService } from '../verifiers/verifier.service' +import { SCOPES } from '../../../enums' +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<{ message: string }> { + return 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 9bb29c12..c8a83a20 100644 --- a/src/controllers/openid4vc/verifiers/verifier.service.ts +++ b/src/controllers/openid4vc/verifiers/verifier.service.ts @@ -1,57 +1,42 @@ -// 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 { OpenId4VcSiopCreateVerifierOptions } from '../types/verifier.types' +import type { Agent } from '@credo-ts/core' +import type { OpenId4VcUpdateVerifierRecordOptions } from '@credo-ts/openid4vc' +import type { Request as Req } from 'express' + +import { OpenId4VcVerifierRepository } from '@credo-ts/openid4vc' + +export class VerifierService { + public async createVerifier(agentReq: Req, options: OpenId4VcSiopCreateVerifierOptions) { + const verifierRecord = await agentReq.agent.modules.openid4vc.verifier.createVerifier(options) + return verifierRecord + } + + public async updateVerifierMetadata(agentReq: Req, options: OpenId4VcUpdateVerifierRecordOptions) { + await agentReq.agent.modules.openid4vc.verifier.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.openid4vc.verifier.getVerifierByVerifierId(publicVerifierId) + } + + public async deleteVerifier(agentReq: Req, publicVerifierId: string) { + const verifierRepository = agentReq.agent.dependencyManager.resolve(OpenId4VcVerifierRepository) + return await verifierRepository + .deleteById(agentReq.agent.context, publicVerifierId) + .then(() => ({ message: 'Record deleted successfully' })) + } +} + +export const verifierService = new VerifierService() diff --git a/src/utils/oid4vc-agent.ts b/src/utils/oid4vc-agent.ts index 9336b0b1..96df4e5f 100644 --- a/src/utils/oid4vc-agent.ts +++ b/src/utils/oid4vc-agent.ts @@ -200,6 +200,7 @@ export async function getTrustedCerts() { return data as string[] // return [ // 'MIICBzCCAbmgAwIBAgIRAMEUex+GR2GZKusP/izv/oswBQYDK2VwMCsxHDAaBgNVBAMTE0V4YW1wbGUgQ29ycG9yYXRpb24xCzAJBgNVBAYTAlVTMB4XDTI1MDEwMTAwMDAwMFoXDTI3MDEwMTAwMDAwMFowKzEcMBoGA1UEAxMTRXhhbXBsZSBDb3Jwb3JhdGlvbjELMAkGA1UEBhMCVVMwKjAFBgMrZXADIQC5RNVbJCX2L/z/PLbvaxLqi7+hA4fUUStWcmAo/qkX2aOB8TCB7jAdBgNVHQ4EFgQUkog6trQXXfsjb472jybLCBixSAMwDgYDVR0PAQH/BAQDAgGiMBUGA1UdJQEB/wQLMAkGByiBjF0FAQIwIgYDVR0jAQH/BBgwFoAUkog6trQXXfsjb472jybLCBixSAMwQAYDVR0SAQH/BDYwNIILZXhhbXBsZS5jb22GEmh0dHA6Ly9leGFtcGxlLmNvbYERYWRtaW5AZXhhbXBsZS5jb20wLAYDVR0RAQH/BCIwIIILZXhhbXBsZS5jb22BEWFkbWluQGV4YW1wbGUuY29tMBIGA1UdEwEB/wQIMAYBAf8CAQAwBQYDK2VwA0EAPjHj2keDv8BN3FGkOqG36VQKaYvb9Ena+1BI7hb+sBJ+QgBTlj1sK/+I7LMUfu/K3oCyZxT1CZpYRZkh7GEWAw==', + // 'MIICBjCCAbigAwIBAgIRAJyCTLRUEF9FQkk+ELnRLOgwBQYDK2VwMCsxHDAaBgNVBAMTE0V4YW1wbGUgQ29ycG9yYXRpb24xCzAJBgNVBAYTAlVTMB4XDTI1MDEwMTAwMDAwMFoXDTI3MDEwMTAwMDAwMFowKzEcMBoGA1UEAxMTRXhhbXBsZSBDb3Jwb3JhdGlvbjELMAkGA1UEBhMCVVMwKjAFBgMrZXADIQBeWlB8f20JOxam3yUOtVq0R3W7rWm1eRVDZY3u5xxnBaOB8DCB7TAdBgNVHQ4EFgQUcayusF1KIxnM+ynxIybo0bwGSY8wDgYDVR0PAQH/BAQDAgGiMBUGA1UdJQEB/wQLMAkGByiBjF0FAQIwIgYDVR0jAQH/BBgwFoAUcayusF1KIxnM+ynxIybo0bwGSY8wQQYDVR0SAQH/BDcwNYIJbG9jYWxob3N0hhVodHRwOi8vbG9jYWxob3N0OjQwMDGBEWFkbWluQGV4YW1wbGUuY29tMCoGA1UdEQEB/wQgMB6CCWxvY2FsaG9zdIERYWRtaW5AZXhhbXBsZS5jb20wEgYDVR0TAQH/BAgwBgEB/wIBADAFBgMrZXADQQCkB9fINZYClndo78TRY632qu937a0Jxo65UOR5kQ7EGDqzuf5ALxZ9Wcd0xgMYweC291WcachvfuyAmZ+BtC8B', // ] } catch (error) { // eslint-disable-next-line no-console From 4bfdaaa8db0078b42d35498ffe013624f9c4a0b4 Mon Sep 17 00:00:00 2001 From: shitrerohit Date: Mon, 12 Jan 2026 17:22:11 +0530 Subject: [PATCH 063/152] fix: resolved code rabbit ai issues Signed-off-by: shitrerohit --- src/cliAgent.ts | 4 ---- .../holder/credentialBindingResolver.ts | 2 -- .../openid4vc/holder/holder.service.ts | 16 ++++------------ .../issuance-sessions.service.ts | 10 ++++++++-- .../openid4vc/issuers/issuer.service.ts | 10 ++++++---- .../verification-sessions.service.ts | 13 +++++++------ src/controllers/x509/x509.service.ts | 1 - 7 files changed, 25 insertions(+), 31 deletions(-) diff --git a/src/cliAgent.ts b/src/cliAgent.ts index fa8eab15..0f3a980b 100644 --- a/src/cliAgent.ts +++ b/src/cliAgent.ts @@ -181,7 +181,6 @@ const getModules = ( new KeyDidResolver(), new WebDidResolver(), new JwkDidResolver(), - new KeyDidResolver(), // , new PolygonDidResolver() ], }), @@ -510,9 +509,6 @@ export async function runRestAgent(restConfig: AriesRestConfig) { }), ) transport.app.use(bodyParser.json({ limit: process.env.APP_JSON_BODY_SIZE ?? '5mb' })) - - // transport.app.use('/oid4vci', modules.openid4vc.issuer?.config.app.routes ?? express.Router()) - // transport.app.use('/oid4vp', modules.openid4vc.verifier?.config.app.routes ?? express.Router()) } } diff --git a/src/controllers/openid4vc/holder/credentialBindingResolver.ts b/src/controllers/openid4vc/holder/credentialBindingResolver.ts index 7f330e73..5727d8fd 100644 --- a/src/controllers/openid4vc/holder/credentialBindingResolver.ts +++ b/src/controllers/openid4vc/holder/credentialBindingResolver.ts @@ -2,10 +2,8 @@ import { DidJwk, DidKey, DidsApi, type JwkDidCreateOptions, type KeyDidCreateOpt import { type OpenId4VciCredentialBindingResolver, OpenId4VciCredentialFormatProfile } from '@credo-ts/openid4vc' export function getCredentialBindingResolver({ - pidSchemes, requestBatch, }: { - pidSchemes?: { sdJwtVcVcts: Array; msoMdocDoctypes: Array } requestBatch?: boolean | number }): OpenId4VciCredentialBindingResolver { return async ({ diff --git a/src/controllers/openid4vc/holder/holder.service.ts b/src/controllers/openid4vc/holder/holder.service.ts index 1d80b09d..6cb0236e 100644 --- a/src/controllers/openid4vc/holder/holder.service.ts +++ b/src/controllers/openid4vc/holder/holder.service.ts @@ -13,16 +13,7 @@ import type { } from '@credo-ts/openid4vc' import type { Request as Req } from 'express' -import { - DifPresentationExchangeService, - DidKey, - DidJwk, - Mdoc, - W3cJsonLdVerifiableCredential, - W3cJwtVerifiableCredential, - SdJwtVcRecord, - MdocRecord, -} from '@credo-ts/core' +import { Mdoc, SdJwtVcRecord, MdocRecord } from '@credo-ts/core' import { OpenId4VciAuthorizationFlow, authorizationCodeGrantIdentifier, @@ -196,7 +187,6 @@ export class HolderService { // return { method: 'jwk', jwk: getJwkFromKey(key) } // }, credentialBindingResolver: getCredentialBindingResolver({ - pidSchemes: undefined, requestBatch: false, }), ...tokenResponse, @@ -321,7 +311,9 @@ export class HolderService { credentials: dcqlCredentials as DcqlCredentialsForRequest, }, }) - return submissionResult.serverResponse + const result: any = submissionResult.serverResponse + result['authorizationResponsePayload'] = submissionResult.authorizationResponsePayload + return result } public async decodeSdJwt(agentReq: Req, body: { jwt: string }) { diff --git a/src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts b/src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts index 8dd7027b..1959379a 100644 --- a/src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts +++ b/src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts @@ -12,7 +12,9 @@ class IssuanceSessionsService { const { credentials, publicIssuerId } = options const issuer = await agentReq.agent.modules.openid4vc.issuer?.getIssuerByIssuerId(publicIssuerId) - + if (!issuer) { + throw new NotFoundError(`Issuer with id ${publicIssuerId} not found`) + } const mappedCredentials = credentials.map((cred) => { const supported = issuer?.credentialConfigurationsSupported[cred.credentialSupportedId] if (!supported) { @@ -74,7 +76,11 @@ class IssuanceSessionsService { } public async getIssuanceSessionsById(agentReq: Req, sessionId: string) { - return agentReq.agent.modules.openid4vc.issuer?.getIssuanceSessionById(sessionId) + const issuer = agentReq.agent.modules.openid4vc.issuer + if (!issuer) { + throw new Error('OID4VC issuer module not initialized') + } + return issuer.getIssuanceSessionById(sessionId) } public async getIssuanceSessionsByQuery( diff --git a/src/controllers/openid4vc/issuers/issuer.service.ts b/src/controllers/openid4vc/issuers/issuer.service.ts index b1f093de..254f90ca 100644 --- a/src/controllers/openid4vc/issuers/issuer.service.ts +++ b/src/controllers/openid4vc/issuers/issuer.service.ts @@ -10,10 +10,12 @@ export class IssuerService { agentReq: Req, createIssuerOptions: any, //TODO: Replace with OpenId4VciCreateIssuerOptions, ) { - const issuerRecord = await agentReq.agent.modules.openid4vc.issuer?.createIssuer(createIssuerOptions) - const issuerMetadata = await agentReq.agent.modules.openid4vc.issuer?.getIssuerMetadata( - issuerRecord?.issuerId ?? '', - ) + const issuer = agentReq.agent.modules.openid4vc.issuer + if (!issuer) { + throw new Error('OID4VC issuer module not initialized') + } + const issuerRecord = await issuer.createIssuer(createIssuerOptions) + const issuerMetadata = await issuer.getIssuerMetadata(issuerRecord?.issuerId ?? '') // eslint-disable-next-line no-console console.log(`\nIssuer URL: ${issuerMetadata?.credentialIssuer.credential_issuer}`) return issuerRecord diff --git a/src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts b/src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts index 53834ded..7d026fc9 100644 --- a/src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts +++ b/src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts @@ -65,7 +65,7 @@ class VerificationSessionsService { verifierId: dto.verifierId, } - if (dto.responseMode === ResponseModeEnum.DC_API || ResponseModeEnum.DC_API_JWT) { + if (dto.responseMode === ResponseModeEnum.DC_API || dto.responseMode === ResponseModeEnum.DC_API_JWT) { options.expectedOrigins = dto.expectedOrigins } @@ -109,11 +109,12 @@ class VerificationSessionsService { } public async getVerifiedAuthorizationResponse(request: Req, verificationSessionId: string) { - const verificationSession = - await request.agent.modules.openid4vc.verifier?.getVerificationSessionById(verificationSessionId) - const verified = await request.agent.modules.openid4vc.verifier?.getVerifiedAuthorizationResponse( - verificationSession!.id, - ) + const verifier = request.agent.modules.openid4vc.verifier + if (!verifier) { + throw new Error('OID4VC verifier module not initialized') + } + const verificationSession = await verifier.getVerificationSessionById(verificationSessionId) + const verified = await verifier.getVerifiedAuthorizationResponse(verificationSession!.id) const presentations = await Promise.all( (verified!.presentationExchange?.presentations ?? Object.values(verified!.dcql?.presentations ?? {})) diff --git a/src/controllers/x509/x509.service.ts b/src/controllers/x509/x509.service.ts index efad9ae8..82b7a4b8 100644 --- a/src/controllers/x509/x509.service.ts +++ b/src/controllers/x509/x509.service.ts @@ -14,7 +14,6 @@ import { type Agent, } from '@credo-ts/core' import { KeyAlgorithm } from '@openwallet-foundation/askar-nodejs' -import { error } from 'console' import { keyAlgorithmToCurve } from '../../utils/constant' import { generateSecretKey, getCertificateValidityForSystem, getTypeFromCurve } from '../../utils/helpers' From 7326ed90f6a9325f02469eaa857145775663e970 Mon Sep 17 00:00:00 2001 From: shitrerohit Date: Tue, 13 Jan 2026 18:14:14 +0530 Subject: [PATCH 064/152] fix: resolved code rabbit issues Signed-off-by: shitrerohit --- src/cliAgent.ts | 62 ++++---- src/controllers/did/DidController.ts | 13 +- .../openid4vc/holder/holder.service.ts | 14 -- .../issuance-sessions.Controller.ts | 6 +- .../openid4vc/types/issuer.types.ts | 7 +- .../verification-sessions.service.ts | 147 ++++++++++-------- .../verifiers/verifier.Controller.ts | 3 + .../openid4vc/verifiers/verifier.service.ts | 4 +- 8 files changed, 130 insertions(+), 126 deletions(-) diff --git a/src/cliAgent.ts b/src/cliAgent.ts index 0f3a980b..a409f8dc 100644 --- a/src/cliAgent.ts +++ b/src/cliAgent.ts @@ -448,41 +448,41 @@ export async function runRestAgent(restConfig: AriesRestConfig) { }, ] } + let modules + + if (afjConfig.tenancy) { + modules = await getWithTenantModules( + networkConfig, + didRegistryContractAddress || '', + fileServerToken || '', + fileServerUrl || '', + rpcUrl || '', + schemaManagerContractAddress || '', + autoAcceptConnections || true, + autoAcceptCredentials || DidCommAutoAcceptCredential.Always, + autoAcceptProofs || DidCommAutoAcceptProof.ContentApproved, + walletScheme || AskarMultiWalletDatabaseScheme.ProfilePerWallet, + walletConfig, + ) + } else { + modules = getModules( + networkConfig, + didRegistryContractAddress || '', + fileServerToken || '', + fileServerUrl || '', + rpcUrl || '', + schemaManagerContractAddress || '', + autoAcceptConnections || true, + autoAcceptCredentials || DidCommAutoAcceptCredential.Always, + autoAcceptProofs || DidCommAutoAcceptProof.ContentApproved, + walletScheme || AskarMultiWalletDatabaseScheme.ProfilePerWallet, + walletConfig, + ) + } - const tenantModule = await getWithTenantModules( - networkConfig, - didRegistryContractAddress || '', - fileServerToken || '', - fileServerUrl || '', - rpcUrl || '', - schemaManagerContractAddress || '', - autoAcceptConnections || true, - autoAcceptCredentials || DidCommAutoAcceptCredential.Always, - autoAcceptProofs || DidCommAutoAcceptProof.ContentApproved, - walletScheme || AskarMultiWalletDatabaseScheme.ProfilePerWallet, - walletConfig, - ) - const modules = getModules( - networkConfig, - didRegistryContractAddress || '', - fileServerToken || '', - fileServerUrl || '', - rpcUrl || '', - schemaManagerContractAddress || '', - autoAcceptConnections || true, - autoAcceptCredentials || DidCommAutoAcceptCredential.Always, - autoAcceptProofs || DidCommAutoAcceptProof.ContentApproved, - walletScheme || AskarMultiWalletDatabaseScheme.ProfilePerWallet, - walletConfig, - ) const agent = new Agent({ config: agentConfig, modules: { - ...(afjConfig.tenancy - ? { - ...tenantModule, - } - : {}), ...modules, }, dependencies: agentDependencies, diff --git a/src/controllers/did/DidController.ts b/src/controllers/did/DidController.ts index b13279a5..e035c691 100644 --- a/src/controllers/did/DidController.ts +++ b/src/controllers/did/DidController.ts @@ -166,7 +166,7 @@ export class DidController extends Controller { throw new BadRequestError('Only ed25519 key type supported') } - if (!Network.Bcovrin_Testnet && !Network.Indicio_Demonet && !Network.Indicio_Testnet) { + if (!Object.values(Network).includes(createDidOptions.network as Network)) { throw new BadRequestError(`Invalid network for 'indy' method: ${createDidOptions.network}`) } @@ -215,6 +215,9 @@ export class DidController extends Controller { didDocument: didDocument, } } else { + if (!process.env.BCOVRIN_REGISTER_URL) { + throw new InternalServerError('BCOVRIN_REGISTER_URL is not set in environment variables') + } const BCOVRIN_REGISTER_URL = process.env.BCOVRIN_REGISTER_URL as string const res = await axios.post(BCOVRIN_REGISTER_URL, { role: 'ENDORSER', @@ -286,6 +289,10 @@ export class DidController extends Controller { did: `${didMethod}:${key.did}`, didDocument: didDocument, } + } else { + throw new InternalServerError( + `Failed to register DID with Indicio: ${res.data.message || res.data.body || 'Unknown error'}`, + ) } } } else { @@ -494,8 +501,8 @@ export class DidController extends Controller { 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') + if (didOptions.keyType !== KeyAlgorithm.Ed25519) { + throw new BadRequestError('Only ed25519 key type supported') } const domain = didOptions.domain diff --git a/src/controllers/openid4vc/holder/holder.service.ts b/src/controllers/openid4vc/holder/holder.service.ts index 6cb0236e..2db89766 100644 --- a/src/controllers/openid4vc/holder/holder.service.ts +++ b/src/controllers/openid4vc/holder/holder.service.ts @@ -95,7 +95,6 @@ export class HolderService { options = { resolvedCredentialOffer, txCode: body.txCode, - code: body.authorizationCode, } as OpenId4VciPreAuthorizedTokenRequestOptions } else { options = { @@ -320,18 +319,5 @@ export class HolderService { const sdJwt = agentReq.agent.sdJwtVc.fromCompact(body.jwt) return sdJwt as any } - - 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..fd8d0ea1 100644 --- a/src/controllers/openid4vc/issuance-sessions/issuance-sessions.Controller.ts +++ b/src/controllers/openid4vc/issuance-sessions/issuance-sessions.Controller.ts @@ -37,7 +37,7 @@ export class IssuanceSessionsController extends Controller { /** * Get issuance details by issuance SessionId */ - @Get('/:issuanceSessionId') + @Get('{issuanceSessionId}') public async getIssuanceSessionsById(@Request() request: Req, @Path('issuanceSessionId') issuanceSessionId: string) { try { return await issuanceSessionService.getIssuanceSessionsById(request, issuanceSessionId) @@ -77,7 +77,7 @@ export class IssuanceSessionsController extends Controller { /** * Update issuance session metadata by session ID */ - @Put('/:issuanceSessionId') + @Put('{issuanceSessionId}') public async updateSessionById( @Request() request: Req, @Path('issuanceSessionId') issuanceSessionId: string, @@ -93,7 +93,7 @@ export class IssuanceSessionsController extends Controller { /** * Delete issuance session by session ID */ - @Delete('/:issuanceSessionId') + @Delete('{issuanceSessionId}') public async deleteIssuanceSessionById( @Request() request: Req, @Path('issuanceSessionId') issuanceSessionId: string, diff --git a/src/controllers/openid4vc/types/issuer.types.ts b/src/controllers/openid4vc/types/issuer.types.ts index a8f35491..d83ef093 100644 --- a/src/controllers/openid4vc/types/issuer.types.ts +++ b/src/controllers/openid4vc/types/issuer.types.ts @@ -20,9 +20,9 @@ export interface OpenId4VciOfferCredentials { } } -export interface DisclosureFrame { +export interface DisclosureFrameForOffer { _sd?: string[] - [claim: string]: DisclosureFrame | string[] | undefined + [claim: string]: DisclosureFrameForOffer | string[] | undefined } export interface OpenId4VciOfferSdJwtCredential extends OpenId4VciOfferCredentials { @@ -30,8 +30,7 @@ export interface OpenId4VciOfferSdJwtCredential extends OpenId4VciOfferCredentia vct?: string [key: string]: unknown } - // disclosureFrame?: Record> - disclosureFrame?: DisclosureFrame + disclosureFrame?: DisclosureFrameForOffer } export interface ValidityInfo { signed: Date diff --git a/src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts b/src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts index 7d026fc9..315e3aa3 100644 --- a/src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts +++ b/src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts @@ -26,65 +26,71 @@ import { CreateAuthorizationRequest, OpenId4VcIssuerX5c, ResponseModeEnum } from @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] + const verifier = agentReq.agent.modules.openid4vc.verifier + if (!verifier) throw new Error('OID4VC verifier module not initialized') + + 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 } - const options: any = { - requestSigner, - verifierId: dto.verifierId, + + if (!verifierDidUrl) { + throw new Error('No matching verification method found on verifier DID document') } - if (dto.responseMode === ResponseModeEnum.DC_API || dto.responseMode === ResponseModeEnum.DC_API_JWT) { - options.expectedOrigins = dto.expectedOrigins + if (!requestSigner.didUrl || !String(requestSigner.didUrl).includes('#')) { + requestSigner.didUrl = verifierDidUrl } - if (dto.responseMode) options.responseMode = dto.responseMode - if (dto.presentationExchange) { - // options.presentationExchange = dto.presentationExchange - throw new Error('Presentation Exchange is not supported for now') - } else if (dto.dcql) { - const parsedCertificate = X509Service.parseCertificate(agentReq.agent.context, { - encodedCertificate: requestSigner.x5c[0], - }) - parsedCertificate.publicJwk.keyId = requestSigner.keyId - options.requestSigner.x5c = [parsedCertificate] - options.dcql = dto.dcql + 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] + } + const options: any = { + requestSigner, + verifierId: dto.verifierId, + } + + if (dto.responseMode === ResponseModeEnum.DC_API || dto.responseMode === ResponseModeEnum.DC_API_JWT) { + options.expectedOrigins = dto.expectedOrigins + } + + if (dto.responseMode) options.responseMode = dto.responseMode + if (dto.presentationExchange) { + // options.presentationExchange = dto.presentationExchange + throw new Error('Presentation Exchange is not supported for now') + } else if (dto.dcql) { + if ( + dto.requestSigner.method !== SignerMethod.X5c || + !Array.isArray((requestSigner as OpenId4VcIssuerX5c).x5c) || + !(requestSigner as OpenId4VcIssuerX5c).x5c[0] + ) { + throw new Error('dcql currently requires x5c requestSigner with a valid certificate chain') } - return (await agentReq.agent.modules.openid4vc.verifier?.createAuthorizationRequest(options)) as any - } catch (error) { - throw error + const parsedCertificate = X509Service.parseCertificate(agentReq.agent.context, { + encodedCertificate: requestSigner.x5c[0], + }) + parsedCertificate.publicJwk.keyId = requestSigner.keyId + options.requestSigner.x5c = [parsedCertificate] + options.dcql = dto.dcql } + return (await verifier.createAuthorizationRequest(options)) as any } public async findVerificationSessionsByQuery( @@ -105,7 +111,11 @@ class VerificationSessionsService { } public async getVerificationSessionsById(agentReq: Req, verificationSessionId: string) { - return await agentReq.agent.modules.openid4vc.verifier?.getVerificationSessionById(verificationSessionId) + const verifier = agentReq.agent.modules.openid4vc.verifier + if (!verifier) { + throw new Error('OID4VC verifier module not initialized') + } + return await verifier.getVerificationSessionById(verificationSessionId) } public async getVerifiedAuthorizationResponse(request: Req, verificationSessionId: string) { @@ -114,10 +124,15 @@ class VerificationSessionsService { throw new Error('OID4VC verifier module not initialized') } const verificationSession = await verifier.getVerificationSessionById(verificationSessionId) - const verified = await verifier.getVerifiedAuthorizationResponse(verificationSession!.id) - + if (!verificationSession) { + throw new Error(`Verification session with id ${verificationSessionId} not found`) + } + const verified = await verifier.getVerifiedAuthorizationResponse(verificationSession.id) + if (!verified) { + throw new Error(`No verified response found for verification session with id ${verificationSessionId}`) + } const presentations = await Promise.all( - (verified!.presentationExchange?.presentations ?? Object.values(verified!.dcql?.presentations ?? {})) + (verified.presentationExchange?.presentations ?? Object.values(verified.dcql?.presentations ?? {})) .flat() .map(async (presentation: any) => { if (presentation instanceof W3cJsonLdVerifiablePresentation) { @@ -159,13 +174,6 @@ class VerificationSessionsService { } } - // if ( - // presentation instanceof W3cV2JwtVerifiablePresentation || - // presentation instanceof W3cV2SdJwtVerifiablePresentation - // ) { - // throw new Error('W3C V2 presentations are not supported yet') - // } - return { pretty: { ...presentation, @@ -175,12 +183,13 @@ class VerificationSessionsService { } }) ?? [], ) - - const dcqlSubmission = verified!.dcql - ? Object.keys(verified!.dcql.presentations).map((key, index) => ({ - queryCredentialId: key, - presentationIndex: index, - })) + const dcqlSubmission = verified?.dcql + ? Object.entries(verified.dcql.presentations).flatMap(([queryCredentialId, presentations]) => + presentations.map((_, presentationIndex) => ({ + queryCredentialId, + presentationIndex, + })), + ) : undefined return { diff --git a/src/controllers/openid4vc/verifiers/verifier.Controller.ts b/src/controllers/openid4vc/verifiers/verifier.Controller.ts index 4f081c6a..c49aa84b 100644 --- a/src/controllers/openid4vc/verifiers/verifier.Controller.ts +++ b/src/controllers/openid4vc/verifiers/verifier.Controller.ts @@ -32,6 +32,9 @@ export class VerifierController { @Path('publicVerifierId') publicVerifierId: string, @Body() verifierRecordOptions: OpenId4VcUpdateVerifierRecordOptions, ) { + if (!publicVerifierId) { + throw new Error('verifierId is required to update verifier metadata') + } return await this.verifierService.updateVerifierMetadata(request, { verifierId: publicVerifierId, clientMetadata: verifierRecordOptions.clientMetadata, diff --git a/src/controllers/openid4vc/verifiers/verifier.service.ts b/src/controllers/openid4vc/verifiers/verifier.service.ts index c8a83a20..725de2c9 100644 --- a/src/controllers/openid4vc/verifiers/verifier.service.ts +++ b/src/controllers/openid4vc/verifiers/verifier.service.ts @@ -31,10 +31,10 @@ export class VerifierService { return await agentReq.agent.modules.openid4vc.verifier.getVerifierByVerifierId(publicVerifierId) } - public async deleteVerifier(agentReq: Req, publicVerifierId: string) { + public async deleteVerifier(agentReq: Req, verifierId: string) { const verifierRepository = agentReq.agent.dependencyManager.resolve(OpenId4VcVerifierRepository) return await verifierRepository - .deleteById(agentReq.agent.context, publicVerifierId) + .deleteById(agentReq.agent.context, verifierId) .then(() => ({ message: 'Record deleted successfully' })) } } From 9fba971a43dc7f63cdbf8a57e7ea0906e7c76732 Mon Sep 17 00:00:00 2001 From: shitrerohit Date: Wed, 14 Jan 2026 11:54:49 +0530 Subject: [PATCH 065/152] fix: added comment for image check in verification session Signed-off-by: shitrerohit --- .../openid4vc/verifier-sessions/verification-sessions.service.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts b/src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts index 315e3aa3..f1811e24 100644 --- a/src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts +++ b/src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts @@ -161,6 +161,7 @@ class VerificationSessionsService { issuerSignedNamespaces: Object.entries(doc.issuerSignedNamespaces).map( ([nameSpace, nameSpacEntries]) => [ nameSpace, + // TODO: Address it later to check whether the received Uint8Array is an image or not. Object.entries(nameSpacEntries).map(([key, value]) => value instanceof Uint8Array ? [`base64:${key}`, `data:image/jpeg;base64,${TypedArrayEncoder.toBase64(value)}`] From 4d4aa7965d8d8234b6438a1373b138e720280567 Mon Sep 17 00:00:00 2001 From: shitrerohit Date: Wed, 14 Jan 2026 13:46:48 +0530 Subject: [PATCH 066/152] fix/removed commented code Signed-off-by: shitrerohit --- src/cliAgent.ts | 21 ----- .../openid4vc/holder/holder.service.ts | 89 ------------------- .../openid4vc/types/issuer.types.ts | 1 - .../verification-sessions.Controller.ts | 14 +-- .../verification-sessions.service.ts | 4 +- .../openid4vc/verifiers/verifier.service.ts | 2 - src/controllers/x509/x509.Controller.ts | 1 + src/utils/oid4vc-agent.ts | 4 - 8 files changed, 10 insertions(+), 126 deletions(-) diff --git a/src/cliAgent.ts b/src/cliAgent.ts index a409f8dc..049ae380 100644 --- a/src/cliAgent.ts +++ b/src/cliAgent.ts @@ -272,27 +272,6 @@ const getModules = ( authorizationRequestExpirationInSeconds: Number(process.env.OID4VP_AUTH_REQUEST_PROOF_REQUEST_EXPIRY) || 3600, }, }), - // openId4VcVerifier: new OpenId4VcVerifierModule({ - // baseUrl: - // process.env.NODE_ENV === 'PROD' - // ? `https://${process.env.APP_URL}/oid4vp` - // : `${process.env.AGENT_HTTP_URL}/oid4vp`, - // app: openId4VpApp, - // authorizationRequestExpirationInSeconds: Number(process.env.OID4VP_AUTH_REQUEST_PROOF_REQUEST_EXPIRY) || 3600, - // }), - // openId4VcIssuer: new OpenId4VcIssuerModule({ - // baseUrl: - // process.env.NODE_ENV === 'PROD' - // ? `https://${process.env.APP_URL}/oid4vci` - // : `${process.env.AGENT_HTTP_URL}/oid4vci`, - // 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) => getCredentialRequestToCredentialMapper()(...args), - // }), openId4VcHolderModule: new OpenId4VcHolderModule(), x509: new X509Module({ getTrustedCertificatesForVerification: async (_agentContext, { certificateChain, verification }) => { diff --git a/src/controllers/openid4vc/holder/holder.service.ts b/src/controllers/openid4vc/holder/holder.service.ts index 2db89766..4d75e7b2 100644 --- a/src/controllers/openid4vc/holder/holder.service.ts +++ b/src/controllers/openid4vc/holder/holder.service.ts @@ -107,55 +107,7 @@ export class HolderService { } 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, - // // }) - - // // 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 - // // } private async requestAndStoreCredentials( agentReq: Req, resolvedCredentialOffer: OpenId4VciResolvedCredentialOffer, @@ -165,52 +117,11 @@ export class HolderService { const credentialResponse = await agentReq.agent.modules.openid4vc.holder.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) } - // }, credentialBindingResolver: getCredentialBindingResolver({ requestBatch: false, }), ...tokenResponse, }) - // const credentialResponse = await agentReq.agent.modules.openid4vc.holder.requestCredentials({ - // ...options, - // credentialConfigurationIds: resolvedCredentialOffer.credentialOfferPayload.credential_configuration_ids, - // credentialBindingResolver: async (options) => { - // const { keyId, publicJwk } = await agentReq.agent.kms.createKey({ - // type: { - // crv: 'Ed25519', - // kty: 'OKP', - // }, - // }) - // if (options.supportsAllDidMethods || options.supportedDidMethods?.includes('did:key')) { - // const didKey = new DidKey(key) - // return { method: 'did', didUrls: [`${didKey.did}#${didKey.key.fingerprint}`] } - // } - // if (options.supportedDidMethods?.includes('did:jwk')) { - // const didJwk = DidJwk.fromKey(key) - // return { method: 'did', didUrls: [`${didJwk.did}#0`] } - // } - // return { method: 'jwk', jwk: key } - // }, - // }) const storedCredentials = await Promise.all( credentialResponse.credentials.map(async (response) => { diff --git a/src/controllers/openid4vc/types/issuer.types.ts b/src/controllers/openid4vc/types/issuer.types.ts index d83ef093..897dfca6 100644 --- a/src/controllers/openid4vc/types/issuer.types.ts +++ b/src/controllers/openid4vc/types/issuer.types.ts @@ -55,7 +55,6 @@ export interface OpenId4VciOfferW3cCredential extends OpenId4VciOfferCredentials } export interface OpenId4VcIssuanceSessionsCreateOffer { - //extends OpenId4VciCreateCredentialOfferOptions { publicIssuerId: string credentials: Array authorizationCodeFlowConfig?: { diff --git a/src/controllers/openid4vc/verifier-sessions/verification-sessions.Controller.ts b/src/controllers/openid4vc/verifier-sessions/verification-sessions.Controller.ts index 603cd542..d6274acf 100644 --- a/src/controllers/openid4vc/verifier-sessions/verification-sessions.Controller.ts +++ b/src/controllers/openid4vc/verifier-sessions/verification-sessions.Controller.ts @@ -8,13 +8,16 @@ import { SCOPES } from '../../../enums' import ErrorHandlingService from '../../../errorHandlingService' import { CreateAuthorizationRequest } from '../types/verifier.types' -import { verificationSessionService } from './verification-sessions.service' +import { VerificationSessionsService } from './verification-sessions.service' @Tags('oid4vc verification sessions') @Route('/openid4vc/verification-sessions') @Security('jwt', [SCOPES.TENANT_AGENT, SCOPES.DEDICATED_AGENT]) @injectable() export class VerificationSessionsController extends Controller { + public constructor(private verificationSessionService: VerificationSessionsService) { + super() + } /** * Create an authorization request, acting as a Relying Party (RP) */ @@ -24,7 +27,7 @@ export class VerificationSessionsController extends Controller { @Body() createAuthorizationRequest: CreateAuthorizationRequest, ) { try { - return await verificationSessionService.createProofRequest(request, createAuthorizationRequest) + return await this.verificationSessionService.createProofRequest(request, createAuthorizationRequest) } catch (error) { throw ErrorHandlingService.handle(error) } @@ -43,7 +46,7 @@ export class VerificationSessionsController extends Controller { @Query('nonce') nonce?: string, ) { try { - return await verificationSessionService.findVerificationSessionsByQuery( + return await this.verificationSessionService.findVerificationSessionsByQuery( request, publicVerifierId, payloadState, @@ -65,12 +68,11 @@ export class VerificationSessionsController extends Controller { @Path('verificationSessionId') verificationSessionId: string, ) { try { - return await verificationSessionService.getVerificationSessionsById(request, verificationSessionId) + return await this.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 // */ @@ -80,7 +82,7 @@ export class VerificationSessionsController extends Controller { @Path('verificationSessionId') verificationSessionId: string, ) { try { - return await verificationSessionService.getVerifiedAuthorizationResponse(request, verificationSessionId) + return await this.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 f1811e24..8b013983 100644 --- a/src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts +++ b/src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts @@ -24,7 +24,7 @@ import { SignerMethod } from '../../../enums' import { CreateAuthorizationRequest, OpenId4VcIssuerX5c, ResponseModeEnum } from '../types/verifier.types' @injectable() -class VerificationSessionsService { +export class VerificationSessionsService { public async createProofRequest(agentReq: Req, dto: CreateAuthorizationRequest) { const verifier = agentReq.agent.modules.openid4vc.verifier if (!verifier) throw new Error('OID4VC verifier module not initialized') @@ -212,5 +212,3 @@ class VerificationSessionsService { } as any } } - -export const verificationSessionService = new VerificationSessionsService() diff --git a/src/controllers/openid4vc/verifiers/verifier.service.ts b/src/controllers/openid4vc/verifiers/verifier.service.ts index 725de2c9..5d9fd510 100644 --- a/src/controllers/openid4vc/verifiers/verifier.service.ts +++ b/src/controllers/openid4vc/verifiers/verifier.service.ts @@ -38,5 +38,3 @@ export class VerifierService { .then(() => ({ message: 'Record deleted successfully' })) } } - -export const verifierService = new VerifierService() diff --git a/src/controllers/x509/x509.Controller.ts b/src/controllers/x509/x509.Controller.ts index 61a412eb..cc4725e4 100644 --- a/src/controllers/x509/x509.Controller.ts +++ b/src/controllers/x509/x509.Controller.ts @@ -5,6 +5,7 @@ import { Body, Controller, Post, Route, Tags, Security, Request, Get } from 'tso import { SCOPES } from '../../enums' import ErrorHandlingService from '../../errorHandlingService' import { X509ImportCertificateOptionsDto } from '../types' + import { x509ServiceT } from './x509.service' import { X509CreateCertificateOptionsDto } from './x509.types' diff --git a/src/utils/oid4vc-agent.ts b/src/utils/oid4vc-agent.ts index 96df4e5f..f9a8053d 100644 --- a/src/utils/oid4vc-agent.ts +++ b/src/utils/oid4vc-agent.ts @@ -198,10 +198,6 @@ export async function getTrustedCerts() { } const data = await response.json() return data as string[] - // return [ - // 'MIICBzCCAbmgAwIBAgIRAMEUex+GR2GZKusP/izv/oswBQYDK2VwMCsxHDAaBgNVBAMTE0V4YW1wbGUgQ29ycG9yYXRpb24xCzAJBgNVBAYTAlVTMB4XDTI1MDEwMTAwMDAwMFoXDTI3MDEwMTAwMDAwMFowKzEcMBoGA1UEAxMTRXhhbXBsZSBDb3Jwb3JhdGlvbjELMAkGA1UEBhMCVVMwKjAFBgMrZXADIQC5RNVbJCX2L/z/PLbvaxLqi7+hA4fUUStWcmAo/qkX2aOB8TCB7jAdBgNVHQ4EFgQUkog6trQXXfsjb472jybLCBixSAMwDgYDVR0PAQH/BAQDAgGiMBUGA1UdJQEB/wQLMAkGByiBjF0FAQIwIgYDVR0jAQH/BBgwFoAUkog6trQXXfsjb472jybLCBixSAMwQAYDVR0SAQH/BDYwNIILZXhhbXBsZS5jb22GEmh0dHA6Ly9leGFtcGxlLmNvbYERYWRtaW5AZXhhbXBsZS5jb20wLAYDVR0RAQH/BCIwIIILZXhhbXBsZS5jb22BEWFkbWluQGV4YW1wbGUuY29tMBIGA1UdEwEB/wQIMAYBAf8CAQAwBQYDK2VwA0EAPjHj2keDv8BN3FGkOqG36VQKaYvb9Ena+1BI7hb+sBJ+QgBTlj1sK/+I7LMUfu/K3oCyZxT1CZpYRZkh7GEWAw==', - // 'MIICBjCCAbigAwIBAgIRAJyCTLRUEF9FQkk+ELnRLOgwBQYDK2VwMCsxHDAaBgNVBAMTE0V4YW1wbGUgQ29ycG9yYXRpb24xCzAJBgNVBAYTAlVTMB4XDTI1MDEwMTAwMDAwMFoXDTI3MDEwMTAwMDAwMFowKzEcMBoGA1UEAxMTRXhhbXBsZSBDb3Jwb3JhdGlvbjELMAkGA1UEBhMCVVMwKjAFBgMrZXADIQBeWlB8f20JOxam3yUOtVq0R3W7rWm1eRVDZY3u5xxnBaOB8DCB7TAdBgNVHQ4EFgQUcayusF1KIxnM+ynxIybo0bwGSY8wDgYDVR0PAQH/BAQDAgGiMBUGA1UdJQEB/wQLMAkGByiBjF0FAQIwIgYDVR0jAQH/BBgwFoAUcayusF1KIxnM+ynxIybo0bwGSY8wQQYDVR0SAQH/BDcwNYIJbG9jYWxob3N0hhVodHRwOi8vbG9jYWxob3N0OjQwMDGBEWFkbWluQGV4YW1wbGUuY29tMCoGA1UdEQEB/wQgMB6CCWxvY2FsaG9zdIERYWRtaW5AZXhhbXBsZS5jb20wEgYDVR0TAQH/BAgwBgEB/wIBADAFBgMrZXADQQCkB9fINZYClndo78TRY632qu937a0Jxo65UOR5kQ7EGDqzuf5ALxZ9Wcd0xgMYweC291WcachvfuyAmZ+BtC8B', - // ] } catch (error) { // eslint-disable-next-line no-console console.error('Error fetching data:', error) From 2d429ceea36ccb62ed579a1333e279e159b2827a Mon Sep 17 00:00:00 2001 From: shitrerohit Date: Tue, 27 Jan 2026 11:18:53 +0530 Subject: [PATCH 067/152] fix:resolved sd-jwt issuance related issues Signed-off-by: shitrerohit --- src/controllers/x509/crypto-util.ts | 4 +++- src/controllers/x509/x509.service.ts | 6 +++--- src/utils/oid4vc-agent.ts | 1 + 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/controllers/x509/crypto-util.ts b/src/controllers/x509/crypto-util.ts index 32e92046..ed675a0a 100644 --- a/src/controllers/x509/crypto-util.ts +++ b/src/controllers/x509/crypto-util.ts @@ -1,4 +1,6 @@ -import { createPrivateKey, KeyObject } from 'crypto' +import type { KeyObject } from 'crypto' + +import { createPrivateKey } from 'crypto' /** * Extracts the raw private key (hex) from a PEM-encoded EC (P-256) private key. diff --git a/src/controllers/x509/x509.service.ts b/src/controllers/x509/x509.service.ts index 82b7a4b8..36f9ffe5 100644 --- a/src/controllers/x509/x509.service.ts +++ b/src/controllers/x509/x509.service.ts @@ -143,7 +143,7 @@ class x509Service { encodedCertificate: options.certificate, }) const issuerCertificate = parsedCertificate.toString('base64') - + let key try { const keyTypeInfo = getTypeFromCurve(options.keyType) const { privateJwk } = transformPrivateKeyToPrivateJwk({ @@ -151,7 +151,7 @@ class x509Service { privateKey, }) - const key = await agent.kms.importKey({ + key = await agent.kms.importKey({ privateJwk, }) if ( @@ -174,7 +174,7 @@ class x509Service { } } - return { issuerCertificate } + return { issuerCertificate, keyId: key?.keyId } } public addTrustedCertificate( diff --git a/src/utils/oid4vc-agent.ts b/src/utils/oid4vc-agent.ts index f9a8053d..b0b97982 100644 --- a/src/utils/oid4vc-agent.ts +++ b/src/utils/oid4vc-agent.ts @@ -168,6 +168,7 @@ export function getMixedCredentialRequestToCredentialMapper(): OpenId4VciCredent } : { method: 'x5c', + // x5c: (issuerx509certificate ?? []).map((cert) => X509Certificate.fromEncodedCertificate(cert)), x5c: [parsedCertificate], // TODO: Need to check validation for issuer value // issuer: process.env.AGENT_HOST ?? 'http://localhost:4001', From 0a812d768898fb137351aead55fc2143341593ce Mon Sep 17 00:00:00 2001 From: shitrerohit Date: Tue, 27 Jan 2026 13:11:34 +0530 Subject: [PATCH 068/152] fix:Removed commented code Signed-off-by: shitrerohit --- src/utils/oid4vc-agent.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/utils/oid4vc-agent.ts b/src/utils/oid4vc-agent.ts index b0b97982..f9a8053d 100644 --- a/src/utils/oid4vc-agent.ts +++ b/src/utils/oid4vc-agent.ts @@ -168,7 +168,6 @@ export function getMixedCredentialRequestToCredentialMapper(): OpenId4VciCredent } : { method: 'x5c', - // x5c: (issuerx509certificate ?? []).map((cert) => X509Certificate.fromEncodedCertificate(cert)), x5c: [parsedCertificate], // TODO: Need to check validation for issuer value // issuer: process.env.AGENT_HOST ?? 'http://localhost:4001', From ed0898911fbc07c46ec78becfead3de30434a4b5 Mon Sep 17 00:00:00 2001 From: shitrerohit Date: Wed, 28 Jan 2026 18:33:10 +0530 Subject: [PATCH 069/152] fix:changes in create proof request Signed-off-by: shitrerohit --- .../verification-sessions.service.ts | 21 +++++++------------ 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts b/src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts index 8b013983..395cd31d 100644 --- a/src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts +++ b/src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts @@ -30,6 +30,7 @@ export class VerificationSessionsService { if (!verifier) throw new Error('OID4VC verifier module not initialized') let requestSigner + let parsedCertificate if (dto.requestSigner.method === SignerMethod.Did) { requestSigner = dto.requestSigner as OpenId4VcJwtIssuerDid @@ -57,7 +58,7 @@ export class VerificationSessionsService { } else { requestSigner = dto.requestSigner as OpenId4VcIssuerX5c - const parsedCertificate = X509Service.parseCertificate(agentReq.agent.context, { + parsedCertificate = X509Service.parseCertificate(agentReq.agent.context, { encodedCertificate: requestSigner.x5c[0], }) requestSigner.issuer = parsedCertificate.sanUriNames[0] @@ -75,21 +76,13 @@ export class VerificationSessionsService { if (dto.presentationExchange) { // options.presentationExchange = dto.presentationExchange throw new Error('Presentation Exchange is not supported for now') - } else if (dto.dcql) { - if ( - dto.requestSigner.method !== SignerMethod.X5c || - !Array.isArray((requestSigner as OpenId4VcIssuerX5c).x5c) || - !(requestSigner as OpenId4VcIssuerX5c).x5c[0] - ) { - throw new Error('dcql currently requires x5c requestSigner with a valid certificate chain') - } - const parsedCertificate = X509Service.parseCertificate(agentReq.agent.context, { - encodedCertificate: requestSigner.x5c[0], - }) + } + if (parsedCertificate) { parsedCertificate.publicJwk.keyId = requestSigner.keyId - options.requestSigner.x5c = [parsedCertificate] - options.dcql = dto.dcql } + options.requestSigner.x5c = [parsedCertificate] + options.dcql = dto.dcql + // } return (await verifier.createAuthorizationRequest(options)) as any } From 7d75cf995706e3d16e3765332eb4498c2d390627 Mon Sep 17 00:00:00 2001 From: shitrerohit Date: Sat, 31 Jan 2026 15:28:38 +0530 Subject: [PATCH 070/152] feat:API for delete credential Signed-off-by: shitrerohit --- .../openid4vc/holder/holder.Controller.ts | 9 +++++++- .../openid4vc/holder/holder.service.ts | 21 +++++++++++++++++++ .../openid4vc/types/holder.types.ts | 10 +++++++++ 3 files changed, 39 insertions(+), 1 deletion(-) diff --git a/src/controllers/openid4vc/holder/holder.Controller.ts b/src/controllers/openid4vc/holder/holder.Controller.ts index 8e976112..9ed076b4 100644 --- a/src/controllers/openid4vc/holder/holder.Controller.ts +++ b/src/controllers/openid4vc/holder/holder.Controller.ts @@ -1,10 +1,12 @@ import { Request as Req } from 'express' -import { Body, Controller, Get, Post, Route, Security, Tags, Request } from 'tsoa' +import { Body, Controller, Get, Post, Route, Security, Tags, Request, Delete } from 'tsoa' import { injectable } from 'tsyringe' import { SCOPES } from '../../../enums/enum' import { AuthorizeRequestCredentialOffer, + CredentialType, + DeleteCredentialBody, RequestCredentialBody, ResolveCredentialOfferBody, ResolveProofRequest, @@ -94,4 +96,9 @@ export class HolderController extends Controller { public async decodeSdJwt(@Request() request: Req, @Body() body: { jwt: string }) { return await holderService.decodeSdJwt(request, body) } + + @Delete('credential') + public async delete(@Request() agentReq: Req, @Body() body: DeleteCredentialBody) { + return await holderService.deleteCredential(agentReq, body) + } } diff --git a/src/controllers/openid4vc/holder/holder.service.ts b/src/controllers/openid4vc/holder/holder.service.ts index 4d75e7b2..87aabb3f 100644 --- a/src/controllers/openid4vc/holder/holder.service.ts +++ b/src/controllers/openid4vc/holder/holder.service.ts @@ -1,5 +1,6 @@ import type { AuthorizeRequestCredentialOffer, + DeleteCredentialBody, RequestCredentialBody, ResolveCredentialOfferBody, ResolveProofRequest, @@ -20,6 +21,8 @@ import { preAuthorizedCodeGrantIdentifier, } from '@credo-ts/openid4vc' +import { CredentialType } from '../types/holder.types' + import { getCredentialBindingResolver } from './credentialBindingResolver' export class HolderService { private HOLDER_REDIRECT = process.env.HOLDER_REDIRECT ?? 'http://localhost:4001/redirect' @@ -226,6 +229,24 @@ export class HolderService { return result } + public async deleteCredential(agentReq: Req, { credentialId, credentialType }: DeleteCredentialBody) { + if (credentialType === CredentialType.SD_JWT) { + const sdJwtRecord = await agentReq.agent.sdJwtVc.getById(credentialId) + if (sdJwtRecord) { + return await agentReq.agent.sdJwtVc.deleteById(credentialId) + } + throw new Error(`Credential with id ${credentialId} not found`) + } else if (credentialType === CredentialType.MSO_MDOC) { + const mdocRecord = await agentReq.agent.mdoc.getById(credentialId) + if (mdocRecord) { + return await agentReq.agent.mdoc.deleteById(credentialId) + } + throw new Error(`Credential with id ${credentialId} not found`) + } else { + throw new Error(`Unsupported credential type: ${credentialType}`) + } + } + public async decodeSdJwt(agentReq: Req, body: { jwt: string }) { const sdJwt = agentReq.agent.sdJwtVc.fromCompact(body.jwt) return sdJwt as any diff --git a/src/controllers/openid4vc/types/holder.types.ts b/src/controllers/openid4vc/types/holder.types.ts index 550e7572..acda4b2c 100644 --- a/src/controllers/openid4vc/types/holder.types.ts +++ b/src/controllers/openid4vc/types/holder.types.ts @@ -23,3 +23,13 @@ export interface AcceptProofRequest { proofRequestUri: string // selectedCredentials?: { [inputDescriptorId: string]: string } } + +export interface DeleteCredentialBody { + credentialType: CredentialType + credentialId: string +} + +export enum CredentialType { + SD_JWT = 'sd-jwt-vc', + MSO_MDOC = 'mso_mdoc', +} From 9d91880f24fdbf5af19fb4d34944aa01e56bf084 Mon Sep 17 00:00:00 2001 From: shitrerohit Date: Sat, 31 Jan 2026 19:20:52 +0530 Subject: [PATCH 071/152] node verison changes Signed-off-by: shitrerohit --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 782ed195..e335d316 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Stage 1: Builder stage -FROM node:18.19.0 AS builder +FROM node:20.19.0 AS builder WORKDIR /app @@ -19,7 +19,7 @@ RUN yarn global add patch-package RUN yarn build # Stage 2: Production stage -FROM node:18.19.0-slim +FROM node:20.19.0-slim WORKDIR /app From 89d4433292d7234e576f641629e9f9b19af47c8b Mon Sep 17 00:00:00 2001 From: shitrerohit Date: Sat, 31 Jan 2026 19:31:39 +0530 Subject: [PATCH 072/152] update node version Signed-off-by: shitrerohit --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index e335d316..dd506c11 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Stage 1: Builder stage -FROM node:20.19.0 AS builder +FROM node:22.22.0 AS builder WORKDIR /app @@ -19,7 +19,7 @@ RUN yarn global add patch-package RUN yarn build # Stage 2: Production stage -FROM node:20.19.0-slim +FROM node:22.22.0-slim WORKDIR /app From 7fa409d12e172c2a99eda9eafba886e7602eb088 Mon Sep 17 00:00:00 2001 From: shitrerohit Date: Sat, 31 Jan 2026 20:36:09 +0530 Subject: [PATCH 073/152] sample x5c certificate added Signed-off-by: shitrerohit --- src/cliAgent.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/cliAgent.ts b/src/cliAgent.ts index 049ae380..71de3568 100644 --- a/src/cliAgent.ts +++ b/src/cliAgent.ts @@ -278,7 +278,13 @@ const getModules = ( //TODO: We need to trust the certificate tenant wise, for that we need to fetch those details from platform const certs: string[] = await getTrustedCerts() - return certs + // return certs + return [ 'MIICJjCCAcugAwIBAgIRAN1fhc0PPzEEzl2g7wO+8+kwCgYIKoZIzj0EAwIwIDERMA8GA1UEAxMITXkgb3JnQ0ExCzAJBgNVBAYTAk5MMB4XDTI2MDEyNzEzMDkwNVoXDTI3MDEyNzEzMDkwNVowIDERMA8GA1UEAxMITXkgb3JnQ0ExCzAJBgNVBAYTAk5MMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEIPQ1tWUHCTCO/lADMFFA2cJFA0vfnG2LmwP0XmY+SWUxhs1pcWVNHOSydISq/Blj8KIbnQu+GSign53r6vlQZqOB5TCB4jAdBgNVHQ4EFgQUgqBFsZHs6ATywXlSra1TZzxocQMwDgYDVR0PAQH/BAQDAgGiMBUGA1UdJQEB/wQLMAkGByiBjF0FAQIwIgYDVR0jAQH/BBgwFoAUgqBFsZHs6ATywXlSra1TZzxocQMwMAYDVR0SAQH/BCYwJIIKMTAuMC4wLjExMoYWaHR0cDovLzEwLjAuMC4xMTI6NDAwMTAwBgNVHREBAf8EJjAkggoxMC4wLjAuMTEyhhZodHRwOi8vMTAuMC4wLjExMjo0MDAxMBIGA1UdEwEB/wQIMAYBAf8CAQAwCgYIKoZIzj0EAwIDSQAwRgIhAKiWZnIZUKRZlnuaoqZjbb3xQyMLExO2VwygzEjHWp2iAiEA5ovREGqmYtUSOB4Kr0UIS+5kzPpzTD1nujNfhHxBcj8=', + 'MIICKjCCAc+gAwIBAgIRAN6sF+QYp2bJV+MG3ChL4NwwCgYIKoZIzj0EAwIwIDERMA8GA1UEAxMITXkgb3JnQ0ExCzAJBgNVBAYTAk5MMB4XDTI2MDEyNzEzMDkwNVoXDTI3MDEyNzEzMDkwNVowIDERMA8GA1UEAxMITXkgb3JnQ0ExCzAJBgNVBAYTAk5MMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE9F3cI/E/5YvpretURS64Z1jmNWGafoUFd6TtJbQXRpNR06JLpGBLnEQlwbR9LGBgzcU3UfuZagkWOsXjIRs6SKOB6TCB5jAdBgNVHQ4EFgQUdbpWCo4C7HmtUvgNeCzj6JQec8kwDgYDVR0PAQH/BAQDAgGiMBUGA1UdJQEB/wQLMAkGByiBjF0FAQIwIgYDVR0jAQH/BBgwFoAUdbpWCo4C7HmtUvgNeCzj6JQec8kwMgYDVR0SAQH/BCgwJoILMTAuNzguMjM2LjSGF2h0dHA6Ly8xMC43OC4yMzYuNDo0MDAxMDIGA1UdEQEB/wQoMCaCCzEwLjc4LjIzNi40hhdodHRwOi8vMTAuNzguMjM2LjQ6NDAwMTASBgNVHRMBAf8ECDAGAQH/AgEAMAoGCCqGSM49BAMCA0kAMEYCIQC9knX3KXpY+g15+hw1MpHM+OAsLpu4rfUkL9OAnbSGYgIhANUjOM/P5d4bn2WhXHHoNy8yv4V3K1ywK1D+eltRkWS2', + 'MIIB6DCCAZqgAwIBAgIQfr+ZHsxv9OksR4v0UtoKrjAFBgMrZXAwIDERMA8GA1UEAxMITXkgb3JnQ0ExCzAJBgNVBAYTAk5MMB4XDTI2MDEyNzE0MjE1OFoXDTI3MDEyNzE0MjE1OFowIDERMA8GA1UEAxMITXkgb3JnQ0ExCzAJBgNVBAYTAk5MMCowBQYDK2VwAyEAKFYb5SrH3cd9gj4R5vOhmEtx6yOdeOEfqwa57bRnZl6jgekwgeYwHQYDVR0OBBYEFK79Buzc1LoSXTlx9QE1i2/vcZcSMA4GA1UdDwEB/wQEAwIBojAVBgNVHSUBAf8ECzAJBgcogYxdBQECMCIGA1UdIwEB/wQYMBaAFK79Buzc1LoSXTlx9QE1i2/vcZcSMDIGA1UdEgEB/wQoMCaCCzEwLjc4LjIzNi40hhdodHRwOi8vMTAuNzguMjM2LjQ6NDAwMTAyBgNVHREBAf8EKDAmggsxMC43OC4yMzYuNIYXaHR0cDovLzEwLjc4LjIzNi40OjQwMDEwEgYDVR0TAQH/BAgwBgEB/wIBADAFBgMrZXADQQASF8k9LsHr46f3cYviu9zj4v7A60dOCrJWDUOY0XFutVluW48EDZWEuMhLT7lUc4NdF7d/V6VQ+odKdKUNAVwJ', + 'MIICODCCAd6gAwIBAgIQIpFA2HrJoh+uf1YPDhEJxzAKBggqhkjOPQQDAjAgMREwDwYDVQQDEwhNeSBvcmdDQTELMAkGA1UEBhMCTkwwHhcNMjYwMTMxMTQ1ODEzWhcNMjcwMTMxMTQ1ODEzWjAgMREwDwYDVQQDEwhNeSBvcmdDQTELMAkGA1UEBhMCTkwwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAASen/g9KRsKHv69/KJLvDfGqhJdXQueG/Y5qNcEEyDzcdZyucI2zgb96CAh+b/3tDb5kahiUXo3s4VXVxLDhYF3o4H5MIH2MB0GA1UdDgQWBBRc5xB2NgKmVNffxaD8LveV22rm8TAOBgNVHQ8BAf8EBAMCAaIwFQYDVR0lAQH/BAswCQYHKIGMXQUBAjAiBgNVHSMBAf8EGDAWgBRc5xB2NgKmVNffxaD8LveV22rm8TA6BgNVHRIBAf8EMDAughFxYS1hZ2VudC5zb3Zpby5pZIYZaHR0cHM6Ly9xYS1hZ2VudC5zb3Zpby5pZDA6BgNVHREBAf8EMDAughFxYS1hZ2VudC5zb3Zpby5pZIYZaHR0cHM6Ly9xYS1hZ2VudC5zb3Zpby5pZDASBgNVHRMBAf8ECDAGAQH/AgEAMAoGCCqGSM49BAMCA0gAMEUCIQCUqzMbpPdFd0RWadV2IM4f0qMSBcf/NzypgXz1OuAXFwIgcgldysw+5Sm6LrW97F3BrJs0ty1F96A3pJk7yAX2GkQ=', + 'MIIB+DCCAaqgAwIBAgIQQLKY+YW0RVReLxnDdd8i+zAFBgMrZXAwIDERMA8GA1UEAxMITXkgb3JnQ0ExCzAJBgNVBAYTAk5MMB4XDTI2MDEzMTE1MDQxNVoXDTI3MDEzMTE1MDQxNVowIDERMA8GA1UEAxMITXkgb3JnQ0ExCzAJBgNVBAYTAk5MMCowBQYDK2VwAyEAp8MYeYtvpEhvM7tihj4OCAhG2A94DMa2MXyF2E/X5uejgfkwgfYwHQYDVR0OBBYEFOIqVW2GthQPlIpIhalGAVxRsNIFMA4GA1UdDwEB/wQEAwIBojAVBgNVHSUBAf8ECzAJBgcogYxdBQECMCIGA1UdIwEB/wQYMBaAFOIqVW2GthQPlIpIhalGAVxRsNIFMDoGA1UdEgEB/wQwMC6CEXFhLWFnZW50LnNvdmlvLmlkhhlodHRwczovL3FhLWFnZW50LnNvdmlvLmlkMDoGA1UdEQEB/wQwMC6CEXFhLWFnZW50LnNvdmlvLmlkhhlodHRwczovL3FhLWFnZW50LnNvdmlvLmlkMBIGA1UdEwEB/wQIMAYBAf8CAQAwBQYDK2VwA0EA5kJzDFbyUnGkFcMcW5dKVOreAcHlptKL3GJGma0OKG8R5T6JOR6PX7AvpStJxMeS+SS4NiTHRsIPlzTC7l63DA==', + ] }, }), } From f8b5396cbe61e80f7af4ab66514f716a9e88e935 Mon Sep 17 00:00:00 2001 From: shitrerohit Date: Mon, 2 Feb 2026 19:09:44 +0530 Subject: [PATCH 074/152] fix: resolved PR comments Signed-off-by: shitrerohit --- samples/sample.ts | 3 +- samples/sampleWithApp.ts | 5 +- src/cliAgent.ts | 12 +-- .../holder/credentialBindingResolver.ts | 1 - .../openid4vc/holder/holder.service.ts | 1 + .../openid4vc/issuers/issuer.Controller.ts | 1 + .../openid4vc/issuers/issuer.service.ts | 2 +- src/controllers/types.ts | 49 ++++-------- src/controllers/x509/x509.service.ts | 2 - src/controllers/x509/x509.types.ts | 1 - src/types/request.d.ts | 21 +----- src/utils/agent.ts | 74 +++++++++++-------- src/utils/oid4vc-agent.ts | 31 +------- 13 files changed, 72 insertions(+), 131 deletions(-) diff --git a/samples/sample.ts b/samples/sample.ts index 3bbd6c88..fece0f8a 100644 --- a/samples/sample.ts +++ b/samples/sample.ts @@ -11,7 +11,8 @@ const run = async () => { const agent = await setupAgent({ port: 3001, endpoints: [endpoint], - name: 'Aries Test Agent', + id: 'Sample', + key: 'Sample', }) const conf: ServerConfig = { diff --git a/samples/sampleWithApp.ts b/samples/sampleWithApp.ts index 5d844e0f..d79db758 100644 --- a/samples/sampleWithApp.ts +++ b/samples/sampleWithApp.ts @@ -14,7 +14,8 @@ const run = async () => { const agent = await setupAgent({ port: 3001, endpoints: [endpoint], - name: 'Aries Test Agent', + id: 'Sample', + key: 'Sample', }) const app = express() @@ -23,7 +24,7 @@ const run = async () => { app.post('/greeting', jsonParser, (req, res) => { const config = agent.dependencyManager.resolve(AgentConfig) - res.send(`Hello, ${config.label}!`) + res.send(`Hello, agent initialized: , ${agent.isInitialized}!`) }) const conf: ServerConfig = { diff --git a/src/cliAgent.ts b/src/cliAgent.ts index 71de3568..0976c82c 100644 --- a/src/cliAgent.ts +++ b/src/cliAgent.ts @@ -174,6 +174,7 @@ const getModules = ( new IndyVdrIndyDidRegistrar(), new KeyDidRegistrar(), new JwkDidRegistrar(), + // TODO: We can enable polygon later // , new PolygonDidRegistrar() ], resolvers: [ @@ -236,7 +237,6 @@ const getModules = ( }), questionAnswer: new QuestionAnswerModule(), - // openid4vc: new OpenId4VcModule({}), // Todo: We can remove this polygon module for time being // polygon: new PolygonModule({ // didContractAddress: didRegistryContractAddress @@ -278,13 +278,7 @@ const getModules = ( //TODO: We need to trust the certificate tenant wise, for that we need to fetch those details from platform const certs: string[] = await getTrustedCerts() - // return certs - return [ 'MIICJjCCAcugAwIBAgIRAN1fhc0PPzEEzl2g7wO+8+kwCgYIKoZIzj0EAwIwIDERMA8GA1UEAxMITXkgb3JnQ0ExCzAJBgNVBAYTAk5MMB4XDTI2MDEyNzEzMDkwNVoXDTI3MDEyNzEzMDkwNVowIDERMA8GA1UEAxMITXkgb3JnQ0ExCzAJBgNVBAYTAk5MMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEIPQ1tWUHCTCO/lADMFFA2cJFA0vfnG2LmwP0XmY+SWUxhs1pcWVNHOSydISq/Blj8KIbnQu+GSign53r6vlQZqOB5TCB4jAdBgNVHQ4EFgQUgqBFsZHs6ATywXlSra1TZzxocQMwDgYDVR0PAQH/BAQDAgGiMBUGA1UdJQEB/wQLMAkGByiBjF0FAQIwIgYDVR0jAQH/BBgwFoAUgqBFsZHs6ATywXlSra1TZzxocQMwMAYDVR0SAQH/BCYwJIIKMTAuMC4wLjExMoYWaHR0cDovLzEwLjAuMC4xMTI6NDAwMTAwBgNVHREBAf8EJjAkggoxMC4wLjAuMTEyhhZodHRwOi8vMTAuMC4wLjExMjo0MDAxMBIGA1UdEwEB/wQIMAYBAf8CAQAwCgYIKoZIzj0EAwIDSQAwRgIhAKiWZnIZUKRZlnuaoqZjbb3xQyMLExO2VwygzEjHWp2iAiEA5ovREGqmYtUSOB4Kr0UIS+5kzPpzTD1nujNfhHxBcj8=', - 'MIICKjCCAc+gAwIBAgIRAN6sF+QYp2bJV+MG3ChL4NwwCgYIKoZIzj0EAwIwIDERMA8GA1UEAxMITXkgb3JnQ0ExCzAJBgNVBAYTAk5MMB4XDTI2MDEyNzEzMDkwNVoXDTI3MDEyNzEzMDkwNVowIDERMA8GA1UEAxMITXkgb3JnQ0ExCzAJBgNVBAYTAk5MMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE9F3cI/E/5YvpretURS64Z1jmNWGafoUFd6TtJbQXRpNR06JLpGBLnEQlwbR9LGBgzcU3UfuZagkWOsXjIRs6SKOB6TCB5jAdBgNVHQ4EFgQUdbpWCo4C7HmtUvgNeCzj6JQec8kwDgYDVR0PAQH/BAQDAgGiMBUGA1UdJQEB/wQLMAkGByiBjF0FAQIwIgYDVR0jAQH/BBgwFoAUdbpWCo4C7HmtUvgNeCzj6JQec8kwMgYDVR0SAQH/BCgwJoILMTAuNzguMjM2LjSGF2h0dHA6Ly8xMC43OC4yMzYuNDo0MDAxMDIGA1UdEQEB/wQoMCaCCzEwLjc4LjIzNi40hhdodHRwOi8vMTAuNzguMjM2LjQ6NDAwMTASBgNVHRMBAf8ECDAGAQH/AgEAMAoGCCqGSM49BAMCA0kAMEYCIQC9knX3KXpY+g15+hw1MpHM+OAsLpu4rfUkL9OAnbSGYgIhANUjOM/P5d4bn2WhXHHoNy8yv4V3K1ywK1D+eltRkWS2', - 'MIIB6DCCAZqgAwIBAgIQfr+ZHsxv9OksR4v0UtoKrjAFBgMrZXAwIDERMA8GA1UEAxMITXkgb3JnQ0ExCzAJBgNVBAYTAk5MMB4XDTI2MDEyNzE0MjE1OFoXDTI3MDEyNzE0MjE1OFowIDERMA8GA1UEAxMITXkgb3JnQ0ExCzAJBgNVBAYTAk5MMCowBQYDK2VwAyEAKFYb5SrH3cd9gj4R5vOhmEtx6yOdeOEfqwa57bRnZl6jgekwgeYwHQYDVR0OBBYEFK79Buzc1LoSXTlx9QE1i2/vcZcSMA4GA1UdDwEB/wQEAwIBojAVBgNVHSUBAf8ECzAJBgcogYxdBQECMCIGA1UdIwEB/wQYMBaAFK79Buzc1LoSXTlx9QE1i2/vcZcSMDIGA1UdEgEB/wQoMCaCCzEwLjc4LjIzNi40hhdodHRwOi8vMTAuNzguMjM2LjQ6NDAwMTAyBgNVHREBAf8EKDAmggsxMC43OC4yMzYuNIYXaHR0cDovLzEwLjc4LjIzNi40OjQwMDEwEgYDVR0TAQH/BAgwBgEB/wIBADAFBgMrZXADQQASF8k9LsHr46f3cYviu9zj4v7A60dOCrJWDUOY0XFutVluW48EDZWEuMhLT7lUc4NdF7d/V6VQ+odKdKUNAVwJ', - 'MIICODCCAd6gAwIBAgIQIpFA2HrJoh+uf1YPDhEJxzAKBggqhkjOPQQDAjAgMREwDwYDVQQDEwhNeSBvcmdDQTELMAkGA1UEBhMCTkwwHhcNMjYwMTMxMTQ1ODEzWhcNMjcwMTMxMTQ1ODEzWjAgMREwDwYDVQQDEwhNeSBvcmdDQTELMAkGA1UEBhMCTkwwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAASen/g9KRsKHv69/KJLvDfGqhJdXQueG/Y5qNcEEyDzcdZyucI2zgb96CAh+b/3tDb5kahiUXo3s4VXVxLDhYF3o4H5MIH2MB0GA1UdDgQWBBRc5xB2NgKmVNffxaD8LveV22rm8TAOBgNVHQ8BAf8EBAMCAaIwFQYDVR0lAQH/BAswCQYHKIGMXQUBAjAiBgNVHSMBAf8EGDAWgBRc5xB2NgKmVNffxaD8LveV22rm8TA6BgNVHRIBAf8EMDAughFxYS1hZ2VudC5zb3Zpby5pZIYZaHR0cHM6Ly9xYS1hZ2VudC5zb3Zpby5pZDA6BgNVHREBAf8EMDAughFxYS1hZ2VudC5zb3Zpby5pZIYZaHR0cHM6Ly9xYS1hZ2VudC5zb3Zpby5pZDASBgNVHRMBAf8ECDAGAQH/AgEAMAoGCCqGSM49BAMCA0gAMEUCIQCUqzMbpPdFd0RWadV2IM4f0qMSBcf/NzypgXz1OuAXFwIgcgldysw+5Sm6LrW97F3BrJs0ty1F96A3pJk7yAX2GkQ=', - 'MIIB+DCCAaqgAwIBAgIQQLKY+YW0RVReLxnDdd8i+zAFBgMrZXAwIDERMA8GA1UEAxMITXkgb3JnQ0ExCzAJBgNVBAYTAk5MMB4XDTI2MDEzMTE1MDQxNVoXDTI3MDEzMTE1MDQxNVowIDERMA8GA1UEAxMITXkgb3JnQ0ExCzAJBgNVBAYTAk5MMCowBQYDK2VwAyEAp8MYeYtvpEhvM7tihj4OCAhG2A94DMa2MXyF2E/X5uejgfkwgfYwHQYDVR0OBBYEFOIqVW2GthQPlIpIhalGAVxRsNIFMA4GA1UdDwEB/wQEAwIBojAVBgNVHSUBAf8ECzAJBgcogYxdBQECMCIGA1UdIwEB/wQYMBaAFOIqVW2GthQPlIpIhalGAVxRsNIFMDoGA1UdEgEB/wQwMC6CEXFhLWFnZW50LnNvdmlvLmlkhhlodHRwczovL3FhLWFnZW50LnNvdmlvLmlkMDoGA1UdEQEB/wQwMC6CEXFhLWFnZW50LnNvdmlvLmlkhhlodHRwczovL3FhLWFnZW50LnNvdmlvLmlkMBIGA1UdEwEB/wQIMAYBAf8CAQAwBQYDK2VwA0EA5kJzDFbyUnGkFcMcW5dKVOreAcHlptKL3GJGma0OKG8R5T6JOR6PX7AvpStJxMeS+SS4NiTHRsIPlzTC7l63DA==', - ] + return certs }, }), } @@ -417,7 +411,7 @@ export async function runRestAgent(restConfig: AriesRestConfig) { let networkConfig: [IndyVdrPoolConfig, ...IndyVdrPoolConfig[]] - const parseIndyLedger = afjConfig?.indyLedger + const parseIndyLedger = afjConfig?.indyLedger ?? [] if (parseIndyLedger.length !== 0) { networkConfig = [ await fetchLedgerData(parseIndyLedger[0]), diff --git a/src/controllers/openid4vc/holder/credentialBindingResolver.ts b/src/controllers/openid4vc/holder/credentialBindingResolver.ts index 5727d8fd..5eb6e12d 100644 --- a/src/controllers/openid4vc/holder/credentialBindingResolver.ts +++ b/src/controllers/openid4vc/holder/credentialBindingResolver.ts @@ -56,7 +56,6 @@ export function getCredentialBindingResolver({ kms .createKeyForSignatureAlgorithm({ algorithm: signatureAlgorithm!, - // FIXME: what should happen with already existing keys created in the secure environment? backend: 'askar', }) .then((key) => Kms.PublicJwk.fromUnknown(key.publicJwk)), diff --git a/src/controllers/openid4vc/holder/holder.service.ts b/src/controllers/openid4vc/holder/holder.service.ts index 87aabb3f..c73b9560 100644 --- a/src/controllers/openid4vc/holder/holder.service.ts +++ b/src/controllers/openid4vc/holder/holder.service.ts @@ -129,6 +129,7 @@ export class HolderService { const storedCredentials = await Promise.all( credentialResponse.credentials.map(async (response) => { const credentialRecord = response.record + // TODO: We can add this later // if (credential instanceof W3cJwtVerifiableCredential || credential instanceof W3cJsonLdVerifiableCredential) { // return await agentReq.agent.w3cCredentials.storeCredential({ credential }) // } diff --git a/src/controllers/openid4vc/issuers/issuer.Controller.ts b/src/controllers/openid4vc/issuers/issuer.Controller.ts index 8e6bfea4..5dbf0418 100644 --- a/src/controllers/openid4vc/issuers/issuer.Controller.ts +++ b/src/controllers/openid4vc/issuers/issuer.Controller.ts @@ -79,6 +79,7 @@ export class IssuerController extends Controller { } } + // TODO: We can implement this method later /** * Deletes a specific issuer by record id. */ diff --git a/src/controllers/openid4vc/issuers/issuer.service.ts b/src/controllers/openid4vc/issuers/issuer.service.ts index 254f90ca..0263d934 100644 --- a/src/controllers/openid4vc/issuers/issuer.service.ts +++ b/src/controllers/openid4vc/issuers/issuer.service.ts @@ -44,6 +44,7 @@ export class IssuerService { return await agentReq.agent.modules.openid4vc.issuer?.getIssuerByIssuerId(publicIssuerId) } + // TODO: We can implement this method later // public async deleteIssuer(agentReq: Req, issuerId: string) { // const result = (agentReq.agent as Agent).openid4vc.config.issuer. // return result @@ -51,7 +52,6 @@ export class IssuerService { public async getIssuerAgentMetaData(agentReq: Req, issuerId: string) { return (await agentReq.agent.modules.openid4vc.issuer?.getIssuerMetadata(issuerId)) as any - // return 0 } } diff --git a/src/controllers/types.ts b/src/controllers/types.ts index 3c9737cf..75edb1ce 100644 --- a/src/controllers/types.ts +++ b/src/controllers/types.ts @@ -17,7 +17,6 @@ import type { X509CertificateIssuerAndSubjectOptions, SingleOrArray, } from '@credo-ts/core' - import type { JsonCredential, ReceiveOutOfBandInvitationConfig, @@ -33,10 +32,10 @@ import type { DidCommRouting, DidCommAttachment, } from '@credo-ts/didcomm' +import type { KeyAlgorithm } from '@openwallet-foundation/askar-nodejs' import type { DIDDocument } from 'did-resolver' -import { KeyAlgorithm } from '@openwallet-foundation/askar-nodejs' -export type CustomTenantConfig = {label: string} & { +export type CustomTenantConfig = { label: string } & { connectionImageUrl?: string } @@ -83,12 +82,6 @@ export interface ProposeCredentialOptions { connectionId: RecordId } -// export interface ProposeCredentialOptions extends BaseOptions { -// connectionId: string -// protocolVersion: CredentialProtocolVersionType -// credentialFormats: DidCommCredentialFormatPayload, 'createProposal'> -// } - export interface AcceptCredentialProposalOptions { credentialRecordId: string credentialFormats?: DidCommCredentialFormatPayload @@ -106,7 +99,10 @@ export interface CreateOfferOptions { goal?: string } -type CredentialFormatType = LegacyIndyCredentialFormat | DidCommJsonLdCredentialFormat | AnonCredsDidCommCredentialFormat +type CredentialFormatType = + | LegacyIndyCredentialFormat + | DidCommJsonLdCredentialFormat + | AnonCredsDidCommCredentialFormat export interface CreateOfferOobOptions { protocolVersion: string @@ -232,17 +228,6 @@ export interface ConnectionInvitationSchema { imageUrl?: string } -// TODO: added type in protocolVersion -// export interface RequestProofOptions { -// protocolVersion: 'v1' | 'v2' -// connectionId: string -// // TODO: added indy proof formate -// proofFormats: ProofFormatPayload<[IndyProofFormat], 'createRequest'> -// comment: string -// autoAcceptProof?: DidCommAutoAcceptProof -// parentThreadId?: string -// } - export interface RequestProofOptions { connectionId: string protocolVersion: string @@ -292,7 +277,6 @@ export interface ResolvedDid { } export interface DidCreate { - // FIXME: Check type keyType?: KeyAlgorithm seed?: string domain?: string @@ -446,26 +430,23 @@ export type DisclosureFrame = { [key: string]: boolean | DisclosureFrame } - export interface BasicX509CreateCertificateConfig extends X509CertificateIssuerAndSubjectOptions { - // FIXME: Check type - keyType: any; - issuerAlternativeNameURL: string; + keyType: any + issuerAlternativeNameURL: string } export interface X509ImportCertificateOptionsDto { - - /* + /* X.509 certificate in base64 string format */ - certificate: string; + certificate: string - /* + /* Private key in base64 string format */ - privateKey?: string; - + privateKey?: string + // FIXME: Check type - keyType: any; -} \ No newline at end of file + keyType: any +} diff --git a/src/controllers/x509/x509.service.ts b/src/controllers/x509/x509.service.ts index 36f9ffe5..c8525d1c 100644 --- a/src/controllers/x509/x509.service.ts +++ b/src/controllers/x509/x509.service.ts @@ -117,9 +117,7 @@ class x509Service { agent.config.logger.info('This is subjectPublicKeyID', subjectPublicKeyID) const certificate = await agent.x509.createCertificate({ - // authorityKey: authorityKeyID as Key, authorityKey: Kms.PublicJwk.fromPublicJwk(authorityKeyID), - // subjectPublicKey: Kms.PublicJwk.fromPublicJwk(subjectPublicKeyID!), serialNumber: options.serialNumber, issuer: options.issuer, extensions: options.extensions, diff --git a/src/controllers/x509/x509.types.ts b/src/controllers/x509/x509.types.ts index 311f6697..54bc08b8 100644 --- a/src/controllers/x509/x509.types.ts +++ b/src/controllers/x509/x509.types.ts @@ -34,7 +34,6 @@ export interface AuthorityAndSubjectKeyDto { * @example "p256" * @description Type of the key used for signing the X.509 Certificate (default is p256) */ - // FIXME: Check type keyType?: Curve } diff --git a/src/types/request.d.ts b/src/types/request.d.ts index 91ef0e3a..c14cad9b 100644 --- a/src/types/request.d.ts +++ b/src/types/request.d.ts @@ -2,16 +2,7 @@ import type { RestAgentModules, RestMultiTenantAgentModules } from '../cliAgent' import type { Agent } from '@credo-ts/core' import type { TenantAgent } from '@credo-ts/tenants' -// declare global { -// namespace Express { -// interface Request { -// user: { -// [x: string]: any -// agent: Agent | Agent | TenantAgent -// } -// } -// } -// } + type AgentType = Agent | Agent | TenantAgent interface IAgent { @@ -26,13 +17,3 @@ declare global { } } -// declare global { -// namespace Express { -// interface Request { -// user: { -// [x: string]: any -// agent: any -// } -// } -// } -// } diff --git a/src/utils/agent.ts b/src/utils/agent.ts index 582ff80b..44ea46c4 100644 --- a/src/utils/agent.ts +++ b/src/utils/agent.ts @@ -11,15 +11,7 @@ import { AnonCredsDidCommCredentialFormatService, } from '@credo-ts/anoncreds' import { AskarModule } from '@credo-ts/askar' -import { - DidsModule, - KeyDidRegistrar, - KeyDidResolver, - WebDidResolver, - Agent, - LogLevel, -} from '@credo-ts/core' - +import { DidsModule, KeyDidRegistrar, KeyDidResolver, WebDidResolver, Agent, LogLevel } from '@credo-ts/core' import { DidCommHttpOutboundTransport, DidCommJsonLdCredentialFormatService, @@ -28,24 +20,33 @@ import { DidCommProofV2Protocol, DidCommCredentialV2Protocol, DidCommModule, - DidCommConnectionInvitationMessage + DidCommConnectionInvitationMessage, } from '@credo-ts/didcomm' import { IndyVdrAnonCredsRegistry, IndyVdrModule } from '@credo-ts/indy-vdr' 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' import { indyVdr } from '@hyperledger/indy-vdr-nodejs' +import { askar } from '@openwallet-foundation/askar-nodejs' import { TsLogger } from './logger' -export const setupAgent = async ({ name, endpoints, port }: { name: string; endpoints: string[]; port: number }) => { +export const setupAgent = async ({ + endpoints, + port, + id, + key, +}: { + endpoints: string[] + port: number + id: string + key: string +}) => { const logger = new TsLogger(LogLevel.debug) const config: InitConfig = { - // endpoints: endpoints, logger: logger, - allowInsecureHttpUrls: process.env.ALLOW_INSECURE_HTTP_URLS === 'true' + allowInsecureHttpUrls: process.env.ALLOW_INSECURE_HTTP_URLS?.toLowerCase() === 'true' ? true : false, } const legacyIndyCredentialFormat = new LegacyIndyDidCommCredentialFormatService() @@ -67,8 +68,8 @@ export const setupAgent = async ({ name, endpoints, port }: { name: string; endp askar: new AskarModule({ askar, store: { - id: name, - key: name + id: id, + key: key, }, }), @@ -101,7 +102,11 @@ export const setupAgent = async ({ name, endpoints, port }: { name: string; endp indyProofFormat: legacyIndyProofFormat, }), new DidCommProofV2Protocol({ - proofFormats: [legacyIndyProofFormat, new AnonCredsDidCommProofFormatService, new DidCommDifPresentationExchangeProofFormatService], + proofFormats: [ + legacyIndyProofFormat, + new AnonCredsDidCommProofFormatService(), + new DidCommDifPresentationExchangeProofFormatService(), + ], }), ], }, @@ -112,7 +117,11 @@ export const setupAgent = async ({ name, endpoints, port }: { name: string; endp indyCredentialFormat: legacyIndyCredentialFormat, }), new DidCommCredentialV2Protocol({ - credentialFormats: [legacyIndyCredentialFormat, new DidCommJsonLdCredentialFormatService(), new AnonCredsDidCommCredentialFormatService()], + credentialFormats: [ + legacyIndyCredentialFormat, + new DidCommJsonLdCredentialFormatService(), + new AnonCredsDidCommCredentialFormatService(), + ], }), ], }, @@ -136,20 +145,23 @@ export const setupAgent = async ({ name, endpoints, port }: { name: string; endp agent.modules.didcomm.registerOutboundTransport(new DidCommHttpOutboundTransport()) - 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 DidCommConnectionInvitationMessage.fromUrl(req.url.replace('d_m=', 'c_i=')) - res.send(invitation.toJSON()) - } - if (typeof req.query.c_i === 'string') { - const invitation = await DidCommConnectionInvitationMessage.fromUrl(req.url) - res.send(invitation.toJSON()) - } else { - const { outOfBandInvitation } = await agent.modules.didcomm.oob.createInvitation() + 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 DidCommConnectionInvitationMessage.fromUrl(req.url.replace('d_m=', 'c_i=')) + res.send(invitation.toJSON()) + } + if (typeof req.query.c_i === 'string') { + const invitation = await DidCommConnectionInvitationMessage.fromUrl(req.url) + res.send(invitation.toJSON()) + } else { + const { outOfBandInvitation } = await agent.modules.didcomm.oob.createInvitation() - res.send(outOfBandInvitation.toUrl({ domain: endpoints + '/invitation' })) - } - }) + res.send(outOfBandInvitation.toUrl({ domain: endpoints + '/invitation' })) + } + }, + ) await agent.initialize() diff --git a/src/utils/oid4vc-agent.ts b/src/utils/oid4vc-agent.ts index f9a8053d..d254a96e 100644 --- a/src/utils/oid4vc-agent.ts +++ b/src/utils/oid4vc-agent.ts @@ -1,28 +1,12 @@ -// 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 { SdJwtVcHolderBinding } from '@credo-ts/core' import type { - OpenId4VcCredentialHolderBinding, - OpenId4VcCredentialHolderDidBinding, OpenId4VciCredentialRequestToCredentialMapper, OpenId4VciSignMdocCredentials, OpenId4VciSignSdJwtCredentials, - OpenId4VciSignW3cCredentials, } from '@credo-ts/openid4vc' -import { DidsApi, Kms, MdocApi, X509Certificate, X509Service } from '@credo-ts/core' -import { - ClaimFormat, - CredoError, - JsonTransformer, - W3cCredential, - W3cCredentialSubject, - W3cIssuer, - X509ModuleConfig, - parseDid, - w3cDate, -} from '@credo-ts/core' +import { DidsApi, X509Certificate, X509Service } from '@credo-ts/core' +import { ClaimFormat, X509ModuleConfig } from '@credo-ts/core' import { OpenId4VciCredentialFormatProfile } from '@credo-ts/openid4vc' import { SignerMethod } from '../enums/enum' @@ -31,7 +15,6 @@ export function getMixedCredentialRequestToCredentialMapper(): OpenId4VciCredent return async ({ holderBinding, issuanceSession, - verification, credentialConfigurationId, credentialConfiguration, agentContext, @@ -169,8 +152,6 @@ export function getMixedCredentialRequestToCredentialMapper(): OpenId4VciCredent : { method: 'x5c', x5c: [parsedCertificate], - // TODO: Need to check validation for issuer value - // issuer: process.env.AGENT_HOST ?? 'http://localhost:4001', }, disclosureFrame: disclosureFramePayload, })), @@ -182,14 +163,6 @@ export function getMixedCredentialRequestToCredentialMapper(): OpenId4VciCredent } } -// function assertDidBasedHolderBinding( -// holderBinding: OpenId4VcCredentialHolderBinding, -// ): asserts holderBinding is OpenId4VcCredentialHolderDidBinding { -// if (holderBinding.method !== 'did') { -// throw new CredoError('Only did based holder bindings supported for this credential type') -// } -// } - export async function getTrustedCerts() { try { const response = await fetch(`${process.env.TRUST_LIST_URL}`) From ba86852560883277e42498aa10e0a7a274749144 Mon Sep 17 00:00:00 2001 From: shitrerohit Date: Tue, 3 Feb 2026 16:51:23 +0530 Subject: [PATCH 075/152] fix: Resolved minor issues Signed-off-by: shitrerohit --- src/controllers/agent/AgentController.ts | 200 +++++++++--------- src/controllers/did/DidController.ts | 3 +- .../openid4vc/holder/holder.Controller.ts | 1 - .../openid4vc/issuers/issuer.service.ts | 4 +- src/controllers/types.ts | 45 +++- src/controllers/x509/x509.types.ts | 64 +----- src/utils/constant.ts | 2 +- src/utils/helpers.ts | 28 +-- 8 files changed, 154 insertions(+), 193 deletions(-) diff --git a/src/controllers/agent/AgentController.ts b/src/controllers/agent/AgentController.ts index 1d5b530f..891ad5a2 100644 --- a/src/controllers/agent/AgentController.ts +++ b/src/controllers/agent/AgentController.ts @@ -1,13 +1,6 @@ -import type { - AgentInfo, - AgentToken, - SafeW3cJsonLdVerifyCredentialOptions, -} from '../types' +import type { AgentInfo, AgentToken, SafeW3cJsonLdVerifyCredentialOptions } from '../types' -import { - JsonTransformer, - W3cJsonLdVerifiableCredential, -} from '@credo-ts/core' +import { JsonTransformer, W3cJsonLdVerifiableCredential } from '@credo-ts/core' import { Request as Req } from 'express' import jwt from 'jsonwebtoken' import { Controller, Get, Route, Tags, Security, Request, Post, Body } from 'tsoa' @@ -27,6 +20,7 @@ export class AgentController extends Controller { @Get('/') public async getAgentInfo(@Request() request: Req): Promise { try { + // TODO: Need to update this config payload based on modules like didcom amd openid4vc return { label: request.agent.context.contextCorrelationId, endpoints: request.agent.modules.didcomm.config.endpoints, @@ -60,108 +54,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/did/DidController.ts b/src/controllers/did/DidController.ts index e035c691..26b0ba71 100644 --- a/src/controllers/did/DidController.ts +++ b/src/controllers/did/DidController.ts @@ -30,8 +30,7 @@ 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 { DidCreate, supportedKeyTypesDID } from '../types' @Tags('Dids') @Route('/dids') diff --git a/src/controllers/openid4vc/holder/holder.Controller.ts b/src/controllers/openid4vc/holder/holder.Controller.ts index 9ed076b4..2e2ad76e 100644 --- a/src/controllers/openid4vc/holder/holder.Controller.ts +++ b/src/controllers/openid4vc/holder/holder.Controller.ts @@ -5,7 +5,6 @@ import { injectable } from 'tsyringe' import { SCOPES } from '../../../enums/enum' import { AuthorizeRequestCredentialOffer, - CredentialType, DeleteCredentialBody, RequestCredentialBody, ResolveCredentialOfferBody, diff --git a/src/controllers/openid4vc/issuers/issuer.service.ts b/src/controllers/openid4vc/issuers/issuer.service.ts index 0263d934..68c635ae 100644 --- a/src/controllers/openid4vc/issuers/issuer.service.ts +++ b/src/controllers/openid4vc/issuers/issuer.service.ts @@ -3,8 +3,6 @@ import type { CreateIssuerOptions } from '../types/issuer.types' import type { Agent } from '@credo-ts/core' import type { Request as Req } from 'express' -// import { OpenId4VcIssuerRepository } from '@credo-ts/openid4vc/build/openid4vc-issuer/repository/OpenId4VcIssuerRepository.mjs' - export class IssuerService { public async createIssuerAgent( agentReq: Req, @@ -35,7 +33,7 @@ export class IssuerService { public async getIssuersByQuery(agentReq: Req, publicIssuerId?: string) { const result = publicIssuerId - ? (agentReq.agent as Agent).openid4vc.issuer?.getIssuerByIssuerId(publicIssuerId) // .dependencyManager.resolve(OpenId4VcIssuerRepository) + ? (agentReq.agent as Agent).openid4vc.issuer?.getIssuerByIssuerId(publicIssuerId) : (agentReq.agent as Agent).openid4vc.issuer?.getAllIssuers() return result } diff --git a/src/controllers/types.ts b/src/controllers/types.ts index 75edb1ce..19e4c635 100644 --- a/src/controllers/types.ts +++ b/src/controllers/types.ts @@ -1,5 +1,4 @@ import type { RecordId } from './examples' -import type { CustomHandshakeProtocol } from '../enums' import type { AnonCredsDidCommCredentialFormat, LegacyIndyCredentialFormat } from '@credo-ts/anoncreds' import type { DidResolutionMetadata, @@ -35,6 +34,8 @@ import type { import type { KeyAlgorithm } from '@openwallet-foundation/askar-nodejs' import type { DIDDocument } from 'did-resolver' +import { DidMethod, type CustomHandshakeProtocol } from '../enums' + export type CustomTenantConfig = { label: string } & { connectionImageUrl?: string } @@ -450,3 +451,45 @@ export interface X509ImportCertificateOptionsDto { // FIXME: Check type keyType: any } + +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' }], +} + +export type Curve = 'Ed25519' | 'X25519' | 'P-256' | 'P-384' | 'P-521' | 'secp256k1' + +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' +} diff --git a/src/controllers/x509/x509.types.ts b/src/controllers/x509/x509.types.ts index 54bc08b8..a642a0ae 100644 --- a/src/controllers/x509/x509.types.ts +++ b/src/controllers/x509/x509.types.ts @@ -1,9 +1,5 @@ +import type { Curve } from '../types' 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 { @@ -205,61 +201,3 @@ 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/utils/constant.ts b/src/utils/constant.ts index cfb07dba..d800a20c 100644 --- a/src/utils/constant.ts +++ b/src/utils/constant.ts @@ -1,4 +1,4 @@ -import type { Curve } from '../controllers/x509/x509.types' +import type { Curve } from 'src/controllers/types' import { KeyAlgorithm } from '@openwallet-foundation/askar-nodejs' diff --git a/src/utils/helpers.ts b/src/utils/helpers.ts index 464125db..2ba105ef 100644 --- a/src/utils/helpers.ts +++ b/src/utils/helpers.ts @@ -1,12 +1,11 @@ -import type { Curve, EcCurve, EcType, OkpCurve, OkpType } from '../controllers/x509/x509.types' import type { KeyAlgorithm } from '@openwallet-foundation/askar-nodejs' +import type { Curve, EcCurve, EcType, OkpCurve, OkpType } from 'src/controllers/types' 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) @@ -31,33 +30,24 @@ export async function generateSecretKey(length: number = 32): Promise { } export function getCertificateValidityForSystem(IsRootCA = false) { - let options: { validityYears?: number, startFromCurrentMonth?: boolean }; + let options: { validityYears?: number; startFromCurrentMonth?: boolean } if (IsRootCA) { options = { - validityYears: parseInt(process.env.ROOT_CA_VALIDITY_YEARS ?? '3'), - startFromCurrentMonth: (process.env.ROOT_CA_START_FROM_CURRENT_MONTH ?? 'true') === 'true' ? true : false + validityYears: parseInt(process.env.ROOT_CA_VALIDITY_YEARS ?? '3'), + startFromCurrentMonth: (process.env.ROOT_CA_START_FROM_CURRENT_MONTH ?? 'true') === 'true' ? true : false, } - } else { options = { - validityYears: parseInt(process.env.DCS_VALIDITY_YEARS ?? '3'), - startFromCurrentMonth: (process.env.DCS_START_FROM_CURRENT_MONTH ?? 'true') === 'true' ? true : false + validityYears: parseInt(process.env.DCS_VALIDITY_YEARS ?? '3'), + startFromCurrentMonth: (process.env.DCS_START_FROM_CURRENT_MONTH ?? 'true') === 'true' ? true : false, } - } - return getCertificateValidity(options); - + return getCertificateValidity(options) } -export function getCertificateValidity(options?: { - validityYears?: number - startFromCurrentMonth?: boolean -}) { - const { - validityYears = 3, - startFromCurrentMonth = false, - } = options || {} +export function getCertificateValidity(options?: { validityYears?: number; startFromCurrentMonth?: boolean }) { + const { validityYears = 3, startFromCurrentMonth = false } = options || {} const now = new Date() From 30297780fe554b0c5013db9fb2aa90d15a18b8c1 Mon Sep 17 00:00:00 2001 From: shitrerohit Date: Wed, 4 Feb 2026 12:21:43 +0530 Subject: [PATCH 076/152] fix:resolve build issues Signed-off-by: shitrerohit --- src/utils/constant.ts | 2 +- src/utils/helpers.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/constant.ts b/src/utils/constant.ts index d800a20c..7ffe094c 100644 --- a/src/utils/constant.ts +++ b/src/utils/constant.ts @@ -1,4 +1,4 @@ -import type { Curve } from 'src/controllers/types' +import type { Curve } from '../controllers/types' import { KeyAlgorithm } from '@openwallet-foundation/askar-nodejs' diff --git a/src/utils/helpers.ts b/src/utils/helpers.ts index 2ba105ef..47218a85 100644 --- a/src/utils/helpers.ts +++ b/src/utils/helpers.ts @@ -1,5 +1,5 @@ +import type { Curve, EcCurve, EcType, OkpCurve, OkpType } from '../controllers/types' import type { KeyAlgorithm } from '@openwallet-foundation/askar-nodejs' -import type { Curve, EcCurve, EcType, OkpCurve, OkpType } from 'src/controllers/types' import { JsonEncoder, JsonTransformer } from '@credo-ts/core' import { randomBytes } from 'crypto' From 61f768d6e688f395a8831445ad0201a205c229c5 Mon Sep 17 00:00:00 2001 From: shitrerohit Date: Thu, 5 Feb 2026 19:51:12 +0530 Subject: [PATCH 077/152] fix:resolved proof verification with base64 image issue Signed-off-by: shitrerohit --- src/cliAgent.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/cliAgent.ts b/src/cliAgent.ts index 0976c82c..ea67b569 100644 --- a/src/cliAgent.ts +++ b/src/cliAgent.ts @@ -135,6 +135,8 @@ function requireEnv(name: string): string { } const expressApp = express() expressApp.disable('x-powered-by') +expressApp.use(express.json({ limit: process.env.APP_JSON_BODY_SIZE ?? '5mb' })) +expressApp.use(express.urlencoded({ limit: process.env.APP_URL_ENCODED_BODY_SIZE ?? '5mb', extended: true })) // TODO: add object const getModules = ( networkConfig: [IndyVdrPoolConfig, ...IndyVdrPoolConfig[]], @@ -277,8 +279,12 @@ const getModules = ( getTrustedCertificatesForVerification: async (_agentContext, { certificateChain, verification }) => { //TODO: We need to trust the certificate tenant wise, for that we need to fetch those details from platform const certs: string[] = await getTrustedCerts() - - return certs + return [ + 'MIICjzCCAjagAwIBAgIQHgBfCoCoWnFurNbvK3mdjDAKBggqhkjOPQQDAjArMRwwGgYDVQQDExNFeGFtcGxlIENvcnBvcmF0aW9uMQswCQYDVQQGEwJVUzAeFw0yNjAxMjcxMzA5MDVaFw0yNzAxMjcxMzA5MDVaMCsxHDAaBgNVBAMTE0V4YW1wbGUgQ29ycG9yYXRpb24xCzAJBgNVBAYTAlVTMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEwekvL0TScDTBUOOwYu94b4y8hPGuYxkQlInJ8yE+H4L3HjzN4KGbp3CLxllvbbzOT5kJAa0sFMQ9MKxOEvyD+aOCATowggE2MB0GA1UdDgQWBBTfe7urCT20mGsgC4JHJx5oCivAQDAOBgNVHQ8BAf8EBAMCAaIwFQYDVR0lAQH/BAswCQYHKIGMXQUBAjAiBgNVHSMBAf8EGDAWgBTfe7urCT20mGsgC4JHJx5oCivAQDBaBgNVHRIBAf8EUDBOgiFhZ2VudC5kZXYuZGlnaXlhdHJhZm91bmRhdGlvbi5vcmeGKWh0dHBzOi8vYWdlbnQuZGV2LmRpZ2l5YXRyYWZvdW5kYXRpb24ub3JnMFoGA1UdEQEB/wRQME6CIWFnZW50LmRldi5kaWdpeWF0cmFmb3VuZGF0aW9uLm9yZ4YpaHR0cHM6Ly9hZ2VudC5kZXYuZGlnaXlhdHJhZm91bmRhdGlvbi5vcmcwEgYDVR0TAQH/BAgwBgEB/wIBADAKBggqhkjOPQQDAgNHADBEAiBhnLYfAjmCoeX2M9bFFiNv1ByZc2KkF8LAtAyf24THWAIgLq7nTqwFnrZvTtFxli7vcipASurHisDiAUuoW+khDr8=', + 'MIICUDCCAgKgAwIBAgIQZ4MiFwu0T9ZZFuwDNBUa4DAFBgMrZXAwKzEcMBoGA1UEAxMTRXhhbXBsZSBDb3Jwb3JhdGlvbjELMAkGA1UEBhMCVVMwHhcNMjYwMTI3MTQyMTU4WhcNMjcwMTI3MTQyMTU4WjArMRwwGgYDVQQDExNFeGFtcGxlIENvcnBvcmF0aW9uMQswCQYDVQQGEwJVUzAqMAUGAytlcAMhALDBfhndH1mtZkt8/rj6dPwDwxGm9hgK8EIAv6KfNFwao4IBOjCCATYwHQYDVR0OBBYEFHnimVSPaEsy8IpQh6ti9rDwOlHUMA4GA1UdDwEB/wQEAwIBojAVBgNVHSUBAf8ECzAJBgcogYxdBQECMCIGA1UdIwEB/wQYMBaAFHnimVSPaEsy8IpQh6ti9rDwOlHUMFoGA1UdEgEB/wRQME6CIWFnZW50LmRldi5kaWdpeWF0cmFmb3VuZGF0aW9uLm9yZ4YpaHR0cHM6Ly9hZ2VudC5kZXYuZGlnaXlhdHJhZm91bmRhdGlvbi5vcmcwWgYDVR0RAQH/BFAwToIhYWdlbnQuZGV2LmRpZ2l5YXRyYWZvdW5kYXRpb24ub3JnhilodHRwczovL2FnZW50LmRldi5kaWdpeWF0cmFmb3VuZGF0aW9uLm9yZzASBgNVHRMBAf8ECDAGAQH/AgEAMAUGAytlcANBAPpq/OIUXj40PPNEeQkAb7UPUd72PRer9be0UIjK8hUZnKhmglVhXCvhJJO6lHES8TiaWFKtwBErgw0XmO6cBAg=', + 'MIICJDCCAcqgAwIBAgIQZ+iQcJw77Qgmg35dNfBxlzAKBggqhkjOPQQDAjAgMREwDwYDVQQDEwhNeSBvcmdDQTELMAkGA1UEBhMCTkwwHhcNMjYwMTI3MTMwOTA1WhcNMjcwMTI3MTMwOTA1WjAgMREwDwYDVQQDEwhNeSBvcmdDQTELMAkGA1UEBhMCTkwwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAASaGddpVXpFnSklRqVuCxjLVnUs8k8RUc9AZEbAG6CFJOzmpnKMlKgqe/a9uZo8RLn/1ldGHNUWJKuLrB23g49Wo4HlMIHiMB0GA1UdDgQWBBQGbqumCW9SbuW/JK4wcgqSY/RGBTAOBgNVHQ8BAf8EBAMCAaIwFQYDVR0lAQH/BAswCQYHKIGMXQUBAjAiBgNVHSMBAf8EGDAWgBQGbqumCW9SbuW/JK4wcgqSY/RGBTAwBgNVHRIBAf8EJjAkggoxMC4wLjAuMTEyhhZodHRwOi8vMTAuMC4wLjExMjo0MDAxMDAGA1UdEQEB/wQmMCSCCjEwLjAuMC4xMTKGFmh0dHA6Ly8xMC4wLjAuMTEyOjQwMDEwEgYDVR0TAQH/BAgwBgEB/wIBADAKBggqhkjOPQQDAgNIADBFAiEA8wCRB+q5RMwLPzc042veyzXUqV9njPJZuqAgwcgsFQwCICVpSZoRHyECXNTSgh9VbWMERCdMv3XKq4XsEx1hP2ri', + ] + // return certs }, }), } From bfd950019668a53a1aacedc31384a9cd5df0fdb2 Mon Sep 17 00:00:00 2001 From: shitrerohit Date: Thu, 5 Feb 2026 19:55:18 +0530 Subject: [PATCH 078/152] fix:removed unused code Signed-off-by: shitrerohit --- src/cliAgent.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/cliAgent.ts b/src/cliAgent.ts index ea67b569..72c4c831 100644 --- a/src/cliAgent.ts +++ b/src/cliAgent.ts @@ -279,12 +279,7 @@ const getModules = ( getTrustedCertificatesForVerification: async (_agentContext, { certificateChain, verification }) => { //TODO: We need to trust the certificate tenant wise, for that we need to fetch those details from platform const certs: string[] = await getTrustedCerts() - return [ - 'MIICjzCCAjagAwIBAgIQHgBfCoCoWnFurNbvK3mdjDAKBggqhkjOPQQDAjArMRwwGgYDVQQDExNFeGFtcGxlIENvcnBvcmF0aW9uMQswCQYDVQQGEwJVUzAeFw0yNjAxMjcxMzA5MDVaFw0yNzAxMjcxMzA5MDVaMCsxHDAaBgNVBAMTE0V4YW1wbGUgQ29ycG9yYXRpb24xCzAJBgNVBAYTAlVTMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEwekvL0TScDTBUOOwYu94b4y8hPGuYxkQlInJ8yE+H4L3HjzN4KGbp3CLxllvbbzOT5kJAa0sFMQ9MKxOEvyD+aOCATowggE2MB0GA1UdDgQWBBTfe7urCT20mGsgC4JHJx5oCivAQDAOBgNVHQ8BAf8EBAMCAaIwFQYDVR0lAQH/BAswCQYHKIGMXQUBAjAiBgNVHSMBAf8EGDAWgBTfe7urCT20mGsgC4JHJx5oCivAQDBaBgNVHRIBAf8EUDBOgiFhZ2VudC5kZXYuZGlnaXlhdHJhZm91bmRhdGlvbi5vcmeGKWh0dHBzOi8vYWdlbnQuZGV2LmRpZ2l5YXRyYWZvdW5kYXRpb24ub3JnMFoGA1UdEQEB/wRQME6CIWFnZW50LmRldi5kaWdpeWF0cmFmb3VuZGF0aW9uLm9yZ4YpaHR0cHM6Ly9hZ2VudC5kZXYuZGlnaXlhdHJhZm91bmRhdGlvbi5vcmcwEgYDVR0TAQH/BAgwBgEB/wIBADAKBggqhkjOPQQDAgNHADBEAiBhnLYfAjmCoeX2M9bFFiNv1ByZc2KkF8LAtAyf24THWAIgLq7nTqwFnrZvTtFxli7vcipASurHisDiAUuoW+khDr8=', - 'MIICUDCCAgKgAwIBAgIQZ4MiFwu0T9ZZFuwDNBUa4DAFBgMrZXAwKzEcMBoGA1UEAxMTRXhhbXBsZSBDb3Jwb3JhdGlvbjELMAkGA1UEBhMCVVMwHhcNMjYwMTI3MTQyMTU4WhcNMjcwMTI3MTQyMTU4WjArMRwwGgYDVQQDExNFeGFtcGxlIENvcnBvcmF0aW9uMQswCQYDVQQGEwJVUzAqMAUGAytlcAMhALDBfhndH1mtZkt8/rj6dPwDwxGm9hgK8EIAv6KfNFwao4IBOjCCATYwHQYDVR0OBBYEFHnimVSPaEsy8IpQh6ti9rDwOlHUMA4GA1UdDwEB/wQEAwIBojAVBgNVHSUBAf8ECzAJBgcogYxdBQECMCIGA1UdIwEB/wQYMBaAFHnimVSPaEsy8IpQh6ti9rDwOlHUMFoGA1UdEgEB/wRQME6CIWFnZW50LmRldi5kaWdpeWF0cmFmb3VuZGF0aW9uLm9yZ4YpaHR0cHM6Ly9hZ2VudC5kZXYuZGlnaXlhdHJhZm91bmRhdGlvbi5vcmcwWgYDVR0RAQH/BFAwToIhYWdlbnQuZGV2LmRpZ2l5YXRyYWZvdW5kYXRpb24ub3JnhilodHRwczovL2FnZW50LmRldi5kaWdpeWF0cmFmb3VuZGF0aW9uLm9yZzASBgNVHRMBAf8ECDAGAQH/AgEAMAUGAytlcANBAPpq/OIUXj40PPNEeQkAb7UPUd72PRer9be0UIjK8hUZnKhmglVhXCvhJJO6lHES8TiaWFKtwBErgw0XmO6cBAg=', - 'MIICJDCCAcqgAwIBAgIQZ+iQcJw77Qgmg35dNfBxlzAKBggqhkjOPQQDAjAgMREwDwYDVQQDEwhNeSBvcmdDQTELMAkGA1UEBhMCTkwwHhcNMjYwMTI3MTMwOTA1WhcNMjcwMTI3MTMwOTA1WjAgMREwDwYDVQQDEwhNeSBvcmdDQTELMAkGA1UEBhMCTkwwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAASaGddpVXpFnSklRqVuCxjLVnUs8k8RUc9AZEbAG6CFJOzmpnKMlKgqe/a9uZo8RLn/1ldGHNUWJKuLrB23g49Wo4HlMIHiMB0GA1UdDgQWBBQGbqumCW9SbuW/JK4wcgqSY/RGBTAOBgNVHQ8BAf8EBAMCAaIwFQYDVR0lAQH/BAswCQYHKIGMXQUBAjAiBgNVHSMBAf8EGDAWgBQGbqumCW9SbuW/JK4wcgqSY/RGBTAwBgNVHRIBAf8EJjAkggoxMC4wLjAuMTEyhhZodHRwOi8vMTAuMC4wLjExMjo0MDAxMDAGA1UdEQEB/wQmMCSCCjEwLjAuMC4xMTKGFmh0dHA6Ly8xMC4wLjAuMTEyOjQwMDEwEgYDVR0TAQH/BAgwBgEB/wIBADAKBggqhkjOPQQDAgNIADBFAiEA8wCRB+q5RMwLPzc042veyzXUqV9njPJZuqAgwcgsFQwCICVpSZoRHyECXNTSgh9VbWMERCdMv3XKq4XsEx1hP2ri', - ] - // return certs + return certs }, }), } From cc38bda511a933adca4bc2df198467910dbe8b66 Mon Sep 17 00:00:00 2001 From: shitrerohit Date: Thu, 5 Feb 2026 18:43:34 +0530 Subject: [PATCH 079/152] feat:delete issuer api added Signed-off-by: shitrerohit --- ...1+add-export-for-issuance-repository.patch | 37 +++++++++++++++++++ .../openid4vc/issuers/issuer.Controller.ts | 16 ++++---- .../openid4vc/issuers/issuer.service.ts | 11 ++++-- 3 files changed, 52 insertions(+), 12 deletions(-) create mode 100644 patches/@credo-ts+openid4vc+0.6.1+001+add-export-for-issuance-repository.patch diff --git a/patches/@credo-ts+openid4vc+0.6.1+001+add-export-for-issuance-repository.patch b/patches/@credo-ts+openid4vc+0.6.1+001+add-export-for-issuance-repository.patch new file mode 100644 index 00000000..41e03ba6 --- /dev/null +++ b/patches/@credo-ts+openid4vc+0.6.1+001+add-export-for-issuance-repository.patch @@ -0,0 +1,37 @@ +diff --git a/node_modules/@credo-ts/openid4vc/build/index.d.mts b/node_modules/@credo-ts/openid4vc/build/index.d.mts +index 81a221a..20bbab4 100644 +--- a/node_modules/@credo-ts/openid4vc/build/index.d.mts ++++ b/node_modules/@credo-ts/openid4vc/build/index.d.mts +@@ -39,4 +39,5 @@ import { OpenId4VcIssuerModule } from "./openid4vc-issuer/OpenId4VcIssuerModule. + import "./openid4vc-issuer/index.mjs"; + import { OpenId4VcApi } from "./OpenId4VcApi.mjs"; + import { OpenId4VcModule } from "./OpenId4VcModule.mjs"; +-export { DefaultOpenId4VcVerificationSessionRecordTags, DefaultOpenId4VcVerifierRecordTags, OpenId4VcApi, OpenId4VcAuthorizationCodeTokenRequestOptions, OpenId4VcCredentialHolderAttestationBinding, OpenId4VcCredentialHolderBinding, OpenId4VcCredentialHolderDidBinding, OpenId4VcCredentialHolderJwkBinding, OpenId4VcHolderApi, OpenId4VcHolderModule, OpenId4VcIssuanceSessionAuthorization, OpenId4VcIssuanceSessionChainedIdentity, OpenId4VcIssuanceSessionDpop, OpenId4VcIssuanceSessionPkce, OpenId4VcIssuanceSessionPresentation, OpenId4VcIssuanceSessionRecord, OpenId4VcIssuanceSessionRecordTransaction, OpenId4VcIssuanceSessionRepository, OpenId4VcIssuanceSessionState, OpenId4VcIssuanceSessionStateChangedEvent, OpenId4VcIssuanceSessionWalletAttestation, OpenId4VcIssuerApi, OpenId4VcIssuerEvents, OpenId4VcIssuerModule, OpenId4VcIssuerModuleConfig, OpenId4VcIssuerModuleConfigOptions, OpenId4VcIssuerRecord, OpenId4VcIssuerRecordProps, OpenId4VcIssuerRecordSignedMetadata, OpenId4VcIssuerRecordTags, OpenId4VcIssuerService, OpenId4VcJwtIssuer, OpenId4VcJwtIssuerDid, OpenId4VcJwtIssuerEncoded, OpenId4VcJwtIssuerJwk, OpenId4VcJwtIssuerJwkEncoded, OpenId4VcJwtIssuerX5c, OpenId4VcJwtIssuerX5cEncoded, OpenId4VcModule, OpenId4VcModuleConfig, OpenId4VcModuleConfigOptions, OpenId4VcUpdateIssuerRecordOptions, OpenId4VcUpdateVerifierRecordOptions, OpenId4VcVerificationSessionRecord, OpenId4VcVerificationSessionRecordProps, OpenId4VcVerificationSessionRecordTags, OpenId4VcVerificationSessionRepository, OpenId4VcVerificationSessionState, OpenId4VcVerificationSessionStateChangedEvent, OpenId4VcVerifierApi, OpenId4VcVerifierEvents, OpenId4VcVerifierModule, OpenId4VcVerifierModuleConfig, OpenId4VcVerifierModuleConfigOptions, OpenId4VcVerifierRecord, OpenId4VcVerifierRecordProps, OpenId4VcVerifierRecordTags, OpenId4VcVerifierRepository, OpenId4VciAcceptCredentialOfferOptions, OpenId4VciAccessTokenResponse, OpenId4VciAuthCodeFlowOptions, OpenId4VciAuthorizationCodeFlowConfig, OpenId4VciAuthorizationFlow, OpenId4VciAuthorizationServerClientAuthenticationClientSecret, OpenId4VciAuthorizationServerConfig, OpenId4VciBatchCredentialIssuanceOptions, OpenId4VciChainedAuthorizationServerConfig, OpenId4VciCreateCredentialOfferOptions, OpenId4VciCreateCredentialResponseOptions, OpenId4VciCreateDeferredCredentialResponseOptions, OpenId4VciCreateIssuerOptions, OpenId4VciCreateStatelessCredentialOfferOptions, OpenId4VciCredentialBindingOptions, OpenId4VciCredentialBindingResolver, OpenId4VciCredentialConfigurationSupported, OpenId4VciCredentialConfigurationSupportedWithFormats, OpenId4VciCredentialConfigurationsSupported, OpenId4VciCredentialConfigurationsSupportedWithFormats, OpenId4VciCredentialFormatProfile, OpenId4VciCredentialIssuerMetadata, OpenId4VciCredentialIssuerMetadataDisplay, OpenId4VciCredentialOfferPayload, OpenId4VciCredentialRequest, OpenId4VciCredentialRequestAuthorization, OpenId4VciCredentialRequestFormatSpecific, OpenId4VciCredentialRequestOptions, OpenId4VciCredentialRequestToCredentialMapper, OpenId4VciCredentialRequestToCredentialMapperOptions, OpenId4VciCredentialRequestWithFormats, OpenId4VciCredentialResponse, OpenId4VciDeferredCredentialRequest, OpenId4VciDeferredCredentialRequestOptions, OpenId4VciDeferredCredentialRequestToCredentialMapper, OpenId4VciDeferredCredentialRequestToCredentialMapperOptions, OpenId4VciDeferredCredentialResponse, OpenId4VciDeferredCredentials, OpenId4VciDirectAuthorizationServerConfig, OpenId4VciDpopRequestOptions, OpenId4VciGetVerificationSessionForIssuanceSessionAuthorization, OpenId4VciHolderService, OpenId4VciMetadata, OpenId4VciNotificationEvent, OpenId4VciParsedCredentialRequest, OpenId4VciPreAuthorizedCodeFlowConfig, OpenId4VciPreAuthorizedTokenRequestOptions, OpenId4VciProofOfPossessionRequirements, OpenId4VciProofOfPressionProofTypes, OpenId4VciRequestTokenResponse, OpenId4VciResolvedAuthorizationRequest, OpenId4VciResolvedCredentialOffer, OpenId4VciRetrieveAuthorizationCodeUsingPresentationOptions, OpenId4VciSendNotificationOptions, OpenId4VciSignCredentials, OpenId4VciSignMdocCredentials, OpenId4VciSignSdJwtCredentials, OpenId4VciSignW3cCredentials, OpenId4VciSignW3cV2Credentials, OpenId4VciSupportedCredentialFormats, OpenId4VciTokenRefreshOptions, OpenId4VciTokenRequestOptions, OpenId4VciTxCode, OpenId4VciVersion, OpenId4VpAcceptAuthorizationRequestOptions, OpenId4VpAuthorizationRequestPayload, OpenId4VpAuthorizationResponsePayload, OpenId4VpCreateAuthorizationRequestOptions, OpenId4VpCreateAuthorizationRequestReturn, OpenId4VpCreateVerifierOptions, OpenId4VpHolderService, OpenId4VpResolvedAuthorizationRequest, OpenId4VpVerifiedAuthorizationRequest, OpenId4VpVerifiedAuthorizationResponse, OpenId4VpVerifiedAuthorizationResponseDcql, OpenId4VpVerifiedAuthorizationResponsePresentationExchange, OpenId4VpVerifiedAuthorizationResponseTransactionData, OpenId4VpVerifierClientMetadata, OpenId4VpVerifierService, OpenId4VpVerifyAuthorizationResponseOptions, OpenId4VpVersion, Openid4vpAuthorizationRequest, ParsedTransactionDataEntry, ResolveOpenId4VpAuthorizationRequestOptions, ResponseMode, VerifiedOpenId4VcCredentialHolderBinding, authorizationCodeGrantIdentifier, dynamicOid4vciClientAuthentication, getAllowedAndRequestedScopeValues, getCredentialConfigurationsSupportedForScopes, getOfferedCredentials, getOid4vcCallbacks, getOid4vcDecryptJweCallback, getOid4vcEncryptJweCallback, getOid4vcJwtSignCallback, getOid4vcJwtVerifyCallback, getScopesFromCredentialConfigurationsSupported, openId4VciSupportedCredentialFormats, preAuthorizedCodeGrantIdentifier }; +\ No newline at end of file ++import { OpenId4VcIssuerRepository } from "./openid4vc-issuer/repository/OpenId4VcIssuerRepository.mjs"; ++export { OpenId4VcIssuerRepository, DefaultOpenId4VcVerificationSessionRecordTags, DefaultOpenId4VcVerifierRecordTags, OpenId4VcApi, OpenId4VcAuthorizationCodeTokenRequestOptions, OpenId4VcCredentialHolderAttestationBinding, OpenId4VcCredentialHolderBinding, OpenId4VcCredentialHolderDidBinding, OpenId4VcCredentialHolderJwkBinding, OpenId4VcHolderApi, OpenId4VcHolderModule, OpenId4VcIssuanceSessionAuthorization, OpenId4VcIssuanceSessionChainedIdentity, OpenId4VcIssuanceSessionDpop, OpenId4VcIssuanceSessionPkce, OpenId4VcIssuanceSessionPresentation, OpenId4VcIssuanceSessionRecord, OpenId4VcIssuanceSessionRecordTransaction, OpenId4VcIssuanceSessionRepository, OpenId4VcIssuanceSessionState, OpenId4VcIssuanceSessionStateChangedEvent, OpenId4VcIssuanceSessionWalletAttestation, OpenId4VcIssuerApi, OpenId4VcIssuerEvents, OpenId4VcIssuerModule, OpenId4VcIssuerModuleConfig, OpenId4VcIssuerModuleConfigOptions, OpenId4VcIssuerRecord, OpenId4VcIssuerRecordProps, OpenId4VcIssuerRecordSignedMetadata, OpenId4VcIssuerRecordTags, OpenId4VcIssuerService, OpenId4VcJwtIssuer, OpenId4VcJwtIssuerDid, OpenId4VcJwtIssuerEncoded, OpenId4VcJwtIssuerJwk, OpenId4VcJwtIssuerJwkEncoded, OpenId4VcJwtIssuerX5c, OpenId4VcJwtIssuerX5cEncoded, OpenId4VcModule, OpenId4VcModuleConfig, OpenId4VcModuleConfigOptions, OpenId4VcUpdateIssuerRecordOptions, OpenId4VcUpdateVerifierRecordOptions, OpenId4VcVerificationSessionRecord, OpenId4VcVerificationSessionRecordProps, OpenId4VcVerificationSessionRecordTags, OpenId4VcVerificationSessionRepository, OpenId4VcVerificationSessionState, OpenId4VcVerificationSessionStateChangedEvent, OpenId4VcVerifierApi, OpenId4VcVerifierEvents, OpenId4VcVerifierModule, OpenId4VcVerifierModuleConfig, OpenId4VcVerifierModuleConfigOptions, OpenId4VcVerifierRecord, OpenId4VcVerifierRecordProps, OpenId4VcVerifierRecordTags, OpenId4VcVerifierRepository, OpenId4VciAcceptCredentialOfferOptions, OpenId4VciAccessTokenResponse, OpenId4VciAuthCodeFlowOptions, OpenId4VciAuthorizationCodeFlowConfig, OpenId4VciAuthorizationFlow, OpenId4VciAuthorizationServerClientAuthenticationClientSecret, OpenId4VciAuthorizationServerConfig, OpenId4VciBatchCredentialIssuanceOptions, OpenId4VciChainedAuthorizationServerConfig, OpenId4VciCreateCredentialOfferOptions, OpenId4VciCreateCredentialResponseOptions, OpenId4VciCreateDeferredCredentialResponseOptions, OpenId4VciCreateIssuerOptions, OpenId4VciCreateStatelessCredentialOfferOptions, OpenId4VciCredentialBindingOptions, OpenId4VciCredentialBindingResolver, OpenId4VciCredentialConfigurationSupported, OpenId4VciCredentialConfigurationSupportedWithFormats, OpenId4VciCredentialConfigurationsSupported, OpenId4VciCredentialConfigurationsSupportedWithFormats, OpenId4VciCredentialFormatProfile, OpenId4VciCredentialIssuerMetadata, OpenId4VciCredentialIssuerMetadataDisplay, OpenId4VciCredentialOfferPayload, OpenId4VciCredentialRequest, OpenId4VciCredentialRequestAuthorization, OpenId4VciCredentialRequestFormatSpecific, OpenId4VciCredentialRequestOptions, OpenId4VciCredentialRequestToCredentialMapper, OpenId4VciCredentialRequestToCredentialMapperOptions, OpenId4VciCredentialRequestWithFormats, OpenId4VciCredentialResponse, OpenId4VciDeferredCredentialRequest, OpenId4VciDeferredCredentialRequestOptions, OpenId4VciDeferredCredentialRequestToCredentialMapper, OpenId4VciDeferredCredentialRequestToCredentialMapperOptions, OpenId4VciDeferredCredentialResponse, OpenId4VciDeferredCredentials, OpenId4VciDirectAuthorizationServerConfig, OpenId4VciDpopRequestOptions, OpenId4VciGetVerificationSessionForIssuanceSessionAuthorization, OpenId4VciHolderService, OpenId4VciMetadata, OpenId4VciNotificationEvent, OpenId4VciParsedCredentialRequest, OpenId4VciPreAuthorizedCodeFlowConfig, OpenId4VciPreAuthorizedTokenRequestOptions, OpenId4VciProofOfPossessionRequirements, OpenId4VciProofOfPressionProofTypes, OpenId4VciRequestTokenResponse, OpenId4VciResolvedAuthorizationRequest, OpenId4VciResolvedCredentialOffer, OpenId4VciRetrieveAuthorizationCodeUsingPresentationOptions, OpenId4VciSendNotificationOptions, OpenId4VciSignCredentials, OpenId4VciSignMdocCredentials, OpenId4VciSignSdJwtCredentials, OpenId4VciSignW3cCredentials, OpenId4VciSignW3cV2Credentials, OpenId4VciSupportedCredentialFormats, OpenId4VciTokenRefreshOptions, OpenId4VciTokenRequestOptions, OpenId4VciTxCode, OpenId4VciVersion, OpenId4VpAcceptAuthorizationRequestOptions, OpenId4VpAuthorizationRequestPayload, OpenId4VpAuthorizationResponsePayload, OpenId4VpCreateAuthorizationRequestOptions, OpenId4VpCreateAuthorizationRequestReturn, OpenId4VpCreateVerifierOptions, OpenId4VpHolderService, OpenId4VpResolvedAuthorizationRequest, OpenId4VpVerifiedAuthorizationRequest, OpenId4VpVerifiedAuthorizationResponse, OpenId4VpVerifiedAuthorizationResponseDcql, OpenId4VpVerifiedAuthorizationResponsePresentationExchange, OpenId4VpVerifiedAuthorizationResponseTransactionData, OpenId4VpVerifierClientMetadata, OpenId4VpVerifierService, OpenId4VpVerifyAuthorizationResponseOptions, OpenId4VpVersion, Openid4vpAuthorizationRequest, ParsedTransactionDataEntry, ResolveOpenId4VpAuthorizationRequestOptions, ResponseMode, VerifiedOpenId4VcCredentialHolderBinding, authorizationCodeGrantIdentifier, dynamicOid4vciClientAuthentication, getAllowedAndRequestedScopeValues, getCredentialConfigurationsSupportedForScopes, getOfferedCredentials, getOid4vcCallbacks, getOid4vcDecryptJweCallback, getOid4vcEncryptJweCallback, getOid4vcJwtSignCallback, getOid4vcJwtVerifyCallback, getScopesFromCredentialConfigurationsSupported, openId4VciSupportedCredentialFormats, preAuthorizedCodeGrantIdentifier }; +\ No newline at end of file +diff --git a/node_modules/@credo-ts/openid4vc/build/index.mjs b/node_modules/@credo-ts/openid4vc/build/index.mjs +index 27b6afa..7c9bdaf 100644 +--- a/node_modules/@credo-ts/openid4vc/build/index.mjs ++++ b/node_modules/@credo-ts/openid4vc/build/index.mjs +@@ -33,5 +33,6 @@ import { OpenId4VcIssuerModule } from "./openid4vc-issuer/OpenId4VcIssuerModule. + import "./openid4vc-issuer/index.mjs"; + import { OpenId4VcApi } from "./OpenId4VcApi.mjs"; + import { OpenId4VcModule } from "./OpenId4VcModule.mjs"; ++import { OpenId4VcIssuerRepository } from "./openid4vc-issuer/repository/OpenId4VcIssuerRepository.mjs"; + +-export { OpenId4VcApi, OpenId4VcHolderApi, OpenId4VcHolderModule, OpenId4VcIssuanceSessionRecord, OpenId4VcIssuanceSessionRepository, OpenId4VcIssuanceSessionState, OpenId4VcIssuerApi, OpenId4VcIssuerEvents, OpenId4VcIssuerModule, OpenId4VcIssuerModuleConfig, OpenId4VcIssuerRecord, OpenId4VcIssuerService, OpenId4VcModule, OpenId4VcModuleConfig, OpenId4VcVerificationSessionRecord, OpenId4VcVerificationSessionRepository, OpenId4VcVerificationSessionState, OpenId4VcVerifierApi, OpenId4VcVerifierEvents, OpenId4VcVerifierModule, OpenId4VcVerifierModuleConfig, OpenId4VcVerifierRecord, OpenId4VcVerifierRepository, OpenId4VciAuthorizationFlow, OpenId4VciCredentialFormatProfile, OpenId4VciHolderService, OpenId4VpHolderService, OpenId4VpVerifierService, authorizationCodeGrantIdentifier, dynamicOid4vciClientAuthentication, getAllowedAndRequestedScopeValues, getCredentialConfigurationsSupportedForScopes, getOfferedCredentials, getOid4vcCallbacks, getOid4vcDecryptJweCallback, getOid4vcEncryptJweCallback, getOid4vcJwtSignCallback, getOid4vcJwtVerifyCallback, getScopesFromCredentialConfigurationsSupported, openId4VciSupportedCredentialFormats, preAuthorizedCodeGrantIdentifier }; +\ No newline at end of file ++export { OpenId4VcIssuerRepository, OpenId4VcApi, OpenId4VcHolderApi, OpenId4VcHolderModule, OpenId4VcIssuanceSessionRecord, OpenId4VcIssuanceSessionRepository, OpenId4VcIssuanceSessionState, OpenId4VcIssuerApi, OpenId4VcIssuerEvents, OpenId4VcIssuerModule, OpenId4VcIssuerModuleConfig, OpenId4VcIssuerRecord, OpenId4VcIssuerService, OpenId4VcModule, OpenId4VcModuleConfig, OpenId4VcVerificationSessionRecord, OpenId4VcVerificationSessionRepository, OpenId4VcVerificationSessionState, OpenId4VcVerifierApi, OpenId4VcVerifierEvents, OpenId4VcVerifierModule, OpenId4VcVerifierModuleConfig, OpenId4VcVerifierRecord, OpenId4VcVerifierRepository, OpenId4VciAuthorizationFlow, OpenId4VciCredentialFormatProfile, OpenId4VciHolderService, OpenId4VpHolderService, OpenId4VpVerifierService, authorizationCodeGrantIdentifier, dynamicOid4vciClientAuthentication, getAllowedAndRequestedScopeValues, getCredentialConfigurationsSupportedForScopes, getOfferedCredentials, getOid4vcCallbacks, getOid4vcDecryptJweCallback, getOid4vcEncryptJweCallback, getOid4vcJwtSignCallback, getOid4vcJwtVerifyCallback, getScopesFromCredentialConfigurationsSupported, openId4VciSupportedCredentialFormats, preAuthorizedCodeGrantIdentifier }; +\ No newline at end of file +diff --git a/node_modules/@credo-ts/openid4vc/build/openid4vc-issuer/index.mjs b/node_modules/@credo-ts/openid4vc/build/openid4vc-issuer/index.mjs +index c389872..4faeb68 100644 +--- a/node_modules/@credo-ts/openid4vc/build/openid4vc-issuer/index.mjs ++++ b/node_modules/@credo-ts/openid4vc/build/openid4vc-issuer/index.mjs +@@ -8,4 +8,5 @@ import "./repository/index.mjs"; + import { OpenId4VcIssuerService } from "./OpenId4VcIssuerService.mjs"; + import { OpenId4VcIssuerApi } from "./OpenId4VcIssuerApi.mjs"; + import { OpenId4VcIssuerModule } from "./OpenId4VcIssuerModule.mjs"; ++import { OpenId4VcIssuerRepository } from "./repository/OpenId4VcIssuerRepository.mjs"; + import "./OpenId4VcIssuerServiceOptions.mjs"; diff --git a/src/controllers/openid4vc/issuers/issuer.Controller.ts b/src/controllers/openid4vc/issuers/issuer.Controller.ts index 5dbf0418..ef783a31 100644 --- a/src/controllers/openid4vc/issuers/issuer.Controller.ts +++ b/src/controllers/openid4vc/issuers/issuer.Controller.ts @@ -83,12 +83,12 @@ export class IssuerController extends Controller { /** * 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) - // } - // } + @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 68c635ae..38832dbd 100644 --- a/src/controllers/openid4vc/issuers/issuer.service.ts +++ b/src/controllers/openid4vc/issuers/issuer.service.ts @@ -3,6 +3,8 @@ import type { CreateIssuerOptions } from '../types/issuer.types' import type { Agent } from '@credo-ts/core' import type { Request as Req } from 'express' +import { OpenId4VcIssuerRepository } from '@credo-ts/openid4vc' + export class IssuerService { public async createIssuerAgent( agentReq: Req, @@ -43,10 +45,11 @@ export class IssuerService { } // TODO: We can implement this method later - // public async deleteIssuer(agentReq: Req, issuerId: string) { - // const result = (agentReq.agent as Agent).openid4vc.config.issuer. - // return result - // } + public async deleteIssuer(agentReq: Req, issuerId: string): Promise { + const issuanceRepository = agentReq.agent.dependencyManager.resolve(OpenId4VcIssuerRepository) + const deleteIssuerResponse = await issuanceRepository.deleteById(agentReq.agent.context, issuerId) + return deleteIssuerResponse + } public async getIssuerAgentMetaData(agentReq: Req, issuerId: string) { return (await agentReq.agent.modules.openid4vc.issuer?.getIssuerMetadata(issuerId)) as any From f0e5320344c29eeb7c0a4339f03d1c8540ae40cd Mon Sep 17 00:00:00 2001 From: shitrerohit Date: Fri, 6 Feb 2026 16:14:22 +0530 Subject: [PATCH 080/152] fix:update delete issuer api response Signed-off-by: shitrerohit --- src/controllers/openid4vc/issuers/issuer.Controller.ts | 5 ++--- src/controllers/openid4vc/issuers/issuer.service.ts | 8 ++++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/controllers/openid4vc/issuers/issuer.Controller.ts b/src/controllers/openid4vc/issuers/issuer.Controller.ts index ef783a31..d95c18aa 100644 --- a/src/controllers/openid4vc/issuers/issuer.Controller.ts +++ b/src/controllers/openid4vc/issuers/issuer.Controller.ts @@ -79,14 +79,13 @@ export class IssuerController extends Controller { } } - // TODO: We can implement this method later /** * Deletes a specific issuer by record id. */ @Delete('{id}') - public async deleteIssuer(@Request() request: Req, @Path() id: string): Promise { + public async deleteIssuer(@Request() request: Req, @Path() id: string) { try { - await issuerService.deleteIssuer(request, id) + return 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 38832dbd..92d4c554 100644 --- a/src/controllers/openid4vc/issuers/issuer.service.ts +++ b/src/controllers/openid4vc/issuers/issuer.service.ts @@ -44,11 +44,11 @@ export class IssuerService { return await agentReq.agent.modules.openid4vc.issuer?.getIssuerByIssuerId(publicIssuerId) } - // TODO: We can implement this method later - public async deleteIssuer(agentReq: Req, issuerId: string): Promise { + public async deleteIssuer(agentReq: Req, issuerId: string) { const issuanceRepository = agentReq.agent.dependencyManager.resolve(OpenId4VcIssuerRepository) - const deleteIssuerResponse = await issuanceRepository.deleteById(agentReq.agent.context, issuerId) - return deleteIssuerResponse + return await issuanceRepository.deleteById(agentReq.agent.context, issuerId).then(() => { + return { message: 'Record deleted successfully' } + }) } public async getIssuerAgentMetaData(agentReq: Req, issuerId: string) { From 3b221535f60e1a9fc400aa553b9a18e9044c6e32 Mon Sep 17 00:00:00 2001 From: shitrerohit Date: Mon, 9 Feb 2026 12:33:34 +0530 Subject: [PATCH 081/152] fix: resolved code rabbit ai comments Signed-off-by: shitrerohit --- src/controllers/openid4vc/issuers/issuer.service.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/controllers/openid4vc/issuers/issuer.service.ts b/src/controllers/openid4vc/issuers/issuer.service.ts index 92d4c554..d5afc0e1 100644 --- a/src/controllers/openid4vc/issuers/issuer.service.ts +++ b/src/controllers/openid4vc/issuers/issuer.service.ts @@ -46,9 +46,8 @@ export class IssuerService { public async deleteIssuer(agentReq: Req, issuerId: string) { const issuanceRepository = agentReq.agent.dependencyManager.resolve(OpenId4VcIssuerRepository) - return await issuanceRepository.deleteById(agentReq.agent.context, issuerId).then(() => { - return { message: 'Record deleted successfully' } - }) + await issuanceRepository.deleteById(agentReq.agent.context, issuerId) + return { message: 'Record deleted successfully' } } public async getIssuerAgentMetaData(agentReq: Req, issuerId: string) { From ffac93b8c3b519a0292690fa684a16c40e70f7e0 Mon Sep 17 00:00:00 2001 From: Rinkal Bhojani Date: Thu, 12 Feb 2026 12:49:37 +0530 Subject: [PATCH 082/152] fix: supporting clientIdPrefix for HAIP support Signed-off-by: Rinkal Bhojani --- .../openid4vc/types/verifier.types.ts | 11 +++++++++- .../verification-sessions.service.ts | 20 ++++++++----------- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/src/controllers/openid4vc/types/verifier.types.ts b/src/controllers/openid4vc/types/verifier.types.ts index e0ad7cd7..3e040382 100644 --- a/src/controllers/openid4vc/types/verifier.types.ts +++ b/src/controllers/openid4vc/types/verifier.types.ts @@ -72,6 +72,15 @@ export type OpenId4VcIssuerX5c = { keyId?: string } +export type OpenId4VcIssuerX5cOptions = OpenId4VcIssuerX5c & { + clientIdPrefix?: ClientIdPrefix +} + +export enum ClientIdPrefix { + X509SanDns = 'x509_san_dns', + X509Hash = 'x509_hash', +} + export interface CreateAuthorizationRequest { verifierId: string presentationExchange?: PresentationDefinition @@ -79,7 +88,7 @@ export interface CreateAuthorizationRequest { responseMode?: ResponseModeEnum - requestSigner: OpenId4VcJwtIssuerDid | OpenId4VcIssuerX5c + requestSigner: OpenId4VcJwtIssuerDid | OpenId4VcIssuerX5cOptions expectedOrigins?: string[] } diff --git a/src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts b/src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts index 395cd31d..d8328528 100644 --- a/src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts +++ b/src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts @@ -1,19 +1,9 @@ -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' @@ -21,7 +11,12 @@ import { Request as Req } from 'express' import { injectable } from 'tsyringe' import { SignerMethod } from '../../../enums' -import { CreateAuthorizationRequest, OpenId4VcIssuerX5c, ResponseModeEnum } from '../types/verifier.types' +import { + ClientIdPrefix, + CreateAuthorizationRequest, + OpenId4VcIssuerX5cOptions, + ResponseModeEnum, +} from '../types/verifier.types' @injectable() export class VerificationSessionsService { @@ -56,12 +51,13 @@ export class VerificationSessionsService { requestSigner = { method: 'did', didUrl: verifierDidUrl } as any } else { - requestSigner = dto.requestSigner as OpenId4VcIssuerX5c + requestSigner = dto.requestSigner as OpenId4VcIssuerX5cOptions parsedCertificate = X509Service.parseCertificate(agentReq.agent.context, { encodedCertificate: requestSigner.x5c[0], }) requestSigner.issuer = parsedCertificate.sanUriNames[0] + requestSigner.clientIdPrefix = dto.requestSigner.clientIdPrefix ?? ClientIdPrefix.X509Hash } const options: any = { requestSigner, From 763d6586aae18b555fb25c553f629d99c956a48e Mon Sep 17 00:00:00 2001 From: Rinkal Bhojani Date: Tue, 17 Feb 2026 16:26:32 +0530 Subject: [PATCH 083/152] refactor: added authorizationRequestId param for querying verification sessions Signed-off-by: Rinkal Bhojani --- .../verifier-sessions/verification-sessions.Controller.ts | 2 ++ .../verifier-sessions/verification-sessions.service.ts | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/controllers/openid4vc/verifier-sessions/verification-sessions.Controller.ts b/src/controllers/openid4vc/verifier-sessions/verification-sessions.Controller.ts index d6274acf..4325b4b1 100644 --- a/src/controllers/openid4vc/verifier-sessions/verification-sessions.Controller.ts +++ b/src/controllers/openid4vc/verifier-sessions/verification-sessions.Controller.ts @@ -43,6 +43,7 @@ export class VerificationSessionsController extends Controller { @Query('payloadState') payloadState?: string, @Query('state') state?: OpenId4VcVerificationSessionState, @Query('authorizationRequestUri') authorizationRequestUri?: string, + @Query('authorizationRequestId') authorizationRequestId?: string, @Query('nonce') nonce?: string, ) { try { @@ -53,6 +54,7 @@ export class VerificationSessionsController extends Controller { state, authorizationRequestUri, nonce, + authorizationRequestId, ) } 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 d8328528..2f977187 100644 --- a/src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts +++ b/src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts @@ -89,6 +89,7 @@ export class VerificationSessionsService { state?: OpenId4VcVerificationSessionState, authorizationRequestUri?: string, nonce?: string, + authorizationRequestId?: string, ) { return await agentReq.agent.modules.openid4vc.verifier?.findVerificationSessionsByQuery({ verifierId: publicVerifierId, @@ -96,6 +97,7 @@ export class VerificationSessionsService { state, authorizationRequestUri, nonce, + authorizationRequestId, }) } From 1e3b147e73a998450cbc38fc1444e7e457422f63 Mon Sep 17 00:00:00 2001 From: shitrerohit Date: Wed, 11 Feb 2026 08:34:07 +0530 Subject: [PATCH 084/152] feat:API for verify the authorization response Signed-off-by: shitrerohit --- .../openid4vc/holder/holder.service.ts | 7 +++++-- .../openid4vc/types/holder.types.ts | 3 +++ .../openid4vc/types/verifier.types.ts | 8 +++++++- .../verification-sessions.Controller.ts | 18 ++++++++++++++++-- .../verification-sessions.service.ts | 11 +++++++++++ 5 files changed, 42 insertions(+), 5 deletions(-) diff --git a/src/controllers/openid4vc/holder/holder.service.ts b/src/controllers/openid4vc/holder/holder.service.ts index c73b9560..cce201d4 100644 --- a/src/controllers/openid4vc/holder/holder.service.ts +++ b/src/controllers/openid4vc/holder/holder.service.ts @@ -200,12 +200,14 @@ export class HolderService { public async resolveProofRequest(agentReq: Req, body: ResolveProofRequest) { return (await agentReq.agent.modules.openid4vc.holder.resolveOpenId4VpAuthorizationRequest( body.proofRequestUri, + body.options, )) as any } public async acceptPresentationRequest(agentReq: Req, body: ResolveProofRequest) { const resolved = await agentReq.agent.modules.openid4vc.holder.resolveOpenId4VpAuthorizationRequest( body.proofRequestUri, + body.options, ) // const presentationExchangeService = agent.dependencyManager.resolve(DifPresentationExchangeService) @@ -224,9 +226,10 @@ export class HolderService { dcql: { credentials: dcqlCredentials as DcqlCredentialsForRequest, }, + origin: body.options?.origin, }) - const result: any = submissionResult.serverResponse - result['authorizationResponsePayload'] = submissionResult.authorizationResponsePayload + const result: any = submissionResult.serverResponse || { status: 200, body: {} } + result['body'] = submissionResult return result } diff --git a/src/controllers/openid4vc/types/holder.types.ts b/src/controllers/openid4vc/types/holder.types.ts index acda4b2c..852470ca 100644 --- a/src/controllers/openid4vc/types/holder.types.ts +++ b/src/controllers/openid4vc/types/holder.types.ts @@ -1,3 +1,5 @@ +import type { ResolveOpenId4VpAuthorizationRequestOptions } from '@credo-ts/openid4vc' + export interface ResolveCredentialOfferBody { credentialOfferUri: string } @@ -17,6 +19,7 @@ export interface AuthorizeRequestCredentialOffer { export interface ResolveProofRequest { proofRequestUri: string + options?: ResolveOpenId4VpAuthorizationRequestOptions } export interface AcceptProofRequest { diff --git a/src/controllers/openid4vc/types/verifier.types.ts b/src/controllers/openid4vc/types/verifier.types.ts index 3e040382..9191d0d8 100644 --- a/src/controllers/openid4vc/types/verifier.types.ts +++ b/src/controllers/openid4vc/types/verifier.types.ts @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/explicit-member-accessibility */ import type { DifPresentationExchangeDefinitionV2 } from '@credo-ts/core' -import type { SubmissionRequirement, Format, Issuance, InputDescriptorV2 } from '@sphereon/pex-models' +import type { Format, Issuance, InputDescriptorV2 } from '@sphereon/pex-models' export enum ResponseModeEnum { DIRECT_POST = 'direct_post', @@ -109,3 +109,9 @@ export class OpenId4VcSiopCreateVerifierOptions { export class OpenId4VcUpdateVerifierRecordOptions { clientMetadata?: OpenId4VcSiopVerifierClientMetadata } + +export interface OpenId4VCDCQLVerificationSessionRecord { + verificationSessionId: string + authorizationResponse: Record + origin?: string +} diff --git a/src/controllers/openid4vc/verifier-sessions/verification-sessions.Controller.ts b/src/controllers/openid4vc/verifier-sessions/verification-sessions.Controller.ts index 4325b4b1..1314577c 100644 --- a/src/controllers/openid4vc/verifier-sessions/verification-sessions.Controller.ts +++ b/src/controllers/openid4vc/verifier-sessions/verification-sessions.Controller.ts @@ -1,4 +1,3 @@ -import { Agent } from '@credo-ts/core' import { OpenId4VcVerificationSessionState } from '@credo-ts/openid4vc' import { Request as Req } from 'express' import { Controller, Get, Path, Query, Route, Request, Security, Tags, Post, Body } from 'tsoa' @@ -6,7 +5,7 @@ import { injectable } from 'tsyringe' import { SCOPES } from '../../../enums' import ErrorHandlingService from '../../../errorHandlingService' -import { CreateAuthorizationRequest } from '../types/verifier.types' +import { CreateAuthorizationRequest, OpenId4VCDCQLVerificationSessionRecord } from '../types/verifier.types' import { VerificationSessionsService } from './verification-sessions.service' @@ -89,4 +88,19 @@ export class VerificationSessionsController extends Controller { throw ErrorHandlingService.handle(error) } } + + /** + * Verify authorization response for a DCAPI proof request + */ + @Post('/verify-authorization-response') + public async verifyDcqlProofRequest( + @Request() request: Req, + @Body() verifydcqlProofRquest: OpenId4VCDCQLVerificationSessionRecord, + ) { + try { + return await this.verificationSessionService.verifyDcqlProofRequest(request, verifydcqlProofRquest) + } 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 2f977187..f8fbdec8 100644 --- a/src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts +++ b/src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts @@ -15,6 +15,8 @@ import { ClientIdPrefix, CreateAuthorizationRequest, OpenId4VcIssuerX5cOptions, + OpenId4VCDCQLVerificationSessionRecord, + OpenId4VcIssuerX5c, ResponseModeEnum, } from '../types/verifier.types' @@ -202,4 +204,13 @@ export class VerificationSessionsService { : undefined, } as any } + + public async verifyDcqlProofRequest(agentReq: Req, verifydcqlProofRquest: OpenId4VCDCQLVerificationSessionRecord) { + const verifier = agentReq.agent.modules.openid4vc.verifier + if (!verifier) { + throw new Error('OID4VC verifier module not initialized') + } + const result = (await verifier.verifyAuthorizationResponse({ ...verifydcqlProofRquest })) as any + return result + } } From 37f91ee755c06e1df1f4cd0a6766beb56e283aa4 Mon Sep 17 00:00:00 2001 From: shitrerohit Date: Wed, 11 Feb 2026 11:18:40 +0530 Subject: [PATCH 085/152] fix:code rabbit ai issues Signed-off-by: shitrerohit --- src/controllers/openid4vc/holder/holder.service.ts | 7 ++++--- .../verifier-sessions/verification-sessions.Controller.ts | 2 +- .../verifier-sessions/verification-sessions.service.ts | 5 ++++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/controllers/openid4vc/holder/holder.service.ts b/src/controllers/openid4vc/holder/holder.service.ts index cce201d4..c1108a0a 100644 --- a/src/controllers/openid4vc/holder/holder.service.ts +++ b/src/controllers/openid4vc/holder/holder.service.ts @@ -228,9 +228,10 @@ export class HolderService { }, origin: body.options?.origin, }) - const result: any = submissionResult.serverResponse || { status: 200, body: {} } - result['body'] = submissionResult - return result + return { + status: submissionResult.serverResponse?.status ?? 200, + body: submissionResult, + } as any } public async deleteCredential(agentReq: Req, { credentialId, credentialType }: DeleteCredentialBody) { diff --git a/src/controllers/openid4vc/verifier-sessions/verification-sessions.Controller.ts b/src/controllers/openid4vc/verifier-sessions/verification-sessions.Controller.ts index 1314577c..7e6385b1 100644 --- a/src/controllers/openid4vc/verifier-sessions/verification-sessions.Controller.ts +++ b/src/controllers/openid4vc/verifier-sessions/verification-sessions.Controller.ts @@ -98,7 +98,7 @@ export class VerificationSessionsController extends Controller { @Body() verifydcqlProofRquest: OpenId4VCDCQLVerificationSessionRecord, ) { try { - return await this.verificationSessionService.verifyDcqlProofRequest(request, verifydcqlProofRquest) + return await this.verificationSessionService.verifyAuthorizationResponse(request, verifydcqlProofRquest) } 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 f8fbdec8..91d58ead 100644 --- a/src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts +++ b/src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts @@ -205,7 +205,10 @@ export class VerificationSessionsService { } as any } - public async verifyDcqlProofRequest(agentReq: Req, verifydcqlProofRquest: OpenId4VCDCQLVerificationSessionRecord) { + public async verifyAuthorizationResponse( + agentReq: Req, + verifydcqlProofRquest: OpenId4VCDCQLVerificationSessionRecord, + ) { const verifier = agentReq.agent.modules.openid4vc.verifier if (!verifier) { throw new Error('OID4VC verifier module not initialized') From 51d2b9a59824c7b9b37d5b266cf45dc4b10912c6 Mon Sep 17 00:00:00 2001 From: shitrerohit Date: Wed, 11 Feb 2026 13:50:28 +0530 Subject: [PATCH 086/152] fix:updated the response in accept proof request Signed-off-by: shitrerohit --- src/controllers/openid4vc/holder/holder.service.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/controllers/openid4vc/holder/holder.service.ts b/src/controllers/openid4vc/holder/holder.service.ts index c1108a0a..f7970458 100644 --- a/src/controllers/openid4vc/holder/holder.service.ts +++ b/src/controllers/openid4vc/holder/holder.service.ts @@ -228,8 +228,16 @@ export class HolderService { }, origin: body.options?.origin, }) + if (submissionResult.serverResponse) { + const { serverResponse, ...rest } = submissionResult + + return { + ...serverResponse, + body: rest, + } as any + } return { - status: submissionResult.serverResponse?.status ?? 200, + status: 200, body: submissionResult, } as any } From 91691924e160197d19ef11d86bb05aa431cddea7 Mon Sep 17 00:00:00 2001 From: Rinkal Bhojani Date: Thu, 12 Feb 2026 12:49:37 +0530 Subject: [PATCH 087/152] fix: supporting clientIdPrefix for HAIP support Signed-off-by: Rinkal Bhojani --- .../verifier-sessions/verification-sessions.service.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts b/src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts index 91d58ead..71d76005 100644 --- a/src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts +++ b/src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts @@ -17,6 +17,8 @@ import { OpenId4VcIssuerX5cOptions, OpenId4VCDCQLVerificationSessionRecord, OpenId4VcIssuerX5c, + ClientIdPrefix, + OpenId4VcIssuerX5cOptions, ResponseModeEnum, } from '../types/verifier.types' From b1eccdfb61b2273f2aa1fbc853b143d27c527fa3 Mon Sep 17 00:00:00 2001 From: shitrerohit Date: Thu, 26 Feb 2026 16:33:32 +0530 Subject: [PATCH 088/152] fix:removed duplicate identifier Signed-off-by: shitrerohit --- .../verifier-sessions/verification-sessions.service.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts b/src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts index 71d76005..9af3aa34 100644 --- a/src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts +++ b/src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts @@ -12,9 +12,7 @@ import { injectable } from 'tsyringe' import { SignerMethod } from '../../../enums' import { - ClientIdPrefix, CreateAuthorizationRequest, - OpenId4VcIssuerX5cOptions, OpenId4VCDCQLVerificationSessionRecord, OpenId4VcIssuerX5c, ClientIdPrefix, From cf644626dc8ff18eff32fdafeae15a6273fe812f Mon Sep 17 00:00:00 2001 From: Krishna Waske Date: Mon, 2 Mar 2026 17:51:57 +0530 Subject: [PATCH 089/152] feat: update credo to latest (#345) * fix: update credo version to 0.6.2 Signed-off-by: Krishna Waske * fix: update credo version Signed-off-by: Krishna Waske --------- Signed-off-by: Krishna Waske --- package.json | 24 +- ...1+add-export-for-issuance-repository.patch | 37 - patches/@credo-ts+openid4vc+0.6.2.patch | 37 + src/controllers/did/DidController.ts | 2 +- .../verification-sessions.service.ts | 1 - src/routes/routes.ts | 3993 +++++++++++ src/routes/swagger.json | 6138 ++++++++++++----- src/utils/oid4vc-agent.ts | 2 +- yarn.lock | 675 +- 9 files changed, 8514 insertions(+), 2395 deletions(-) delete mode 100644 patches/@credo-ts+openid4vc+0.6.1+001+add-export-for-issuance-repository.patch create mode 100644 patches/@credo-ts+openid4vc+0.6.2.patch create mode 100644 src/routes/routes.ts diff --git a/package.json b/package.json index 13c2b362..4dbfeb42 100644 --- a/package.json +++ b/package.json @@ -39,17 +39,17 @@ "validate": "yarn lint && yarn check-types && yarn check-format" }, "dependencies": { - "@ayanworks/credo-polygon-w3c-module": "1.0.1-alpha.1", - "@credo-ts/anoncreds": "0.6.1", - "@credo-ts/askar": "0.6.1", - "@credo-ts/core": "0.6.1", - "@credo-ts/didcomm": "0.6.1", - "@credo-ts/indy-vdr": "0.6.1", - "@credo-ts/node": "0.6.1", - "@credo-ts/openid4vc": "0.6.1", + "@ayanworks/credo-polygon-w3c-module": "2.0.0", + "@credo-ts/anoncreds": "0.6.2", + "@credo-ts/askar": "0.6.2", + "@credo-ts/core": "0.6.2", + "@credo-ts/didcomm": "0.6.2", + "@credo-ts/indy-vdr": "0.6.2", + "@credo-ts/node": "0.6.2", + "@credo-ts/openid4vc": "0.6.2", "@credo-ts/push-notifications": "^0.7.1", - "@credo-ts/question-answer": "0.6.1", - "@credo-ts/tenants": "0.6.1", + "@credo-ts/question-answer": "0.6.2", + "@credo-ts/tenants": "0.6.2", "@hyperledger/anoncreds-nodejs": "0.3.1", "@hyperledger/indy-vdr-nodejs": "0.2.2", "@opentelemetry/api": "^1.9.0", @@ -118,7 +118,7 @@ "typescript": "^5.8.3" }, "resolutions": { - "@credo-ts/core": "0.6.1", - "@credo-ts/askar": "0.6.1" + "@credo-ts/core": "0.6.2", + "@credo-ts/askar": "0.6.2" } } diff --git a/patches/@credo-ts+openid4vc+0.6.1+001+add-export-for-issuance-repository.patch b/patches/@credo-ts+openid4vc+0.6.1+001+add-export-for-issuance-repository.patch deleted file mode 100644 index 41e03ba6..00000000 --- a/patches/@credo-ts+openid4vc+0.6.1+001+add-export-for-issuance-repository.patch +++ /dev/null @@ -1,37 +0,0 @@ -diff --git a/node_modules/@credo-ts/openid4vc/build/index.d.mts b/node_modules/@credo-ts/openid4vc/build/index.d.mts -index 81a221a..20bbab4 100644 ---- a/node_modules/@credo-ts/openid4vc/build/index.d.mts -+++ b/node_modules/@credo-ts/openid4vc/build/index.d.mts -@@ -39,4 +39,5 @@ import { OpenId4VcIssuerModule } from "./openid4vc-issuer/OpenId4VcIssuerModule. - import "./openid4vc-issuer/index.mjs"; - import { OpenId4VcApi } from "./OpenId4VcApi.mjs"; - import { OpenId4VcModule } from "./OpenId4VcModule.mjs"; --export { DefaultOpenId4VcVerificationSessionRecordTags, DefaultOpenId4VcVerifierRecordTags, OpenId4VcApi, OpenId4VcAuthorizationCodeTokenRequestOptions, OpenId4VcCredentialHolderAttestationBinding, OpenId4VcCredentialHolderBinding, OpenId4VcCredentialHolderDidBinding, OpenId4VcCredentialHolderJwkBinding, OpenId4VcHolderApi, OpenId4VcHolderModule, OpenId4VcIssuanceSessionAuthorization, OpenId4VcIssuanceSessionChainedIdentity, OpenId4VcIssuanceSessionDpop, OpenId4VcIssuanceSessionPkce, OpenId4VcIssuanceSessionPresentation, OpenId4VcIssuanceSessionRecord, OpenId4VcIssuanceSessionRecordTransaction, OpenId4VcIssuanceSessionRepository, OpenId4VcIssuanceSessionState, OpenId4VcIssuanceSessionStateChangedEvent, OpenId4VcIssuanceSessionWalletAttestation, OpenId4VcIssuerApi, OpenId4VcIssuerEvents, OpenId4VcIssuerModule, OpenId4VcIssuerModuleConfig, OpenId4VcIssuerModuleConfigOptions, OpenId4VcIssuerRecord, OpenId4VcIssuerRecordProps, OpenId4VcIssuerRecordSignedMetadata, OpenId4VcIssuerRecordTags, OpenId4VcIssuerService, OpenId4VcJwtIssuer, OpenId4VcJwtIssuerDid, OpenId4VcJwtIssuerEncoded, OpenId4VcJwtIssuerJwk, OpenId4VcJwtIssuerJwkEncoded, OpenId4VcJwtIssuerX5c, OpenId4VcJwtIssuerX5cEncoded, OpenId4VcModule, OpenId4VcModuleConfig, OpenId4VcModuleConfigOptions, OpenId4VcUpdateIssuerRecordOptions, OpenId4VcUpdateVerifierRecordOptions, OpenId4VcVerificationSessionRecord, OpenId4VcVerificationSessionRecordProps, OpenId4VcVerificationSessionRecordTags, OpenId4VcVerificationSessionRepository, OpenId4VcVerificationSessionState, OpenId4VcVerificationSessionStateChangedEvent, OpenId4VcVerifierApi, OpenId4VcVerifierEvents, OpenId4VcVerifierModule, OpenId4VcVerifierModuleConfig, OpenId4VcVerifierModuleConfigOptions, OpenId4VcVerifierRecord, OpenId4VcVerifierRecordProps, OpenId4VcVerifierRecordTags, OpenId4VcVerifierRepository, OpenId4VciAcceptCredentialOfferOptions, OpenId4VciAccessTokenResponse, OpenId4VciAuthCodeFlowOptions, OpenId4VciAuthorizationCodeFlowConfig, OpenId4VciAuthorizationFlow, OpenId4VciAuthorizationServerClientAuthenticationClientSecret, OpenId4VciAuthorizationServerConfig, OpenId4VciBatchCredentialIssuanceOptions, OpenId4VciChainedAuthorizationServerConfig, OpenId4VciCreateCredentialOfferOptions, OpenId4VciCreateCredentialResponseOptions, OpenId4VciCreateDeferredCredentialResponseOptions, OpenId4VciCreateIssuerOptions, OpenId4VciCreateStatelessCredentialOfferOptions, OpenId4VciCredentialBindingOptions, OpenId4VciCredentialBindingResolver, OpenId4VciCredentialConfigurationSupported, OpenId4VciCredentialConfigurationSupportedWithFormats, OpenId4VciCredentialConfigurationsSupported, OpenId4VciCredentialConfigurationsSupportedWithFormats, OpenId4VciCredentialFormatProfile, OpenId4VciCredentialIssuerMetadata, OpenId4VciCredentialIssuerMetadataDisplay, OpenId4VciCredentialOfferPayload, OpenId4VciCredentialRequest, OpenId4VciCredentialRequestAuthorization, OpenId4VciCredentialRequestFormatSpecific, OpenId4VciCredentialRequestOptions, OpenId4VciCredentialRequestToCredentialMapper, OpenId4VciCredentialRequestToCredentialMapperOptions, OpenId4VciCredentialRequestWithFormats, OpenId4VciCredentialResponse, OpenId4VciDeferredCredentialRequest, OpenId4VciDeferredCredentialRequestOptions, OpenId4VciDeferredCredentialRequestToCredentialMapper, OpenId4VciDeferredCredentialRequestToCredentialMapperOptions, OpenId4VciDeferredCredentialResponse, OpenId4VciDeferredCredentials, OpenId4VciDirectAuthorizationServerConfig, OpenId4VciDpopRequestOptions, OpenId4VciGetVerificationSessionForIssuanceSessionAuthorization, OpenId4VciHolderService, OpenId4VciMetadata, OpenId4VciNotificationEvent, OpenId4VciParsedCredentialRequest, OpenId4VciPreAuthorizedCodeFlowConfig, OpenId4VciPreAuthorizedTokenRequestOptions, OpenId4VciProofOfPossessionRequirements, OpenId4VciProofOfPressionProofTypes, OpenId4VciRequestTokenResponse, OpenId4VciResolvedAuthorizationRequest, OpenId4VciResolvedCredentialOffer, OpenId4VciRetrieveAuthorizationCodeUsingPresentationOptions, OpenId4VciSendNotificationOptions, OpenId4VciSignCredentials, OpenId4VciSignMdocCredentials, OpenId4VciSignSdJwtCredentials, OpenId4VciSignW3cCredentials, OpenId4VciSignW3cV2Credentials, OpenId4VciSupportedCredentialFormats, OpenId4VciTokenRefreshOptions, OpenId4VciTokenRequestOptions, OpenId4VciTxCode, OpenId4VciVersion, OpenId4VpAcceptAuthorizationRequestOptions, OpenId4VpAuthorizationRequestPayload, OpenId4VpAuthorizationResponsePayload, OpenId4VpCreateAuthorizationRequestOptions, OpenId4VpCreateAuthorizationRequestReturn, OpenId4VpCreateVerifierOptions, OpenId4VpHolderService, OpenId4VpResolvedAuthorizationRequest, OpenId4VpVerifiedAuthorizationRequest, OpenId4VpVerifiedAuthorizationResponse, OpenId4VpVerifiedAuthorizationResponseDcql, OpenId4VpVerifiedAuthorizationResponsePresentationExchange, OpenId4VpVerifiedAuthorizationResponseTransactionData, OpenId4VpVerifierClientMetadata, OpenId4VpVerifierService, OpenId4VpVerifyAuthorizationResponseOptions, OpenId4VpVersion, Openid4vpAuthorizationRequest, ParsedTransactionDataEntry, ResolveOpenId4VpAuthorizationRequestOptions, ResponseMode, VerifiedOpenId4VcCredentialHolderBinding, authorizationCodeGrantIdentifier, dynamicOid4vciClientAuthentication, getAllowedAndRequestedScopeValues, getCredentialConfigurationsSupportedForScopes, getOfferedCredentials, getOid4vcCallbacks, getOid4vcDecryptJweCallback, getOid4vcEncryptJweCallback, getOid4vcJwtSignCallback, getOid4vcJwtVerifyCallback, getScopesFromCredentialConfigurationsSupported, openId4VciSupportedCredentialFormats, preAuthorizedCodeGrantIdentifier }; -\ No newline at end of file -+import { OpenId4VcIssuerRepository } from "./openid4vc-issuer/repository/OpenId4VcIssuerRepository.mjs"; -+export { OpenId4VcIssuerRepository, DefaultOpenId4VcVerificationSessionRecordTags, DefaultOpenId4VcVerifierRecordTags, OpenId4VcApi, OpenId4VcAuthorizationCodeTokenRequestOptions, OpenId4VcCredentialHolderAttestationBinding, OpenId4VcCredentialHolderBinding, OpenId4VcCredentialHolderDidBinding, OpenId4VcCredentialHolderJwkBinding, OpenId4VcHolderApi, OpenId4VcHolderModule, OpenId4VcIssuanceSessionAuthorization, OpenId4VcIssuanceSessionChainedIdentity, OpenId4VcIssuanceSessionDpop, OpenId4VcIssuanceSessionPkce, OpenId4VcIssuanceSessionPresentation, OpenId4VcIssuanceSessionRecord, OpenId4VcIssuanceSessionRecordTransaction, OpenId4VcIssuanceSessionRepository, OpenId4VcIssuanceSessionState, OpenId4VcIssuanceSessionStateChangedEvent, OpenId4VcIssuanceSessionWalletAttestation, OpenId4VcIssuerApi, OpenId4VcIssuerEvents, OpenId4VcIssuerModule, OpenId4VcIssuerModuleConfig, OpenId4VcIssuerModuleConfigOptions, OpenId4VcIssuerRecord, OpenId4VcIssuerRecordProps, OpenId4VcIssuerRecordSignedMetadata, OpenId4VcIssuerRecordTags, OpenId4VcIssuerService, OpenId4VcJwtIssuer, OpenId4VcJwtIssuerDid, OpenId4VcJwtIssuerEncoded, OpenId4VcJwtIssuerJwk, OpenId4VcJwtIssuerJwkEncoded, OpenId4VcJwtIssuerX5c, OpenId4VcJwtIssuerX5cEncoded, OpenId4VcModule, OpenId4VcModuleConfig, OpenId4VcModuleConfigOptions, OpenId4VcUpdateIssuerRecordOptions, OpenId4VcUpdateVerifierRecordOptions, OpenId4VcVerificationSessionRecord, OpenId4VcVerificationSessionRecordProps, OpenId4VcVerificationSessionRecordTags, OpenId4VcVerificationSessionRepository, OpenId4VcVerificationSessionState, OpenId4VcVerificationSessionStateChangedEvent, OpenId4VcVerifierApi, OpenId4VcVerifierEvents, OpenId4VcVerifierModule, OpenId4VcVerifierModuleConfig, OpenId4VcVerifierModuleConfigOptions, OpenId4VcVerifierRecord, OpenId4VcVerifierRecordProps, OpenId4VcVerifierRecordTags, OpenId4VcVerifierRepository, OpenId4VciAcceptCredentialOfferOptions, OpenId4VciAccessTokenResponse, OpenId4VciAuthCodeFlowOptions, OpenId4VciAuthorizationCodeFlowConfig, OpenId4VciAuthorizationFlow, OpenId4VciAuthorizationServerClientAuthenticationClientSecret, OpenId4VciAuthorizationServerConfig, OpenId4VciBatchCredentialIssuanceOptions, OpenId4VciChainedAuthorizationServerConfig, OpenId4VciCreateCredentialOfferOptions, OpenId4VciCreateCredentialResponseOptions, OpenId4VciCreateDeferredCredentialResponseOptions, OpenId4VciCreateIssuerOptions, OpenId4VciCreateStatelessCredentialOfferOptions, OpenId4VciCredentialBindingOptions, OpenId4VciCredentialBindingResolver, OpenId4VciCredentialConfigurationSupported, OpenId4VciCredentialConfigurationSupportedWithFormats, OpenId4VciCredentialConfigurationsSupported, OpenId4VciCredentialConfigurationsSupportedWithFormats, OpenId4VciCredentialFormatProfile, OpenId4VciCredentialIssuerMetadata, OpenId4VciCredentialIssuerMetadataDisplay, OpenId4VciCredentialOfferPayload, OpenId4VciCredentialRequest, OpenId4VciCredentialRequestAuthorization, OpenId4VciCredentialRequestFormatSpecific, OpenId4VciCredentialRequestOptions, OpenId4VciCredentialRequestToCredentialMapper, OpenId4VciCredentialRequestToCredentialMapperOptions, OpenId4VciCredentialRequestWithFormats, OpenId4VciCredentialResponse, OpenId4VciDeferredCredentialRequest, OpenId4VciDeferredCredentialRequestOptions, OpenId4VciDeferredCredentialRequestToCredentialMapper, OpenId4VciDeferredCredentialRequestToCredentialMapperOptions, OpenId4VciDeferredCredentialResponse, OpenId4VciDeferredCredentials, OpenId4VciDirectAuthorizationServerConfig, OpenId4VciDpopRequestOptions, OpenId4VciGetVerificationSessionForIssuanceSessionAuthorization, OpenId4VciHolderService, OpenId4VciMetadata, OpenId4VciNotificationEvent, OpenId4VciParsedCredentialRequest, OpenId4VciPreAuthorizedCodeFlowConfig, OpenId4VciPreAuthorizedTokenRequestOptions, OpenId4VciProofOfPossessionRequirements, OpenId4VciProofOfPressionProofTypes, OpenId4VciRequestTokenResponse, OpenId4VciResolvedAuthorizationRequest, OpenId4VciResolvedCredentialOffer, OpenId4VciRetrieveAuthorizationCodeUsingPresentationOptions, OpenId4VciSendNotificationOptions, OpenId4VciSignCredentials, OpenId4VciSignMdocCredentials, OpenId4VciSignSdJwtCredentials, OpenId4VciSignW3cCredentials, OpenId4VciSignW3cV2Credentials, OpenId4VciSupportedCredentialFormats, OpenId4VciTokenRefreshOptions, OpenId4VciTokenRequestOptions, OpenId4VciTxCode, OpenId4VciVersion, OpenId4VpAcceptAuthorizationRequestOptions, OpenId4VpAuthorizationRequestPayload, OpenId4VpAuthorizationResponsePayload, OpenId4VpCreateAuthorizationRequestOptions, OpenId4VpCreateAuthorizationRequestReturn, OpenId4VpCreateVerifierOptions, OpenId4VpHolderService, OpenId4VpResolvedAuthorizationRequest, OpenId4VpVerifiedAuthorizationRequest, OpenId4VpVerifiedAuthorizationResponse, OpenId4VpVerifiedAuthorizationResponseDcql, OpenId4VpVerifiedAuthorizationResponsePresentationExchange, OpenId4VpVerifiedAuthorizationResponseTransactionData, OpenId4VpVerifierClientMetadata, OpenId4VpVerifierService, OpenId4VpVerifyAuthorizationResponseOptions, OpenId4VpVersion, Openid4vpAuthorizationRequest, ParsedTransactionDataEntry, ResolveOpenId4VpAuthorizationRequestOptions, ResponseMode, VerifiedOpenId4VcCredentialHolderBinding, authorizationCodeGrantIdentifier, dynamicOid4vciClientAuthentication, getAllowedAndRequestedScopeValues, getCredentialConfigurationsSupportedForScopes, getOfferedCredentials, getOid4vcCallbacks, getOid4vcDecryptJweCallback, getOid4vcEncryptJweCallback, getOid4vcJwtSignCallback, getOid4vcJwtVerifyCallback, getScopesFromCredentialConfigurationsSupported, openId4VciSupportedCredentialFormats, preAuthorizedCodeGrantIdentifier }; -\ No newline at end of file -diff --git a/node_modules/@credo-ts/openid4vc/build/index.mjs b/node_modules/@credo-ts/openid4vc/build/index.mjs -index 27b6afa..7c9bdaf 100644 ---- a/node_modules/@credo-ts/openid4vc/build/index.mjs -+++ b/node_modules/@credo-ts/openid4vc/build/index.mjs -@@ -33,5 +33,6 @@ import { OpenId4VcIssuerModule } from "./openid4vc-issuer/OpenId4VcIssuerModule. - import "./openid4vc-issuer/index.mjs"; - import { OpenId4VcApi } from "./OpenId4VcApi.mjs"; - import { OpenId4VcModule } from "./OpenId4VcModule.mjs"; -+import { OpenId4VcIssuerRepository } from "./openid4vc-issuer/repository/OpenId4VcIssuerRepository.mjs"; - --export { OpenId4VcApi, OpenId4VcHolderApi, OpenId4VcHolderModule, OpenId4VcIssuanceSessionRecord, OpenId4VcIssuanceSessionRepository, OpenId4VcIssuanceSessionState, OpenId4VcIssuerApi, OpenId4VcIssuerEvents, OpenId4VcIssuerModule, OpenId4VcIssuerModuleConfig, OpenId4VcIssuerRecord, OpenId4VcIssuerService, OpenId4VcModule, OpenId4VcModuleConfig, OpenId4VcVerificationSessionRecord, OpenId4VcVerificationSessionRepository, OpenId4VcVerificationSessionState, OpenId4VcVerifierApi, OpenId4VcVerifierEvents, OpenId4VcVerifierModule, OpenId4VcVerifierModuleConfig, OpenId4VcVerifierRecord, OpenId4VcVerifierRepository, OpenId4VciAuthorizationFlow, OpenId4VciCredentialFormatProfile, OpenId4VciHolderService, OpenId4VpHolderService, OpenId4VpVerifierService, authorizationCodeGrantIdentifier, dynamicOid4vciClientAuthentication, getAllowedAndRequestedScopeValues, getCredentialConfigurationsSupportedForScopes, getOfferedCredentials, getOid4vcCallbacks, getOid4vcDecryptJweCallback, getOid4vcEncryptJweCallback, getOid4vcJwtSignCallback, getOid4vcJwtVerifyCallback, getScopesFromCredentialConfigurationsSupported, openId4VciSupportedCredentialFormats, preAuthorizedCodeGrantIdentifier }; -\ No newline at end of file -+export { OpenId4VcIssuerRepository, OpenId4VcApi, OpenId4VcHolderApi, OpenId4VcHolderModule, OpenId4VcIssuanceSessionRecord, OpenId4VcIssuanceSessionRepository, OpenId4VcIssuanceSessionState, OpenId4VcIssuerApi, OpenId4VcIssuerEvents, OpenId4VcIssuerModule, OpenId4VcIssuerModuleConfig, OpenId4VcIssuerRecord, OpenId4VcIssuerService, OpenId4VcModule, OpenId4VcModuleConfig, OpenId4VcVerificationSessionRecord, OpenId4VcVerificationSessionRepository, OpenId4VcVerificationSessionState, OpenId4VcVerifierApi, OpenId4VcVerifierEvents, OpenId4VcVerifierModule, OpenId4VcVerifierModuleConfig, OpenId4VcVerifierRecord, OpenId4VcVerifierRepository, OpenId4VciAuthorizationFlow, OpenId4VciCredentialFormatProfile, OpenId4VciHolderService, OpenId4VpHolderService, OpenId4VpVerifierService, authorizationCodeGrantIdentifier, dynamicOid4vciClientAuthentication, getAllowedAndRequestedScopeValues, getCredentialConfigurationsSupportedForScopes, getOfferedCredentials, getOid4vcCallbacks, getOid4vcDecryptJweCallback, getOid4vcEncryptJweCallback, getOid4vcJwtSignCallback, getOid4vcJwtVerifyCallback, getScopesFromCredentialConfigurationsSupported, openId4VciSupportedCredentialFormats, preAuthorizedCodeGrantIdentifier }; -\ No newline at end of file -diff --git a/node_modules/@credo-ts/openid4vc/build/openid4vc-issuer/index.mjs b/node_modules/@credo-ts/openid4vc/build/openid4vc-issuer/index.mjs -index c389872..4faeb68 100644 ---- a/node_modules/@credo-ts/openid4vc/build/openid4vc-issuer/index.mjs -+++ b/node_modules/@credo-ts/openid4vc/build/openid4vc-issuer/index.mjs -@@ -8,4 +8,5 @@ import "./repository/index.mjs"; - import { OpenId4VcIssuerService } from "./OpenId4VcIssuerService.mjs"; - import { OpenId4VcIssuerApi } from "./OpenId4VcIssuerApi.mjs"; - import { OpenId4VcIssuerModule } from "./OpenId4VcIssuerModule.mjs"; -+import { OpenId4VcIssuerRepository } from "./repository/OpenId4VcIssuerRepository.mjs"; - import "./OpenId4VcIssuerServiceOptions.mjs"; diff --git a/patches/@credo-ts+openid4vc+0.6.2.patch b/patches/@credo-ts+openid4vc+0.6.2.patch new file mode 100644 index 00000000..2025930b --- /dev/null +++ b/patches/@credo-ts+openid4vc+0.6.2.patch @@ -0,0 +1,37 @@ +diff --git a/node_modules/@credo-ts/openid4vc/build/index.d.mts b/node_modules/@credo-ts/openid4vc/build/index.d.mts +index 6684f74..f1c9849 100644 +--- a/node_modules/@credo-ts/openid4vc/build/index.d.mts ++++ b/node_modules/@credo-ts/openid4vc/build/index.d.mts +@@ -39,4 +39,5 @@ import { OpenId4VcIssuerModule } from "./openid4vc-issuer/OpenId4VcIssuerModule. + import "./openid4vc-issuer/index.mjs"; + import { OpenId4VcApi } from "./OpenId4VcApi.mjs"; + import { OpenId4VcModule } from "./OpenId4VcModule.mjs"; +-export { DefaultOpenId4VcVerificationSessionRecordTags, DefaultOpenId4VcVerifierRecordTags, OpenId4VcApi, OpenId4VcAuthorizationCodeTokenRequestOptions, OpenId4VcCredentialHolderAttestationBinding, OpenId4VcCredentialHolderBinding, OpenId4VcCredentialHolderDidBinding, OpenId4VcCredentialHolderJwkBinding, OpenId4VcHolderApi, OpenId4VcHolderModule, OpenId4VcIssuanceSessionAuthorization, OpenId4VcIssuanceSessionChainedIdentity, OpenId4VcIssuanceSessionDpop, OpenId4VcIssuanceSessionPkce, OpenId4VcIssuanceSessionPresentation, OpenId4VcIssuanceSessionRecord, OpenId4VcIssuanceSessionRecordTransaction, OpenId4VcIssuanceSessionRepository, OpenId4VcIssuanceSessionState, OpenId4VcIssuanceSessionStateChangedEvent, OpenId4VcIssuanceSessionWalletAttestation, OpenId4VcIssuerApi, OpenId4VcIssuerEvents, OpenId4VcIssuerModule, OpenId4VcIssuerModuleConfig, OpenId4VcIssuerModuleConfigOptions, OpenId4VcIssuerRecord, OpenId4VcIssuerRecordProps, OpenId4VcIssuerRecordSignedMetadata, OpenId4VcIssuerRecordTags, OpenId4VcIssuerService, OpenId4VcJwtIssuer, OpenId4VcJwtIssuerDid, OpenId4VcJwtIssuerEncoded, OpenId4VcJwtIssuerJwk, OpenId4VcJwtIssuerJwkEncoded, OpenId4VcJwtIssuerX5c, OpenId4VcJwtIssuerX5cEncoded, OpenId4VcModule, OpenId4VcModuleConfig, OpenId4VcModuleConfigOptions, OpenId4VcParseAndVerifyAuthorizationResponseOptions, OpenId4VcUpdateIssuerRecordOptions, OpenId4VcUpdateVerifierRecordOptions, OpenId4VcVerificationSessionRecord, OpenId4VcVerificationSessionRecordProps, OpenId4VcVerificationSessionRecordTags, OpenId4VcVerificationSessionRepository, OpenId4VcVerificationSessionState, OpenId4VcVerificationSessionStateChangedEvent, OpenId4VcVerifierApi, OpenId4VcVerifierEvents, OpenId4VcVerifierModule, OpenId4VcVerifierModuleConfig, OpenId4VcVerifierModuleConfigOptions, OpenId4VcVerifierRecord, OpenId4VcVerifierRecordProps, OpenId4VcVerifierRecordTags, OpenId4VcVerifierRepository, OpenId4VciAcceptCredentialOfferOptions, OpenId4VciAccessTokenResponse, OpenId4VciAuthCodeFlowOptions, OpenId4VciAuthorizationCodeFlowConfig, OpenId4VciAuthorizationFlow, OpenId4VciAuthorizationServerClientAuthenticationClientSecret, OpenId4VciAuthorizationServerConfig, OpenId4VciBatchCredentialIssuanceOptions, OpenId4VciChainedAuthorizationServerConfig, OpenId4VciCreateCredentialOfferOptions, OpenId4VciCreateCredentialResponseOptions, OpenId4VciCreateDeferredCredentialResponseOptions, OpenId4VciCreateIssuerOptions, OpenId4VciCreateStatelessCredentialOfferOptions, OpenId4VciCredentialBindingOptions, OpenId4VciCredentialBindingResolver, OpenId4VciCredentialConfigurationSupported, OpenId4VciCredentialConfigurationSupportedWithFormats, OpenId4VciCredentialConfigurationsSupported, OpenId4VciCredentialConfigurationsSupportedWithFormats, OpenId4VciCredentialFormatProfile, OpenId4VciCredentialIssuerMetadata, OpenId4VciCredentialIssuerMetadataDisplay, OpenId4VciCredentialOfferPayload, OpenId4VciCredentialRequest, OpenId4VciCredentialRequestAuthorization, OpenId4VciCredentialRequestFormatSpecific, OpenId4VciCredentialRequestOptions, OpenId4VciCredentialRequestToCredentialMapper, OpenId4VciCredentialRequestToCredentialMapperOptions, OpenId4VciCredentialRequestWithFormats, OpenId4VciCredentialResponse, OpenId4VciDeferredCredentialRequest, OpenId4VciDeferredCredentialRequestOptions, OpenId4VciDeferredCredentialRequestToCredentialMapper, OpenId4VciDeferredCredentialRequestToCredentialMapperOptions, OpenId4VciDeferredCredentialResponse, OpenId4VciDeferredCredentials, OpenId4VciDirectAuthorizationServerConfig, OpenId4VciDpopRequestOptions, OpenId4VciGetVerificationSessionForIssuanceSessionAuthorization, OpenId4VciHolderService, OpenId4VciMetadata, OpenId4VciNotificationEvent, OpenId4VciParsedCredentialRequest, OpenId4VciPreAuthorizedCodeFlowConfig, OpenId4VciPreAuthorizedTokenRequestOptions, OpenId4VciProofOfPossessionRequirements, OpenId4VciProofOfPressionProofTypes, OpenId4VciRequestTokenResponse, OpenId4VciResolvedAuthorizationRequest, OpenId4VciResolvedCredentialOffer, OpenId4VciRetrieveAuthorizationCodeUsingPresentationOptions, OpenId4VciSendNotificationOptions, OpenId4VciSignCredentials, OpenId4VciSignMdocCredentials, OpenId4VciSignSdJwtCredentials, OpenId4VciSignW3cCredentials, OpenId4VciSignW3cV2Credentials, OpenId4VciSupportedCredentialFormats, OpenId4VciTokenRefreshOptions, OpenId4VciTokenRequestOptions, OpenId4VciTxCode, OpenId4VciVersion, OpenId4VpAcceptAuthorizationRequestOptions, OpenId4VpAuthorizationRequestPayload, OpenId4VpAuthorizationResponsePayload, OpenId4VpCreateAuthorizationRequestOptions, OpenId4VpCreateAuthorizationRequestReturn, OpenId4VpCreateVerifierOptions, OpenId4VpHolderService, OpenId4VpResolvedAuthorizationRequest, OpenId4VpVerifiedAuthorizationRequest, OpenId4VpVerifiedAuthorizationResponse, OpenId4VpVerifiedAuthorizationResponseDcql, OpenId4VpVerifiedAuthorizationResponsePresentationExchange, OpenId4VpVerifiedAuthorizationResponseTransactionData, OpenId4VpVerifierClientMetadata, OpenId4VpVerifierService, OpenId4VpVerifyAuthorizationResponseOptions, OpenId4VpVersion, Openid4vpAuthorizationRequest, ParsedTransactionDataEntry, ResolveOpenId4VpAuthorizationRequestOptions, ResponseMode, VerifiedOpenId4VcCredentialHolderBinding, authorizationCodeGrantIdentifier, dynamicOid4vciClientAuthentication, getAllowedAndRequestedScopeValues, getCredentialConfigurationsSupportedForScopes, getOfferedCredentials, getOid4vcCallbacks, getOid4vcDecryptJweCallback, getOid4vcEncryptJweCallback, getOid4vcJwtSignCallback, getOid4vcJwtVerifyCallback, getScopesFromCredentialConfigurationsSupported, openId4VciSupportedCredentialFormats, preAuthorizedCodeGrantIdentifier }; +\ No newline at end of file ++import { OpenId4VcIssuerRepository } from "./openid4vc-issuer/repository/OpenId4VcIssuerRepository.mjs"; ++export { OpenId4VcIssuerRepository, DefaultOpenId4VcVerificationSessionRecordTags, DefaultOpenId4VcVerifierRecordTags, OpenId4VcApi, OpenId4VcAuthorizationCodeTokenRequestOptions, OpenId4VcCredentialHolderAttestationBinding, OpenId4VcCredentialHolderBinding, OpenId4VcCredentialHolderDidBinding, OpenId4VcCredentialHolderJwkBinding, OpenId4VcHolderApi, OpenId4VcHolderModule, OpenId4VcIssuanceSessionAuthorization, OpenId4VcIssuanceSessionChainedIdentity, OpenId4VcIssuanceSessionDpop, OpenId4VcIssuanceSessionPkce, OpenId4VcIssuanceSessionPresentation, OpenId4VcIssuanceSessionRecord, OpenId4VcIssuanceSessionRecordTransaction, OpenId4VcIssuanceSessionRepository, OpenId4VcIssuanceSessionState, OpenId4VcIssuanceSessionStateChangedEvent, OpenId4VcIssuanceSessionWalletAttestation, OpenId4VcIssuerApi, OpenId4VcIssuerEvents, OpenId4VcIssuerModule, OpenId4VcIssuerModuleConfig, OpenId4VcIssuerModuleConfigOptions, OpenId4VcIssuerRecord, OpenId4VcIssuerRecordProps, OpenId4VcIssuerRecordSignedMetadata, OpenId4VcIssuerRecordTags, OpenId4VcIssuerService, OpenId4VcJwtIssuer, OpenId4VcJwtIssuerDid, OpenId4VcJwtIssuerEncoded, OpenId4VcJwtIssuerJwk, OpenId4VcJwtIssuerJwkEncoded, OpenId4VcJwtIssuerX5c, OpenId4VcJwtIssuerX5cEncoded, OpenId4VcModule, OpenId4VcModuleConfig, OpenId4VcModuleConfigOptions, OpenId4VcParseAndVerifyAuthorizationResponseOptions, OpenId4VcUpdateIssuerRecordOptions, OpenId4VcUpdateVerifierRecordOptions, OpenId4VcVerificationSessionRecord, OpenId4VcVerificationSessionRecordProps, OpenId4VcVerificationSessionRecordTags, OpenId4VcVerificationSessionRepository, OpenId4VcVerificationSessionState, OpenId4VcVerificationSessionStateChangedEvent, OpenId4VcVerifierApi, OpenId4VcVerifierEvents, OpenId4VcVerifierModule, OpenId4VcVerifierModuleConfig, OpenId4VcVerifierModuleConfigOptions, OpenId4VcVerifierRecord, OpenId4VcVerifierRecordProps, OpenId4VcVerifierRecordTags, OpenId4VcVerifierRepository, OpenId4VciAcceptCredentialOfferOptions, OpenId4VciAccessTokenResponse, OpenId4VciAuthCodeFlowOptions, OpenId4VciAuthorizationCodeFlowConfig, OpenId4VciAuthorizationFlow, OpenId4VciAuthorizationServerClientAuthenticationClientSecret, OpenId4VciAuthorizationServerConfig, OpenId4VciBatchCredentialIssuanceOptions, OpenId4VciChainedAuthorizationServerConfig, OpenId4VciCreateCredentialOfferOptions, OpenId4VciCreateCredentialResponseOptions, OpenId4VciCreateDeferredCredentialResponseOptions, OpenId4VciCreateIssuerOptions, OpenId4VciCreateStatelessCredentialOfferOptions, OpenId4VciCredentialBindingOptions, OpenId4VciCredentialBindingResolver, OpenId4VciCredentialConfigurationSupported, OpenId4VciCredentialConfigurationSupportedWithFormats, OpenId4VciCredentialConfigurationsSupported, OpenId4VciCredentialConfigurationsSupportedWithFormats, OpenId4VciCredentialFormatProfile, OpenId4VciCredentialIssuerMetadata, OpenId4VciCredentialIssuerMetadataDisplay, OpenId4VciCredentialOfferPayload, OpenId4VciCredentialRequest, OpenId4VciCredentialRequestAuthorization, OpenId4VciCredentialRequestFormatSpecific, OpenId4VciCredentialRequestOptions, OpenId4VciCredentialRequestToCredentialMapper, OpenId4VciCredentialRequestToCredentialMapperOptions, OpenId4VciCredentialRequestWithFormats, OpenId4VciCredentialResponse, OpenId4VciDeferredCredentialRequest, OpenId4VciDeferredCredentialRequestOptions, OpenId4VciDeferredCredentialRequestToCredentialMapper, OpenId4VciDeferredCredentialRequestToCredentialMapperOptions, OpenId4VciDeferredCredentialResponse, OpenId4VciDeferredCredentials, OpenId4VciDirectAuthorizationServerConfig, OpenId4VciDpopRequestOptions, OpenId4VciGetVerificationSessionForIssuanceSessionAuthorization, OpenId4VciHolderService, OpenId4VciMetadata, OpenId4VciNotificationEvent, OpenId4VciParsedCredentialRequest, OpenId4VciPreAuthorizedCodeFlowConfig, OpenId4VciPreAuthorizedTokenRequestOptions, OpenId4VciProofOfPossessionRequirements, OpenId4VciProofOfPressionProofTypes, OpenId4VciRequestTokenResponse, OpenId4VciResolvedAuthorizationRequest, OpenId4VciResolvedCredentialOffer, OpenId4VciRetrieveAuthorizationCodeUsingPresentationOptions, OpenId4VciSendNotificationOptions, OpenId4VciSignCredentials, OpenId4VciSignMdocCredentials, OpenId4VciSignSdJwtCredentials, OpenId4VciSignW3cCredentials, OpenId4VciSignW3cV2Credentials, OpenId4VciSupportedCredentialFormats, OpenId4VciTokenRefreshOptions, OpenId4VciTokenRequestOptions, OpenId4VciTxCode, OpenId4VciVersion, OpenId4VpAcceptAuthorizationRequestOptions, OpenId4VpAuthorizationRequestPayload, OpenId4VpAuthorizationResponsePayload, OpenId4VpCreateAuthorizationRequestOptions, OpenId4VpCreateAuthorizationRequestReturn, OpenId4VpCreateVerifierOptions, OpenId4VpHolderService, OpenId4VpResolvedAuthorizationRequest, OpenId4VpVerifiedAuthorizationRequest, OpenId4VpVerifiedAuthorizationResponse, OpenId4VpVerifiedAuthorizationResponseDcql, OpenId4VpVerifiedAuthorizationResponsePresentationExchange, OpenId4VpVerifiedAuthorizationResponseTransactionData, OpenId4VpVerifierClientMetadata, OpenId4VpVerifierService, OpenId4VpVerifyAuthorizationResponseOptions, OpenId4VpVersion, Openid4vpAuthorizationRequest, ParsedTransactionDataEntry, ResolveOpenId4VpAuthorizationRequestOptions, ResponseMode, VerifiedOpenId4VcCredentialHolderBinding, authorizationCodeGrantIdentifier, dynamicOid4vciClientAuthentication, getAllowedAndRequestedScopeValues, getCredentialConfigurationsSupportedForScopes, getOfferedCredentials, getOid4vcCallbacks, getOid4vcDecryptJweCallback, getOid4vcEncryptJweCallback, getOid4vcJwtSignCallback, getOid4vcJwtVerifyCallback, getScopesFromCredentialConfigurationsSupported, openId4VciSupportedCredentialFormats, preAuthorizedCodeGrantIdentifier }; +\ No newline at end of file +diff --git a/node_modules/@credo-ts/openid4vc/build/index.mjs b/node_modules/@credo-ts/openid4vc/build/index.mjs +index 27b6afa..bf990b8 100644 +--- a/node_modules/@credo-ts/openid4vc/build/index.mjs ++++ b/node_modules/@credo-ts/openid4vc/build/index.mjs +@@ -33,5 +33,5 @@ import { OpenId4VcIssuerModule } from "./openid4vc-issuer/OpenId4VcIssuerModule. + import "./openid4vc-issuer/index.mjs"; + import { OpenId4VcApi } from "./OpenId4VcApi.mjs"; + import { OpenId4VcModule } from "./OpenId4VcModule.mjs"; +- +-export { OpenId4VcApi, OpenId4VcHolderApi, OpenId4VcHolderModule, OpenId4VcIssuanceSessionRecord, OpenId4VcIssuanceSessionRepository, OpenId4VcIssuanceSessionState, OpenId4VcIssuerApi, OpenId4VcIssuerEvents, OpenId4VcIssuerModule, OpenId4VcIssuerModuleConfig, OpenId4VcIssuerRecord, OpenId4VcIssuerService, OpenId4VcModule, OpenId4VcModuleConfig, OpenId4VcVerificationSessionRecord, OpenId4VcVerificationSessionRepository, OpenId4VcVerificationSessionState, OpenId4VcVerifierApi, OpenId4VcVerifierEvents, OpenId4VcVerifierModule, OpenId4VcVerifierModuleConfig, OpenId4VcVerifierRecord, OpenId4VcVerifierRepository, OpenId4VciAuthorizationFlow, OpenId4VciCredentialFormatProfile, OpenId4VciHolderService, OpenId4VpHolderService, OpenId4VpVerifierService, authorizationCodeGrantIdentifier, dynamicOid4vciClientAuthentication, getAllowedAndRequestedScopeValues, getCredentialConfigurationsSupportedForScopes, getOfferedCredentials, getOid4vcCallbacks, getOid4vcDecryptJweCallback, getOid4vcEncryptJweCallback, getOid4vcJwtSignCallback, getOid4vcJwtVerifyCallback, getScopesFromCredentialConfigurationsSupported, openId4VciSupportedCredentialFormats, preAuthorizedCodeGrantIdentifier }; +\ No newline at end of file ++import { OpenId4VcIssuerRepository } from "./openid4vc-issuer/repository/OpenId4VcIssuerRepository.mjs"; ++export { OpenId4VcIssuerRepository, OpenId4VcApi, OpenId4VcHolderApi, OpenId4VcHolderModule, OpenId4VcIssuanceSessionRecord, OpenId4VcIssuanceSessionRepository, OpenId4VcIssuanceSessionState, OpenId4VcIssuerApi, OpenId4VcIssuerEvents, OpenId4VcIssuerModule, OpenId4VcIssuerModuleConfig, OpenId4VcIssuerRecord, OpenId4VcIssuerService, OpenId4VcModule, OpenId4VcModuleConfig, OpenId4VcVerificationSessionRecord, OpenId4VcVerificationSessionRepository, OpenId4VcVerificationSessionState, OpenId4VcVerifierApi, OpenId4VcVerifierEvents, OpenId4VcVerifierModule, OpenId4VcVerifierModuleConfig, OpenId4VcVerifierRecord, OpenId4VcVerifierRepository, OpenId4VciAuthorizationFlow, OpenId4VciCredentialFormatProfile, OpenId4VciHolderService, OpenId4VpHolderService, OpenId4VpVerifierService, authorizationCodeGrantIdentifier, dynamicOid4vciClientAuthentication, getAllowedAndRequestedScopeValues, getCredentialConfigurationsSupportedForScopes, getOfferedCredentials, getOid4vcCallbacks, getOid4vcDecryptJweCallback, getOid4vcEncryptJweCallback, getOid4vcJwtSignCallback, getOid4vcJwtVerifyCallback, getScopesFromCredentialConfigurationsSupported, openId4VciSupportedCredentialFormats, preAuthorizedCodeGrantIdentifier }; +\ No newline at end of file +diff --git a/node_modules/@credo-ts/openid4vc/build/openid4vc-issuer/index.mjs b/node_modules/@credo-ts/openid4vc/build/openid4vc-issuer/index.mjs +index c389872..4faeb68 100644 +--- a/node_modules/@credo-ts/openid4vc/build/openid4vc-issuer/index.mjs ++++ b/node_modules/@credo-ts/openid4vc/build/openid4vc-issuer/index.mjs +@@ -8,4 +8,5 @@ import "./repository/index.mjs"; + import { OpenId4VcIssuerService } from "./OpenId4VcIssuerService.mjs"; + import { OpenId4VcIssuerApi } from "./OpenId4VcIssuerApi.mjs"; + import { OpenId4VcIssuerModule } from "./OpenId4VcIssuerModule.mjs"; ++import { OpenId4VcIssuerRepository } from "./repository/OpenId4VcIssuerRepository.mjs"; + import "./OpenId4VcIssuerServiceOptions.mjs"; diff --git a/src/controllers/did/DidController.ts b/src/controllers/did/DidController.ts index 26b0ba71..682c12bf 100644 --- a/src/controllers/did/DidController.ts +++ b/src/controllers/did/DidController.ts @@ -1,5 +1,5 @@ import type { DidResolutionResultProps } from '../types' -import type { PolygonDidCreateOptions } from '@ayanworks/credo-polygon-w3c-module/build/dids' +import type { PolygonDidCreateOptions } from '@ayanworks/credo-polygon-w3c-module/build/dids/PolygonDidRegistrar.mjs' import type { DidDocument, KeyDidCreateOptions, PeerDidNumAlgo2CreateOptions } from '@credo-ts/core' import { transformPrivateKeyToPrivateJwk, transformSeedToPrivateJwk } from '@credo-ts/askar' diff --git a/src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts b/src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts index 9af3aa34..c1aa7850 100644 --- a/src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts +++ b/src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts @@ -14,7 +14,6 @@ import { SignerMethod } from '../../../enums' import { CreateAuthorizationRequest, OpenId4VCDCQLVerificationSessionRecord, - OpenId4VcIssuerX5c, ClientIdPrefix, OpenId4VcIssuerX5cOptions, ResponseModeEnum, diff --git a/src/routes/routes.ts b/src/routes/routes.ts new file mode 100644 index 00000000..a504929e --- /dev/null +++ b/src/routes/routes.ts @@ -0,0 +1,3993 @@ +/* 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 = { + "Curve": { + "dataType": "refAlias", + "type": {"dataType":"union","subSchemas":[{"dataType":"enum","enums":["Ed25519"]},{"dataType":"enum","enums":["X25519"]},{"dataType":"enum","enums":["P-256"]},{"dataType":"enum","enums":["P-384"]},{"dataType":"enum","enums":["P-521"]},{"dataType":"enum","enums":["secp256k1"]}],"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 + "AuthorityAndSubjectKeyDto": { + "dataType": "refObject", + "properties": { + "seed": {"dataType":"string"}, + "publicKeyBase58": {"dataType":"string"}, + "keyType": {"ref":"Curve"}, + }, + "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": {"dataType":"any","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 + "PublicJwk": { + "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 + "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 + "AnyUint8Array": { + "dataType": "refAlias", + "type": {"ref":"Uint8Array","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 + "X509Certificate": { + "dataType": "refObject", + "properties": { + "publicJwk": {"ref":"PublicJwk","required":true}, + "privateKey": {"ref":"AnyUint8Array"}, + }, + "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 + "DcqlDefinition": { + "dataType": "refObject", + "properties": { + "query": {"dataType":"any","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":{"keyId":{"dataType":"string"},"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 + "ClientIdPrefix": { + "dataType": "refEnum", + "enums": ["x509_san_dns","x509_hash"], + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "OpenId4VcIssuerX5cOptions": { + "dataType": "refAlias", + "type": {"dataType":"intersection","subSchemas":[{"ref":"OpenId4VcIssuerX5c"},{"dataType":"nestedObjectLiteral","nestedProperties":{"clientIdPrefix":{"ref":"ClientIdPrefix"}}}],"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":"OpenId4VcIssuerX5cOptions"}],"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 + "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 + "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 + "OpenId4VCDCQLVerificationSessionRecord": { + "dataType": "refObject", + "properties": { + "verificationSessionId": {"dataType":"string","required":true}, + "authorizationResponse": {"ref":"Record_string.unknown_","required":true}, + "origin": {"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 + "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 + "KeyAttestationRequiredRecords": { + "dataType": "refObject", + "properties": { + "key_storage": {"dataType":"array","array":{"dataType":"string"},"required":true}, + "user_authentication": {"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 + "ProofTypeConfig": { + "dataType": "refObject", + "properties": { + "proof_signing_alg_values_supported": {"dataType":"array","array":{"dataType":"string"},"required":true}, + "key_attestations_required": {"ref":"KeyAttestationRequiredRecords"}, + }, + "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 + "ClaimDisplay": { + "dataType": "refObject", + "properties": { + "name": {"dataType":"string","required":true}, + "locale": {"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 + "Claim": { + "dataType": "refObject", + "properties": { + "path": {"dataType":"array","array":{"dataType":"string"},"required":true}, + "display": {"dataType":"array","array":{"dataType":"refObject","ref":"ClaimDisplay"}}, + "mandatory": {"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 + "CredentialMetadata": { + "dataType": "refObject", + "properties": { + "display": {"dataType":"array","array":{"dataType":"refObject","ref":"CredentialDisplay"},"required":true}, + "claims": {"dataType":"array","array":{"dataType":"refObject","ref":"Claim"},"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 + "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"}, + "cryptographic_binding_methods_supported": {"dataType":"array","array":{"dataType":"string"}}, + "credential_signing_alg_values_supported": {"dataType":"union","subSchemas":[{"dataType":"array","array":{"dataType":"string"}},{"dataType":"array","array":{"dataType":"double"}}]}, + "proof_types_supported": {"ref":"Record_string.ProofTypeConfig_"}, + "credential_definition": {"ref":"CredentialDefinition"}, + "credential_metadata": {"ref":"CredentialMetadata"}, + }, + "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":"any"}, + "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 + "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 + "DisclosureFrameForOffer": { + "dataType": "refObject", + "properties": { + "_sd": {"dataType":"array","array":{"dataType":"string"}}, + }, + "additionalProperties": {"dataType":"union","subSchemas":[{"ref":"DisclosureFrameForOffer"},{"dataType":"array","array":{"dataType":"string"}},{"dataType":"undefined"}]}, + }, + // WARNING: This 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","dc+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":{"keyId":{"dataType":"string"},"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":"DisclosureFrameForOffer"}, + }, + "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":{"keyId":{"dataType":"string"},"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 + "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 + "OpenId4VciOfferW3cCredential": { + "dataType": "refObject", + "properties": { + "credentialSupportedId": {"dataType":"string","required":true}, + "format": {"ref":"OpenId4VciCredentialFormatProfile","required":true}, + "signerOptions": {"dataType":"nestedObjectLiteral","nestedProperties":{"keyId":{"dataType":"string"},"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 + "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 + "EncodedX509Certificate": { + "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 + "ResolveOpenId4VpAuthorizationRequestOptions": { + "dataType": "refObject", + "properties": { + "trustedCertificates": {"dataType":"array","array":{"dataType":"refAlias","ref":"EncodedX509Certificate"}}, + "origin": {"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}, + "options": {"ref":"ResolveOpenId4VpAuthorizationRequestOptions"}, + }, + "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 + "CredentialType": { + "dataType": "refEnum", + "enums": ["sd-jwt-vc","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 + "DeleteCredentialBody": { + "dataType": "refObject", + "properties": { + "credentialType": {"ref":"CredentialType","required":true}, + "credentialId": {"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 + "TenantConfig": { + "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 + "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 + "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 + "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 + "DidCommPlaintextMessage": { + "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 + "DidCommHandshakeProtocol": { + "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 + "DidCommMessage": { + "dataType": "refAlias", + "type": {"ref":"DidCommPlaintextMessage","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 + "PublicJwk_Ed25519PublicJwk_": { + "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 + "DidCommRouting": { + "dataType": "refObject", + "properties": { + "endpoints": {"dataType":"array","array":{"dataType":"string"},"required":true}, + "recipientKey": {"ref":"PublicJwk_Ed25519PublicJwk_","required":true}, + "routingKeys": {"dataType":"array","array":{"dataType":"refObject","ref":"PublicJwk_Ed25519PublicJwk_"},"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 + "DidCommAttachmentData": { + "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 + "DidCommAttachment": { + "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":"DidCommAttachmentData","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":"DidCommHandshakeProtocol"}}, + "messages": {"dataType":"array","array":{"dataType":"refAlias","ref":"DidCommMessage"}}, + "multiUseInvitation": {"dataType":"boolean"}, + "autoAcceptConnection": {"dataType":"boolean"}, + "routing": {"ref":"DidCommRouting"}, + "appendedAttachments": {"dataType":"array","array":{"dataType":"refObject","ref":"DidCommAttachment"}}, + "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 + "DidCommOutOfBandRecord": { + "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","required":true},"imageUrl":{"dataType":"string"},"autoAcceptInvitation":{"dataType":"boolean"},"autoAcceptConnection":{"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","required":true}, + "imageUrl": {"dataType":"string"}, + "autoAcceptInvitation": {"dataType":"boolean"}, + "autoAcceptConnection": {"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","required":true}, + "imageUrl": {"dataType":"string"}, + "autoAcceptInvitation": {"dataType":"boolean"}, + "autoAcceptConnection": {"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","required":true}, + "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 + "DidCommDidExchangeState": { + "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 + "DidCommConnectionRecord": { + "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 + "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 + "KeyAlgorithm": { + "dataType": "refEnum", + "enums": ["a128gcm","a256gcm","a128cbchs256","a256cbchs512","a128kw","a256kw","bls12381g1","bls12381g2","c20p","xc20p","ed25519","x25519","k256","p256","p384"], + }, + // WARNING: This 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 + "DidCreate": { + "dataType": "refObject", + "properties": { + "keyType": {"ref":"KeyAlgorithm"}, + "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 + "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 + "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 + "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_any-or-DataIntegrityProofOptions_": { + "dataType": "refAlias", + "type": {"dataType":"union","subSchemas":[{"dataType":"union","subSchemas":[{"dataType":"any"},{"ref":"DataIntegrityProofOptions"}]},{"dataType":"array","array":{"dataType":"union","subSchemas":[{"dataType":"any"},{"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_any-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 + "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": { + "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 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"}, + authorizationRequestId: {"in":"query","name":"authorizationRequestId","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 argsVerificationSessionsController_verifyDcqlProofRequest: Record = { + request: {"in":"request","name":"request","required":true,"dataType":"object"}, + verifydcqlProofRquest: {"in":"body","name":"verifydcqlProofRquest","required":true,"ref":"OpenId4VCDCQLVerificationSessionRecord"}, + }; + app.post('/openid4vc/verification-sessions/verify-authorization-response', + authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), + ...(fetchMiddlewares(VerificationSessionsController)), + ...(fetchMiddlewares(VerificationSessionsController.prototype.verifyDcqlProofRequest)), + + async function VerificationSessionsController_verifyDcqlProofRequest(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_verifyDcqlProofRequest, 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: 'verifyDcqlProofRequest', + 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 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 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 argsHolderController_delete: Record = { + agentReq: {"in":"request","name":"agentReq","required":true,"dataType":"object"}, + body: {"in":"body","name":"body","required":true,"ref":"DeleteCredentialBody"}, + }; + app.delete('/openid4vc/holder/credential', + authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), + ...(fetchMiddlewares(HolderController)), + ...(fetchMiddlewares(HolderController.prototype.delete)), + + async function HolderController_delete(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_delete, 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: 'delete', + 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 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 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_createLegacyConnectionlessInvitation: Record = { + request: {"in":"request","name":"request","required":true,"dataType":"object"}, + config: {"in":"body","name":"config","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"routing":{"ref":"DidCommRouting"},"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 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":"DidCommDidExchangeState"}, + 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 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 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_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 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 1dccfa78..f8a0220b 100644 --- a/src/routes/swagger.json +++ b/src/routes/swagger.json @@ -7,25 +7,16 @@ "requestBodies": {}, "responses": {}, "schemas": { - "KeyAlgorithm": { + "Curve": { + "type": "string", "enum": [ - "a128gcm", - "a256gcm", - "a128cbchs256", - "a256cbchs512", - "a128kw", - "a256kw", - "bls12381g1", - "bls12381g2", - "c20p", - "xc20p", - "ed25519", - "x25519", - "k256", - "p256", - "p384" - ], - "type": "string" + "Ed25519", + "X25519", + "P-256", + "P-384", + "P-521", + "secp256k1" + ] }, "AuthorityAndSubjectKeyDto": { "properties": { @@ -38,7 +29,7 @@ "example": "3yPQbnk6WwLgX8K3JZ4t7vBnJ8XqY2mMpRcD9fNvGtHw" }, "keyType": { - "$ref": "#/components/schemas/KeyAlgorithm", + "$ref": "#/components/schemas/Curve", "example": "p256" } }, @@ -399,1150 +390,944 @@ "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": { + "JwtObject": { "properties": { - "text": { - "type": "string" + "alg": { + "items": { + "type": "string" + }, + "type": "array" } }, "required": [ - "text" + "alg" ], "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" - }, - "DidCommPlaintextMessage": { + "LdpObject": { "properties": { - "@type": { - "type": "string" - }, - "@id": { - "type": "string" - }, - "~thread": { - "properties": { - "pthid": { - "type": "string" - }, - "thid": { - "type": "string" - } + "proof_type": { + "items": { + "type": "string" }, - "type": "object" + "type": "array" } }, "required": [ - "@type", - "@id" - ], - "type": "object", - "additionalProperties": {} - }, - "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": [ - "https://didcomm.org/didexchange/1.x", - "https://didcomm.org/connections/1.x" + "proof_type" ], - "type": "string" - }, - "DidCommMessage": { - "$ref": "#/components/schemas/DidCommPlaintextMessage" - }, - "PublicJwk_Ed25519PublicJwk_": { - "properties": {}, "type": "object", "additionalProperties": false }, - "DidCommRouting": { + "DiObject": { "properties": { - "endpoints": { + "proof_type": { "items": { "type": "string" }, "type": "array" }, - "recipientKey": { - "$ref": "#/components/schemas/PublicJwk_Ed25519PublicJwk_" - }, - "routingKeys": { + "cryptosuite": { "items": { - "$ref": "#/components/schemas/PublicJwk_Ed25519PublicJwk_" + "type": "string" }, "type": "array" - }, - "mediatorId": { - "type": "string" } }, "required": [ - "endpoints", - "recipientKey", - "routingKeys" + "proof_type", + "cryptosuite" ], "type": "object", "additionalProperties": false }, - "Pick_JwsGeneralFormat.Exclude_keyofJwsGeneralFormat.payload__": { + "SdJwtObject": { "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" + "undefined": { + "items": { + "type": "string" + }, + "type": "array" } }, - "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_" + "additionalProperties": false }, - "JwsFlattenedDetachedFormat": { + "MsoMdocObject": { "properties": { - "signatures": { + "alg": { "items": { - "$ref": "#/components/schemas/JwsDetachedFormat" + "type": "string" }, "type": "array" } }, "required": [ - "signatures" + "alg" ], "type": "object", "additionalProperties": false }, - "DidCommAttachmentData": { - "description": "A JSON object that gives access to the actual content of the attachment", + "Format": { "properties": { - "base64": { - "type": "string", - "description": "Base64-encoded data, when representing arbitrary content inline instead of via links. Optional." + "jwt": { + "$ref": "#/components/schemas/JwtObject" }, - "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." + "jwt_vc": { + "$ref": "#/components/schemas/JwtObject" }, - "links": { - "items": { - "type": "string" - }, - "type": "array", - "description": "A list of zero or more locations at which the content may be fetched. Optional." + "jwt_vc_json": { + "$ref": "#/components/schemas/JwtObject" }, - "jws": { - "anyOf": [ - { - "$ref": "#/components/schemas/JwsDetachedFormat" - }, - { - "$ref": "#/components/schemas/JwsFlattenedDetachedFormat" - } - ], - "description": "A JSON Web Signature over the content of the attachment. Optional." + "jwt_vp": { + "$ref": "#/components/schemas/JwtObject" }, - "sha256": { - "type": "string", - "description": "The hash of the content. Optional." - } - }, - "type": "object", - "additionalProperties": false - }, - "DidCommAttachment": { - "description": "Represents DIDComm attachment\nhttps://github.com/hyperledger/aries-rfcs/blob/master/concepts/0017-attachments/README.md", - "properties": { - "id": { - "type": "string" + "jwt_vp_json": { + "$ref": "#/components/schemas/JwtObject" }, - "description": { - "type": "string", - "description": "An optional human-readable description of the content." + "ldp": { + "$ref": "#/components/schemas/LdpObject" }, - "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." + "ldp_vc": { + "$ref": "#/components/schemas/LdpObject" }, - "mimeType": { - "type": "string", - "description": "Describes the MIME type of the attached content. Optional but recommended." + "ldp_vp": { + "$ref": "#/components/schemas/LdpObject" }, - "lastmodTime": { - "type": "string", - "format": "date-time", - "description": "A hint about when the content in this attachment was last modified." + "di": { + "$ref": "#/components/schemas/DiObject" }, - "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." + "di_vc": { + "$ref": "#/components/schemas/DiObject" }, - "data": { - "$ref": "#/components/schemas/DidCommAttachmentData" + "di_vp": { + "$ref": "#/components/schemas/DiObject" + }, + "undefined": { + "$ref": "#/components/schemas/SdJwtObject" + }, + "mso_mdoc": { + "$ref": "#/components/schemas/MsoMdocObject" } }, - "required": [ - "id", - "data" - ], "type": "object", "additionalProperties": false }, - "CreateInvitationOptions": { + "Issuance": { "properties": { - "label": { - "type": "string" - }, - "alias": { - "type": "string" - }, - "imageUrl": { - "type": "string" - }, - "goalCode": { - "type": "string" - }, - "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": { + "manifest": { "type": "string" } }, "type": "object", - "additionalProperties": false + "additionalProperties": {} }, - "RecipientKeyOption": { + "Optionality": { + "type": "string", + "enum": [ + "required", + "preferred" + ] + }, + "Directives": { + "type": "string", + "enum": [ + "required", + "allowed", + "disallowed" + ] + }, + "PdStatus": { "properties": { - "recipientKey": { - "type": "string" + "directive": { + "$ref": "#/components/schemas/Directives" } }, "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" + "Statuses": { + "properties": { + "active": { + "$ref": "#/components/schemas/PdStatus" + }, + "suspended": { + "$ref": "#/components/schemas/PdStatus" + }, + "revoked": { + "$ref": "#/components/schemas/PdStatus" + } + }, + "type": "object", + "additionalProperties": false }, - "SingleOrArray_string-or-Record_string.unknown__": { + "OneOfNumberStringBoolean": { "anyOf": [ { - "anyOf": [ - { - "type": "string" - }, - { - "$ref": "#/components/schemas/Record_string.unknown_" - } - ] + "type": "boolean" }, { - "items": { - "anyOf": [ - { - "type": "string" - }, - { - "$ref": "#/components/schemas/Record_string.unknown_" - } - ] - }, - "type": "array" + "type": "number", + "format": "double" + }, + { + "type": "string" } ] }, - "OutOfBandDidCommService": { - "properties": { - "id": { - "type": "string" - }, - "serviceEndpoint": { - "type": "string" + "OneOfNumberString": { + "anyOf": [ + { + "type": "number", + "format": "double" }, - "type": { + { "type": "string" + } + ] + }, + "FilterV2": { + "properties": { + "const": { + "$ref": "#/components/schemas/OneOfNumberStringBoolean" }, - "recipientKeys": { + "enum": { "items": { - "type": "string" + "$ref": "#/components/schemas/OneOfNumberStringBoolean" }, "type": "array" }, - "routingKeys": { - "items": { - "type": "string" - }, - "type": "array" + "exclusiveMinimum": { + "$ref": "#/components/schemas/OneOfNumberString" }, - "accept": { - "items": { - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "id", - "serviceEndpoint", - "type", - "recipientKeys" - ], - "type": "object", - "additionalProperties": false - }, - "OutOfBandInvitationSchema": { - "properties": { - "@id": { + "exclusiveMaximum": { + "$ref": "#/components/schemas/OneOfNumberString" + }, + "format": { "type": "string" }, - "@type": { + "formatMaximum": { "type": "string" }, - "label": { + "formatMinimum": { "type": "string" }, - "goalCode": { + "formatExclusiveMaximum": { "type": "string" }, - "goal": { + "formatExclusiveMinimum": { "type": "string" }, - "accept": { - "items": { - "type": "string" - }, - "type": "array" + "minLength": { + "type": "number", + "format": "double" }, - "handshake_protocols": { - "items": { - "$ref": "#/components/schemas/CustomHandshakeProtocol" - }, - "type": "array" + "maxLength": { + "type": "number", + "format": "double" }, - "services": { - "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/OutOfBandDidCommService" - }, - { - "type": "string" - } - ] - }, - "type": "array" + "minimum": { + "$ref": "#/components/schemas/OneOfNumberString" }, - "imageUrl": { + "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" } }, - "required": [ - "@type", - "label", - "services" - ], "type": "object", "additionalProperties": false }, - "Pick_ReceiveOutOfBandInvitationConfig.Exclude_keyofReceiveOutOfBandInvitationConfig.routing__": { + "FilterV2Items": { "properties": { - "alias": { - "type": "string" + "const": { + "$ref": "#/components/schemas/OneOfNumberStringBoolean" }, - "label": { + "enum": { + "items": { + "$ref": "#/components/schemas/OneOfNumberStringBoolean" + }, + "type": "array" + }, + "exclusiveMinimum": { + "$ref": "#/components/schemas/OneOfNumberString" + }, + "exclusiveMaximum": { + "$ref": "#/components/schemas/OneOfNumberString" + }, + "format": { "type": "string" }, - "imageUrl": { + "formatMaximum": { "type": "string" }, - "autoAcceptInvitation": { - "type": "boolean" + "formatMinimum": { + "type": "string" }, - "autoAcceptConnection": { - "type": "boolean" + "formatExclusiveMaximum": { + "type": "string" }, - "reuseConnection": { - "type": "boolean" + "formatExclusiveMinimum": { + "type": "string" }, - "acceptInvitationTimeoutMs": { + "minLength": { "type": "number", "format": "double" }, - "ourDid": { - "type": "string" - } - }, - "required": [ - "label" - ], - "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" + "maxLength": { + "type": "number", + "format": "double" }, - "autoAcceptInvitation": { - "type": "boolean" + "minimum": { + "$ref": "#/components/schemas/OneOfNumberString" }, - "autoAcceptConnection": { - "type": "boolean" + "maximum": { + "$ref": "#/components/schemas/OneOfNumberString" }, - "reuseConnection": { - "type": "boolean" + "not": { + "additionalProperties": false, + "type": "object" }, - "acceptInvitationTimeoutMs": { - "type": "number", - "format": "double" + "pattern": { + "type": "string" }, - "ourDid": { + "type": { "type": "string" }, - "invitation": { - "$ref": "#/components/schemas/OutOfBandInvitationSchema" + "contains": { + "$ref": "#/components/schemas/FilterV2" + }, + "items": { + "$ref": "#/components/schemas/FilterV2Items" } }, - "required": [ - "label", - "invitation" - ], "type": "object", "additionalProperties": false }, - "ReceiveInvitationByUrlProps": { + "FieldV2": { "properties": { - "alias": { + "id": { "type": "string" }, - "label": { - "type": "string" + "path": { + "items": { + "type": "string" + }, + "type": "array" }, - "imageUrl": { + "purpose": { "type": "string" }, - "autoAcceptInvitation": { - "type": "boolean" + "filter": { + "$ref": "#/components/schemas/FilterV2" }, - "autoAcceptConnection": { - "type": "boolean" + "predicate": { + "$ref": "#/components/schemas/Optionality" }, - "reuseConnection": { + "intent_to_retain": { "type": "boolean" }, - "acceptInvitationTimeoutMs": { - "type": "number", - "format": "double" - }, - "ourDid": { + "name": { "type": "string" }, - "invitationUrl": { - "type": "string" + "optional": { + "type": "boolean" } }, "required": [ - "label", - "invitationUrl" + "path" ], "type": "object", "additionalProperties": false }, - "AcceptInvitationConfig": { + "HolderSubject": { "properties": { - "autoAcceptConnection": { - "type": "boolean" - }, - "reuseConnection": { - "type": "boolean" - }, - "label": { - "type": "string" - }, - "alias": { - "type": "string" - }, - "imageUrl": { - "type": "string" + "field_id": { + "items": { + "type": "string" + }, + "type": "array" }, - "mediatorId": { - "type": "string" + "directive": { + "$ref": "#/components/schemas/Optionality" } }, "required": [ - "label" + "field_id", + "directive" ], "type": "object", "additionalProperties": false }, - "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": { + "ConstraintsV2": { "properties": { - "contentType": { - "type": "string" + "limit_disclosure": { + "$ref": "#/components/schemas/Optionality" }, - "error": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "string", - "enum": [ - "invalidDid", - "notFound", - "representationNotSupported", - "unsupportedDidMethod" - ] - } - ] + "statuses": { + "$ref": "#/components/schemas/Statuses" }, - "message": { - "type": "string" + "fields": { + "items": { + "$ref": "#/components/schemas/FieldV2" + }, + "type": "array" }, - "servedFromCache": { - "type": "boolean", - "description": "Whether the did document was served from the cache" + "subject_is_issuer": { + "$ref": "#/components/schemas/Optionality" }, - "servedFromDidRecord": { - "type": "boolean", - "description": "Whether the did document was served from a local did record" + "is_holder": { + "items": { + "$ref": "#/components/schemas/HolderSubject" + }, + "type": "array" + }, + "same_subject": { + "items": { + "$ref": "#/components/schemas/HolderSubject" + }, + "type": "array" } }, "type": "object", "additionalProperties": false }, - "DIDDocumentMetadata": { - "description": "Represents metadata about the DID document resulting from a {@link Resolvable.resolve} operation.", + "InputDescriptorV2Model": { "properties": { - "created": { + "id": { "type": "string" }, - "updated": { + "name": { "type": "string" }, - "deactivated": { - "type": "boolean" - }, - "versionId": { + "purpose": { "type": "string" }, - "nextUpdate": { - "type": "string" + "format": { + "$ref": "#/components/schemas/Format" }, - "nextVersionId": { - "type": "string" + "group": { + "items": { + "type": "string" + }, + "type": "array" }, - "equivalentId": { - "type": "string" + "issuance": { + "items": { + "$ref": "#/components/schemas/Issuance" + }, + "type": "array" }, - "canonicalId": { - "type": "string" + "constraints": { + "$ref": "#/components/schemas/ConstraintsV2" } }, + "required": [ + "id", + "constraints" + ], "type": "object", "additionalProperties": false }, - "Did": { + "Rules": { "type": "string", - "example": "did:key:z6Mkk7yqnGF3YwTrLpqrW6PGsKci7dNqh1CjnvMbzrMerSeL" - }, - "DidDocument": { - "$ref": "#/components/schemas/Record_string.any_" + "enum": [ + "all", + "pick" + ] }, - "DidCreate": { + "SubmissionRequirement": { "properties": { - "keyType": { - "$ref": "#/components/schemas/KeyAlgorithm" - }, - "seed": { - "type": "string" - }, - "domain": { - "type": "string" - }, - "method": { + "name": { "type": "string" }, - "network": { + "purpose": { "type": "string" }, - "did": { - "type": "string" + "rule": { + "$ref": "#/components/schemas/Rules" }, - "role": { - "type": "string" + "count": { + "type": "number", + "format": "double" }, - "endorserDid": { - "type": "string" + "min": { + "type": "number", + "format": "double" }, - "didDocument": { - "$ref": "#/components/schemas/DidDocument" + "max": { + "type": "number", + "format": "double" }, - "privatekey": { + "from": { "type": "string" }, - "endpoint": { - "type": "string" + "from_nested": { + "items": { + "$ref": "#/components/schemas/SubmissionRequirement" + }, + "type": "array" } }, "required": [ - "method" + "rule" ], "type": "object", "additionalProperties": false }, - "DidRecord": { - "$ref": "#/components/schemas/Record_string.unknown_" - }, - "AgentInfo": { + "InputDescriptorV2": { "properties": { - "label": { + "id": { "type": "string" }, - "endpoints": { + "name": { + "type": "string" + }, + "purpose": { + "type": "string" + }, + "format": { + "$ref": "#/components/schemas/Format" + }, + "group": { "items": { "type": "string" }, "type": "array" }, - "isInitialized": { - "type": "boolean" + "issuance": { + "items": { + "$ref": "#/components/schemas/Issuance" + }, + "type": "array" }, - "publicDid": {} + "constraints": { + "$ref": "#/components/schemas/ConstraintsV2" + } }, "required": [ - "label", - "endpoints", - "isInitialized", - "publicDid" + "id", + "constraints" ], "type": "object", "additionalProperties": false }, - "AgentToken": { + "PresentationDefinitionV2": { "properties": { - "token": { + "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": [ - "token" + "id", + "input_descriptors" ], "type": "object", "additionalProperties": false }, - "Partial_W3cCredentialValidations_": { - "properties": {}, - "type": "object", - "description": "Make all properties in T optional" - }, - "Error": { + "DifPresentationExchangeDefinitionV2Model": { "properties": { - "name": { + "id": { "type": "string" }, - "message": { + "name": { "type": "string" }, - "stack": { + "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": [ - "name", - "message" + "id", + "input_descriptors" ], "type": "object", "additionalProperties": false }, - "W3cVerifyResult_W3cCredentialValidations_": { + "PresentationDefinition": { "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" + "definition": { + "$ref": "#/components/schemas/DifPresentationExchangeDefinitionV2Model" } }, "required": [ - "isValid", - "validations" + "definition" ], "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_" - } - ] + "DcqlDefinition": { + "properties": { + "query": {} }, - "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" + "required": [ + "query" ], - "type": "string" + "type": "object", + "additionalProperties": false }, - "SignerMethod": { + "ResponseModeEnum": { "enum": [ - "did", - "x5c" + "direct_post", + "direct_post.jwt", + "dc_api", + "dc_api.jwt" ], "type": "string" }, - "OpenId4VciOfferSdJwtCredential": { + "OpenId4VcJwtIssuerDid": { "properties": { - "type": { + "didUrl": { "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" + "method": { + "type": "string", + "enum": [ + "did" ], - "type": "object" - }, - "payload": { - "properties": { - "vct": { - "type": "string" - } - }, - "additionalProperties": {}, - "type": "object" - }, - "disclosureFrame": { - "$ref": "#/components/schemas/Record_string.boolean-or-Record_string.boolean__" + "nullable": false } }, "required": [ - "credentialSupportedId", - "format", - "signerOptions", - "payload" + "didUrl", + "method" ], - "type": "object", - "additionalProperties": false + "type": "object" }, - "Partial_ValidityInfo_": { + "OpenId4VcIssuerX5c": { "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" - }, - "challenge": { - "type": "string" - }, - "nonce": { + "keyId": { "type": "string" }, - "created": { + "alg": { "type": "string" }, - "expires": { - "type": "string" + "x5c": { + "items": { + "type": "string" + }, + "type": "array" }, - "proofValue": { + "issuer": { "type": "string" }, - "previousProof": { - "type": "string" + "method": { + "type": "string", + "enum": [ + "x5c" + ], + "nullable": false } }, "required": [ - "type", - "cryptosuite", - "verificationMethod", - "proofPurpose" + "x5c", + "method" ], - "type": "object", - "additionalProperties": false + "type": "object" }, - "SingleOrArray_any-or-DataIntegrityProofOptions_": { - "anyOf": [ + "ClientIdPrefix": { + "enum": [ + "x509_san_dns", + "x509_hash" + ], + "type": "string" + }, + "OpenId4VcIssuerX5cOptions": { + "allOf": [ { - "anyOf": [ - {}, - { - "$ref": "#/components/schemas/DataIntegrityProofOptions" - } - ] + "$ref": "#/components/schemas/OpenId4VcIssuerX5c" }, { - "items": { - "anyOf": [ - {}, - { - "$ref": "#/components/schemas/DataIntegrityProofOptions" - } - ] + "properties": { + "clientIdPrefix": { + "$ref": "#/components/schemas/ClientIdPrefix" + } }, - "type": "array" + "type": "object" } ] }, - "LinkedDataProof": { - "description": "Linked Data Proof", + "CreateAuthorizationRequest": { "properties": { - "type": { - "type": "string" - }, - "proofPurpose": { - "type": "string" - }, - "verificationMethod": { - "type": "string" - }, - "created": { + "verifierId": { "type": "string" }, - "domain": { - "type": "string" + "presentationExchange": { + "$ref": "#/components/schemas/PresentationDefinition" }, - "challenge": { - "type": "string" + "dcql": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/components/schemas/DcqlDefinition" + } + ] }, - "jws": { - "type": "string" + "responseMode": { + "$ref": "#/components/schemas/ResponseModeEnum" }, - "proofValue": { - "type": "string" + "requestSigner": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenId4VcJwtIssuerDid" + }, + { + "$ref": "#/components/schemas/OpenId4VcIssuerX5cOptions" + } + ] }, - "nonce": { - "type": "string" + "expectedOrigins": { + "items": { + "type": "string" + }, + "type": "array" } }, "required": [ - "type", - "proofPurpose", - "verificationMethod", - "created" + "verifierId", + "requestSigner" ], "type": "object", "additionalProperties": false }, - "DataIntegrityProof": { - "description": "Linked Data Proof", + "Record_string.unknown_": { + "properties": {}, + "additionalProperties": {}, + "type": "object", + "description": "Construct a type with a set of properties K of type T" + }, + "OpenId4VcVerificationSessionRecord": { + "$ref": "#/components/schemas/Record_string.unknown_" + }, + "OpenId4VcVerificationSessionState": { + "enum": [ + "RequestCreated", + "RequestUriRetrieved", + "ResponseVerified", + "Error" + ], + "type": "string" + }, + "OpenId4VCDCQLVerificationSessionRecord": { "properties": { - "type": { + "verificationSessionId": { "type": "string" }, - "cryptosuite": { - "type": "string" + "authorizationResponse": { + "$ref": "#/components/schemas/Record_string.unknown_" }, - "proofPurpose": { + "origin": { "type": "string" - }, - "verificationMethod": { + } + }, + "required": [ + "verificationSessionId", + "authorizationResponse" + ], + "type": "object", + "additionalProperties": false + }, + "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" }, - "domain": { + "alt_text": { "type": "string" - }, - "challenge": { + } + }, + "type": "object", + "additionalProperties": {} + }, + "CredentialDisplay": { + "properties": { + "name": { "type": "string" }, - "nonce": { + "locale": { "type": "string" }, - "created": { + "logo": { + "$ref": "#/components/schemas/Logo" + } + }, + "type": "object", + "additionalProperties": {} + }, + "AuthorizationServerClientAuth": { + "properties": { + "clientId": { "type": "string" }, - "expires": { + "clientSecret": { "type": "string" - }, - "proofValue": { + } + }, + "required": [ + "clientId", + "clientSecret" + ], + "type": "object", + "additionalProperties": false + }, + "AuthorizationServerConfig": { + "properties": { + "issuer": { "type": "string" }, - "previousProof": { - "type": "string" + "clientAuthentication": { + "$ref": "#/components/schemas/AuthorizationServerClientAuth" } }, "required": [ - "type", - "cryptosuite", - "proofPurpose", - "verificationMethod" + "issuer" ], "type": "object", "additionalProperties": false }, - "SingleOrArray_LinkedDataProof-or-DataIntegrityProof_": { - "anyOf": [ - { - "anyOf": [ - { - "$ref": "#/components/schemas/LinkedDataProof" - }, - { - "$ref": "#/components/schemas/DataIntegrityProof" - } - ] + "KeyAttestationRequiredRecords": { + "properties": { + "key_storage": { + "items": { + "type": "string" + }, + "type": "array" }, - { + "user_authentication": { "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/LinkedDataProof" - }, - { - "$ref": "#/components/schemas/DataIntegrityProof" - } - ] + "type": "string" }, "type": "array" } - ] + }, + "required": [ + "key_storage", + "user_authentication" + ], + "type": "object", + "additionalProperties": false }, - "W3cJsonLdVerifiableCredential": { + "ProofTypeConfig": { "properties": { - "context": { + "proof_signing_alg_values_supported": { "items": { - "anyOf": [ - { - "type": "string" - }, - { - "$ref": "#/components/schemas/JsonObject" - } - ] + "type": "string" }, "type": "array" }, - "id": { - "type": "string" - }, + "key_attestations_required": { + "$ref": "#/components/schemas/KeyAttestationRequiredRecords" + } + }, + "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" - }, - "input_descriptors": { - "items": { - "$ref": "#/components/schemas/InputDescriptorV2Model" - }, - "type": "array" - }, - "frame": { - "additionalProperties": false, - "type": "object" } }, "required": [ - "id", - "input_descriptors" + "type" ], "type": "object", - "additionalProperties": false + "additionalProperties": {} }, - "PresentationDefinition": { + "ClaimDisplay": { "properties": { - "definition": { - "$ref": "#/components/schemas/DifPresentationExchangeDefinitionV2Model" + "name": { + "type": "string" + }, + "locale": { + "type": "string" } }, "required": [ - "definition" + "name", + "locale" ], "type": "object", "additionalProperties": false }, - "DcqlClaim": { + "Claim": { "properties": { "path": { "items": { @@ -1550,7 +1335,13 @@ }, "type": "array" }, - "intent_to_retain": { + "display": { + "items": { + "$ref": "#/components/schemas/ClaimDisplay" + }, + "type": "array" + }, + "mandatory": { "type": "boolean" } }, @@ -1560,190 +1351,184 @@ "type": "object", "additionalProperties": false }, - "DcqlCredential": { + "CredentialMetadata": { "properties": { - "id": { - "type": "string" - }, - "format": { - "type": "string" - }, - "meta": { - "$ref": "#/components/schemas/Record_string.any_" - }, - "require_cryptographic_holder_binding": { - "type": "boolean" + "display": { + "items": { + "$ref": "#/components/schemas/CredentialDisplay" + }, + "type": "array" }, "claims": { "items": { - "$ref": "#/components/schemas/DcqlClaim" + "$ref": "#/components/schemas/Claim" }, "type": "array" } }, "required": [ - "id", - "format", + "display", "claims" ], "type": "object", "additionalProperties": false }, - "DcqlQuery": { + "CredentialConfigurationSupportedWithFormats": { "properties": { - "combine": { - "type": "string", - "enum": [ - "all", - "any" + "format": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "string", + "enum": [ + "vc+sd-jwt", + "mso_mdoc", + "jwt_vc_json" + ] + } ] }, - "credentials": { + "vct": { + "type": "string" + }, + "doctype": { + "type": "string" + }, + "scope": { + "type": "string" + }, + "cryptographic_binding_methods_supported": { "items": { - "$ref": "#/components/schemas/DcqlCredential" + "type": "string" }, "type": "array" + }, + "credential_signing_alg_values_supported": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "items": { + "type": "number", + "format": "double" + }, + "type": "array" + } + ] + }, + "proof_types_supported": { + "$ref": "#/components/schemas/Record_string.ProofTypeConfig_" + }, + "credential_definition": { + "$ref": "#/components/schemas/CredentialDefinition" + }, + "credential_metadata": { + "$ref": "#/components/schemas/CredentialMetadata" } }, "required": [ - "credentials" - ], - "type": "object", - "additionalProperties": false - }, - "DcqlDefinition": { - "properties": { - "query": { - "$ref": "#/components/schemas/DcqlQuery" - } - }, - "required": [ - "credential", - "proof" + "format" ], "type": "object", "additionalProperties": false }, - "TenantConfig": { - "properties": { - "label": { - "type": "string" - } - }, - "required": [ - "label" - ], - "type": "object" - }, - "MetadataValue": { - "$ref": "#/components/schemas/Record_string.any_" - }, - "MetadataBase": { + "Record_string.CredentialConfigurationSupportedWithFormats_": { "properties": {}, "additionalProperties": { - "$ref": "#/components/schemas/MetadataValue" + "$ref": "#/components/schemas/CredentialConfigurationSupportedWithFormats" }, - "type": "object" + "type": "object", + "description": "Construct a type with a set of properties K of type T" }, - "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", + "BatchCredentialIssuanceOptions": { "properties": { - "data": { - "$ref": "#/components/schemas/MetadataBase" + "batchSize": { + "type": "number", + "format": "double" } }, "required": [ - "data" + "batchSize" ], "type": "object", "additionalProperties": false }, - "Pick_CustomTenantConfig.Exclude_keyofCustomTenantConfig.walletConfig__": { + "CreateIssuerOptions": { "properties": { - "label": { + "issuerId": { "type": "string" }, - "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 - }, - "JwtObject": { - "properties": { - "alg": { + "accessTokenSignerKeyType": {}, + "display": { "items": { - "type": "string" + "$ref": "#/components/schemas/CredentialDisplay" }, "type": "array" - } - }, - "required": [ - "alg" - ], - "type": "object", - "additionalProperties": false - }, - "LdpObject": { - "properties": { - "proof_type": { + }, + "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": [ - "proof_type" + "credentialConfigurationsSupported" ], "type": "object", "additionalProperties": false }, - "DiObject": { + "UpdateIssuerRecordOptions": { "properties": { - "proof_type": { + "display": { "items": { - "type": "string" + "$ref": "#/components/schemas/CredentialDisplay" }, "type": "array" }, - "cryptosuite": { + "dpopSigningAlgValuesSupported": { "items": { "type": "string" }, "type": "array" + }, + "credentialConfigurationsSupported": { + "$ref": "#/components/schemas/Record_string.CredentialConfigurationSupportedWithFormats_" + }, + "batchCredentialIssuance": { + "$ref": "#/components/schemas/BatchCredentialIssuanceOptions" } }, "required": [ - "proof_type", - "cryptosuite" + "credentialConfigurationsSupported" ], "type": "object", "additionalProperties": false }, - "SdJwtObject": { + "OpenId4VcIssuanceSessionRecord": { + "$ref": "#/components/schemas/Record_string.unknown_" + }, + "DisclosureFrameForOffer": { "properties": { - "undefined": { + "_sd": { "items": { "type": "string" }, @@ -1751,810 +1536,3475 @@ } }, "type": "object", - "additionalProperties": false - }, - "MsoMdocObject": { - "properties": { - "alg": { - "items": { - "type": "string" + "additionalProperties": { + "anyOf": [ + { + "$ref": "#/components/schemas/DisclosureFrameForOffer" }, - "type": "array" - } - }, - "required": [ - "alg" + { + "items": { + "type": "string" + }, + "type": "array" + } + ] + } + }, + "OpenId4VciCredentialFormatProfile": { + "enum": [ + "jwt_vc_json", + "jwt_vc_json-ld", + "ldp_vc", + "vc+sd-jwt", + "dc+sd-jwt", + "mso_mdoc" ], - "type": "object", - "additionalProperties": false + "type": "string" }, - "Format": { + "SignerMethod": { + "enum": [ + "did", + "x5c" + ], + "type": "string" + }, + "OpenId4VciOfferSdJwtCredential": { "properties": { - "jwt": { - "$ref": "#/components/schemas/JwtObject" - }, - "jwt_vc": { - "$ref": "#/components/schemas/JwtObject" - }, - "jwt_vc_json": { - "$ref": "#/components/schemas/JwtObject" + "credentialSupportedId": { + "type": "string" }, - "jwt_vp": { - "$ref": "#/components/schemas/JwtObject" + "format": { + "$ref": "#/components/schemas/OpenId4VciCredentialFormatProfile" }, - "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" + "signerOptions": { + "properties": { + "keyId": { + "type": "string" + }, + "x5c": { + "items": { + "type": "string" + }, + "type": "array" + }, + "did": { + "type": "string" + }, + "method": { + "$ref": "#/components/schemas/SignerMethod" + } + }, + "required": [ + "method" + ], + "type": "object" }, - "undefined": { - "$ref": "#/components/schemas/SdJwtObject" + "payload": { + "properties": { + "vct": { + "type": "string" + } + }, + "additionalProperties": {}, + "type": "object" }, - "mso_mdoc": { - "$ref": "#/components/schemas/MsoMdocObject" + "disclosureFrame": { + "$ref": "#/components/schemas/DisclosureFrameForOffer" } }, + "required": [ + "credentialSupportedId", + "format", + "signerOptions", + "payload" + ], "type": "object", "additionalProperties": false }, - "Issuance": { + "Partial_ValidityInfo_": { "properties": { - "manifest": { - "type": "string" + "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", - "additionalProperties": {} - }, - "Optionality": { - "type": "string", - "enum": [ - "required", - "preferred" - ] - }, - "Directives": { - "type": "string", - "enum": [ - "required", - "allowed", - "disallowed" - ] + "description": "Make all properties in T optional" }, - "PdStatus": { - "properties": { - "directive": { - "$ref": "#/components/schemas/Directives" - } + "Record_string.Record_string.unknown__": { + "properties": {}, + "additionalProperties": { + "$ref": "#/components/schemas/Record_string.unknown_" }, "type": "object", - "additionalProperties": false + "description": "Construct a type with a set of properties K of type T" }, - "Statuses": { + "MdocNameSpaces": { + "$ref": "#/components/schemas/Record_string.Record_string.unknown__" + }, + "OpenId4VciOfferMdocCredential": { "properties": { - "active": { - "$ref": "#/components/schemas/PdStatus" + "credentialSupportedId": { + "type": "string" }, - "suspended": { - "$ref": "#/components/schemas/PdStatus" + "format": { + "$ref": "#/components/schemas/OpenId4VciCredentialFormatProfile" }, - "revoked": { - "$ref": "#/components/schemas/PdStatus" + "signerOptions": { + "properties": { + "keyId": { + "type": "string" + }, + "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 }, - "OneOfNumberStringBoolean": { + "JsonObject": { + "properties": {}, + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/JsonValue" + } + }, + "JsonValue": { "anyOf": [ { - "type": "boolean" + "type": "string" }, { "type": "number", "format": "double" }, { + "type": "boolean" + }, + { + "$ref": "#/components/schemas/JsonObject" + }, + { + "$ref": "#/components/schemas/JsonArray" + } + ], + "nullable": true + }, + "JsonArray": { + "items": { + "$ref": "#/components/schemas/JsonValue" + }, + "type": "array" + }, + "W3cIssuer": { + "properties": { + "id": { "type": "string" } - ] + }, + "required": [ + "id" + ], + "type": "object", + "additionalProperties": false }, - "OneOfNumberString": { + "W3cCredentialSubject": { + "properties": { + "id": { + "type": "string" + }, + "claims": { + "$ref": "#/components/schemas/Record_string.unknown_" + } + }, + "type": "object", + "additionalProperties": false + }, + "SingleOrArray_W3cCredentialSubject_": { "anyOf": [ { - "type": "number", - "format": "double" + "$ref": "#/components/schemas/W3cCredentialSubject" }, { - "type": "string" + "items": { + "$ref": "#/components/schemas/W3cCredentialSubject" + }, + "type": "array" } ] }, - "FilterV2": { + "W3cCredentialSchema": { "properties": { - "const": { - "$ref": "#/components/schemas/OneOfNumberStringBoolean" + "id": { + "type": "string" }, - "enum": { + "type": { + "type": "string" + } + }, + "required": [ + "id", + "type" + ], + "type": "object", + "additionalProperties": false + }, + "SingleOrArray_W3cCredentialSchema_": { + "anyOf": [ + { + "$ref": "#/components/schemas/W3cCredentialSchema" + }, + { "items": { - "$ref": "#/components/schemas/OneOfNumberStringBoolean" + "$ref": "#/components/schemas/W3cCredentialSchema" }, "type": "array" - }, - "exclusiveMinimum": { - "$ref": "#/components/schemas/OneOfNumberString" - }, - "exclusiveMaximum": { - "$ref": "#/components/schemas/OneOfNumberString" - }, - "format": { - "type": "string" - }, - "formatMaximum": { + } + ] + }, + "W3cCredentialStatus": { + "properties": { + "id": { "type": "string" }, - "formatMinimum": { + "type": { "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" } }, + "required": [ + "id", + "type" + ], "type": "object", "additionalProperties": false }, - "FilterV2Items": { + "W3cCredential": { "properties": { - "const": { - "$ref": "#/components/schemas/OneOfNumberStringBoolean" - }, - "enum": { + "context": { "items": { - "$ref": "#/components/schemas/OneOfNumberStringBoolean" + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/components/schemas/JsonObject" + } + ] }, "type": "array" }, - "exclusiveMinimum": { - "$ref": "#/components/schemas/OneOfNumberString" - }, - "exclusiveMaximum": { - "$ref": "#/components/schemas/OneOfNumberString" - }, - "format": { + "id": { "type": "string" }, - "formatMaximum": { - "type": "string" + "type": { + "items": { + "type": "string" + }, + "type": "array" }, - "formatMinimum": { - "type": "string" + "issuer": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/components/schemas/W3cIssuer" + } + ] }, - "formatExclusiveMaximum": { + "issuanceDate": { "type": "string" }, - "formatExclusiveMinimum": { + "expirationDate": { "type": "string" }, - "minLength": { - "type": "number", - "format": "double" - }, - "maxLength": { - "type": "number", - "format": "double" - }, - "minimum": { - "$ref": "#/components/schemas/OneOfNumberString" - }, - "maximum": { - "$ref": "#/components/schemas/OneOfNumberString" + "credentialSubject": { + "$ref": "#/components/schemas/SingleOrArray_W3cCredentialSubject_" }, - "not": { - "additionalProperties": false, - "type": "object" + "credentialSchema": { + "$ref": "#/components/schemas/SingleOrArray_W3cCredentialSchema_" }, - "pattern": { + "credentialStatus": { + "$ref": "#/components/schemas/W3cCredentialStatus" + } + }, + "required": [ + "context", + "type", + "issuer", + "issuanceDate", + "credentialSubject" + ], + "type": "object", + "additionalProperties": false + }, + "OpenId4VciOfferW3cCredential": { + "properties": { + "credentialSupportedId": { "type": "string" }, - "type": { - "type": "string" + "format": { + "$ref": "#/components/schemas/OpenId4VciCredentialFormatProfile" }, - "contains": { - "$ref": "#/components/schemas/FilterV2" + "signerOptions": { + "properties": { + "keyId": { + "type": "string" + }, + "x5c": { + "items": { + "type": "string" + }, + "type": "array" + }, + "did": { + "type": "string" + }, + "method": { + "$ref": "#/components/schemas/SignerMethod" + } + }, + "required": [ + "method" + ], + "type": "object" }, - "items": { - "$ref": "#/components/schemas/FilterV2Items" + "payload": { + "properties": { + "credential": { + "$ref": "#/components/schemas/W3cCredential" + }, + "verificationMethod": { + "type": "string" + } + }, + "required": [ + "credential", + "verificationMethod" + ], + "type": "object" } }, + "required": [ + "credentialSupportedId", + "format", + "signerOptions", + "payload" + ], "type": "object", "additionalProperties": false }, - "FieldV2": { + "OpenId4VcIssuanceSessionsCreateOffer": { "properties": { - "id": { + "publicIssuerId": { "type": "string" }, - "path": { + "credentials": { "items": { - "type": "string" + "anyOf": [ + { + "$ref": "#/components/schemas/OpenId4VciOfferSdJwtCredential" + }, + { + "$ref": "#/components/schemas/OpenId4VciOfferMdocCredential" + }, + { + "$ref": "#/components/schemas/OpenId4VciOfferW3cCredential" + } + ] }, "type": "array" }, - "purpose": { - "type": "string" - }, - "filter": { - "$ref": "#/components/schemas/FilterV2" - }, - "predicate": { - "$ref": "#/components/schemas/Optionality" + "authorizationCodeFlowConfig": { + "properties": { + "issuerState": { + "type": "string" + }, + "requirePresentationDuringIssuance": { + "type": "boolean" + }, + "authorizationServerUrl": { + "type": "string" + } + }, + "required": [ + "authorizationServerUrl" + ], + "type": "object" }, - "intent_to_retain": { - "type": "boolean" + "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" }, - "name": { + "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" + }, + "SdJwtVcRecord": { + "$ref": "#/components/schemas/Record_string.unknown_" + }, + "MdocRecord": { + "$ref": "#/components/schemas/Record_string.unknown_" + }, + "ResolveCredentialOfferBody": { + "properties": { + "credentialOfferUri": { "type": "string" - }, - "optional": { - "type": "boolean" } }, "required": [ - "path" + "credentialOfferUri" ], "type": "object", "additionalProperties": false }, - "HolderSubject": { + "AuthorizeRequestCredentialOffer": { "properties": { - "field_id": { + "credentialOfferUri": { + "type": "string" + }, + "credentialsToRequest": { "items": { "type": "string" }, "type": "array" - }, - "directive": { - "$ref": "#/components/schemas/Optionality" } }, "required": [ - "field_id", - "directive" + "credentialOfferUri", + "credentialsToRequest" ], "type": "object", "additionalProperties": false }, - "ConstraintsV2": { + "RequestCredentialBody": { "properties": { - "limit_disclosure": { - "$ref": "#/components/schemas/Optionality" - }, - "statuses": { - "$ref": "#/components/schemas/Statuses" + "credentialOfferUri": { + "type": "string" }, - "fields": { + "credentialsToRequest": { "items": { - "$ref": "#/components/schemas/FieldV2" + "type": "string" }, "type": "array" }, - "subject_is_issuer": { - "$ref": "#/components/schemas/Optionality" + "authorizationCode": { + "type": "string" }, - "is_holder": { - "items": { - "$ref": "#/components/schemas/HolderSubject" - }, - "type": "array" + "codeVerifier": { + "type": "string" }, - "same_subject": { - "items": { - "$ref": "#/components/schemas/HolderSubject" - }, - "type": "array" + "txCode": { + "type": "string" } }, + "required": [ + "credentialOfferUri", + "credentialsToRequest" + ], "type": "object", "additionalProperties": false }, - "InputDescriptorV2Model": { + "EncodedX509Certificate": { + "type": "string", + "description": "Base64 or PEM" + }, + "ResolveOpenId4VpAuthorizationRequestOptions": { "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "purpose": { - "type": "string" - }, - "format": { - "$ref": "#/components/schemas/Format" - }, - "group": { + "trustedCertificates": { "items": { - "type": "string" + "$ref": "#/components/schemas/EncodedX509Certificate" }, "type": "array" }, - "issuance": { - "items": { - "$ref": "#/components/schemas/Issuance" - }, - "type": "array" + "origin": { + "type": "string" + } + }, + "type": "object", + "additionalProperties": false + }, + "ResolveProofRequest": { + "properties": { + "proofRequestUri": { + "type": "string" }, - "constraints": { - "$ref": "#/components/schemas/ConstraintsV2" + "options": { + "$ref": "#/components/schemas/ResolveOpenId4VpAuthorizationRequestOptions" } }, "required": [ - "id", - "constraints" + "proofRequestUri" ], "type": "object", "additionalProperties": false }, - "Rules": { - "type": "string", + "CredentialType": { "enum": [ - "all", - "pick" - ] + "sd-jwt-vc", + "mso_mdoc" + ], + "type": "string" }, - "SubmissionRequirement": { + "DeleteCredentialBody": { "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" + "credentialType": { + "$ref": "#/components/schemas/CredentialType" }, - "from": { + "credentialId": { "type": "string" - }, - "from_nested": { - "items": { - "$ref": "#/components/schemas/SubmissionRequirement" - }, - "type": "array" } }, "required": [ - "rule" + "credentialType", + "credentialId" ], "type": "object", "additionalProperties": false }, - "InputDescriptorV2": { + "TenantConfig": { "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "purpose": { + "label": { "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" + "label" ], + "type": "object" + }, + "Record_string.any_": { + "properties": {}, + "additionalProperties": {}, "type": "object", - "additionalProperties": false + "description": "Construct a type with a set of properties K of type T" }, - "PresentationDefinitionV2": { + "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": { - "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" + "data": { + "$ref": "#/components/schemas/MetadataBase" } }, "required": [ - "id", - "input_descriptors" + "data" ], "type": "object", "additionalProperties": false }, - "DifPresentationExchangeDefinitionV2Model": { + "Pick_CustomTenantConfig.Exclude_keyofCustomTenantConfig.walletConfig__": { "properties": { - "id": { - "type": "string" - }, - "name": { + "label": { "type": "string" }, - "purpose": { + "connectionImageUrl": { "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" + "label" ], "type": "object", - "additionalProperties": false + "description": "From T, pick a set of properties whose keys are in the union K" }, - "PresentationDefinition": { + "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": { - "definition": { - "$ref": "#/components/schemas/DifPresentationExchangeDefinitionV2Model" + "config": { + "$ref": "#/components/schemas/Omit_CustomTenantConfig.walletConfig_" } }, "required": [ - "definition" + "config" ], "type": "object", "additionalProperties": false }, - "DcqlClaim": { + "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": { - "path": { - "items": { - "type": "string" - }, - "type": "array" - }, - "intent_to_retain": { - "type": "boolean" + "text": { + "type": "string" } }, "required": [ - "path" + "text" ], "type": "object", "additionalProperties": false }, - "DcqlCredential": { + "Record_response.string_": { "properties": { - "id": { - "type": "string" - }, - "format": { + "response": { "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" + "response" ], "type": "object", - "additionalProperties": false + "description": "Construct a type with a set of properties K of type T" }, - "DcqlQuery": { + "DidCommPlaintextMessage": { "properties": { - "combine": { - "type": "string", - "enum": [ - "all", - "any" - ] + "@type": { + "type": "string" }, - "credentials": { - "items": { - "$ref": "#/components/schemas/DcqlCredential" + "@id": { + "type": "string" + }, + "~thread": { + "properties": { + "pthid": { + "type": "string" + }, + "thid": { + "type": "string" + } }, - "type": "array" + "type": "object" } }, "required": [ - "credentials" + "@type", + "@id" + ], + "type": "object", + "additionalProperties": {} + }, + "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": [ + "https://didcomm.org/didexchange/1.x", + "https://didcomm.org/connections/1.x" ], + "type": "string" + }, + "DidCommMessage": { + "$ref": "#/components/schemas/DidCommPlaintextMessage" + }, + "PublicJwk_Ed25519PublicJwk_": { + "properties": {}, "type": "object", "additionalProperties": false }, - "DcqlDefinition": { + "DidCommRouting": { "properties": { - "query": { - "$ref": "#/components/schemas/DcqlQuery" + "endpoints": { + "items": { + "type": "string" + }, + "type": "array" + }, + "recipientKey": { + "$ref": "#/components/schemas/PublicJwk_Ed25519PublicJwk_" + }, + "routingKeys": { + "items": { + "$ref": "#/components/schemas/PublicJwk_Ed25519PublicJwk_" + }, + "type": "array" + }, + "mediatorId": { + "type": "string" } }, "required": [ - "query" + "endpoints", + "recipientKey", + "routingKeys" ], "type": "object", "additionalProperties": false }, - "ResponseModeEnum": { - "enum": [ - "direct_post", - "direct_post.jwt", - "dc_api", - "dc_api.jwt" - ], - "type": "string" - }, - "OpenId4VcJwtIssuerDid": { + "Pick_JwsGeneralFormat.Exclude_keyofJwsGeneralFormat.payload__": { "properties": { - "didUrl": { - "type": "string" + "header": { + "$ref": "#/components/schemas/Record_string.unknown_", + "description": "unprotected header" }, - "method": { + "signature": { "type": "string", - "enum": [ - "did" - ], - "nullable": false + "description": "Base64url encoded signature" + }, + "protected": { + "type": "string", + "description": "Base64url encoded protected header" } }, "required": [ - "didUrl", - "method" + "header", + "signature", + "protected" ], - "type": "object" + "type": "object", + "description": "From T, pick a set of properties whose keys are in the union K" }, - "OpenId4VcIssuerX5c": { + "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": { - "alg": { - "type": "string" - }, - "x5c": { + "signatures": { "items": { - "type": "string" + "$ref": "#/components/schemas/JwsDetachedFormat" }, "type": "array" - }, - "issuer": { - "type": "string" - }, - "method": { - "type": "string", - "enum": [ - "x5c" - ], - "nullable": false } }, "required": [ - "x5c", - "method" + "signatures" ], - "type": "object" + "type": "object", + "additionalProperties": false }, - "CreateAuthorizationRequest": { + "DidCommAttachmentData": { + "description": "A JSON object that gives access to the actual content of the attachment", "properties": { - "verifierId": { - "type": "string" + "base64": { + "type": "string", + "description": "Base64-encoded data, when representing arbitrary content inline instead of via links. Optional." }, - "presentationExchange": { - "$ref": "#/components/schemas/PresentationDefinition" + "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." }, - "dcql": { + "links": { + "items": { + "type": "string" + }, + "type": "array", + "description": "A list of zero or more locations at which the content may be fetched. Optional." + }, + "jws": { "anyOf": [ { - "type": "string" + "$ref": "#/components/schemas/JwsDetachedFormat" }, { - "$ref": "#/components/schemas/DcqlDefinition" + "$ref": "#/components/schemas/JwsFlattenedDetachedFormat" } - ] + ], + "description": "A JSON Web Signature over the content of the attachment. Optional." }, - "responseMode": { - "$ref": "#/components/schemas/ResponseModeEnum" + "sha256": { + "type": "string", + "description": "The hash of the content. Optional." + } + }, + "type": "object", + "additionalProperties": false + }, + "DidCommAttachment": { + "description": "Represents DIDComm attachment\nhttps://github.com/hyperledger/aries-rfcs/blob/master/concepts/0017-attachments/README.md", + "properties": { + "id": { + "type": "string" }, - "requestSigner": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenId4VcJwtIssuerDid" - }, - { - "$ref": "#/components/schemas/OpenId4VcIssuerX5c" - } - ] + "description": { + "type": "string", + "description": "An optional human-readable description of the content." }, - "expectedOrigins": { - "items": { - "type": "string" - }, - "type": "array" + "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/DidCommAttachmentData" } }, "required": [ - "verifierId", - "requestSigner" + "id", + "data" ], "type": "object", "additionalProperties": false }, - "OpenId4VcVerificationSessionRecord": { - "$ref": "#/components/schemas/Record_string.unknown_" - }, - "OpenId4VcVerificationSessionState": { - "enum": [ - "RequestCreated", - "RequestUriRetrieved", - "ResponseVerified", - "Error" - ], - "type": "string" - } - }, - "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": { + "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/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 + }, + "RecipientKeyOption": { + "properties": { + "recipientKey": { + "type": "string" + } + }, + "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": [ + { + "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" + }, + "autoAcceptInvitation": { + "type": "boolean" + }, + "autoAcceptConnection": { + "type": "boolean" + }, + "reuseConnection": { + "type": "boolean" + }, + "acceptInvitationTimeoutMs": { + "type": "number", + "format": "double" + }, + "ourDid": { + "type": "string" + } + }, + "required": [ + "label" + ], + "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" + }, + "autoAcceptInvitation": { + "type": "boolean" + }, + "autoAcceptConnection": { + "type": "boolean" + }, + "reuseConnection": { + "type": "boolean" + }, + "acceptInvitationTimeoutMs": { + "type": "number", + "format": "double" + }, + "ourDid": { + "type": "string" + }, + "invitation": { + "$ref": "#/components/schemas/OutOfBandInvitationSchema" + } + }, + "required": [ + "label", + "invitation" + ], + "type": "object", + "additionalProperties": false + }, + "ReceiveInvitationByUrlProps": { + "properties": { + "alias": { + "type": "string" + }, + "label": { + "type": "string" + }, + "imageUrl": { + "type": "string" + }, + "autoAcceptInvitation": { + "type": "boolean" + }, + "autoAcceptConnection": { + "type": "boolean" + }, + "reuseConnection": { + "type": "boolean" + }, + "acceptInvitationTimeoutMs": { + "type": "number", + "format": "double" + }, + "ourDid": { + "type": "string" + }, + "invitationUrl": { + "type": "string" + } + }, + "required": [ + "label", + "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" + } + }, + "required": [ + "label" + ], + "type": "object", + "additionalProperties": false + }, + "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_" + }, + "DidResolutionMetadata": { + "properties": { + "contentType": { + "type": "string" + }, + "error": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "string", + "enum": [ + "invalidDid", + "notFound", + "representationNotSupported", + "unsupportedDidMethod" + ] + } + ] + }, + "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" + } + }, + "type": "object", + "additionalProperties": false + }, + "DIDDocumentMetadata": { + "description": "Represents metadata about the DID document resulting from a {@link Resolvable.resolve} operation.", + "properties": { + "created": { + "type": "string" + }, + "updated": { + "type": "string" + }, + "deactivated": { + "type": "boolean" + }, + "versionId": { + "type": "string" + }, + "nextUpdate": { + "type": "string" + }, + "nextVersionId": { + "type": "string" + }, + "equivalentId": { + "type": "string" + }, + "canonicalId": { + "type": "string" + } + }, + "type": "object", + "additionalProperties": false + }, + "Did": { + "type": "string", + "example": "did:key:z6Mkk7yqnGF3YwTrLpqrW6PGsKci7dNqh1CjnvMbzrMerSeL" + }, + "KeyAlgorithm": { + "enum": [ + "a128gcm", + "a256gcm", + "a128cbchs256", + "a256cbchs512", + "a128kw", + "a256kw", + "bls12381g1", + "bls12381g2", + "c20p", + "xc20p", + "ed25519", + "x25519", + "k256", + "p256", + "p384" + ], + "type": "string" + }, + "DidDocument": { + "$ref": "#/components/schemas/Record_string.any_" + }, + "DidCreate": { + "properties": { + "keyType": { + "$ref": "#/components/schemas/KeyAlgorithm" + }, + "seed": { + "type": "string" + }, + "domain": { + "type": "string" + }, + "method": { + "type": "string" + }, + "network": { + "type": "string" + }, + "did": { + "type": "string" + }, + "role": { + "type": "string" + }, + "endorserDid": { + "type": "string" + }, + "didDocument": { + "$ref": "#/components/schemas/DidDocument" + }, + "privatekey": { + "type": "string" + }, + "endpoint": { + "type": "string" + } + }, + "required": [ + "method" + ], + "type": "object", + "additionalProperties": false + }, + "DidRecord": { + "$ref": "#/components/schemas/Record_string.unknown_" + }, + "AgentInfo": { + "properties": { + "label": { + "type": "string" + }, + "endpoints": { + "items": { + "type": "string" + }, + "type": "array" + }, + "isInitialized": { + "type": "boolean" + }, + "publicDid": {} + }, + "required": [ + "label", + "endpoints", + "isInitialized", + "publicDid" + ], + "type": "object", + "additionalProperties": false + }, + "AgentToken": { + "properties": { + "token": { + "type": "string" + } + }, + "required": [ + "token" + ], + "type": "object", + "additionalProperties": false + }, + "Partial_W3cCredentialValidations_": { + "properties": {}, + "type": "object", + "description": "Make all properties in T optional" + }, + "Error": { + "properties": { + "name": { + "type": "string" + }, + "message": { + "type": "string" + }, + "stack": { + "type": "string" + } + }, + "required": [ + "name", + "message" + ], + "type": "object", + "additionalProperties": false + }, + "W3cVerifyResult_W3cCredentialValidations_": { + "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" + } + }, + "required": [ + "isValid", + "validations" + ], + "type": "object", + "additionalProperties": false + }, + "W3cVerifyCredentialResult": { + "$ref": "#/components/schemas/W3cVerifyResult_W3cCredentialValidations_" + }, + "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_any-or-DataIntegrityProofOptions_": { + "anyOf": [ + { + "anyOf": [ + {}, + { + "$ref": "#/components/schemas/DataIntegrityProofOptions" + } + ] + }, + { + "items": { + "anyOf": [ + {}, + { + "$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", + "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" + } + }, + "required": [ + "type", + "cryptosuite", + "proofPurpose", + "verificationMethod" + ], + "type": "object", + "additionalProperties": false + }, + "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_any-or-DataIntegrityProofOptions_" + } + }, + "required": [ + "credential", + "proof" + ], + "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": { + "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": { + "keyId": {}, + "publicCertificateBase64": { + "type": "string" + } + }, + "required": [ + "keyId", + "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": { + "keyId": {}, + "issuerCertificate": { + "type": "string" + } + }, + "required": [ + "keyId", + "issuerCertificate" + ], + "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" + } + } + } + } + } + }, + "/openid4vc/verification-sessions/create-presentation-request": { + "post": { + "operationId": "CreateProofRequest", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": {} + } + } + } + }, + "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" + } + } + } + } + } + }, + "/openid4vc/verification-sessions": { + "get": { + "operationId": "GetAllVerificationSessions", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/OpenId4VcVerificationSessionRecord" + }, + "type": "array" + } + } + } + } + }, + "description": "Retrieve all verification session records", + "tags": [ + "oid4vc verification sessions" + ], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } + ], + "parameters": [ + { + "in": "query", + "name": "publicVerifierId", + "required": false, + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "payloadState", + "required": false, + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "state", + "required": false, + "schema": { + "$ref": "#/components/schemas/OpenId4VcVerificationSessionState" + } + }, + { + "in": "query", + "name": "authorizationRequestUri", + "required": false, + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "authorizationRequestId", + "required": false, + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "nonce", + "required": false, + "schema": { + "type": "string" + } + } + ] + } + }, + "/openid4vc/verification-sessions/{verificationSessionId}": { + "get": { + "operationId": "GetVerificationSessionsById", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenId4VcVerificationSessionRecord" + } + } + } + } + }, + "description": "Get verification session by ID", + "tags": [ + "oid4vc verification sessions" + ], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } + ], + "parameters": [ + { + "in": "path", + "name": "verificationSessionId", + "required": true, + "schema": { + "type": "string" + } + } + ] + } + }, + "/openid4vc/verification-sessions/response/{verificationSessionId}": { + "get": { + "operationId": "GetVerifiedAuthorizationResponse", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": {} + } + } + } + }, + "tags": [ + "oid4vc verification sessions" + ], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } + ], + "parameters": [ + { + "in": "path", + "name": "verificationSessionId", + "required": true, + "schema": { + "type": "string" + } + } + ] + } + }, + "/openid4vc/verification-sessions/verify-authorization-response": { + "post": { + "operationId": "VerifyDcqlProofRequest", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": {} + } + } + } + }, + "description": "Verify authorization response for a DCAPI proof request", + "tags": [ + "oid4vc verification sessions" + ], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenId4VCDCQLVerificationSessionRecord" + } + } + } + } + } + }, + "/openid4vc/issuer": { + "post": { + "operationId": "CreateIssuer", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenId4VcIssuerRecord" + }, + "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" + } + ] + }, + "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" + ], + "cryptographic_binding_methods_supported": [ + "did:key" + ], + "display": [ + { + "name": "University Degree Credential", + "description": "Issued by a recognized educational institution", + "locale": "en" + } + ] + }, + "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" + } + ] + } + } + } + } + } + } + } + } + }, + "description": "Creates an issuer with issuer metadata.", + "tags": [ + "oid4vc issuers" + ], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateIssuerOptions" + } + } + } + } + }, + "get": { + "operationId": "GetIssuersByQuery", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenId4VcIssuerRecord" + }, + { + "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", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenId4VcIssuerRecord" + } + } + } + } + }, + "description": "Updates issuer metadata for a given publicIssuerId.", + "tags": [ + "oid4vc issuers" + ], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } + ], + "parameters": [ + { + "in": "path", + "name": "publicIssuerId", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateIssuerRecordOptions" + } + } + } + } + }, + "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", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": {} + } + } + } + }, + "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": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" + } + } + } + } + }, + "description": "Deletes a specific issuer by record id.", + "tags": [ + "oid4vc issuers" + ], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + } + } + ] + } + }, + "/openid4vc/issuance-sessions/create-credential-offer": { + "post": { + "operationId": "CreateCredentialOffer", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "properties": { + "issuanceSession": { + "$ref": "#/components/schemas/OpenId4VcIssuanceSessionRecord" + }, + "credentialOffer": { + "type": "string" + } + }, + "required": [ + "issuanceSession", + "credentialOffer" + ], + "type": "object" + } + } + } + } + }, + "description": "Creates a credential offer with the specified credential configurations and authorization type.", + "tags": [ + "oid4vc issuance sessions" + ], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenId4VcIssuanceSessionsCreateOffer" + } + } + } + } + } + }, + "/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", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenId4VcIssuanceSessionRecord" + } + } + } + } + }, + "description": "Update issuance session metadata by session ID", + "tags": [ + "oid4vc issuance sessions" + ], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } + ], + "parameters": [ + { + "in": "path", + "name": "issuanceSessionId", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "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" + }, + "type": "array" + } + } + } + } + }, + "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/holder/sd-jwt-vcs": { + "get": { + "operationId": "GetSdJwtCredentials", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/SdJwtVcRecord" + }, + "type": "array" + } + } + } + } + }, + "description": "Get SdJwt type of credentials", + "tags": [ + "oid4vc holders" + ], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } + ], + "parameters": [] + } + }, + "/openid4vc/holder/mdoc-vcs": { + "get": { + "operationId": "GetMdocCredentials", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { "schema": { - "properties": { - "publicCertificateBase64": { - "type": "string" - } + "items": { + "$ref": "#/components/schemas/MdocRecord" }, - "required": [ - "publicCertificateBase64" - ], - "type": "object" + "type": "array" } } } } }, + "description": "Fetch all mso mdoc credentials in wallet", + "tags": [ + "oid4vc holders" + ], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } + ], + "parameters": [] + } + }, + "/openid4vc/holder/mdoc-vcs/decode": { + "post": { + "operationId": "DecodeMdocCredential", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": {} + } + } + } + }, + "description": "Decode mso mdoc credential in wallet", + "tags": [ + "oid4vc holders" + ], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "properties": { + "base64Url": { + "type": "string" + } + }, + "required": [ + "base64Url" + ], + "type": "object" + } + } + } + } + } + }, + "/openid4vc/holder/resolve-credential-offer": { + "post": { + "operationId": "ResolveCredOffer", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": {} + } + } + } + }, + "description": "Resolve a credential offer", + "tags": [ + "oid4vc holders" + ], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResolveCredentialOfferBody" + } + } + } + } + } + }, + "/openid4vc/holder/authorization-request": { + "post": { + "operationId": "RequestAuthorizationForCredential", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": {} + } + } + } + }, + "tags": [ + "oid4vc holders" + ], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthorizeRequestCredentialOffer" + } + } + } + } + } + }, + "/openid4vc/holder/request-credential": { + "post": { + "operationId": "RequestCredential", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": {} + } + } + } + }, + "description": "Initiates a token request, then requests credentials from issuer", + "tags": [ + "oid4vc holders" + ], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RequestCredentialBody" + } + } + } + } + } + }, + "/openid4vc/holder/resolve-proof-request": { + "post": { + "operationId": "ResolveProofRequest", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": {} + } + } + } + }, + "description": "Resolve a proof request", + "tags": [ + "oid4vc holders" + ], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResolveProofRequest" + } + } + } + } + } + }, + "/openid4vc/holder/accept-proof-request": { + "post": { + "operationId": "AcceptProofRequest", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": {} + } + } + } + }, + "description": "Accept a proof request", + "tags": [ + "oid4vc holders" + ], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResolveProofRequest" + } + } + } + } + } + }, + "/openid4vc/holder/decode-sdjwt": { + "post": { + "operationId": "DecodeSdJwt", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": {} + } + } + } + }, + "tags": [ + "oid4vc holders" + ], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "properties": { + "jwt": { + "type": "string" + } + }, + "required": [ + "jwt" + ], + "type": "object" + } + } + } + } + } + }, + "/openid4vc/holder/credential": { + "delete": { + "operationId": "Delete", + "responses": { + "204": { + "description": "No content" + } + }, "tags": [ - "x509" + "oid4vc holders" ], "security": [ { @@ -2570,16 +5020,16 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/X509CreateCertificateOptionsDto" + "$ref": "#/components/schemas/DeleteCredentialBody" } } } } } }, - "/x509/import": { + "/multi-tenancy/create-tenant": { "post": { - "operationId": "ImportX509Certificates", + "operationId": "CreateTenant", "responses": { "200": { "description": "Ok", @@ -2587,12 +5037,47 @@ "application/json": { "schema": { "properties": { - "issuerCertficicate": { + "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": [ - "issuerCertficicate" + "token", + "metadata", + "allowCache", + "createdAt", + "id", + "storageVersion", + "config", + "type" ], "type": "object" } @@ -2601,13 +5086,12 @@ } }, "tags": [ - "x509" + "MultiTenancy" ], "security": [ { "jwt": [ - "tenant", - "dedicated" + "Basewallet" ] } ], @@ -2617,128 +5101,222 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/X509ImportCertificateOptionsDto" + "$ref": "#/components/schemas/CreateTenantOptions" } } } } } }, - "/x509/trusted": { + "/multi-tenancy/get-token/{tenantId}": { "post": { - "operationId": "AddTrustedCertificate", + "operationId": "GetTenantToken", "responses": { - "204": { - "description": "No content" + "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" + } + } + } } }, "tags": [ - "x509" + "MultiTenancy" ], "security": [ { "jwt": [ - "tenant", - "dedicated" + "Basewallet" ] } ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "properties": { - "certificate": { - "type": "string" - } - }, - "required": [ - "certificate" - ], - "type": "object" - } + "parameters": [ + { + "in": "path", + "name": "tenantId", + "required": true, + "schema": { + "type": "string" } } - } - }, + ] + } + }, + "/multi-tenancy/{tenantId}": { "get": { - "operationId": "GetTrustedCertificates", + "operationId": "GetTenantById", "responses": { "200": { "description": "Ok", + "content": { + "application/json": { + "schema": {} + } + } + }, + "404": { + "description": "", "content": { "application/json": { "schema": { - "items": { - "type": "string" + "properties": { + "reason": { + "type": "string" + } }, - "type": "array" + "required": [ + "reason" + ], + "type": "object" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" } } } } }, "tags": [ - "x509" + "MultiTenancy" ], "security": [ { "jwt": [ - "tenant", - "dedicated" + "Basewallet" ] } ], - "parameters": [] - } - }, - "/x509/decode": { - "post": { - "operationId": "DecodeCertificate", + "parameters": [ + { + "in": "path", + "name": "tenantId", + "required": true, + "schema": { + "type": "string" + } + } + ] + }, + "delete": { + "operationId": "DeleteTenantById", "responses": { "200": { "description": "Ok", + "content": { + "application/json": { + "schema": {} + } + } + }, + "404": { + "description": "", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/X509Certificate" + "properties": { + "reason": { + "type": "string" + } + }, + "required": [ + "reason" + ], + "type": "object" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" } } } } }, "tags": [ - "x509" + "MultiTenancy" ], "security": [ { "jwt": [ - "tenant", - "dedicated" + "Basewallet" ] } ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "properties": { - "certificate": { - "type": "string" - } - }, - "required": [ - "certificate" - ], - "type": "object" - } + "parameters": [ + { + "in": "path", + "name": "tenantId", + "required": true, + "schema": { + "type": "string" } } - } + ] } }, "/didcomm/question-answer": { @@ -4089,7 +6667,7 @@ "operationId": "GetDidRecordByDid", "responses": { "200": { - "description": "DidResolutionResult", + "description": "Ok", "content": { "application/json": { "schema": { @@ -4161,7 +6739,6 @@ } } }, - "description": "Resolves did and returns did resolution result", "tags": [ "Dids" ], @@ -4175,7 +6752,6 @@ ], "parameters": [ { - "description": "Decentralized Identifier", "in": "path", "name": "did", "required": true, @@ -4288,409 +6864,119 @@ "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/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" - }, - {} - ] - } - } - } - } - } - }, - "/multi-tenancy/create-tenant": { - "post": { - "operationId": "CreateTenant", - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": { - "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" - } - } - } - } - }, - "tags": [ - "MultiTenancy" - ], - "security": [ - { - "jwt": [ - "Basewallet" - ] - } - ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateTenantOptions" - } - } - } - } - } - }, - "/multi-tenancy/get-token/{tenantId}": { - "post": { - "operationId": "GetTenantToken", - "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" + "application/json": { + "schema": { + "$ref": "#/components/schemas/AgentInfo" } } } } }, + "description": "Retrieve basic agent information", "tags": [ - "MultiTenancy" + "Agent" ], "security": [ { "jwt": [ + "tenant", + "dedicated", "Basewallet" ] } ], - "parameters": [ - { - "in": "path", - "name": "tenantId", - "required": true, - "schema": { - "type": "string" - } - } - ] + "parameters": [] } }, - "/multi-tenancy/{tenantId}": { - "get": { - "operationId": "GetTenantById", + "/agent/token": { + "post": { + "operationId": "GetAgentToken", "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" + "$ref": "#/components/schemas/AgentToken" } } } } }, + "description": "Retrieve agent token", "tags": [ - "MultiTenancy" + "Agent" ], "security": [ { - "jwt": [ - "Basewallet" - ] + "apiKey": [] } ], - "parameters": [ - { - "in": "path", - "name": "tenantId", - "required": true, - "schema": { - "type": "string" - } - } - ] - }, - "delete": { - "operationId": "DeleteTenantById", + "parameters": [] + } + }, + "/agent/credential/verify": { + "post": { + "operationId": "VerifyCredential", "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" + "$ref": "#/components/schemas/W3cVerifyCredentialResult" } } } } }, "tags": [ - "MultiTenancy" + "Agent" ], "security": [ { "jwt": [ - "Basewallet" + "tenant", + "dedicated" ] } ], - "parameters": [ - { - "in": "path", - "name": "tenantId", - "required": true, - "schema": { - "type": "string" + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "$ref": "#/components/schemas/SafeW3cJsonLdVerifyCredentialOptions" + }, + {} + ] + } } } - ] + } } }, - "/openid4vc/verification-sessions/create-presentation-request": { + "/openid4vc/verifier": { "post": { - "operationId": "CreateProofRequest", + "operationId": "CreateVerifier", "responses": { "200": { "description": "Ok", "content": { "application/json": { - "schema": {} + "schema": { + "$ref": "#/components/schemas/OpenId4VcVerifierRecord" + } } } } }, - "description": "Create an authorization request, acting as a Relying Party (RP)", + "description": "Create a new verifier and store the verifier record", "tags": [ - "oid4vc verification sessions" + "oid4vc verifiers" ], "security": [ { @@ -4706,16 +6992,14 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateAuthorizationRequest" + "$ref": "#/components/schemas/OpenId4VcSiopCreateVerifierOptions" } } } } - } - }, - "/openid4vc/verification-sessions": { + }, "get": { - "operationId": "GetAllVerificationSessions", + "operationId": "GetVerifiersByQuery", "responses": { "200": { "description": "Ok", @@ -4723,7 +7007,7 @@ "application/json": { "schema": { "items": { - "$ref": "#/components/schemas/OpenId4VcVerificationSessionRecord" + "$ref": "#/components/schemas/OpenId4VcVerifierRecord" }, "type": "array" } @@ -4731,9 +7015,9 @@ } } }, - "description": "Retrieve all verification session records", + "description": "Get verifiers by query", "tags": [ - "oid4vc verification sessions" + "oid4vc verifiers" ], "security": [ { @@ -4751,60 +7035,75 @@ "schema": { "type": "string" } - }, - { - "in": "query", - "name": "payloadState", - "required": false, - "schema": { - "type": "string" + } + ] + } + }, + "/openid4vc/verifier/{publicVerifierId}": { + "put": { + "operationId": "UpdateVerifierMetadata", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenId4VcVerifierRecord" + } + } } - }, + } + }, + "description": "Update verifier metadata", + "tags": [ + "oid4vc verifiers" + ], + "security": [ { - "in": "query", - "name": "state", - "required": false, - "schema": { - "$ref": "#/components/schemas/OpenId4VcVerificationSessionState" - } - }, + "jwt": [ + "tenant", + "dedicated" + ] + } + ], + "parameters": [ { - "in": "query", - "name": "authorizationRequestUri", - "required": false, + "in": "path", + "name": "publicVerifierId", + "required": true, "schema": { "type": "string" } - }, - { - "in": "query", - "name": "nonce", - "required": false, - "schema": { - "type": "string" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenId4VcUpdateVerifierRecordOptions" + } } } - ] - } - }, - "/openid4vc/verification-sessions/{verificationSessionId}": { + } + }, "get": { - "operationId": "GetVerificationSessionsById", + "operationId": "GetVerifier", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/OpenId4VcVerificationSessionRecord" + "$ref": "#/components/schemas/OpenId4VcVerifierRecord" } } } } }, - "description": "Get verification session by ID", + "description": "Get single verifier by ID", "tags": [ - "oid4vc verification sessions" + "oid4vc verifiers" ], "security": [ { @@ -4817,7 +7116,7 @@ "parameters": [ { "in": "path", - "name": "verificationSessionId", + "name": "publicVerifierId", "required": true, "schema": { "type": "string" @@ -4826,21 +7125,32 @@ ] } }, - "/openid4vc/verification-sessions/response/{verificationSessionId}": { - "get": { - "operationId": "GetVerifiedAuthorizationResponse", + "/openid4vc/verifier/{verifierId}": { + "delete": { + "operationId": "DeleteVerifier", "responses": { "200": { "description": "Ok", "content": { "application/json": { - "schema": {} + "schema": { + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" + } } } } }, + "description": "Delete verifier by ID", "tags": [ - "oid4vc verification sessions" + "oid4vc verifiers" ], "security": [ { @@ -4853,7 +7163,7 @@ "parameters": [ { "in": "path", - "name": "verificationSessionId", + "name": "verifierId", "required": true, "schema": { "type": "string" diff --git a/src/utils/oid4vc-agent.ts b/src/utils/oid4vc-agent.ts index d254a96e..05ffef75 100644 --- a/src/utils/oid4vc-agent.ts +++ b/src/utils/oid4vc-agent.ts @@ -72,7 +72,7 @@ export function getMixedCredentialRequestToCredentialMapper(): OpenId4VciCredent credentials: [ { payload: { - vct: credentialConfiguration.vct, + vct: credentialConfiguration.vct as string, authorized_user: authorization.accessToken.payload.sub, }, holder: { diff --git a/yarn.lock b/yarn.lock index f4ef7485..3d31b382 100644 --- a/yarn.lock +++ b/yarn.lock @@ -61,62 +61,60 @@ dependencies: static-eval "2.0.2" -"@ayanworks/credo-polygon-w3c-module@1.0.1-alpha.1": - version "1.0.1-alpha.1" - resolved "https://registry.yarnpkg.com/@ayanworks/credo-polygon-w3c-module/-/credo-polygon-w3c-module-1.0.1-alpha.1.tgz#ddbc5135c9010cf1de15a7aef0bacaba49bc55fa" - integrity sha512-H2WDwcdtHG5aCzcFu4j/2zOTtU9mrM6xSGjK7JIuwJbCAOY7/dhSCAWEG2myBZDkNccOeC9NjMdDRDJfqORJNA== - dependencies: - "@ayanworks/polygon-did-registrar" "1.0.0" - "@ayanworks/polygon-did-resolver" "1.0.0" - "@ayanworks/polygon-schema-manager" "1.0.1-alpha.1" - "@credo-ts/askar" "0.5.3" - "@credo-ts/core" "0.5.3" +"@ayanworks/credo-polygon-w3c-module@2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@ayanworks/credo-polygon-w3c-module/-/credo-polygon-w3c-module-2.0.0.tgz#8682b3dfeffe166c7da718afac9739db825ef626" + integrity sha512-6ZJH/TtieyIQ1mxOj00JyixZ56wi2G7nhDgZEWYkQiEcY1x3IRNR75iRLTOK23NTn2tLneC6Kl5niWEg7BsCjg== + dependencies: + "@ayanworks/polygon-did-registrar" "2.2.0" + "@ayanworks/polygon-did-resolver" "1.0.2" + "@ayanworks/polygon-schema-manager" "2.2.0" + "@credo-ts/askar" "^0.6.1" + "@credo-ts/core" "^0.6.1" did-resolver "^4.1.0" - ethers "^6.9.0" + ethers "^6.16.0" -"@ayanworks/polygon-did-registrar@1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@ayanworks/polygon-did-registrar/-/polygon-did-registrar-1.0.0.tgz#6704a51b154e12c9484c90581a1c9dc41e01dcd3" - integrity sha512-pK6WELi9avhxFk7BGioMFu9U/VL6GLvW6n18QFq8G4EMPMWsAvTfiiqUadTVWU8nuHSOrgpBBW8kN5DPWwJPFg== - dependencies: - "@ayanworks/polygon-did-registry-contract" "3.0.0" - "@ayanworks/polygon-did-resolver" "1.0.0" - "@credo-ts/core" "0.5.3" - "@ethersproject/basex" "^5.7.0" - "@ethersproject/signing-key" "^5.7.0" - "@ethersproject/transactions" "^5.7.0" - "@ethersproject/wallet" "^5.7.0" +"@ayanworks/polygon-did-registrar@2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@ayanworks/polygon-did-registrar/-/polygon-did-registrar-2.2.0.tgz#87c09b8965a81ee8b896fb4efc74a37b3e43e626" + integrity sha512-E6z3fkpfhs8SyN4c3UMnGcmfWMC9dxXJlqLPMfXIsGCFM5G2ZiQuI7pnFyd2hnGpZ818VeIFFYkojm68LNpdyw== + dependencies: + "@ayanworks/polygon-did-registry-contract" "4.0.0" + "@ayanworks/polygon-did-resolver" "1.0.2" + "@ethersproject/basex" "^5.8.0" + "@ethersproject/signing-key" "^5.8.0" + "@ethersproject/transactions" "^5.8.0" + "@ethersproject/wallet" "^5.8.0" did-resolver "^4.1.0" - ethers "^6.9.0" - uuid "^9.0.1" + ethers "^6.16.0" + uuid "^13.0.0" -"@ayanworks/polygon-did-registry-contract@3.0.0": - version "3.0.0" - resolved "https://registry.yarnpkg.com/@ayanworks/polygon-did-registry-contract/-/polygon-did-registry-contract-3.0.0.tgz#52b18768b887e933d44a9713b33dc2efbb1dcf53" - integrity sha512-RnW31nkDIMG1YzuOycxGGrJFpgTcpBwS/UZR6/wMPrsJBKBEN28k2CZImwXkbgaknyTfL7xe1u3C8NxfDvhI4Q== +"@ayanworks/polygon-did-registry-contract@4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/@ayanworks/polygon-did-registry-contract/-/polygon-did-registry-contract-4.0.0.tgz#33d3fb6534700e1dc91b6e757c4276d8a91242df" + integrity sha512-18iePYxKMa0MY7xHxBKjeL3AIaiPy9YT+WSlreVDqF4XUGGWqh4TaUtMPx89i3NprcTFiYOVVhC0KhbsitBgnA== -"@ayanworks/polygon-did-resolver@1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@ayanworks/polygon-did-resolver/-/polygon-did-resolver-1.0.0.tgz#4d267004a509fad9a75bb18c6f449f6c51e1f198" - integrity sha512-mzYh3XNQ4HJ0GakP1QD7UOW8PjMAhdtu/TXzeOqMtHLhWktFMQcgJuqNMNxMGbJFdIe12qFJROlle6p1BjF01g== +"@ayanworks/polygon-did-resolver@1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@ayanworks/polygon-did-resolver/-/polygon-did-resolver-1.0.2.tgz#5aee0d2f54f0374b9e3de9af413d66bda12e39b2" + integrity sha512-y4irODbWS96W5zk/+M22bD0qjRBDaCbU7D6W37/132BZJdcXEUPmLD4tMNUQ8wFmc1aPION+EMrqUPOyCos+kw== dependencies: - "@ayanworks/polygon-did-registry-contract" "3.0.0" + "@ayanworks/polygon-did-registry-contract" "4.0.0" did-resolver "^4.1.0" - ethers "^5.1.0" + ethers "^6.16.0" -"@ayanworks/polygon-schema-manager@1.0.1-alpha.1": - version "1.0.1-alpha.1" - resolved "https://registry.yarnpkg.com/@ayanworks/polygon-schema-manager/-/polygon-schema-manager-1.0.1-alpha.1.tgz#97b9d497739753a97c0ad452d6e6276ef7c69c43" - integrity sha512-Qkbp1bQ+PqakUb7jq15dWfQ3usM1SLmFJnNIgzInQICSoLo1wYjYPlRlRtfwsuebNV2V4NeZTLEKKvTetIL/Jg== +"@ayanworks/polygon-schema-manager@2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@ayanworks/polygon-schema-manager/-/polygon-schema-manager-2.2.0.tgz#59cea872f50ef8862180cd982581b855385bc7a0" + integrity sha512-1ZwKxGE2M5CK9PSlO6MOuk63PpWiXS3IiwM5V4Lluf4AN+eejquP/cAqicyjthoiMQ/h28FDIdFqsQOFz8fC1A== dependencies: - "@ayanworks/polygon-did-registry-contract" "3.0.0" - "@ayanworks/polygon-did-resolver" "1.0.0" - "@nomicfoundation/hardhat-verify" "^2.0.3" + "@ayanworks/polygon-did-registry-contract" "4.0.0" + "@ayanworks/polygon-did-resolver" "1.0.2" axios "^1.6.3" did-resolver "^4.1.0" - ethers "^6.9.0" + ethers "^6.16.0" keccak256 "^1.0.6" - uuid "^9.0.1" + uuid "^13.0.0" "@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.27.1": version "7.27.1" @@ -386,34 +384,34 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@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== +"@credo-ts/anoncreds@0.6.2": + version "0.6.2" + resolved "https://registry.yarnpkg.com/@credo-ts/anoncreds/-/anoncreds-0.6.2.tgz#cbde637b6f5f13df5c0c517348eddb8becc9fa48" + integrity sha512-9LwcnkpX4OpuHjFbB3C1NPA1yY6oHhPt7jiYu6mOBaAMCo5qbdam+xMijR0vC1+cnmS5Kf/c14medYlqI03Zxw== dependencies: "@astronautlabs/jsonpath" "^1.1.2" - "@credo-ts/core" "0.6.1" - "@credo-ts/didcomm" "0.6.1" + "@credo-ts/core" "0.6.2" + "@credo-ts/didcomm" "0.6.2" "@sphereon/pex-models" "^2.3.2" class-transformer "0.5.1" - class-validator "^0.14.1" + class-validator "^0.14.3" reflect-metadata "0.2.2" -"@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== +"@credo-ts/askar@0.6.2", "@credo-ts/askar@^0.6.1": + version "0.6.2" + resolved "https://registry.yarnpkg.com/@credo-ts/askar/-/askar-0.6.2.tgz#3d5ea35e9a30f41df9db0134bae1d185aa8e5fda" + integrity sha512-SeAjHBuk+2l5For/0v8vzQuDbBB6TbLRg8AfChKV2phGsKKoIGXtDwZZLicvB+bgtRrR221keL8LrHp9kN3o7Q== dependencies: - "@credo-ts/core" "0.6.1" + "@credo-ts/core" "0.6.2" class-transformer "0.5.1" - class-validator "^0.14.1" + class-validator "^0.14.3" rxjs "^7.8.2" tsyringe "^4.10.0" -"@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== +"@credo-ts/core@0.6.2", "@credo-ts/core@^0.6.1": + version "0.6.2" + resolved "https://registry.yarnpkg.com/@credo-ts/core/-/core-0.6.2.tgz#7ee8e78ce3fad3d2c60db978623e2b29784b24b7" + integrity sha512-A7yXs6y/73wIvgEHpfriVZW1osuASYhrO/TQIFlwSK/cRTjaXWFgBapzYaJh09O1PuEJ4v1A1mt72uardqCj8g== dependencies: "@animo-id/mdoc" "^0.5.2" "@animo-id/pex" "^6.1.1" @@ -428,21 +426,21 @@ "@peculiar/asn1-rsa" "^2.6.0" "@peculiar/asn1-schema" "^2.6.0" "@peculiar/asn1-x509" "^2.6.0" - "@peculiar/x509" "^1.14.2" - "@sd-jwt/core" "^0.17.0" - "@sd-jwt/decode" "^0.17.0" - "@sd-jwt/jwt-status-list" "^0.17.1" - "@sd-jwt/present" "^0.17.0" - "@sd-jwt/sd-jwt-vc" "^0.17.1" - "@sd-jwt/types" "^0.17.0" - "@sd-jwt/utils" "^0.17.0" + "@peculiar/x509" "^1.14.3" + "@sd-jwt/core" "^0.19.0" + "@sd-jwt/decode" "^0.19.0" + "@sd-jwt/jwt-status-list" "^0.19.0" + "@sd-jwt/present" "^0.19.0" + "@sd-jwt/sd-jwt-vc" "^0.19.0" + "@sd-jwt/types" "^0.19.0" + "@sd-jwt/utils" "^0.19.0" "@sphereon/pex-models" "^2.3.2" "@sphereon/ssi-types" "0.33.0" "@stablelib/ed25519" "^2.0.2" "@types/ws" "^8.18.1" buffer "^6.0.3" class-transformer "0.5.1" - class-validator "^0.14.1" + class-validator "^0.14.3" dcql "^3.0.0" did-resolver "^4.1.0" ec-compression "0.0.1-alpha.12" @@ -454,57 +452,57 @@ tsyringe "^4.10.0" uuid "^13.0.0" varint "^6.0.0" - web-did-resolver "^2.0.31" + web-did-resolver "^2.0.32" webcrypto-core "^1.8.1" - zod "^4.1.12" + zod "^4.3.6" -"@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== +"@credo-ts/didcomm@0.6.2": + version "0.6.2" + resolved "https://registry.yarnpkg.com/@credo-ts/didcomm/-/didcomm-0.6.2.tgz#651ecf9039335faa0b8b0286a3598705381fc1e4" + integrity sha512-0cZP753sxzcw11Y3/3B3GY3qYPfw+r/TwqzpOvwiUHDMMdvQOP4yrfqTvI2Ae0fwzfz69ePoMo52tlXYbgAadw== dependencies: - "@credo-ts/core" "0.6.1" + "@credo-ts/core" "0.6.2" class-transformer "0.5.1" - class-validator "^0.14.1" + class-validator "^0.14.3" luxon "^3.7.2" query-string "^9.3.1" rxjs "^7.8.2" -"@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== +"@credo-ts/indy-vdr@0.6.2": + version "0.6.2" + resolved "https://registry.yarnpkg.com/@credo-ts/indy-vdr/-/indy-vdr-0.6.2.tgz#fecf255070f250981031f83f5aceb5ec64b91257" + integrity sha512-9nvYjs4ys+iC4H04aQodMtHV8aHPEA42oN0ijRew+mYTNOW2lpuyHl4q4HeuUHWwzQjTrKWE6LGkLX/6BKcbCA== dependencies: - "@credo-ts/anoncreds" "0.6.1" - "@credo-ts/core" "0.6.1" + "@credo-ts/anoncreds" "0.6.2" + "@credo-ts/core" "0.6.2" -"@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== +"@credo-ts/node@0.6.2": + version "0.6.2" + resolved "https://registry.yarnpkg.com/@credo-ts/node/-/node-0.6.2.tgz#ed6a745d87b218ec1db32f3687af1d1c48b7ff6a" + integrity sha512-bHeQG77qxnh6xqVpJiLlBYgTtj0bVM8jqwrWcbcf1hKia6MldTJjeQ0c28bcW08dVLiQ+Bm0mObYWQQ6sKcwXw== dependencies: - "@credo-ts/core" "0.6.1" - "@credo-ts/didcomm" "0.6.1" + "@credo-ts/core" "0.6.2" + "@credo-ts/didcomm" "0.6.2" "@types/express" "^5.0.6" - express "^5.2.0" + express "^5.2.1" rxjs "^7.8.2" - ws "^8.18.3" - -"@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" + ws "^8.19.0" + +"@credo-ts/openid4vc@0.6.2": + version "0.6.2" + resolved "https://registry.yarnpkg.com/@credo-ts/openid4vc/-/openid4vc-0.6.2.tgz#52e05aad6927e43174fdc097dabc39a7bf0933e5" + integrity sha512-3LAVCdEM3wAMTJmmDi2D5liJTkvhK+rt2kp+Im8zQ0Zn6tcbcSAaPJHZ00+wa8w1oMb2AYFTqAKDZwzw0RfGUQ== + dependencies: + "@credo-ts/core" "0.6.2" + "@openid4vc/oauth2" "^0.4.5" + "@openid4vc/openid4vci" "^0.4.5" + "@openid4vc/openid4vp" "^0.4.5" + "@openid4vc/utils" "^0.4.5" "@types/express" "^5.0.6" class-transformer "0.5.1" - express "^5.2.0" + express "^5.2.1" rxjs "^7.8.2" - zod "^4.1.12" + zod "^4.3.6" "@credo-ts/push-notifications@^0.7.1": version "0.7.1" @@ -515,24 +513,24 @@ class-validator "0.14.1" tsyringe "^4.6.0" -"@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== +"@credo-ts/question-answer@0.6.2": + version "0.6.2" + resolved "https://registry.yarnpkg.com/@credo-ts/question-answer/-/question-answer-0.6.2.tgz#b9d7e7f8074f8eaaeeb549025e7fb01c14a06e75" + integrity sha512-Vq2+9Mj3DNirkgvujAQXJBdjrNI6/PDii97DE1KTgGfriuzKTcVBV8zTRbxvykYU0460ab/FE3zkhJr1zGz6Og== dependencies: - "@credo-ts/core" "0.6.1" - "@credo-ts/didcomm" "0.6.1" + "@credo-ts/core" "0.6.2" + "@credo-ts/didcomm" "0.6.2" class-transformer "0.5.1" - class-validator "^0.14.1" + class-validator "^0.14.3" rxjs "^7.8.2" -"@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== +"@credo-ts/tenants@0.6.2": + version "0.6.2" + resolved "https://registry.yarnpkg.com/@credo-ts/tenants/-/tenants-0.6.2.tgz#8bef564c37c5729bb71e12ea4547a84255ce555f" + integrity sha512-DC1uaoIUwc2OLlpygq2YQZStgHAgLg5dkUir+i4fMcHvK32hUFXg6tMneIyDek7iJpHGGaV6ZAiKJDVxFDWMfg== dependencies: - "@credo-ts/core" "0.6.1" - "@credo-ts/didcomm" "0.6.1" + "@credo-ts/core" "0.6.2" + "@credo-ts/didcomm" "0.6.2" async-mutex "^0.5.0" "@cspotcode/source-map-support@^0.8.0": @@ -687,22 +685,7 @@ "@eslint/core" "^0.17.0" levn "^0.4.1" -"@ethersproject/abi@5.8.0", "@ethersproject/abi@^5.1.2", "@ethersproject/abi@^5.8.0": - version "5.8.0" - resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.8.0.tgz#e79bb51940ac35fe6f3262d7fe2cdb25ad5f07d9" - integrity sha512-b9YS/43ObplgyV6SlyQsG53/vkSal0MNA1fskSC4mbnCMi8R+NkcH8K9FPYNESf6jUefBUniE4SOKms0E/KK1Q== - dependencies: - "@ethersproject/address" "^5.8.0" - "@ethersproject/bignumber" "^5.8.0" - "@ethersproject/bytes" "^5.8.0" - "@ethersproject/constants" "^5.8.0" - "@ethersproject/hash" "^5.8.0" - "@ethersproject/keccak256" "^5.8.0" - "@ethersproject/logger" "^5.8.0" - "@ethersproject/properties" "^5.8.0" - "@ethersproject/strings" "^5.8.0" - -"@ethersproject/abstract-provider@5.8.0", "@ethersproject/abstract-provider@^5.8.0": +"@ethersproject/abstract-provider@^5.8.0": version "5.8.0" resolved "https://registry.yarnpkg.com/@ethersproject/abstract-provider/-/abstract-provider-5.8.0.tgz#7581f9be601afa1d02b95d26b9d9840926a35b0c" integrity sha512-wC9SFcmh4UK0oKuLJQItoQdzS/qZ51EJegK6EmAWlh+OptpQ/npECOR3QqECd8iGHC0RJb4WKbVdSfif4ammrg== @@ -715,7 +698,7 @@ "@ethersproject/transactions" "^5.8.0" "@ethersproject/web" "^5.8.0" -"@ethersproject/abstract-signer@5.8.0", "@ethersproject/abstract-signer@^5.8.0": +"@ethersproject/abstract-signer@^5.8.0": version "5.8.0" resolved "https://registry.yarnpkg.com/@ethersproject/abstract-signer/-/abstract-signer-5.8.0.tgz#8d7417e95e4094c1797a9762e6789c7356db0754" integrity sha512-N0XhZTswXcmIZQdYtUnd79VJzvEwXQw6PK0dTl9VoYrEBxxCPXqS0Eod7q5TNKRxe1/5WUMuR0u0nqTF/avdCA== @@ -726,7 +709,7 @@ "@ethersproject/logger" "^5.8.0" "@ethersproject/properties" "^5.8.0" -"@ethersproject/address@5.8.0", "@ethersproject/address@^5.0.2", "@ethersproject/address@^5.8.0": +"@ethersproject/address@^5.8.0": version "5.8.0" resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.8.0.tgz#3007a2c352eee566ad745dca1dbbebdb50a6a983" integrity sha512-GhH/abcC46LJwshoN+uBNoKVFPxUuZm6dA257z0vZkKmU1+t8xTn8oK7B9qrj8W2rFRMch4gbJl6PmVxjxBEBA== @@ -737,14 +720,14 @@ "@ethersproject/logger" "^5.8.0" "@ethersproject/rlp" "^5.8.0" -"@ethersproject/base64@5.8.0", "@ethersproject/base64@^5.8.0": +"@ethersproject/base64@^5.8.0": version "5.8.0" resolved "https://registry.yarnpkg.com/@ethersproject/base64/-/base64-5.8.0.tgz#61c669c648f6e6aad002c228465d52ac93ee83eb" integrity sha512-lN0oIwfkYj9LbPx4xEkie6rAMJtySbpOAFXSDVQaBnAzYfB4X2Qr+FXJGxMoc3Bxp2Sm8OwvzMrywxyw0gLjIQ== dependencies: "@ethersproject/bytes" "^5.8.0" -"@ethersproject/basex@5.8.0", "@ethersproject/basex@^5.7.0", "@ethersproject/basex@^5.8.0": +"@ethersproject/basex@^5.8.0": version "5.8.0" resolved "https://registry.yarnpkg.com/@ethersproject/basex/-/basex-5.8.0.tgz#1d279a90c4be84d1c1139114a1f844869e57d03a" integrity sha512-PIgTszMlDRmNwW9nhS6iqtVfdTAKosA7llYXNmGPw4YAI1PUyMv28988wAb41/gHF/WqGdoLv0erHaRcHRKW2Q== @@ -752,7 +735,7 @@ "@ethersproject/bytes" "^5.8.0" "@ethersproject/properties" "^5.8.0" -"@ethersproject/bignumber@5.8.0", "@ethersproject/bignumber@^5.8.0": +"@ethersproject/bignumber@^5.8.0": version "5.8.0" resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.8.0.tgz#c381d178f9eeb370923d389284efa19f69efa5d7" integrity sha512-ZyaT24bHaSeJon2tGPKIiHszWjD/54Sz8t57Toch475lCLljC6MgPmxk7Gtzz+ddNN5LuHea9qhAe0x3D+uYPA== @@ -761,37 +744,21 @@ "@ethersproject/logger" "^5.8.0" bn.js "^5.2.1" -"@ethersproject/bytes@5.8.0", "@ethersproject/bytes@^5.8.0": +"@ethersproject/bytes@^5.8.0": version "5.8.0" resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.8.0.tgz#9074820e1cac7507a34372cadeb035461463be34" integrity sha512-vTkeohgJVCPVHu5c25XWaWQOZ4v+DkGoC42/TS2ond+PARCxTJvgTFUNDZovyQ/uAQ4EcpqqowKydcdmRKjg7A== dependencies: "@ethersproject/logger" "^5.8.0" -"@ethersproject/constants@5.8.0", "@ethersproject/constants@^5.8.0": +"@ethersproject/constants@^5.8.0": version "5.8.0" resolved "https://registry.yarnpkg.com/@ethersproject/constants/-/constants-5.8.0.tgz#12f31c2f4317b113a4c19de94e50933648c90704" integrity sha512-wigX4lrf5Vu+axVTIvNsuL6YrV4O5AXl5ubcURKMEME5TnWBouUh0CDTWxZ2GpnRn1kcCgE7l8O5+VbV9QTTcg== dependencies: "@ethersproject/bignumber" "^5.8.0" -"@ethersproject/contracts@5.8.0": - version "5.8.0" - resolved "https://registry.yarnpkg.com/@ethersproject/contracts/-/contracts-5.8.0.tgz#243a38a2e4aa3e757215ea64e276f8a8c9d8ed73" - integrity sha512-0eFjGz9GtuAi6MZwhb4uvUM216F38xiuR0yYCjKJpNfSEy4HUM8hvqqBj9Jmm0IUz8l0xKEhWwLIhPgxNY0yvQ== - dependencies: - "@ethersproject/abi" "^5.8.0" - "@ethersproject/abstract-provider" "^5.8.0" - "@ethersproject/abstract-signer" "^5.8.0" - "@ethersproject/address" "^5.8.0" - "@ethersproject/bignumber" "^5.8.0" - "@ethersproject/bytes" "^5.8.0" - "@ethersproject/constants" "^5.8.0" - "@ethersproject/logger" "^5.8.0" - "@ethersproject/properties" "^5.8.0" - "@ethersproject/transactions" "^5.8.0" - -"@ethersproject/hash@5.8.0", "@ethersproject/hash@^5.8.0": +"@ethersproject/hash@^5.8.0": version "5.8.0" resolved "https://registry.yarnpkg.com/@ethersproject/hash/-/hash-5.8.0.tgz#b8893d4629b7f8462a90102572f8cd65a0192b4c" integrity sha512-ac/lBcTbEWW/VGJij0CNSw/wPcw9bSRgCB0AIBz8CvED/jfvDoV9hsIIiWfvWmFEi8RcXtlNwp2jv6ozWOsooA== @@ -806,7 +773,7 @@ "@ethersproject/properties" "^5.8.0" "@ethersproject/strings" "^5.8.0" -"@ethersproject/hdnode@5.8.0", "@ethersproject/hdnode@^5.8.0": +"@ethersproject/hdnode@^5.8.0": version "5.8.0" resolved "https://registry.yarnpkg.com/@ethersproject/hdnode/-/hdnode-5.8.0.tgz#a51ae2a50bcd48ef6fd108c64cbae5e6ff34a761" integrity sha512-4bK1VF6E83/3/Im0ERnnUeWOY3P1BZml4ZD3wcH8Ys0/d1h1xaFt6Zc+Dh9zXf9TapGro0T4wvO71UTCp3/uoA== @@ -824,7 +791,7 @@ "@ethersproject/transactions" "^5.8.0" "@ethersproject/wordlists" "^5.8.0" -"@ethersproject/json-wallets@5.8.0", "@ethersproject/json-wallets@^5.8.0": +"@ethersproject/json-wallets@^5.8.0": version "5.8.0" resolved "https://registry.yarnpkg.com/@ethersproject/json-wallets/-/json-wallets-5.8.0.tgz#d18de0a4cf0f185f232eb3c17d5e0744d97eb8c9" integrity sha512-HxblNck8FVUtNxS3VTEYJAcwiKYsBIF77W15HufqlBF9gGfhmYOJtYZp8fSDZtn9y5EaXTE87zDwzxRoTFk11w== @@ -843,7 +810,7 @@ aes-js "3.0.0" scrypt-js "3.0.1" -"@ethersproject/keccak256@5.8.0", "@ethersproject/keccak256@^5.8.0": +"@ethersproject/keccak256@^5.8.0": version "5.8.0" resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.8.0.tgz#d2123a379567faf2d75d2aaea074ffd4df349e6a" integrity sha512-A1pkKLZSz8pDaQ1ftutZoaN46I6+jvuqugx5KYNeQOPqq+JZ0Txm7dlWesCHB5cndJSu5vP2VKptKf7cksERng== @@ -851,19 +818,19 @@ "@ethersproject/bytes" "^5.8.0" js-sha3 "0.8.0" -"@ethersproject/logger@5.8.0", "@ethersproject/logger@^5.8.0": +"@ethersproject/logger@^5.8.0": version "5.8.0" resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.8.0.tgz#f0232968a4f87d29623a0481690a2732662713d6" integrity sha512-Qe6knGmY+zPPWTC+wQrpitodgBfH7XoceCGL5bJVejmH+yCS3R8jJm8iiWuvWbG76RUmyEG53oqv6GMVWqunjA== -"@ethersproject/networks@5.8.0", "@ethersproject/networks@^5.8.0": +"@ethersproject/networks@^5.8.0": version "5.8.0" resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.8.0.tgz#8b4517a3139380cba9fb00b63ffad0a979671fde" integrity sha512-egPJh3aPVAzbHwq8DD7Po53J4OUSsA1MjQp8Vf/OZPav5rlmWUaFLiq8cvQiGK0Z5K6LYzm29+VA/p4RL1FzNg== dependencies: "@ethersproject/logger" "^5.8.0" -"@ethersproject/pbkdf2@5.8.0", "@ethersproject/pbkdf2@^5.8.0": +"@ethersproject/pbkdf2@^5.8.0": version "5.8.0" resolved "https://registry.yarnpkg.com/@ethersproject/pbkdf2/-/pbkdf2-5.8.0.tgz#cd2621130e5dd51f6a0172e63a6e4a0c0a0ec37e" integrity sha512-wuHiv97BrzCmfEaPbUFpMjlVg/IDkZThp9Ri88BpjRleg4iePJaj2SW8AIyE8cXn5V1tuAaMj6lzvsGJkGWskg== @@ -871,40 +838,14 @@ "@ethersproject/bytes" "^5.8.0" "@ethersproject/sha2" "^5.8.0" -"@ethersproject/properties@5.8.0", "@ethersproject/properties@^5.8.0": +"@ethersproject/properties@^5.8.0": version "5.8.0" resolved "https://registry.yarnpkg.com/@ethersproject/properties/-/properties-5.8.0.tgz#405a8affb6311a49a91dabd96aeeae24f477020e" integrity sha512-PYuiEoQ+FMaZZNGrStmN7+lWjlsoufGIHdww7454FIaGdbe/p5rnaCXTr5MtBYl3NkeoVhHZuyzChPeGeKIpQw== dependencies: "@ethersproject/logger" "^5.8.0" -"@ethersproject/providers@5.8.0": - version "5.8.0" - resolved "https://registry.yarnpkg.com/@ethersproject/providers/-/providers-5.8.0.tgz#6c2ae354f7f96ee150439f7de06236928bc04cb4" - integrity sha512-3Il3oTzEx3o6kzcg9ZzbE+oCZYyY+3Zh83sKkn4s1DZfTUjIegHnN2Cm0kbn9YFy45FDVcuCLLONhU7ny0SsCw== - dependencies: - "@ethersproject/abstract-provider" "^5.8.0" - "@ethersproject/abstract-signer" "^5.8.0" - "@ethersproject/address" "^5.8.0" - "@ethersproject/base64" "^5.8.0" - "@ethersproject/basex" "^5.8.0" - "@ethersproject/bignumber" "^5.8.0" - "@ethersproject/bytes" "^5.8.0" - "@ethersproject/constants" "^5.8.0" - "@ethersproject/hash" "^5.8.0" - "@ethersproject/logger" "^5.8.0" - "@ethersproject/networks" "^5.8.0" - "@ethersproject/properties" "^5.8.0" - "@ethersproject/random" "^5.8.0" - "@ethersproject/rlp" "^5.8.0" - "@ethersproject/sha2" "^5.8.0" - "@ethersproject/strings" "^5.8.0" - "@ethersproject/transactions" "^5.8.0" - "@ethersproject/web" "^5.8.0" - bech32 "1.1.4" - ws "8.18.0" - -"@ethersproject/random@5.8.0", "@ethersproject/random@^5.8.0": +"@ethersproject/random@^5.8.0": version "5.8.0" resolved "https://registry.yarnpkg.com/@ethersproject/random/-/random-5.8.0.tgz#1bced04d49449f37c6437c701735a1a022f0057a" integrity sha512-E4I5TDl7SVqyg4/kkA/qTfuLWAQGXmSOgYyO01So8hLfwgKvYK5snIlzxJMk72IFdG/7oh8yuSqY2KX7MMwg+A== @@ -912,7 +853,7 @@ "@ethersproject/bytes" "^5.8.0" "@ethersproject/logger" "^5.8.0" -"@ethersproject/rlp@5.8.0", "@ethersproject/rlp@^5.8.0": +"@ethersproject/rlp@^5.8.0": version "5.8.0" resolved "https://registry.yarnpkg.com/@ethersproject/rlp/-/rlp-5.8.0.tgz#5a0d49f61bc53e051532a5179472779141451de5" integrity sha512-LqZgAznqDbiEunaUvykH2JAoXTT9NV0Atqk8rQN9nx9SEgThA/WMx5DnW8a9FOufo//6FZOCHZ+XiClzgbqV9Q== @@ -920,7 +861,7 @@ "@ethersproject/bytes" "^5.8.0" "@ethersproject/logger" "^5.8.0" -"@ethersproject/sha2@5.8.0", "@ethersproject/sha2@^5.8.0": +"@ethersproject/sha2@^5.8.0": version "5.8.0" resolved "https://registry.yarnpkg.com/@ethersproject/sha2/-/sha2-5.8.0.tgz#8954a613bb78dac9b46829c0a95de561ef74e5e1" integrity sha512-dDOUrXr9wF/YFltgTBYS0tKslPEKr6AekjqDW2dbn1L1xmjGR+9GiKu4ajxovnrDbwxAKdHjW8jNcwfz8PAz4A== @@ -929,7 +870,7 @@ "@ethersproject/logger" "^5.8.0" hash.js "1.1.7" -"@ethersproject/signing-key@5.8.0", "@ethersproject/signing-key@^5.7.0", "@ethersproject/signing-key@^5.8.0": +"@ethersproject/signing-key@^5.8.0": version "5.8.0" resolved "https://registry.yarnpkg.com/@ethersproject/signing-key/-/signing-key-5.8.0.tgz#9797e02c717b68239c6349394ea85febf8893119" integrity sha512-LrPW2ZxoigFi6U6aVkFN/fa9Yx/+4AtIUe4/HACTvKJdhm0eeb107EVCIQcrLZkxaSIgc/eCrX8Q1GtbH+9n3w== @@ -941,19 +882,7 @@ elliptic "6.6.1" hash.js "1.1.7" -"@ethersproject/solidity@5.8.0": - version "5.8.0" - resolved "https://registry.yarnpkg.com/@ethersproject/solidity/-/solidity-5.8.0.tgz#429bb9fcf5521307a9448d7358c26b93695379b9" - integrity sha512-4CxFeCgmIWamOHwYN9d+QWGxye9qQLilpgTU0XhYs1OahkclF+ewO+3V1U0mvpiuQxm5EHHmv8f7ClVII8EHsA== - dependencies: - "@ethersproject/bignumber" "^5.8.0" - "@ethersproject/bytes" "^5.8.0" - "@ethersproject/keccak256" "^5.8.0" - "@ethersproject/logger" "^5.8.0" - "@ethersproject/sha2" "^5.8.0" - "@ethersproject/strings" "^5.8.0" - -"@ethersproject/strings@5.8.0", "@ethersproject/strings@^5.8.0": +"@ethersproject/strings@^5.8.0": version "5.8.0" resolved "https://registry.yarnpkg.com/@ethersproject/strings/-/strings-5.8.0.tgz#ad79fafbf0bd272d9765603215ac74fd7953908f" integrity sha512-qWEAk0MAvl0LszjdfnZ2uC8xbR2wdv4cDabyHiBh3Cldq/T8dPH3V4BbBsAYJUeonwD+8afVXld274Ls+Y1xXg== @@ -962,7 +891,7 @@ "@ethersproject/constants" "^5.8.0" "@ethersproject/logger" "^5.8.0" -"@ethersproject/transactions@5.8.0", "@ethersproject/transactions@^5.7.0", "@ethersproject/transactions@^5.8.0": +"@ethersproject/transactions@^5.8.0": version "5.8.0" resolved "https://registry.yarnpkg.com/@ethersproject/transactions/-/transactions-5.8.0.tgz#1e518822403abc99def5a043d1c6f6fe0007e46b" integrity sha512-UglxSDjByHG0TuU17bDfCemZ3AnKO2vYrL5/2n2oXvKzvb7Cz+W9gOWXKARjp2URVwcWlQlPOEQyAviKwT4AHg== @@ -977,16 +906,7 @@ "@ethersproject/rlp" "^5.8.0" "@ethersproject/signing-key" "^5.8.0" -"@ethersproject/units@5.8.0": - version "5.8.0" - resolved "https://registry.yarnpkg.com/@ethersproject/units/-/units-5.8.0.tgz#c12f34ba7c3a2de0e9fa0ed0ee32f3e46c5c2c6a" - integrity sha512-lxq0CAnc5kMGIiWW4Mr041VT8IhNM+Pn5T3haO74XZWFulk7wH1Gv64HqE96hT4a7iiNMdOCFEBgaxWuk8ETKQ== - dependencies: - "@ethersproject/bignumber" "^5.8.0" - "@ethersproject/constants" "^5.8.0" - "@ethersproject/logger" "^5.8.0" - -"@ethersproject/wallet@5.8.0", "@ethersproject/wallet@^5.7.0": +"@ethersproject/wallet@^5.8.0": version "5.8.0" resolved "https://registry.yarnpkg.com/@ethersproject/wallet/-/wallet-5.8.0.tgz#49c300d10872e6986d953e8310dc33d440da8127" integrity sha512-G+jnzmgg6UxurVKRKvw27h0kvG75YKXZKdlLYmAHeF32TGUzHkOFd7Zn6QHOTYRFWnfjtSSFjBowKo7vfrXzPA== @@ -1007,7 +927,7 @@ "@ethersproject/transactions" "^5.8.0" "@ethersproject/wordlists" "^5.8.0" -"@ethersproject/web@5.8.0", "@ethersproject/web@^5.8.0": +"@ethersproject/web@^5.8.0": version "5.8.0" resolved "https://registry.yarnpkg.com/@ethersproject/web/-/web-5.8.0.tgz#3e54badc0013b7a801463a7008a87988efce8a37" integrity sha512-j7+Ksi/9KfGviws6Qtf9Q7KCqRhpwrYKQPs+JBA/rKVFF/yaWLHJEH3zfVP2plVu+eys0d2DlFmhoQJayFewcw== @@ -1018,7 +938,7 @@ "@ethersproject/properties" "^5.8.0" "@ethersproject/strings" "^5.8.0" -"@ethersproject/wordlists@5.8.0", "@ethersproject/wordlists@^5.8.0": +"@ethersproject/wordlists@^5.8.0": version "5.8.0" resolved "https://registry.yarnpkg.com/@ethersproject/wordlists/-/wordlists-5.8.0.tgz#7a5654ee8d1bb1f4dbe43f91d217356d650ad821" integrity sha512-2df9bbXicZws2Sb5S6ET493uJ0Z84Fjr3pC4tu/qlnZERibZCeUVuqdtt+7Tv9xxhUxHoIekIA7avrKUWHrezg== @@ -1029,11 +949,6 @@ "@ethersproject/properties" "^5.8.0" "@ethersproject/strings" "^5.8.0" -"@fastify/busboy@^2.0.0": - version "2.1.1" - resolved "https://registry.yarnpkg.com/@fastify/busboy/-/busboy-2.1.1.tgz#b9da6a878a371829a0502c9b6c1c143ef6663f4d" - integrity sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA== - "@grpc/grpc-js@^1.7.1": version "1.14.2" resolved "https://registry.yarnpkg.com/@grpc/grpc-js/-/grpc-js-1.14.2.tgz#d245069181a1a8057abd35522d6052482730cf19" @@ -1719,54 +1634,40 @@ resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.8.0.tgz#cee43d801fcef9644b11b8194857695acd5f815a" integrity sha512-jCs9ldd7NwzpgXDIf6P3+NrHh9/sD6CQdxHyjQI+h/6rDNo88ypBxxz45UDuZHz9r3tNz7N/VInSVoVdtXEI4A== -"@nomicfoundation/hardhat-verify@^2.0.3": - version "2.1.3" - resolved "https://registry.yarnpkg.com/@nomicfoundation/hardhat-verify/-/hardhat-verify-2.1.3.tgz#f61a192a792b39f9978cef1450047deaff3ea052" - integrity sha512-danbGjPp2WBhLkJdQy9/ARM3WQIK+7vwzE0urNem1qZJjh9f54Kf5f1xuQv8DvqewUAkuPxVt/7q4Grz5WjqSg== +"@openid4vc/oauth2@0.4.6", "@openid4vc/oauth2@^0.4.5": + version "0.4.6" + resolved "https://registry.yarnpkg.com/@openid4vc/oauth2/-/oauth2-0.4.6.tgz#197d424ae8144f1c085f4ec559cc93fa8df3f6be" + integrity sha512-PVa+N9UHt4KhHh02KHUHqS64vdnoaktNSVr7VUgeaB1NS0c3+7UIa2A/TnsyZqUAy9TxGltAflxsaWO+HtWPQQ== dependencies: - "@ethersproject/abi" "^5.1.2" - "@ethersproject/address" "^5.0.2" - cbor "^8.1.0" - debug "^4.1.1" - lodash.clonedeep "^4.5.0" - picocolors "^1.1.0" - semver "^6.3.0" - table "^6.8.0" - undici "^5.14.0" + "@openid4vc/utils" "0.4.6" + zod "^4.3.5" -"@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== +"@openid4vc/openid4vci@^0.4.5": + version "0.4.6" + resolved "https://registry.yarnpkg.com/@openid4vc/openid4vci/-/openid4vci-0.4.6.tgz#ee2b1d1b1e91ac48e50a818facce3951491bb43d" + integrity sha512-qjxLeE6K285r+lyy+4jJFS+M70+dyImVGvqo97BO+JxL4059jMb/FwJIXjnp2Ygl8+FuaEgFxhGpFdnaNwj30w== dependencies: - "@openid4vc/utils" "0.4.2" - zod "^4.1.13" + "@openid4vc/oauth2" "0.4.6" + "@openid4vc/utils" "0.4.6" + zod "^4.3.5" -"@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== +"@openid4vc/openid4vp@^0.4.5": + version "0.4.6" + resolved "https://registry.yarnpkg.com/@openid4vc/openid4vp/-/openid4vp-0.4.6.tgz#60d729cf07d69a4036c8ef52ea08207fbb637b85" + integrity sha512-d7H8SuFlHZS30OC1U8vsezGHuXkOTp97rrHbsxrge7AQaHHi8BZXAwUGdujbXdkkU7zulXx9yk2+J+ZTb/GE3A== dependencies: - "@openid4vc/oauth2" "0.4.2" - "@openid4vc/utils" "0.4.2" - zod "^4.1.13" + "@openid4vc/oauth2" "0.4.6" + "@openid4vc/utils" "0.4.6" + zod "^4.3.5" -"@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.2" - "@openid4vc/utils" "0.4.2" - zod "^4.1.13" - -"@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== +"@openid4vc/utils@0.4.6", "@openid4vc/utils@^0.4.5": + version "0.4.6" + resolved "https://registry.yarnpkg.com/@openid4vc/utils/-/utils-0.4.6.tgz#abe1360878e691fbf2ca19bc8e7f23c1f2a73197" + integrity sha512-qpZ40ccnYTMdmW5zzIiN5SvNBzWHu0cUz97Itw+YMC8obosQ62c4Tg9LpwWwVirouN9oOQZ7IuF1EDakiB8w3w== dependencies: buffer "^6.0.3" - zod "^4.1.13" + zod "^4.3.5" + zod-validation-error "^5.0.0" "@opentelemetry/api-logs@0.202.0": version "0.202.0" @@ -2230,10 +2131,10 @@ dependencies: tslib "^2.0.0" -"@peculiar/x509@^1.14.2": - version "1.14.2" - resolved "https://registry.yarnpkg.com/@peculiar/x509/-/x509-1.14.2.tgz#635078480a0e4796eab2fb765361dec142af0f3b" - integrity sha512-r2w1Hg6pODDs0zfAKHkSS5HLkOLSeburtcgwvlLLWWCixw+MmW3U6kD5ddyvc2Y2YdbGuVwCF2S2ASoU1cFAag== +"@peculiar/x509@^1.14.3": + version "1.14.3" + resolved "https://registry.yarnpkg.com/@peculiar/x509/-/x509-1.14.3.tgz#2c44c2b89474346afec38a0c2803ec4fb8ce959e" + integrity sha512-C2Xj8FZ0uHWeCXXqX5B4/gVFQmtSkiuOolzAgutjTfseNOHT3pUjljDZsTSxXFGgio54bCzVFqmEOUrIVk8RDA== dependencies: "@peculiar/asn1-cms" "^2.6.0" "@peculiar/asn1-csr" "^2.6.0" @@ -2320,23 +2221,23 @@ resolved "https://registry.yarnpkg.com/@scarf/scarf/-/scarf-1.4.0.tgz#3bbb984085dbd6d982494538b523be1ce6562972" integrity sha512-xxeapPiUXdZAE3che6f3xogoJPeZgig6omHEy1rIY5WVsB3H2BHNnZH+gHG6x91SCWyQCzWGsuL2Hh3ClO5/qQ== -"@sd-jwt/core@0.17.0", "@sd-jwt/core@^0.17.0": - version "0.17.0" - resolved "https://registry.yarnpkg.com/@sd-jwt/core/-/core-0.17.0.tgz#dec5dacb4f2ec8baabb2651323b0ad265540a712" - integrity sha512-8NM2kZFjBxNT7JE+UukhcXDEiTq/6LSltVx2R2BlL2NlbYaT29Eln+vKyULNDI8FaRbh4lierLguPJGba4E5uA== +"@sd-jwt/core@0.19.0", "@sd-jwt/core@^0.19.0": + version "0.19.0" + resolved "https://registry.yarnpkg.com/@sd-jwt/core/-/core-0.19.0.tgz#b0e2cdc6e4d408de6696de13ffd635a47d921426" + integrity sha512-/FeuQjzQFtnxDsHF64Bw+3uixVogNkXlMGBo1CKWrxB/OLNqtGXQZplKBRZMJWgnOJEqDwD6750wrOxsVly6mg== dependencies: - "@sd-jwt/decode" "0.17.0" - "@sd-jwt/present" "0.17.0" - "@sd-jwt/types" "0.17.0" - "@sd-jwt/utils" "0.17.0" + "@sd-jwt/decode" "0.19.0" + "@sd-jwt/present" "0.19.0" + "@sd-jwt/types" "0.19.0" + "@sd-jwt/utils" "0.19.0" -"@sd-jwt/decode@0.17.0", "@sd-jwt/decode@^0.17.0": - version "0.17.0" - resolved "https://registry.yarnpkg.com/@sd-jwt/decode/-/decode-0.17.0.tgz#769bb5f16834959865ec5be22941b02cc439d90d" - integrity sha512-1qBA0nfsYdAPb/s+n+uWfeaYRVaiDYBg/cL7iDpPcSS8Zq8rtHFwR86KhQfRk8WR5V4cKO7p+njK/8LweqlHxg== +"@sd-jwt/decode@0.19.0", "@sd-jwt/decode@^0.19.0": + version "0.19.0" + resolved "https://registry.yarnpkg.com/@sd-jwt/decode/-/decode-0.19.0.tgz#e36ce30a6c890bd6af8afd5137ec9a186f0fba60" + integrity sha512-gRfpJseFRy3bFMdlmJjVjuEcLNuekpiZJD2F2luJIKVlk26AEjZSJf6377vwNySa8hb+i4MZDwdy14lcTTmqtA== dependencies: - "@sd-jwt/types" "0.17.0" - "@sd-jwt/utils" "0.17.0" + "@sd-jwt/types" "0.19.0" + "@sd-jwt/utils" "0.19.0" "@sd-jwt/decode@0.7.2", "@sd-jwt/decode@^0.7.2": version "0.7.2" @@ -2354,23 +2255,23 @@ "@sd-jwt/types" "0.9.2" "@sd-jwt/utils" "0.9.2" -"@sd-jwt/jwt-status-list@0.17.1", "@sd-jwt/jwt-status-list@^0.17.1": - version "0.17.1" - resolved "https://registry.yarnpkg.com/@sd-jwt/jwt-status-list/-/jwt-status-list-0.17.1.tgz#8d108429e48c97378e4ff7cda4941954c69cbe97" - integrity sha512-5vcOQsEmWwCkh7uEU7iwSaZ9aDH7nSNLnt48dTc6X5UrF9qWNFkVf8r/juBfuzSy2JlxRZQitVYGhyactiXxHA== +"@sd-jwt/jwt-status-list@0.19.0", "@sd-jwt/jwt-status-list@^0.19.0": + version "0.19.0" + resolved "https://registry.yarnpkg.com/@sd-jwt/jwt-status-list/-/jwt-status-list-0.19.0.tgz#54d5352713948905a93eae8a323b2458410875df" + integrity sha512-Xhh0n0DKe3paEtNNQSScy4dtA0ZVKF2OrmDcIB2jm77Doh4xsSs1pOseGEWBs9fmAe5Y0m082wgkmQnWEV53IQ== dependencies: - "@sd-jwt/types" "0.17.0" - "@sd-jwt/utils" "0.17.0" + "@sd-jwt/types" "0.19.0" + "@sd-jwt/utils" "0.19.0" pako "^2.1.0" -"@sd-jwt/present@0.17.0", "@sd-jwt/present@^0.17.0": - version "0.17.0" - resolved "https://registry.yarnpkg.com/@sd-jwt/present/-/present-0.17.0.tgz#23ba9ffbf064f4c25234bdf57fabfe0fe9754155" - integrity sha512-qh226z4H76uMVfFfqvltV9d0oz2N9S2REURy2HcVFKhsa1fSYZXdKkhg4S102iwp9fEELEPyCnLkW26+qwWLcg== +"@sd-jwt/present@0.19.0", "@sd-jwt/present@^0.19.0": + version "0.19.0" + resolved "https://registry.yarnpkg.com/@sd-jwt/present/-/present-0.19.0.tgz#0137cebdc80354fb590b2562537f0ed04268f58e" + integrity sha512-WXDwqwUXmtyj7YZ5c+wb26ZBeVOsKXCbCI7s1pRH9ngIjFNDGgAZoVCOmLq8pPgWSJzOTgJe3ErO2k63ZwhyeQ== dependencies: - "@sd-jwt/decode" "0.17.0" - "@sd-jwt/types" "0.17.0" - "@sd-jwt/utils" "0.17.0" + "@sd-jwt/decode" "0.19.0" + "@sd-jwt/types" "0.19.0" + "@sd-jwt/utils" "0.19.0" "@sd-jwt/present@^0.7.2": version "0.7.2" @@ -2381,19 +2282,20 @@ "@sd-jwt/types" "0.7.2" "@sd-jwt/utils" "0.7.2" -"@sd-jwt/sd-jwt-vc@^0.17.1": - version "0.17.1" - resolved "https://registry.yarnpkg.com/@sd-jwt/sd-jwt-vc/-/sd-jwt-vc-0.17.1.tgz#e77422051342efdc628d440f375b6779951232fd" - integrity sha512-rkbkAfZSJM6gLyOn+eKqzFRrsztfpo+k8odKkXv+psmmZURnOleVvECJHdn2v3ggn6HSqa5uiiH7WkjNiHmGMA== +"@sd-jwt/sd-jwt-vc@^0.19.0": + version "0.19.0" + resolved "https://registry.yarnpkg.com/@sd-jwt/sd-jwt-vc/-/sd-jwt-vc-0.19.0.tgz#c9c936483e120fda0745a13d157b722a329ff986" + integrity sha512-sjX9/E32X0HNpOM5b9np2fHSS9CJu72JDkGEuaHTfZTLTmgh1Cj6KhP7kwI1Bxhw0CCt7tjhrAmMvEEIbgIwVg== dependencies: - "@sd-jwt/core" "0.17.0" - "@sd-jwt/jwt-status-list" "0.17.1" - "@sd-jwt/utils" "0.17.0" + "@sd-jwt/core" "0.19.0" + "@sd-jwt/jwt-status-list" "0.19.0" + "@sd-jwt/utils" "0.19.0" + zod "^4.3.5" -"@sd-jwt/types@0.17.0", "@sd-jwt/types@^0.17.0": - version "0.17.0" - resolved "https://registry.yarnpkg.com/@sd-jwt/types/-/types-0.17.0.tgz#3dde7136de12a56e6b3bbd234593b3cc8488f0a0" - integrity sha512-XMZprAzSst+ze6JXoMttV3zrUNTL9VFAzHWChENTlFuh9tM6gy+/hJjFyTO0RVO0SRRNl2c7eMeYu7byLMj6Jg== +"@sd-jwt/types@0.19.0", "@sd-jwt/types@^0.19.0": + version "0.19.0" + resolved "https://registry.yarnpkg.com/@sd-jwt/types/-/types-0.19.0.tgz#83fb2f01c3a697d46ff572a1ef3c487530a22425" + integrity sha512-nfuC9zRLKe7o4HSvc+N4ojWRAxo4JGfgcNWpR7bJloLUlnE9eQuu9h9pEaJZht7KRwMpGorNTIdYpoi1btuiew== "@sd-jwt/types@0.7.2", "@sd-jwt/types@^0.7.2": version "0.7.2" @@ -2405,12 +2307,12 @@ resolved "https://registry.yarnpkg.com/@sd-jwt/types/-/types-0.9.2.tgz#17a9d62e36d9863b2c20a127be22a3e77005a6a8" integrity sha512-eV/MY80ekeTrqaohzPpkrgwPki6Igx69D6RniduV1Ehv6o/zaJQ2F0hY/RqBAkJhQtBQoOzouwKYHme40k1Dlw== -"@sd-jwt/utils@0.17.0", "@sd-jwt/utils@^0.17.0": - version "0.17.0" - resolved "https://registry.yarnpkg.com/@sd-jwt/utils/-/utils-0.17.0.tgz#9e3176c53389f26783a27910401c7926903da086" - integrity sha512-Xe6GgO3tzjQrKbwVgtrE4LkB8Prcl0zCX+LDFC0QCzsvrks1jEFSPpcpP5Ge/ESBK6LrNG/srBKOQlFM/RuGsg== +"@sd-jwt/utils@0.19.0", "@sd-jwt/utils@^0.19.0": + version "0.19.0" + resolved "https://registry.yarnpkg.com/@sd-jwt/utils/-/utils-0.19.0.tgz#2df84d6564fc487aede095e2dfaa7204e8a83b83" + integrity sha512-bDwDRjfxMBNOsAXY8q8hnxQq7jdOWxrdqTK926Mxt8DN+ttXbXbZIPLwSh84M90WP0V7+WdkXlZD31iISzUR3w== dependencies: - "@sd-jwt/types" "0.17.0" + "@sd-jwt/types" "0.19.0" js-base64 "^3.7.8" "@sd-jwt/utils@0.7.2": @@ -3305,7 +3207,7 @@ ajv@^6.12.4: json-schema-traverse "^0.4.1" uri-js "^4.2.2" -ajv@^8.0.0, ajv@^8.0.1, ajv@^8.12.0: +ajv@^8.0.0, ajv@^8.12.0: version "8.17.1" resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.17.1.tgz#37d9a5c776af6bc92d7f4f9510eba4c0a60d11a6" integrity sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g== @@ -3482,11 +3384,6 @@ asn1js@^3.0.5, asn1js@^3.0.6: pvutils "^1.1.3" tslib "^2.8.1" -astral-regex@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-2.0.0.tgz#483143c567aeed4785759c0865786dc77d7d2e31" - integrity sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ== - async-function@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/async-function/-/async-function-1.0.0.tgz#509c9fca60eaf85034c6829838188e4e4c8ffb2b" @@ -3598,11 +3495,6 @@ baseline-browser-mapping@^2.9.0: resolved "https://registry.yarnpkg.com/baseline-browser-mapping/-/baseline-browser-mapping-2.9.4.tgz#a010e50ea6da48fba78179aef9b6e771d00fff42" integrity sha512-ZCQ9GEWl73BVm8bu5Fts8nt7MHdbt5vY9bP6WGnUh+r3l8M7CgfyTlwsgCbMC66BNxPr6Xoce3j66Ms5YUQTNA== -bech32@1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/bech32/-/bech32-1.1.4.tgz#e38c9f37bf179b8eb16ae3a772b40c356d4832e9" - integrity sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ== - binary-extensions@^2.0.0: version "2.3.0" resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.3.0.tgz#f6e14a97858d327252200242d4ccfe522c445522" @@ -3800,13 +3692,6 @@ canonicalize@^1.0.1: resolved "https://registry.yarnpkg.com/canonicalize/-/canonicalize-1.0.8.tgz#24d1f1a00ed202faafd9bf8e63352cd4450c6df1" integrity sha512-0CNTVCLZggSh7bc5VkX5WWPWO+cyZbNd07IHIsSXLia/eAq+r836hgk+8BKoEh7949Mda87VUOitx5OddVj64A== -cbor@^8.1.0: - version "8.1.0" - resolved "https://registry.yarnpkg.com/cbor/-/cbor-8.1.0.tgz#cfc56437e770b73417a2ecbfc9caf6b771af60d5" - integrity sha512-DwGjNW9omn6EwP70aXsn7FQJx5kO12tX0bZkaTjzdVFM6/7nhA4t0EENocKGx6D2Bch9PE2KzCUf5SceBdeijg== - dependencies: - nofilter "^3.1.0" - chalk@^4.0.0, chalk@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" @@ -3869,14 +3754,14 @@ class-validator@0.14.1: libphonenumber-js "^1.10.53" validator "^13.9.0" -class-validator@^0.14.1: - version "0.14.3" - resolved "https://registry.yarnpkg.com/class-validator/-/class-validator-0.14.3.tgz#834a4caafa8359aed73d7708badb4cf271be50fe" - integrity sha512-rXXekcjofVN1LTOSw+u4u9WXVEUvNBVjORW154q/IdmYWy1nMbOU9aNtZB0t8m+FJQ9q91jlr2f9CwwUFdFMRA== +class-validator@^0.14.3: + version "0.14.4" + resolved "https://registry.yarnpkg.com/class-validator/-/class-validator-0.14.4.tgz#d0084ae847a96264ad5158451a4e66c1c544de96" + integrity sha512-AwNusCCam51q703dW82x95tOqQp6oC9HNUl724KxJJOfnKscI8dOloXFgyez7LbTTKWuRBA37FScqVbJEoq8Yw== dependencies: "@types/validator" "^13.15.3" libphonenumber-js "^1.11.1" - validator "^13.15.20" + validator "^13.15.22" cliui@^8.0.1: version "8.0.1" @@ -4668,43 +4553,7 @@ etag@^1.8.1, etag@~1.8.1: resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" integrity sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg== -ethers@^5.1.0: - version "5.8.0" - resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.8.0.tgz#97858dc4d4c74afce83ea7562fe9493cedb4d377" - integrity sha512-DUq+7fHrCg1aPDFCHx6UIPb3nmt2XMpM7Y/g2gLhsl3lIBqeAfOJIl1qEvRf2uq3BiKxmh6Fh5pfp2ieyek7Kg== - dependencies: - "@ethersproject/abi" "5.8.0" - "@ethersproject/abstract-provider" "5.8.0" - "@ethersproject/abstract-signer" "5.8.0" - "@ethersproject/address" "5.8.0" - "@ethersproject/base64" "5.8.0" - "@ethersproject/basex" "5.8.0" - "@ethersproject/bignumber" "5.8.0" - "@ethersproject/bytes" "5.8.0" - "@ethersproject/constants" "5.8.0" - "@ethersproject/contracts" "5.8.0" - "@ethersproject/hash" "5.8.0" - "@ethersproject/hdnode" "5.8.0" - "@ethersproject/json-wallets" "5.8.0" - "@ethersproject/keccak256" "5.8.0" - "@ethersproject/logger" "5.8.0" - "@ethersproject/networks" "5.8.0" - "@ethersproject/pbkdf2" "5.8.0" - "@ethersproject/properties" "5.8.0" - "@ethersproject/providers" "5.8.0" - "@ethersproject/random" "5.8.0" - "@ethersproject/rlp" "5.8.0" - "@ethersproject/sha2" "5.8.0" - "@ethersproject/signing-key" "5.8.0" - "@ethersproject/solidity" "5.8.0" - "@ethersproject/strings" "5.8.0" - "@ethersproject/transactions" "5.8.0" - "@ethersproject/units" "5.8.0" - "@ethersproject/wallet" "5.8.0" - "@ethersproject/web" "5.8.0" - "@ethersproject/wordlists" "5.8.0" - -ethers@^6.9.0: +ethers@^6.16.0: version "6.16.0" resolved "https://registry.yarnpkg.com/ethers/-/ethers-6.16.0.tgz#fff9b4f05d7a359c774ad6e91085a800f7fccf65" integrity sha512-U1wulmetNymijEhpSEQ7Ct/P/Jw9/e7R1j5XIbPRydgV2DjLVMsULDlNksq3RQnFgKoLlZf88ijYtWEXcPa07A== @@ -4803,7 +4652,7 @@ express@^4.21.2: utils-merge "1.0.1" vary "~1.1.2" -express@^5.1.0, express@^5.2.0: +express@^5.1.0, express@^5.2.1: version "5.2.1" resolved "https://registry.yarnpkg.com/express/-/express-5.2.1.tgz#8f21d15b6d327f92b4794ecf8cb08a72f956ac04" integrity sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw== @@ -6477,11 +6326,6 @@ lodash.once@^4.0.0: resolved "https://registry.yarnpkg.com/lodash.once/-/lodash.once-4.1.1.tgz#0dd3971213c7c56df880977d504c88fb471a97ac" integrity sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg== -lodash.truncate@^4.4.2: - version "4.4.2" - resolved "https://registry.yarnpkg.com/lodash.truncate/-/lodash.truncate-4.4.2.tgz#5a350da0b1113b837ecfffd5812cbe58d6eae193" - integrity sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw== - long@^5.0.0: version "5.3.2" resolved "https://registry.yarnpkg.com/long/-/long-5.3.2.tgz#1d84463095999262d7d7b7f8bfd4a8cc55167f83" @@ -6813,11 +6657,6 @@ node-releases@^2.0.27: resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.27.tgz#eedca519205cf20f650f61d56b070db111231e4e" integrity sha512-nmh3lCkYZ3grZvqcCH+fjmQ7X+H0OeZgP40OierEaAptX4XofMh5kwNbWh7lBduUzCcV/8kZ+NDLCwm2iorIlA== -nofilter@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/nofilter/-/nofilter-3.1.0.tgz#c757ba68801d41ff930ba2ec55bab52ca184aa66" - integrity sha512-l2NNj07e9afPnhAhvgVrCD/oy2Ai1yfLpuo3EpiO1jFTsB4sFz6oIfAfSZyQzVpkZQ9xS8ZS5g1jCBgq4Hwo0g== - nopt@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/nopt/-/nopt-5.0.0.tgz#530942bb58a512fccafe53fe210f13a25355dc88" @@ -7103,7 +6942,7 @@ pend@~1.2.0: resolved "https://registry.yarnpkg.com/pend/-/pend-1.2.0.tgz#7a57eb550a6783f9115331fcf4663d5c8e007a50" integrity sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg== -picocolors@^1.1.0, picocolors@^1.1.1: +picocolors@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.1.1.tgz#3d321af3eab939b083c8f929a1d12cda81c26b6b" integrity sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA== @@ -7712,15 +7551,6 @@ slash@^3.0.0: resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== -slice-ansi@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-4.0.0.tgz#500e8dd0fd55b05815086255b3195adf2a45fe6b" - integrity sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ== - dependencies: - ansi-styles "^4.0.0" - astral-regex "^2.0.0" - is-fullwidth-code-point "^3.0.0" - source-map-support@0.5.13: version "0.5.13" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.13.tgz#31b24a9c2e73c2de85066c0feb7d44767ed52932" @@ -7972,17 +7802,6 @@ synckit@^0.11.7: dependencies: "@pkgr/core" "^0.2.9" -table@^6.8.0: - version "6.9.0" - resolved "https://registry.yarnpkg.com/table/-/table-6.9.0.tgz#50040afa6264141c7566b3b81d4d82c47a8668f5" - integrity sha512-9kY+CygyYM6j02t5YFHbNz2FN5QmYGv9zAjVp4lCDjlCw7amdckXlEt/bjMhUIfj4ThGRE4gCUH5+yGnNuPo5A== - dependencies: - ajv "^8.0.1" - lodash.truncate "^4.4.2" - slice-ansi "^4.0.0" - string-width "^4.2.3" - strip-ansi "^6.0.1" - tar@^6.1.11: version "6.2.1" resolved "https://registry.yarnpkg.com/tar/-/tar-6.2.1.tgz#717549c541bc3c2af15751bea94b1dd068d4b03a" @@ -8315,13 +8134,6 @@ undici-types@~7.16.0: resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-7.16.0.tgz#ffccdff36aea4884cbfce9a750a0580224f58a46" integrity sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw== -undici@^5.14.0: - version "5.29.0" - resolved "https://registry.yarnpkg.com/undici/-/undici-5.29.0.tgz#419595449ae3f2cdcba3580a2e8903399bd1f5a3" - integrity sha512-raqeBD6NQK4SkWhQzeYKd1KmIG6dllBOTt55Rmkt4HtI9mwdWtJljnrXjAFUBLTSN67HWrOIZ3EPF4kjUw80Bg== - dependencies: - "@fastify/busboy" "^2.0.0" - undici@^6.6.2: version "6.22.0" resolved "https://registry.yarnpkg.com/undici/-/undici-6.22.0.tgz#281adbc157af41da8e75393c9d75a1b788811bc3" @@ -8399,11 +8211,6 @@ uuid@^13.0.0: resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== -uuid@^9.0.1: - version "9.0.1" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-9.0.1.tgz#e188d4c8853cc722220392c424cd637f32293f30" - integrity sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA== - v8-compile-cache-lib@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz#6336e8d71965cb3d35a1bbb7868445a7c05264bf" @@ -8423,11 +8230,16 @@ valibot@1.2.0: resolved "https://registry.yarnpkg.com/valibot/-/valibot-1.2.0.tgz#8fc720d9e4082ba16e30a914064a39619b2f1d6f" integrity sha512-mm1rxUsmOxzrwnX5arGS+U4T25RdvpPjPN4yR0u9pUBov9+zGVtO84tif1eY4r6zWxVxu3KzIyknJy3rxfRZZg== -validator@^13.12.0, validator@^13.15.20, validator@^13.9.0: +validator@^13.12.0, validator@^13.9.0: version "13.15.23" resolved "https://registry.yarnpkg.com/validator/-/validator-13.15.23.tgz#59a874f84e4594588e3409ab1edbe64e96d0c62d" integrity sha512-4yoz1kEWqUjzi5zsPbAS/903QXSYp0UOtHsPpp7p9rHAw/W+dkInskAE386Fat3oKRROwO98d9ZB0G4cObgUyw== +validator@^13.15.22: + version "13.15.26" + resolved "https://registry.yarnpkg.com/validator/-/validator-13.15.26.tgz#36c3deeab30e97806a658728a155c66fcaa5b944" + integrity sha512-spH26xU080ydGggxRyR1Yhcbgx+j3y5jbNXk/8L+iRvdIEQ4uTRH2Sgf2dokud6Q4oAtsbNvJ1Ft+9xmm6IZcA== + varint@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/varint/-/varint-6.0.0.tgz#9881eb0ce8feaea6512439d19ddf84bf551661d0" @@ -8445,7 +8257,7 @@ walker@^1.0.8: dependencies: makeerror "1.0.12" -web-did-resolver@^2.0.31: +web-did-resolver@^2.0.32: version "2.0.32" resolved "https://registry.yarnpkg.com/web-did-resolver/-/web-did-resolver-2.0.32.tgz#6c86c1797cd651620aa311a94660e0a51131b334" integrity sha512-L91/ApTmDjgzS0UDstTKn3kN/1hlQBnVcUN8K29e3xhVBpPktHYC6uvVAQ8ohbIg9D6wrrbaBQvfRArDxgJG2g== @@ -8599,16 +8411,16 @@ ws@8.17.1: resolved "https://registry.yarnpkg.com/ws/-/ws-8.17.1.tgz#9293da530bb548febc95371d90f9c878727d919b" integrity sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ== -ws@8.18.0: - version "8.18.0" - resolved "https://registry.yarnpkg.com/ws/-/ws-8.18.0.tgz#0d7505a6eafe2b0e712d232b42279f53bc289bbc" - integrity sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw== - -ws@^8.18.2, ws@^8.18.3: +ws@^8.18.2: version "8.18.3" resolved "https://registry.yarnpkg.com/ws/-/ws-8.18.3.tgz#b56b88abffde62791c639170400c93dcb0c95472" integrity sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg== +ws@^8.19.0: + version "8.19.0" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.19.0.tgz#ddc2bdfa5b9ad860204f5a72a4863a8895fd8c8b" + integrity sha512-blAT2mjOEIi0ZzruJfIhb3nps74PRWTCz1IjglWEEpQl5XS/UNama6u2/rjFkDDouqr4L67ry+1aGIALViWjDg== + xtend@^4.0.0: version "4.0.2" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" @@ -8680,7 +8492,12 @@ yocto-queue@^0.1.0: resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== -zod@^4.1.12, zod@^4.1.13: - version "4.1.13" - resolved "https://registry.yarnpkg.com/zod/-/zod-4.1.13.tgz#93699a8afe937ba96badbb0ce8be6033c0a4b6b1" - integrity sha512-AvvthqfqrAhNH9dnfmrfKzX5upOdjUVJYFqNSlkmGf64gRaTzlPwz99IHYnVs28qYAybvAlBV+H7pn0saFY4Ig== +zod-validation-error@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/zod-validation-error/-/zod-validation-error-5.0.0.tgz#96db948070b7bfcb13bfec5134113e580f9eee38" + integrity sha512-hmk+pkyKq7Q71PiWVSDUc3VfpzpvcRHZ3QPw9yEMVvmtCekaMeOHnbr3WbxfrgEnQTv6haGP4cmv0Ojmihzsxw== + +zod@^4.3.5, zod@^4.3.6: + version "4.3.6" + resolved "https://registry.yarnpkg.com/zod/-/zod-4.3.6.tgz#89c56e0aa7d2b05107d894412227087885ab112a" + integrity sha512-rftlrkhHZOcjDwkGlnUtZZkvaPHCsDATp4pGpuOOMDaTdDDXF91wuVDJoWoPsKX/3YPQ5fHuF3STjcYyKr+Qhg== From 4a2847a61fd8f887b0f275019c6e9dbdbe57bd56 Mon Sep 17 00:00:00 2001 From: Tipu_Singh Date: Tue, 3 Mar 2026 15:56:09 +0530 Subject: [PATCH 090/152] feat: added x509 certificates logic with auth Signed-off-by: Tipu_Singh --- .env.sample | 10 ++ src/cliAgent.ts | 7 +- src/controllers/auth/AuthController.ts | 64 ++++++++++ src/routes/routes.ts | 161 +++++++++++++++++++++++++ src/routes/swagger.json | 146 ++++++++++++++++++++++ src/utils/helpers.ts | 138 +++++++++++++++++++++ src/utils/oid4vc-agent.ts | 104 ++++++++++++++-- 7 files changed, 620 insertions(+), 10 deletions(-) create mode 100644 src/controllers/auth/AuthController.ts diff --git a/.env.sample b/.env.sample index 74f41f73..8838b5c1 100644 --- a/.env.sample +++ b/.env.sample @@ -47,6 +47,16 @@ INDICIO_TEST_GENESIS=`{"reqSignature":{},"txn":{"data":{"data":{"alias":"OpsNode {"reqSignature":{},"txn":{"data":{"data":{"alias":"lorica-identity-node1","blskey":"wUh24sVCQ8PHDgSb343g2eLxjD5vwxsrETfuV2sbwMNnYon9nhbaK5jcWTekvXtyiwxHxuiCCoZwKS97MQEAeC2oLbbMeKjYm212QwSnm7aKLEqTStXht35VqZvZLT7Q3mPQRYLjMGixdn4ocNHrBTMwPUQYycEqwaHWgE1ncDueXY","blskey_pop":"R2sMwF7UW6AaD4ALa1uB1YVPuP6JsdJ7LsUoViM9oySFqFt34C1x1tdHDysS9wwruzaaEFui6xNPqJ8eu3UBqcFKkoWhdsMqCALwe63ytxPwvtLtCffJLhHAcgrPC7DorXYdqhdG2cevdqc5oqFEAaKoFDBf12p5SsbbM4PYWCmVCb","client_ip":"35.225.220.151","client_port":"9702","node_ip":"35.224.26.110","node_port":"9701","services":["VALIDATOR"]},"dest":"k74ZsZuUaJEcB8RRxMwkCwdE5g1r9yzA3nx41qvYqYf"},"metadata":{"from":"Ex6hzsJFYzNJ7kzbfncNeU"},"type":"0"},"txnMetadata":{"seqNo":6,"txnId":"6880673ce4ae4a2352f103d2a6ae20469dd070f2027283a1da5e62a64a59d688"},"ver":"1"} {"reqSignature":{},"txn":{"data":{"data":{"alias":"cysecure-itn","blskey":"GdCvMLkkBYevRFi93b6qaj9G2u1W6Vnbg8QhRD1chhrWR8vRE8x9x7KXVeUBPFf6yW5qq2JCfA2frc8SGni2RwjtTagezfwAwnorLhVJqS5ZxTi4pgcw6smebnt4zWVhTkh6ugDHEypHwNQBcw5WhBZcEJKgNbyVLnHok9ob6cfr3u","blskey_pop":"RbH9mY7M5p3UB3oj4sT1skYwMkxjoUnja8eTYfcm83VcNbxC9zR9pCiRhk4q1dJT3wkDBPGNKnk2p83vaJYLcgMuJtzoWoJAWAxjb3Mcq8Agf6cgQpBuzBq2uCzFPuQCAhDS4Kv9iwA6FsRnfvoeFTs1hhgSJVxQzDWMVTVAD9uCqu","client_ip":"35.169.19.171","client_port":"9702","node_ip":"54.225.56.21","node_port":"9701","services":["VALIDATOR"]},"dest":"4ETBDmHzx8iDQB6Xygmo9nNXtMgq9f6hxGArNhQ6Hh3u"},"metadata":{"from":"uSXXXEdBicPHMMhr3ddNF"},"type":"0"},"txnMetadata":{"seqNo":7,"txnId":"3c21718b07806b2f193b35953dda5b68b288efd551dce4467ce890703d5ba549"},"ver":"1"}` +PLATFORM_BASE_URL= #CREDEBL BASE URL +#if the agent is dedicated +PLATFORM_DEDICATED_CLIENT_ID= +PLATFORM_DEDICATED_CLIENT_SECRET= +#If the agent is shared +PLATFORM_SHARED_AGENT_CLIENT_ID= +PLATFORM_SHARED_AGENT_CLIENT_SECRET= +#Trust service url to fetch trusted certificates for TLS pinning +TRUST_SERVICE_URL= + APP_URL= AGENT_HTTP_URL= HOLDER_REDIRECT= diff --git a/src/cliAgent.ts b/src/cliAgent.ts index 72c4c831..093ed83d 100644 --- a/src/cliAgent.ts +++ b/src/cliAgent.ts @@ -276,9 +276,12 @@ const getModules = ( }), openId4VcHolderModule: new OpenId4VcHolderModule(), x509: new X509Module({ - getTrustedCertificatesForVerification: async (_agentContext, { certificateChain, verification }) => { + getTrustedCertificatesForVerification: async (agentContext, { certificateChain: _certificateChain, verification: _verification }) => { //TODO: We need to trust the certificate tenant wise, for that we need to fetch those details from platform - const certs: string[] = await getTrustedCerts() + const tenantId = agentContext.contextCorrelationId + console.log('[getTrustedCertificatesForVerification] tenantId from agentContext:', tenantId) + const certs: string[] = await getTrustedCerts(tenantId) + return certs }, }), diff --git a/src/controllers/auth/AuthController.ts b/src/controllers/auth/AuthController.ts new file mode 100644 index 00000000..2a26cacb --- /dev/null +++ b/src/controllers/auth/AuthController.ts @@ -0,0 +1,64 @@ +import axios from 'axios' +import { Request as Req } from 'express' +import { Body, Controller, Get, Path, Post, Request, Route, Tags } from 'tsoa' +import { injectable } from 'tsyringe' + +import { BadRequestError } from '../../errors' +import { fetchDedicatedX509Certificates, fetchSharedAgentX509Certificates } from '../../utils/helpers' +import { getTrustedCerts } from '../../utils/oid4vc-agent' + +interface OrgTokenRequest { + clientId: string + clientSecret: string +} + +interface OrgTokenResponse { + token: string +} + +@Tags('Auth') +@Route('/v1/orgs') +@injectable() +export class AuthController extends Controller { + /** + * Generate an organization token by forwarding credentials to the platform + */ + // @Security('jwt', [SCOPES.UNPROTECTED]) + @Post('/{orgId}/token') + public async getOrgToken( + @Request() _request: Req, + @Path('orgId') orgId: string, + @Body() body: OrgTokenRequest, + ): Promise { + const platformBaseUrl = process.env.PLATFORM_BASE_URL + if (!platformBaseUrl) { + throw new BadRequestError('PLATFORM_BASE_URL is not configured') + } + + const response = await axios.post( + `${platformBaseUrl}/v1/orgs/${orgId}/token`, + { clientId: body.clientId, clientSecret: body.clientSecret }, + { headers: { 'Content-Type': 'application/json', accept: 'application/json' } }, + ) + + return response.data + } +// TODO: Remove these test endpoints after manual testing is done + @Get('/test/dedicated-x509-certificates') + public async testFetchDedicatedX509Certificates(@Request() _request: Req): Promise { + return fetchDedicatedX509Certificates() + } + + @Get('/test/shared-agent-x509-certificates') + public async testFetchSharedAgentX509Certificates(@Request() _request: Req): Promise { + return fetchSharedAgentX509Certificates() + } + + /** + * [TEMP] Manually trigger getTrustedCerts to test agent type detection and trust list fetch + */ + @Get('/test/trusted-certs') + public async testGetTrustedCerts(@Request() _request: Req): Promise { + return getTrustedCerts() + } +} diff --git a/src/routes/routes.ts b/src/routes/routes.ts index a504929e..496f0dbe 100644 --- a/src/routes/routes.ts +++ b/src/routes/routes.ts @@ -24,6 +24,8 @@ import { ConnectionController } from './../controllers/didcomm/connections/Conne // WARNING: This 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 { AuthController } from './../controllers/auth/AuthController'; +// WARNING: This 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 { VerifierController } from './../controllers/openid4vc/verifiers/verifier.Controller'; @@ -1330,6 +1332,23 @@ const models: TsoaRoute.Models = { "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 + "OrgTokenResponse": { + "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 + "OrgTokenRequest": { + "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 "AgentInfo": { "dataType": "refObject", "properties": { @@ -3618,6 +3637,148 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This 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 argsAuthController_getOrgToken: Record = { + _request: {"in":"request","name":"_request","required":true,"dataType":"object"}, + orgId: {"in":"path","name":"orgId","required":true,"dataType":"string"}, + body: {"in":"body","name":"body","required":true,"ref":"OrgTokenRequest"}, + }; + app.post('/v1/orgs/:orgId/token', + ...(fetchMiddlewares(AuthController)), + ...(fetchMiddlewares(AuthController.prototype.getOrgToken)), + + async function AuthController_getOrgToken(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: argsAuthController_getOrgToken, request, response }); + + const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; + + const controller: any = await container.get(AuthController); + if (typeof controller['setStatus'] === 'function') { + controller.setStatus(undefined); + } + + await templateService.apiHandler({ + methodName: 'getOrgToken', + 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 argsAuthController_testFetchDedicatedX509Certificates: Record = { + _request: {"in":"request","name":"_request","required":true,"dataType":"object"}, + }; + app.get('/v1/orgs/test/dedicated-x509-certificates', + ...(fetchMiddlewares(AuthController)), + ...(fetchMiddlewares(AuthController.prototype.testFetchDedicatedX509Certificates)), + + async function AuthController_testFetchDedicatedX509Certificates(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: argsAuthController_testFetchDedicatedX509Certificates, request, response }); + + const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; + + const controller: any = await container.get(AuthController); + if (typeof controller['setStatus'] === 'function') { + controller.setStatus(undefined); + } + + await templateService.apiHandler({ + methodName: 'testFetchDedicatedX509Certificates', + 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 argsAuthController_testFetchSharedAgentX509Certificates: Record = { + _request: {"in":"request","name":"_request","required":true,"dataType":"object"}, + }; + app.get('/v1/orgs/test/shared-agent-x509-certificates', + ...(fetchMiddlewares(AuthController)), + ...(fetchMiddlewares(AuthController.prototype.testFetchSharedAgentX509Certificates)), + + async function AuthController_testFetchSharedAgentX509Certificates(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: argsAuthController_testFetchSharedAgentX509Certificates, request, response }); + + const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; + + const controller: any = await container.get(AuthController); + if (typeof controller['setStatus'] === 'function') { + controller.setStatus(undefined); + } + + await templateService.apiHandler({ + methodName: 'testFetchSharedAgentX509Certificates', + 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 argsAuthController_testGetTrustedCerts: Record = { + _request: {"in":"request","name":"_request","required":true,"dataType":"object"}, + }; + app.get('/v1/orgs/test/trusted-certs', + ...(fetchMiddlewares(AuthController)), + ...(fetchMiddlewares(AuthController.prototype.testGetTrustedCerts)), + + async function AuthController_testGetTrustedCerts(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: argsAuthController_testGetTrustedCerts, request, response }); + + const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; + + const controller: any = await container.get(AuthController); + if (typeof controller['setStatus'] === 'function') { + controller.setStatus(undefined); + } + + await templateService.apiHandler({ + methodName: 'testGetTrustedCerts', + 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"}, }; diff --git a/src/routes/swagger.json b/src/routes/swagger.json index f8a0220b..0995acc3 100644 --- a/src/routes/swagger.json +++ b/src/routes/swagger.json @@ -2982,6 +2982,34 @@ "DidRecord": { "$ref": "#/components/schemas/Record_string.unknown_" }, + "OrgTokenResponse": { + "properties": { + "token": { + "type": "string" + } + }, + "required": [ + "token" + ], + "type": "object", + "additionalProperties": false + }, + "OrgTokenRequest": { + "properties": { + "clientId": { + "type": "string" + }, + "clientSecret": { + "type": "string" + } + }, + "required": [ + "clientId", + "clientSecret" + ], + "type": "object", + "additionalProperties": false + }, "AgentInfo": { "properties": { "label": { @@ -6857,6 +6885,124 @@ "parameters": [] } }, + "/v1/orgs/{orgId}/token": { + "post": { + "operationId": "GetOrgToken", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OrgTokenResponse" + } + } + } + } + }, + "description": "Generate an organization token by forwarding credentials to the platform", + "tags": [ + "Auth" + ], + "security": [], + "parameters": [ + { + "in": "path", + "name": "orgId", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OrgTokenRequest" + } + } + } + } + } + }, + "/v1/orgs/test/dedicated-x509-certificates": { + "get": { + "operationId": "TestFetchDedicatedX509Certificates", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "items": { + "type": "string" + }, + "type": "array" + } + } + } + } + }, + "tags": [ + "Auth" + ], + "security": [], + "parameters": [] + } + }, + "/v1/orgs/test/shared-agent-x509-certificates": { + "get": { + "operationId": "TestFetchSharedAgentX509Certificates", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "items": { + "type": "string" + }, + "type": "array" + } + } + } + } + }, + "tags": [ + "Auth" + ], + "security": [], + "parameters": [] + } + }, + "/v1/orgs/test/trusted-certs": { + "get": { + "operationId": "TestGetTrustedCerts", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "items": { + "type": "string" + }, + "type": "array" + } + } + } + } + }, + "description": "[TEMP] Manually trigger getTrustedCerts to test agent type detection and trust list fetch", + "tags": [ + "Auth" + ], + "security": [], + "parameters": [] + } + }, "/agent": { "get": { "operationId": "GetAgentInfo", diff --git a/src/utils/helpers.ts b/src/utils/helpers.ts index 47218a85..97938e92 100644 --- a/src/utils/helpers.ts +++ b/src/utils/helpers.ts @@ -2,6 +2,7 @@ import type { Curve, EcCurve, EcType, OkpCurve, OkpType } from '../controllers/t import type { KeyAlgorithm } from '@openwallet-foundation/askar-nodejs' import { JsonEncoder, JsonTransformer } from '@credo-ts/core' +import axios from 'axios' import { randomBytes } from 'crypto' import { curveToKty, keyAlgorithmToCurve } from './constant' @@ -92,3 +93,140 @@ export function getTypeFromCurve(key: Curve | KeyAlgorithm): OkpType | EcType { } return keyTypeInfo } + +async function fetchPlatformToken(platformBaseUrl: string, clientId: string, clientSecret: string, label: string): Promise { + const tokenUrl = `${platformBaseUrl}/v1/orgs/${clientId}/token` + console.log(`[${label}] fetching token from:`, tokenUrl) + + try { + const tokenResponse = await axios.post( + tokenUrl, + { clientSecret }, + { headers: { 'Content-Type': 'application/json', accept: 'application/json' } }, + ) + + console.log(`[${label}] token response status:`, tokenResponse.status) + console.log(`[${label}] token response data:`, JSON.stringify(tokenResponse.data, null, 2)) + + const token: string = tokenResponse.data.data.access_token + if (!token) throw new Error('Token not found in platform response') + + return token + } catch (error) { + if (axios.isAxiosError(error)) { + console.error(`[${label}] token request failed:`, { + status: error.response?.status, + statusText: error.response?.statusText, + data: error.response?.data, + message: error.message, + }) + throw new Error(`Failed to fetch token from platform: ${error.response?.status} ${JSON.stringify(error.response?.data)}`) + } + throw error + } +} + +async function fetchTrustServiceCertificates(trustServiceUrl: string, token: string, ecosystemIds: string[], label: string): Promise { + const certsUrl = `${trustServiceUrl}/api/x509-certificates/ecosystems` + console.log(`[${label}] fetching certificates from:`, certsUrl, 'ecosystemIds:', ecosystemIds) + + try { + const certResponse = await axios.get(certsUrl, { + params: { ecosystemIds: ecosystemIds.join(',') }, + headers: { accept: 'application/json', Authorization: `Bearer ${token}` }, + }) + + console.log(`[${label}] certificates response status:`, certResponse.status) + console.log(`[${label}] certificates response data:`, JSON.stringify(certResponse.data, null, 2)) + + if (!Array.isArray(certResponse.data) || certResponse.data.length === 0) { + throw new Error('No certificates returned from trust-service') + } + + const certificates: string[] = certResponse.data.map((cert: { certificateData: string }) => cert.certificateData) + console.log(`[${label}] extracted certificates count:`, certificates.length) + + return certificates + } catch (error) { + if (axios.isAxiosError(error)) { + console.error(`[${label}] certificates request failed:`, { + status: error.response?.status, + statusText: error.response?.statusText, + data: error.response?.data, + message: error.message, + }) + throw new Error(`Failed to fetch certificates from trust-service: ${error.response?.status} ${JSON.stringify(error.response?.data)}`) + } + throw error + } +} + +export async function fetchDedicatedX509Certificates(): Promise { + const platformBaseUrl = process.env.PLATFORM_BASE_URL + const clientId = process.env.PLATFORM_DEDICATED_CLIENT_ID + const clientSecret = process.env.PLATFORM_DEDICATED_CLIENT_SECRET + const trustServiceUrl = process.env.TRUST_SERVICE_URL + + if (!platformBaseUrl) throw new Error('PLATFORM_BASE_URL is not configured') + if (!clientId) throw new Error('PLATFORM_DEDICATED_CLIENT_ID is not configured') + if (!clientSecret) throw new Error('PLATFORM_DEDICATED_CLIENT_SECRET is not configured') + if (!trustServiceUrl) throw new Error('TRUST_SERVICE_URL is not configured') + + const token = await fetchPlatformToken(platformBaseUrl, clientId, clientSecret, 'fetchDedicatedX509Certificates') + return fetchTrustServiceCertificates(trustServiceUrl, token, [], 'fetchDedicatedX509Certificates') +} + +export async function fetchSharedAgentX509Certificates(tenantId?: string): Promise { + const label = 'fetchSharedAgentX509Certificates' + + const platformBaseUrl = process.env.PLATFORM_BASE_URL + const clientId = process.env.PLATFORM_SHARED_AGENT_CLIENT_ID + const clientSecret = process.env.PLATFORM_SHARED_AGENT_CLIENT_SECRET + const resolvedTenantId = tenantId ?? process.env.PLATFORM_SHARED_AGENT_TENANT_ID + const trustServiceUrl = process.env.TRUST_SERVICE_URL + + if (!platformBaseUrl) throw new Error('PLATFORM_BASE_URL is not configured') + if (!clientId) throw new Error('PLATFORM_SHARED_AGENT_CLIENT_ID is not configured') + if (!clientSecret) throw new Error('PLATFORM_SHARED_AGENT_CLIENT_SECRET is not configured') + if (!resolvedTenantId) throw new Error('tenantId not provided and PLATFORM_SHARED_AGENT_TENANT_ID is not configured') + if (!trustServiceUrl) throw new Error('TRUST_SERVICE_URL is not configured') + console.log(`[${label}] starting certificate fetch for tenantId:`, resolvedTenantId) + + console.log(`[${label}] using tenantId:`, resolvedTenantId, tenantId ? '(from agent context)' : '(from .env)') + + const token = await fetchPlatformToken(platformBaseUrl, clientId, clientSecret, label) + + const ecosystemsUrl = `${platformBaseUrl}/v1/orgs/tenant/${resolvedTenantId}/ecosystems` + console.log(`[${label}] fetching ecosystem IDs from:`, ecosystemsUrl) + + let ecosystemIds: string[] + try { + const ecosystemResponse = await axios.get<{ statusCode: number; message: string; data: string[] }>( + ecosystemsUrl, + { headers: { accept: 'application/json', Authorization: `Bearer ${token}` } }, + ) + + console.log(`[${label}] ecosystem response status:`, ecosystemResponse.status) + console.log(`[${label}] ecosystem response data:`, JSON.stringify(ecosystemResponse.data, null, 2)) + + ecosystemIds = ecosystemResponse.data.data + if (!Array.isArray(ecosystemIds) || ecosystemIds.length === 0) { + throw new Error(`No ecosystem IDs found for tenant: ${resolvedTenantId}`) + } + + console.log(`[${label}] ecosystem IDs:`, ecosystemIds) + } catch (error) { + if (axios.isAxiosError(error)) { + console.error(`[${label}] ecosystem IDs request failed:`, { + status: error.response?.status, + statusText: error.response?.statusText, + data: error.response?.data, + message: error.message, + }) + throw new Error(`Failed to fetch ecosystem IDs from platform: ${error.response?.status} ${JSON.stringify(error.response?.data)}`) + } + throw error + } + + return fetchTrustServiceCertificates(trustServiceUrl, token, ecosystemIds, label) +} diff --git a/src/utils/oid4vc-agent.ts b/src/utils/oid4vc-agent.ts index 05ffef75..6acbf823 100644 --- a/src/utils/oid4vc-agent.ts +++ b/src/utils/oid4vc-agent.ts @@ -1,5 +1,12 @@ import type { SdJwtVcHolderBinding } from '@credo-ts/core' +import type { DisclosureFrame } from '../controllers/types' +import { Agent, CredoError } from '@credo-ts/core' +import { container } from 'tsyringe' + +import { fetchDedicatedX509Certificates, fetchSharedAgentX509Certificates } from './helpers' import type { + OpenId4VcCredentialHolderBinding, + OpenId4VcCredentialHolderDidBinding, OpenId4VciCredentialRequestToCredentialMapper, OpenId4VciSignMdocCredentials, OpenId4VciSignSdJwtCredentials, @@ -163,17 +170,98 @@ export function getMixedCredentialRequestToCredentialMapper(): OpenId4VciCredent } } -export async function getTrustedCerts() { +function assertDidBasedHolderBinding( + holderBinding: OpenId4VcCredentialHolderBinding, +): asserts holderBinding is OpenId4VcCredentialHolderDidBinding { + if (holderBinding.method !== 'did') { + throw new CredoError('Only did based holder bindings supported for this credential type') + } +} + +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(tenantId?: string): Promise { try { - const response = await fetch(`${process.env.TRUST_LIST_URL}`) - if (!response.ok) { - throw new Error(`HTTP error! status: ${response.status}`) + const agent = container.resolve(Agent) + if (!agent) { + console.error('[getTrustedCerts] agent not available in container') + return [] + } + + const isDedicated = !('tenants' in agent.modules) + console.log('[getTrustedCerts] agent type:', isDedicated ? 'dedicated' : 'shared') + + let certs: string[] + if (isDedicated) { + certs = await fetchDedicatedX509Certificates() + } else { + certs = await fetchSharedAgentX509Certificates(tenantId) + } + + if (!Array.isArray(certs) || certs.length === 0) { + console.warn('[getTrustedCerts] no certificates returned') + return [] } - const data = await response.json() - return data as string[] +// Remove this log after testing to avoid logging sensitive certificate information + console.log('[getTrustedCerts] fetched certificates count:', certs.length) + console.log("certs::::::::::::::::::::::::::", certs) + return certs } catch (error) { - // eslint-disable-next-line no-console - console.error('Error fetching data:', error) + console.error('[getTrustedCerts] failed:', error instanceof Error ? error.message : error) return [] } } From dcbc3387c3d2d6fcfec1fd552bd8c7d706c2cb7a Mon Sep 17 00:00:00 2001 From: Tipu_Singh Date: Tue, 3 Mar 2026 18:49:33 +0530 Subject: [PATCH 091/152] refactor: resolved PR comments Signed-off-by: Tipu_Singh --- src/utils/helpers.ts | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/src/utils/helpers.ts b/src/utils/helpers.ts index 97938e92..8338592a 100644 --- a/src/utils/helpers.ts +++ b/src/utils/helpers.ts @@ -95,35 +95,46 @@ export function getTypeFromCurve(key: Curve | KeyAlgorithm): OkpType | EcType { } async function fetchPlatformToken(platformBaseUrl: string, clientId: string, clientSecret: string, label: string): Promise { + if (!platformBaseUrl) throw new Error(`[${label}] platformBaseUrl is required`) + if (!clientId) throw new Error(`[${label}] clientId is required`) + if (!clientSecret) throw new Error(`[${label}] clientSecret is required`) + const tokenUrl = `${platformBaseUrl}/v1/orgs/${clientId}/token` console.log(`[${label}] fetching token from:`, tokenUrl) + let tokenResponse try { - const tokenResponse = await axios.post( + tokenResponse = await axios.post( tokenUrl, { clientSecret }, { headers: { 'Content-Type': 'application/json', accept: 'application/json' } }, ) - - console.log(`[${label}] token response status:`, tokenResponse.status) - console.log(`[${label}] token response data:`, JSON.stringify(tokenResponse.data, null, 2)) - - const token: string = tokenResponse.data.data.access_token - if (!token) throw new Error('Token not found in platform response') - - return token } catch (error) { if (axios.isAxiosError(error)) { console.error(`[${label}] token request failed:`, { + url: tokenUrl, status: error.response?.status, statusText: error.response?.statusText, data: error.response?.data, message: error.message, }) - throw new Error(`Failed to fetch token from platform: ${error.response?.status} ${JSON.stringify(error.response?.data)}`) + throw new Error( + `[${label}] platform token request failed with status ${error.response?.status ?? 'no response'}: ${JSON.stringify(error.response?.data ?? error.message)}`, + ) } throw error } + + console.log(`[${label}] token response status:`, tokenResponse.status) + console.log(`[${label}] token response data:`, JSON.stringify(tokenResponse.data, null, 2)) + + const token: string = tokenResponse.data?.data?.access_token + if (!token) { + console.error(`[${label}] unexpected token response shape:`, JSON.stringify(tokenResponse.data, null, 2)) + throw new Error(`[${label}] access_token not found in platform response`) + } + + return token } async function fetchTrustServiceCertificates(trustServiceUrl: string, token: string, ecosystemIds: string[], label: string): Promise { From b0098f6e73369c6f11690d43c0feaa2ccdc9a33d Mon Sep 17 00:00:00 2001 From: Krishna Waske Date: Mon, 16 Mar 2026 12:10:18 +0530 Subject: [PATCH 092/152] fix: did and polygon controller (#347) * fix: add polygon resolver and registrar Signed-off-by: Krishna Waske * fix: restore polygon module Signed-off-by: Krishna Waske * fix: linting Signed-off-by: Krishna Waske * fix: polygon controller Signed-off-by: Krishna Waske * fix: take polygon config from env for setupAgent Signed-off-by: Krishna Waske * fix: update rpc url Signed-off-by: Krishna Waske * fix: polygon signature issue and schema creation Signed-off-by: Krishna Waske * fix: polygon package update Signed-off-by: Krishna Waske * fix: remove unnecessary logs Signed-off-by: Krishna Waske --------- Signed-off-by: Krishna Waske --- .env.demo | 2 +- package.json | 2 +- src/cliAgent.ts | 32 +- src/controllers/auth/AuthController.ts | 2 +- .../connections/ConnectionController.ts | 3 +- .../didcomm/outofband/OutOfBandController.ts | 34 +- .../openid4vc/examples/issuer.examples.ts | 171 ++++----- src/controllers/polygon/PolygonController.ts | 275 ++++++++------- src/errorHandlingService.ts | 7 +- src/events/BasicMessageEvents.ts | 41 ++- src/events/ConnectionEvents.ts | 39 ++- src/events/CredentialEvents.ts | 69 ++-- src/events/ProofEvents.ts | 2 +- src/events/WebSocketEvents.ts | 2 +- src/events/openId4VcIssuanceSessionEvents.ts | 35 +- .../openId4VcVerificationSessionEvents.ts | 35 +- src/routes/routes.ts | 224 +++++++++++- src/routes/swagger.json | 327 +++++++++++++++++- src/types/request.d.ts | 2 - src/utils/agent.ts | 15 +- src/utils/helpers.ts | 31 +- src/utils/oid4vc-agent.ts | 3 - yarn.lock | 73 ++-- 23 files changed, 976 insertions(+), 450 deletions(-) diff --git a/.env.demo b/.env.demo index 28d87956..b975dfba 100644 --- a/.env.demo +++ b/.env.demo @@ -13,7 +13,7 @@ INDICIO_NYM_URL=https://selfserve.indiciotech.io/nym # Contract address for Polygon (mainnet) SCHEMA_MANAGER_CONTRACT_ADDRESS=0x4B16719E73949a62E9A7306F352ec73F1B143c27 DID_CONTRACT_ADDRESS=0x0C16958c4246271622201101C83B9F0Fc7180d15 -RPC_URL=https://polygon-rpc.com +RPC_URL=https://polygon.drpc.org # Contract address for Polygon (testnet) # SCHEMA_MANAGER_CONTRACT_ADDRESS=0x4742d43C2dFCa5a1d4238240Afa8547Daf87Ee7a # DID_CONTRACT_ADDRESS=0xcB80F37eDD2bE3570c6C9D5B0888614E04E1e49E diff --git a/package.json b/package.json index 4dbfeb42..6ed17522 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "validate": "yarn lint && yarn check-types && yarn check-format" }, "dependencies": { - "@ayanworks/credo-polygon-w3c-module": "2.0.0", + "@ayanworks/credo-polygon-w3c-module": "2.0.2", "@credo-ts/anoncreds": "0.6.2", "@credo-ts/askar": "0.6.2", "@credo-ts/core": "0.6.2", diff --git a/src/cliAgent.ts b/src/cliAgent.ts index 093ed83d..36a092bc 100644 --- a/src/cliAgent.ts +++ b/src/cliAgent.ts @@ -67,6 +67,7 @@ import { CustomDocumentLoader } from './utils/customDocumentLoader' import { generateSecretKey } from './utils/helpers' import { TsLogger } from './utils/logger' import { getMixedCredentialRequestToCredentialMapper, getTrustedCerts } from './utils/oid4vc-agent' +import { PolygonDidRegistrar, PolygonDidResolver, PolygonModule } from '@ayanworks/credo-polygon-w3c-module' export type Transports = 'ws' | 'http' export type InboundTransport = { @@ -176,15 +177,14 @@ const getModules = ( new IndyVdrIndyDidRegistrar(), new KeyDidRegistrar(), new JwkDidRegistrar(), - // TODO: We can enable polygon later - // , new PolygonDidRegistrar() + new PolygonDidRegistrar(), ], resolvers: [ new IndyVdrIndyDidResolver(), new KeyDidResolver(), new WebDidResolver(), new JwkDidResolver(), - // , new PolygonDidResolver() + new PolygonDidResolver(), ], }), @@ -239,17 +239,16 @@ const getModules = ( }), questionAnswer: new QuestionAnswerModule(), - // Todo: We can remove this polygon module for time being - // 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), + }), openid4vc: new OpenId4VcModule({ app: expressApp, issuer: { @@ -276,7 +275,10 @@ const getModules = ( }), openId4VcHolderModule: new OpenId4VcHolderModule(), x509: new X509Module({ - getTrustedCertificatesForVerification: async (agentContext, { certificateChain: _certificateChain, verification: _verification }) => { + getTrustedCertificatesForVerification: async ( + agentContext, + { certificateChain: _certificateChain, verification: _verification }, + ) => { //TODO: We need to trust the certificate tenant wise, for that we need to fetch those details from platform const tenantId = agentContext.contextCorrelationId console.log('[getTrustedCertificatesForVerification] tenantId from agentContext:', tenantId) diff --git a/src/controllers/auth/AuthController.ts b/src/controllers/auth/AuthController.ts index 2a26cacb..eba1e892 100644 --- a/src/controllers/auth/AuthController.ts +++ b/src/controllers/auth/AuthController.ts @@ -43,7 +43,7 @@ export class AuthController extends Controller { return response.data } -// TODO: Remove these test endpoints after manual testing is done + // TODO: Remove these test endpoints after manual testing is done @Get('/test/dedicated-x509-certificates') public async testFetchDedicatedX509Certificates(@Request() _request: Req): Promise { return fetchDedicatedX509Certificates() diff --git a/src/controllers/didcomm/connections/ConnectionController.ts b/src/controllers/didcomm/connections/ConnectionController.ts index 7c6fa5c2..6e7e7ed9 100644 --- a/src/controllers/didcomm/connections/ConnectionController.ts +++ b/src/controllers/didcomm/connections/ConnectionController.ts @@ -134,8 +134,7 @@ export class ConnectionController extends Controller { try { const outOfBandRecord = await request.agent.modules.didcomm.connections.findByInvitationDid(invitationId) - if (!outOfBandRecord) - throw new NotFoundError(`connection with invitationId "${invitationId}" not found.`) + if (!outOfBandRecord) throw new NotFoundError(`connection with invitationId "${invitationId}" not found.`) return outOfBandRecord } catch (error) { diff --git a/src/controllers/didcomm/outofband/OutOfBandController.ts b/src/controllers/didcomm/outofband/OutOfBandController.ts index 22aab3d6..2923668d 100644 --- a/src/controllers/didcomm/outofband/OutOfBandController.ts +++ b/src/controllers/didcomm/outofband/OutOfBandController.ts @@ -1,20 +1,15 @@ import type { OutOfBandInvitationProps, OutOfBandRecordWithInvitationProps } from '../../examples' import type { RecipientKeyOption, CreateInvitationOptions, AgentMessageType } from '../../types' -import type { - PeerDidNumAlgo2CreateOptions, -} from '@credo-ts/core' +import type { PeerDidNumAlgo2CreateOptions } from '@credo-ts/core' -import { - createPeerDidDocumentFromServices, - JsonTransformer, - PeerDidNumAlgo, -} from '@credo-ts/core' +import { createPeerDidDocumentFromServices, JsonTransformer, PeerDidNumAlgo } from '@credo-ts/core' import { DidCommConnectionRecordProps, DidCommRouting, DidCommOutOfBandInvitation, - DidCommMessage} from '@credo-ts/didcomm' + DidCommMessage, +} from '@credo-ts/didcomm' import { Request as Req } from 'express' import { Body, Controller, Delete, Example, Get, Path, Post, Query, Route, Tags, Security, Request } from 'tsoa' import { injectable } from 'tsyringe' @@ -94,8 +89,7 @@ export class OutOfBandController extends Controller { let invitationDid: string | undefined if (config?.invitationDid) { invitationDid = config?.invitationDid - } - else { + } else { const didRouting = await request.agent.modules.didcomm.mediationRecipient.getRouting({}) const { didDocument, keys } = createPeerDidDocumentFromServices( [ @@ -113,7 +107,7 @@ export class OutOfBandController extends Controller { method: 'peer', options: { numAlgo: PeerDidNumAlgo.MultipleInceptionKeyWithoutDoc, - keys + keys, }, }) @@ -159,9 +153,9 @@ export class OutOfBandController extends Controller { @Body() config: { recordId: string - message: Record; - domain: string, - routing?: DidCommRouting; + message: Record + domain: string + routing?: DidCommRouting }, ) { try { @@ -193,8 +187,14 @@ export class OutOfBandController extends Controller { const { invitation, ...config } = invitationRequest try { - const invite = new DidCommOutOfBandInvitation({ ...invitation, handshakeProtocols: invitation.handshake_protocols }) - const { outOfBandRecord, connectionRecord } = await request.agent.modules.didcomm.oob.receiveInvitation(invite, config) + const invite = new DidCommOutOfBandInvitation({ + ...invitation, + handshakeProtocols: invitation.handshake_protocols, + }) + const { outOfBandRecord, connectionRecord } = await request.agent.modules.didcomm.oob.receiveInvitation( + invite, + config, + ) return { outOfBandRecord: outOfBandRecord.toJSON(), diff --git a/src/controllers/openid4vc/examples/issuer.examples.ts b/src/controllers/openid4vc/examples/issuer.examples.ts index 1d5885da..5b3c9b79 100644 --- a/src/controllers/openid4vc/examples/issuer.examples.ts +++ b/src/controllers/openid4vc/examples/issuer.examples.ts @@ -1,111 +1,118 @@ export const OpenId4VcUpdateIssuerRecordOptionsExample = { withScope: { value: { - issuerId: "abc-gov", - accessTokenSignerKeyType: "ed25519", + issuerId: 'abc-gov', + accessTokenSignerKeyType: 'ed25519', display: [ { - name: "ABC Gov", - locale: "en", + name: 'ABC Gov', + locale: 'en', logo: { - uri: "https://upload.wikimedia.org/wikipedia/commons/2/2f/ABC-2021-LOGO.svg", - alt_text: "abc_logo", + uri: 'https://upload.wikimedia.org/wikipedia/commons/2/2f/ABC-2021-LOGO.svg', + alt_text: 'abc_logo', }, }, ], - dpopSigningAlgValuesSupported: ["RS256", "ES256"], + dpopSigningAlgValuesSupported: ['RS256', 'ES256'], credentialConfigurationsSupported: { - "VaccinationCredential-sdjwt": { - format: "vc+sd-jwt", - vct: "VaccinationCredential", - scope: "openid4vc:credential:VaccinationCredential-sdjwt", + '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" } } + 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"], + 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" - } - ] + 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", + '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" } } + 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"], + credential_signing_alg_values_supported: ['ES256'], + cryptographic_binding_methods_supported: ['did:key'], display: [ { - name: "National ID", - description: "Digital government-issued identity credential", - locale: "en" - } - ] + name: 'National ID', + description: 'Digital government-issued identity credential', + locale: 'en', + }, + ], }, - "UniversityDegreeCredential-sdjwt": { - format: "vc+sd-jwt", - vct: "UniversityDegreeCredential", - scope: "openid4vc:credential:UniversityDegreeCredential-sdjwt", + '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" } } + 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"], - cryptographic_binding_methods_supported: ["did:key"], + credential_signing_alg_values_supported: ['ES256', 'EdDSA'], + cryptographic_binding_methods_supported: ['did:key'], display: [ { - name: "University Degree Credential", - description: "Issued by a recognized educational institution", - locale: "en" - } - ] + name: 'University Degree Credential', + description: 'Issued by a recognized educational institution', + locale: 'en', + }, + ], }, - "DrivingLicenseCredential-mdoc": { - format: "mso_mdoc", - doctype: "org.iso.18013.5.1", - scope: "openid4vc:credential:DrivingLicenseCredential-mdoc", + '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" } } + 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"], + credential_signing_alg_values_supported: ['ES256'], + cryptographic_binding_methods_supported: ['did:key'], display: [ { - name: "Driving License", - description: "ISO-compliant mobile driving license", - locale: "en" - } - ] - } - } - } - } -}; + name: 'Driving License', + description: 'ISO-compliant mobile driving license', + locale: 'en', + }, + ], + }, + }, + }, + }, +} diff --git a/src/controllers/polygon/PolygonController.ts b/src/controllers/polygon/PolygonController.ts index e889e2b7..c2f96ca8 100644 --- a/src/controllers/polygon/PolygonController.ts +++ b/src/controllers/polygon/PolygonController.ts @@ -1,146 +1,145 @@ -// 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' -// 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 { 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' +import { DidOperation, DidOperationOptions } from '@ayanworks/credo-polygon-w3c-module' -// @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 (!Object.values(DidOperation).includes(operation)) { + 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/errorHandlingService.ts b/src/errorHandlingService.ts index 317ee472..b3ad6aa4 100644 --- a/src/errorHandlingService.ts +++ b/src/errorHandlingService.ts @@ -1,12 +1,7 @@ import type { BaseError } from './errors/errors' import { AnonCredsError, AnonCredsRsError, AnonCredsStoreRecordError } from '@credo-ts/anoncreds' -import { - CredoError, - RecordNotFoundError, - RecordDuplicateError, - ClassValidationError -} from '@credo-ts/core' +import { CredoError, RecordNotFoundError, RecordDuplicateError, ClassValidationError } from '@credo-ts/core' import { MessageSendingError } from '@credo-ts/didcomm' import { IndyVdrError } from '@hyperledger/indy-vdr-nodejs' diff --git a/src/events/BasicMessageEvents.ts b/src/events/BasicMessageEvents.ts index 93470d64..e064995e 100644 --- a/src/events/BasicMessageEvents.ts +++ b/src/events/BasicMessageEvents.ts @@ -1,29 +1,32 @@ import type { ServerConfig } from '../utils/ServerConfig' import type { Agent } from '@credo-ts/core' -import { DidCommBasicMessageEventTypes,DidCommBasicMessageStateChangedEvent } from '@credo-ts/didcomm' +import { DidCommBasicMessageEventTypes, DidCommBasicMessageStateChangedEvent } from '@credo-ts/didcomm' import { sendWebSocketEvent } from './WebSocketEvents' import { sendWebhookEvent } from './WebhookEvent' export const basicMessageEvents = async (agent: Agent, config: ServerConfig) => { - agent.events.on(DidCommBasicMessageEventTypes.DidCommBasicMessageStateChanged, async (event: DidCommBasicMessageStateChangedEvent) => { - const record = event.payload.basicMessageRecord - const body = record.toJSON() + agent.events.on( + DidCommBasicMessageEventTypes.DidCommBasicMessageStateChanged, + async (event: DidCommBasicMessageStateChangedEvent) => { + const record = event.payload.basicMessageRecord + const body = record.toJSON() - // Only send webhook if webhook url is configured - if (config.webhookUrl) { - await sendWebhookEvent(config.webhookUrl + '/basic-messages', body, agent.config.logger) - } + // Only send webhook if webhook url is configured + if (config.webhookUrl) { + await sendWebhookEvent(config.webhookUrl + '/basic-messages', body, agent.config.logger) + } - if (config.socketServer) { - // Always emit websocket event to clients (could be 0) - sendWebSocketEvent(config.socketServer, { - ...event, - payload: { - message: event.payload.message.toJSON(), - basicMessageRecord: body, - }, - }) - } - }) + if (config.socketServer) { + // Always emit websocket event to clients (could be 0) + sendWebSocketEvent(config.socketServer, { + ...event, + payload: { + message: event.payload.message.toJSON(), + basicMessageRecord: body, + }, + }) + } + }, + ) } diff --git a/src/events/ConnectionEvents.ts b/src/events/ConnectionEvents.ts index ae8cda39..7a67a7d2 100644 --- a/src/events/ConnectionEvents.ts +++ b/src/events/ConnectionEvents.ts @@ -7,24 +7,27 @@ import { sendWebSocketEvent } from './WebSocketEvents' import { sendWebhookEvent } from './WebhookEvent' export const connectionEvents = async (agent: Agent, config: ServerConfig) => { - agent.events.on(DidCommConnectionEventTypes.DidCommConnectionStateChanged, async (event: DidCommConnectionStateChangedEvent) => { - const record = event.payload.connectionRecord - const body = { ...record.toJSON(), ...event.metadata } + agent.events.on( + DidCommConnectionEventTypes.DidCommConnectionStateChanged, + async (event: DidCommConnectionStateChangedEvent) => { + const record = event.payload.connectionRecord + const body = { ...record.toJSON(), ...event.metadata } - // Only send webhook if webhook url is configured - if (config.webhookUrl) { - await sendWebhookEvent(config.webhookUrl + '/connections', body, agent.config.logger) - } + // Only send webhook if webhook url is configured + if (config.webhookUrl) { + await sendWebhookEvent(config.webhookUrl + '/connections', body, agent.config.logger) + } - if (config.socketServer) { - // Always emit websocket event to clients (could be 0) - sendWebSocketEvent(config.socketServer, { - ...event, - payload: { - ...event.payload, - connectionRecord: body, - }, - }) - } - }) + if (config.socketServer) { + // Always emit websocket event to clients (could be 0) + sendWebSocketEvent(config.socketServer, { + ...event, + payload: { + ...event.payload, + connectionRecord: body, + }, + }) + } + }, + ) } diff --git a/src/events/CredentialEvents.ts b/src/events/CredentialEvents.ts index d9b8cf14..080ecf6d 100644 --- a/src/events/CredentialEvents.ts +++ b/src/events/CredentialEvents.ts @@ -8,37 +8,40 @@ import { sendWebSocketEvent } from './WebSocketEvents' import { sendWebhookEvent } from './WebhookEvent' export const credentialEvents = async (agent: Agent, config: ServerConfig) => { - agent.events.on(DidCommCredentialEventTypes.DidCommCredentialStateChanged, async (event: DidCommCredentialStateChangedEvent) => { - const record = event.payload.credentialExchangeRecord - - const body: Record = { - ...record.toJSON(), - ...event.metadata, - outOfBandId: null, - credentialData: null, - } - - if (record?.connectionId) { - const connectionRecord = await agent.modules.connections.findById(record.connectionId!) - body.outOfBandId = connectionRecord?.outOfBandId - } - - const data = await agent.modules.credentials.getFormatData(record.id) - body.credentialData = data - - if (config.webhookUrl) { - await sendWebhookEvent(config.webhookUrl + '/credentials', body, agent.config.logger) - } - - if (config.socketServer) { - // Always emit websocket event to clients (could be 0) - sendWebSocketEvent(config.socketServer, { - ...event, - payload: { - ...event.payload, - credentialRecord: body, - }, - }) - } - }) + agent.events.on( + DidCommCredentialEventTypes.DidCommCredentialStateChanged, + async (event: DidCommCredentialStateChangedEvent) => { + const record = event.payload.credentialExchangeRecord + + const body: Record = { + ...record.toJSON(), + ...event.metadata, + outOfBandId: null, + credentialData: null, + } + + if (record?.connectionId) { + const connectionRecord = await agent.modules.connections.findById(record.connectionId!) + body.outOfBandId = connectionRecord?.outOfBandId + } + + const data = await agent.modules.credentials.getFormatData(record.id) + body.credentialData = data + + if (config.webhookUrl) { + await sendWebhookEvent(config.webhookUrl + '/credentials', body, agent.config.logger) + } + + if (config.socketServer) { + // Always emit websocket event to clients (could be 0) + sendWebSocketEvent(config.socketServer, { + ...event, + payload: { + ...event.payload, + credentialRecord: body, + }, + }) + } + }, + ) } diff --git a/src/events/ProofEvents.ts b/src/events/ProofEvents.ts index ad961675..44166f62 100644 --- a/src/events/ProofEvents.ts +++ b/src/events/ProofEvents.ts @@ -1,5 +1,5 @@ import type { ServerConfig } from '../utils/ServerConfig' -import type { Agent, } from '@credo-ts/core' +import type { Agent } from '@credo-ts/core' import { DidCommProofStateChangedEvent, DidCommProofEventTypes } from '@credo-ts/didcomm' import { sendWebSocketEvent } from './WebSocketEvents' diff --git a/src/events/WebSocketEvents.ts b/src/events/WebSocketEvents.ts index 358ca800..e3f1b00f 100644 --- a/src/events/WebSocketEvents.ts +++ b/src/events/WebSocketEvents.ts @@ -1,4 +1,4 @@ -import {Server} from 'ws' +import { Server } from 'ws' export const sendWebSocketEvent = async (server: Server, data: unknown) => { server.clients.forEach((client) => { diff --git a/src/events/openId4VcIssuanceSessionEvents.ts b/src/events/openId4VcIssuanceSessionEvents.ts index 291331a0..18267b1b 100644 --- a/src/events/openId4VcIssuanceSessionEvents.ts +++ b/src/events/openId4VcIssuanceSessionEvents.ts @@ -7,23 +7,26 @@ import { OpenId4VcIssuerEvents } from '@credo-ts/openid4vc' import type { OpenId4VcIssuanceSessionStateChangedEvent } from '@credo-ts/openid4vc' export const openId4VcIssuanceSessionEvents = async (agent: Agent, config: ServerConfig) => { - agent.events.on(OpenId4VcIssuerEvents.IssuanceSessionStateChanged, async (event: OpenId4VcIssuanceSessionStateChangedEvent) => { - const record = event.payload.issuanceSession + agent.events.on( + OpenId4VcIssuerEvents.IssuanceSessionStateChanged, + async (event: OpenId4VcIssuanceSessionStateChangedEvent) => { + const record = event.payload.issuanceSession - const body = { ...record.toJSON(), ...event.metadata } + const body = { ...record.toJSON(), ...event.metadata } - if (config.webhookUrl) { - await sendWebhookEvent(config.webhookUrl + '/openid4vc-issuance', body, agent.config.logger) - } + if (config.webhookUrl) { + await sendWebhookEvent(config.webhookUrl + '/openid4vc-issuance', body, agent.config.logger) + } - if (config.socketServer) { - sendWebSocketEvent(config.socketServer, { - ...event, - payload: { - ...event.payload, - issuanceRecord: body, - }, - }) - } - }) + if (config.socketServer) { + sendWebSocketEvent(config.socketServer, { + ...event, + payload: { + ...event.payload, + issuanceRecord: body, + }, + }) + } + }, + ) } diff --git a/src/events/openId4VcVerificationSessionEvents.ts b/src/events/openId4VcVerificationSessionEvents.ts index 4643b44d..50fbdf03 100644 --- a/src/events/openId4VcVerificationSessionEvents.ts +++ b/src/events/openId4VcVerificationSessionEvents.ts @@ -6,22 +6,25 @@ import { sendWebhookEvent } from './WebhookEvent' import { OpenId4VcVerificationSessionStateChangedEvent, OpenId4VcVerifierEvents } from '@credo-ts/openid4vc' export const openId4VcVerificationSessionEvents = async (agent: Agent, config: ServerConfig) => { - agent.events.on(OpenId4VcVerifierEvents.VerificationSessionStateChanged, async (event: OpenId4VcVerificationSessionStateChangedEvent) => { - const record = event.payload.verificationSession - const body = { ...record.toJSON(), ...event.metadata } + agent.events.on( + OpenId4VcVerifierEvents.VerificationSessionStateChanged, + async (event: OpenId4VcVerificationSessionStateChangedEvent) => { + const record = event.payload.verificationSession + const body = { ...record.toJSON(), ...event.metadata } - if (config.webhookUrl) { - await sendWebhookEvent(config.webhookUrl + '/openid4vc-verification', body, agent.config.logger) - } + if (config.webhookUrl) { + await sendWebhookEvent(config.webhookUrl + '/openid4vc-verification', body, agent.config.logger) + } - if (config.socketServer) { - sendWebSocketEvent(config.socketServer, { - ...event, - payload: { - ...event.payload, - verificationRecord: body, - }, - }) - } - }) + if (config.socketServer) { + sendWebSocketEvent(config.socketServer, { + ...event, + payload: { + ...event.payload, + verificationRecord: body, + }, + }) + } + }, + ) } diff --git a/src/routes/routes.ts b/src/routes/routes.ts index 496f0dbe..55f296e3 100644 --- a/src/routes/routes.ts +++ b/src/routes/routes.ts @@ -6,6 +6,8 @@ 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 { 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 { IssuerController } from './../controllers/openid4vc/issuers/issuer.Controller'; @@ -222,6 +224,66 @@ const models: TsoaRoute.Models = { "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 "JwtObject": { "dataType": "refObject", "properties": { @@ -546,11 +608,6 @@ const models: TsoaRoute.Models = { "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 "OpenId4VcVerificationSessionRecord": { "dataType": "refAlias", "type": {"ref":"Record_string.unknown_","validators":{}}, @@ -974,11 +1031,6 @@ const models: TsoaRoute.Models = { "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 - "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 "MetadataValue": { "dataType": "refAlias", "type": {"ref":"Record_string.any_","validators":{}}, @@ -1304,11 +1356,6 @@ const models: TsoaRoute.Models = { "enums": ["a128gcm","a256gcm","a128cbchs256","a256cbchs512","a128kw","a256kw","bls12381g1","bls12381g2","c20p","xc20p","ed25519","x25519","k256","p256","p384"], }, // WARNING: This 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 "DidCreate": { "dataType": "refObject", "properties": { @@ -1725,6 +1772,153 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This 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 argsVerificationSessionsController_createProofRequest: Record = { request: {"in":"request","name":"request","required":true,"dataType":"object"}, createAuthorizationRequest: {"in":"body","name":"createAuthorizationRequest","required":true,"ref":"CreateAuthorizationRequest"}, diff --git a/src/routes/swagger.json b/src/routes/swagger.json index 0995acc3..55f04345 100644 --- a/src/routes/swagger.json +++ b/src/routes/swagger.json @@ -390,6 +390,133 @@ "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": { + "enum": [ + "createDID" + ], + "type": "string" + }, + "CreateDidOperationOptions": { + "properties": { + "serviceEndpoint": { + "type": "string" + }, + "operation": { + "$ref": "#/components/schemas/DidOperation.Create" + } + }, + "required": [ + "operation" + ], + "type": "object" + }, + "DidOperation.Update": { + "enum": [ + "updateDIDDoc" + ], + "type": "string" + }, + "Record_string.any_": { + "properties": {}, + "additionalProperties": {}, + "type": "object", + "description": "Construct a type with a set of properties K of type T" + }, + "DidDocument": { + "$ref": "#/components/schemas/Record_string.any_" + }, + "UpdateDidOperationOptions": { + "properties": { + "did": { + "type": "string" + }, + "didDocument": { + "$ref": "#/components/schemas/DidDocument" + }, + "operation": { + "$ref": "#/components/schemas/DidOperation.Update" + } + }, + "required": [ + "did", + "didDocument", + "operation" + ], + "type": "object" + }, + "DidOperation.Deactivate": { + "enum": [ + "deactivate" + ], + "type": "string" + }, + "DeactivateDidOperationOptions": { + "properties": { + "did": { + "type": "string" + }, + "operation": { + "$ref": "#/components/schemas/DidOperation.Deactivate" + } + }, + "required": [ + "did", + "operation" + ], + "type": "object" + }, + "DidOperation.AddResource": { + "enum": [ + "addResource" + ], + "type": "string" + }, + "AddResourceDidOperationOptions": { + "properties": { + "did": { + "type": "string" + }, + "resource": { + "additionalProperties": false, + "type": "object" + }, + "resourceId": { + "type": "string" + }, + "operation": { + "$ref": "#/components/schemas/DidOperation.AddResource" + } + }, + "required": [ + "did", + "resource", + "resourceId", + "operation" + ], + "type": "object" + }, + "DidOperationOptions": { + "anyOf": [ + { + "$ref": "#/components/schemas/CreateDidOperationOptions" + }, + { + "$ref": "#/components/schemas/UpdateDidOperationOptions" + }, + { + "$ref": "#/components/schemas/DeactivateDidOperationOptions" + }, + { + "$ref": "#/components/schemas/AddResourceDidOperationOptions" + } + ] + }, "JwtObject": { "properties": { "alg": { @@ -1149,12 +1276,6 @@ "type": "object", "additionalProperties": false }, - "Record_string.unknown_": { - "properties": {}, - "additionalProperties": {}, - "type": "object", - "description": "Construct a type with a set of properties K of type T" - }, "OpenId4VcVerificationSessionRecord": { "$ref": "#/components/schemas/Record_string.unknown_" }, @@ -2193,12 +2314,6 @@ ], "type": "object" }, - "Record_string.any_": { - "properties": {}, - "additionalProperties": {}, - "type": "object", - "description": "Construct a type with a set of properties K of type T" - }, "MetadataValue": { "$ref": "#/components/schemas/Record_string.any_" }, @@ -2934,9 +3049,6 @@ ], "type": "string" }, - "DidDocument": { - "$ref": "#/components/schemas/Record_string.any_" - }, "DidCreate": { "properties": { "keyType": { @@ -3641,6 +3753,191 @@ } } }, + "/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" + } + } + ] + } + }, "/openid4vc/verification-sessions/create-presentation-request": { "post": { "operationId": "CreateProofRequest", diff --git a/src/types/request.d.ts b/src/types/request.d.ts index c14cad9b..a5223399 100644 --- a/src/types/request.d.ts +++ b/src/types/request.d.ts @@ -2,7 +2,6 @@ import type { RestAgentModules, RestMultiTenantAgentModules } from '../cliAgent' import type { Agent } from '@credo-ts/core' import type { TenantAgent } from '@credo-ts/tenants' - type AgentType = Agent | Agent | TenantAgent interface IAgent { @@ -16,4 +15,3 @@ declare global { } } } - diff --git a/src/utils/agent.ts b/src/utils/agent.ts index 44ea46c4..aebf6c49 100644 --- a/src/utils/agent.ts +++ b/src/utils/agent.ts @@ -30,6 +30,7 @@ import { indyVdr } from '@hyperledger/indy-vdr-nodejs' import { askar } from '@openwallet-foundation/askar-nodejs' import { TsLogger } from './logger' +import { PolygonModule } from '@ayanworks/credo-polygon-w3c-module' export const setupAgent = async ({ endpoints, @@ -126,13 +127,13 @@ export const setupAgent = async ({ ], }, }), - // polygon: new PolygonModule({ - // didContractAddress: '', - // schemaManagerContractAddress: '', - // fileServerToken: '', - // rpcUrl: '', - // serverUrl: '', - // }), + polygon: new PolygonModule({ + didContractAddress: process.env.DID_CONTRACT_ADDRESS as string, + schemaManagerContractAddress: process.env.SCHEMA_MANAGER_CONTRACT_ADDRESS as string, + fileServerToken: process.env.FILE_SERVER_TOKEN as string, + rpcUrl: process.env.RPC_URL as string, + serverUrl: process.env.SERVER_URL as string, + }), }, dependencies: agentDependencies, }) diff --git a/src/utils/helpers.ts b/src/utils/helpers.ts index 8338592a..ef33bafc 100644 --- a/src/utils/helpers.ts +++ b/src/utils/helpers.ts @@ -94,7 +94,12 @@ export function getTypeFromCurve(key: Curve | KeyAlgorithm): OkpType | EcType { return keyTypeInfo } -async function fetchPlatformToken(platformBaseUrl: string, clientId: string, clientSecret: string, label: string): Promise { +async function fetchPlatformToken( + platformBaseUrl: string, + clientId: string, + clientSecret: string, + label: string, +): Promise { if (!platformBaseUrl) throw new Error(`[${label}] platformBaseUrl is required`) if (!clientId) throw new Error(`[${label}] clientId is required`) if (!clientSecret) throw new Error(`[${label}] clientSecret is required`) @@ -137,7 +142,12 @@ async function fetchPlatformToken(platformBaseUrl: string, clientId: string, cli return token } -async function fetchTrustServiceCertificates(trustServiceUrl: string, token: string, ecosystemIds: string[], label: string): Promise { +async function fetchTrustServiceCertificates( + trustServiceUrl: string, + token: string, + ecosystemIds: string[], + label: string, +): Promise { const certsUrl = `${trustServiceUrl}/api/x509-certificates/ecosystems` console.log(`[${label}] fetching certificates from:`, certsUrl, 'ecosystemIds:', ecosystemIds) @@ -166,7 +176,9 @@ async function fetchTrustServiceCertificates(trustServiceUrl: string, token: str data: error.response?.data, message: error.message, }) - throw new Error(`Failed to fetch certificates from trust-service: ${error.response?.status} ${JSON.stringify(error.response?.data)}`) + throw new Error( + `Failed to fetch certificates from trust-service: ${error.response?.status} ${JSON.stringify(error.response?.data)}`, + ) } throw error } @@ -201,7 +213,7 @@ export async function fetchSharedAgentX509Certificates(tenantId?: string): Promi if (!clientSecret) throw new Error('PLATFORM_SHARED_AGENT_CLIENT_SECRET is not configured') if (!resolvedTenantId) throw new Error('tenantId not provided and PLATFORM_SHARED_AGENT_TENANT_ID is not configured') if (!trustServiceUrl) throw new Error('TRUST_SERVICE_URL is not configured') - console.log(`[${label}] starting certificate fetch for tenantId:`, resolvedTenantId) + console.log(`[${label}] starting certificate fetch for tenantId:`, resolvedTenantId) console.log(`[${label}] using tenantId:`, resolvedTenantId, tenantId ? '(from agent context)' : '(from .env)') @@ -212,10 +224,9 @@ export async function fetchSharedAgentX509Certificates(tenantId?: string): Promi let ecosystemIds: string[] try { - const ecosystemResponse = await axios.get<{ statusCode: number; message: string; data: string[] }>( - ecosystemsUrl, - { headers: { accept: 'application/json', Authorization: `Bearer ${token}` } }, - ) + const ecosystemResponse = await axios.get<{ statusCode: number; message: string; data: string[] }>(ecosystemsUrl, { + headers: { accept: 'application/json', Authorization: `Bearer ${token}` }, + }) console.log(`[${label}] ecosystem response status:`, ecosystemResponse.status) console.log(`[${label}] ecosystem response data:`, JSON.stringify(ecosystemResponse.data, null, 2)) @@ -234,7 +245,9 @@ export async function fetchSharedAgentX509Certificates(tenantId?: string): Promi data: error.response?.data, message: error.message, }) - throw new Error(`Failed to fetch ecosystem IDs from platform: ${error.response?.status} ${JSON.stringify(error.response?.data)}`) + throw new Error( + `Failed to fetch ecosystem IDs from platform: ${error.response?.status} ${JSON.stringify(error.response?.data)}`, + ) } throw error } diff --git a/src/utils/oid4vc-agent.ts b/src/utils/oid4vc-agent.ts index 6acbf823..a07d5abc 100644 --- a/src/utils/oid4vc-agent.ts +++ b/src/utils/oid4vc-agent.ts @@ -256,9 +256,6 @@ export async function getTrustedCerts(tenantId?: string): Promise { console.warn('[getTrustedCerts] no certificates returned') return [] } -// Remove this log after testing to avoid logging sensitive certificate information - console.log('[getTrustedCerts] fetched certificates count:', certs.length) - console.log("certs::::::::::::::::::::::::::", certs) return certs } catch (error) { console.error('[getTrustedCerts] failed:', error instanceof Error ? error.message : error) diff --git a/yarn.lock b/yarn.lock index 3d31b382..bbf92326 100644 --- a/yarn.lock +++ b/yarn.lock @@ -61,26 +61,26 @@ dependencies: static-eval "2.0.2" -"@ayanworks/credo-polygon-w3c-module@2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@ayanworks/credo-polygon-w3c-module/-/credo-polygon-w3c-module-2.0.0.tgz#8682b3dfeffe166c7da718afac9739db825ef626" - integrity sha512-6ZJH/TtieyIQ1mxOj00JyixZ56wi2G7nhDgZEWYkQiEcY1x3IRNR75iRLTOK23NTn2tLneC6Kl5niWEg7BsCjg== +"@ayanworks/credo-polygon-w3c-module@2.0.2": + version "2.0.2" + resolved "https://registry.yarnpkg.com/@ayanworks/credo-polygon-w3c-module/-/credo-polygon-w3c-module-2.0.2.tgz#5d52bbbc8ecb990d19056c7eec69aa31b1f4a477" + integrity sha512-RtXl06kGy7w8axH60Wqj402rH748S9KottDVEwkXhSb9OrXMYy30vrNLercy25+NeGd8lpK5g1oscpLPW70Zzg== dependencies: - "@ayanworks/polygon-did-registrar" "2.2.0" - "@ayanworks/polygon-did-resolver" "1.0.2" - "@ayanworks/polygon-schema-manager" "2.2.0" + "@ayanworks/polygon-did-registrar" "2.2.1" + "@ayanworks/polygon-did-resolver" "1.0.3" + "@ayanworks/polygon-schema-manager" "2.2.1" "@credo-ts/askar" "^0.6.1" "@credo-ts/core" "^0.6.1" did-resolver "^4.1.0" ethers "^6.16.0" -"@ayanworks/polygon-did-registrar@2.2.0": - version "2.2.0" - resolved "https://registry.yarnpkg.com/@ayanworks/polygon-did-registrar/-/polygon-did-registrar-2.2.0.tgz#87c09b8965a81ee8b896fb4efc74a37b3e43e626" - integrity sha512-E6z3fkpfhs8SyN4c3UMnGcmfWMC9dxXJlqLPMfXIsGCFM5G2ZiQuI7pnFyd2hnGpZ818VeIFFYkojm68LNpdyw== +"@ayanworks/polygon-did-registrar@2.2.1": + version "2.2.1" + resolved "https://registry.yarnpkg.com/@ayanworks/polygon-did-registrar/-/polygon-did-registrar-2.2.1.tgz#131824f34baeedb93989a9e3f65b69a2c022144c" + integrity sha512-lpDe3p0tcPB4eOKCQGtl67PxK8MjR1CGRKOn4qGwySRxH9hBJq8AF0l+Lbi9Zisqnm3eo8nv/EiBLnwpsdwAdA== dependencies: - "@ayanworks/polygon-did-registry-contract" "4.0.0" - "@ayanworks/polygon-did-resolver" "1.0.2" + "@ayanworks/polygon-did-registry-contract" "4.0.1" + "@ayanworks/polygon-did-resolver" "1.0.3" "@ethersproject/basex" "^5.8.0" "@ethersproject/signing-key" "^5.8.0" "@ethersproject/transactions" "^5.8.0" @@ -89,28 +89,28 @@ ethers "^6.16.0" uuid "^13.0.0" -"@ayanworks/polygon-did-registry-contract@4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@ayanworks/polygon-did-registry-contract/-/polygon-did-registry-contract-4.0.0.tgz#33d3fb6534700e1dc91b6e757c4276d8a91242df" - integrity sha512-18iePYxKMa0MY7xHxBKjeL3AIaiPy9YT+WSlreVDqF4XUGGWqh4TaUtMPx89i3NprcTFiYOVVhC0KhbsitBgnA== +"@ayanworks/polygon-did-registry-contract@4.0.1": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@ayanworks/polygon-did-registry-contract/-/polygon-did-registry-contract-4.0.1.tgz#104ca2cec0f88cf616529ba11099d47d653958d9" + integrity sha512-gBUtZOme6PIhLWE2hwJ006jNKm2fbYTaFKyR7uazgDrJUGNCZ+w9VM2ETByzVWBGuWyANWUJyoJm50GfGp+5wg== -"@ayanworks/polygon-did-resolver@1.0.2": - version "1.0.2" - resolved "https://registry.yarnpkg.com/@ayanworks/polygon-did-resolver/-/polygon-did-resolver-1.0.2.tgz#5aee0d2f54f0374b9e3de9af413d66bda12e39b2" - integrity sha512-y4irODbWS96W5zk/+M22bD0qjRBDaCbU7D6W37/132BZJdcXEUPmLD4tMNUQ8wFmc1aPION+EMrqUPOyCos+kw== +"@ayanworks/polygon-did-resolver@1.0.3": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@ayanworks/polygon-did-resolver/-/polygon-did-resolver-1.0.3.tgz#f0c0ef86b04194234096c79b3abe6631ce08d128" + integrity sha512-ZkiWFNxJRvMJhw6oJAhbCXiLLV4ntroE/lVve+ZBQM9U1XHEAORWZfjEJZpfWwhAIQu7gQgaR80hIuucZ0wuWw== dependencies: - "@ayanworks/polygon-did-registry-contract" "4.0.0" + "@ayanworks/polygon-did-registry-contract" "4.0.1" did-resolver "^4.1.0" ethers "^6.16.0" -"@ayanworks/polygon-schema-manager@2.2.0": - version "2.2.0" - resolved "https://registry.yarnpkg.com/@ayanworks/polygon-schema-manager/-/polygon-schema-manager-2.2.0.tgz#59cea872f50ef8862180cd982581b855385bc7a0" - integrity sha512-1ZwKxGE2M5CK9PSlO6MOuk63PpWiXS3IiwM5V4Lluf4AN+eejquP/cAqicyjthoiMQ/h28FDIdFqsQOFz8fC1A== +"@ayanworks/polygon-schema-manager@2.2.1": + version "2.2.1" + resolved "https://registry.yarnpkg.com/@ayanworks/polygon-schema-manager/-/polygon-schema-manager-2.2.1.tgz#22e56f86df36ad117cc86de86b1e0c4ba051f005" + integrity sha512-s75ouYENY46PVSE77+Jl1UVXfmTobuMm0yV+qx/DnHiUT2XgamvFBqh9DzJrKzSjws/dSxmHsVuVlbX0h3uyOQ== dependencies: - "@ayanworks/polygon-did-registry-contract" "4.0.0" - "@ayanworks/polygon-did-resolver" "1.0.2" - axios "^1.6.3" + "@ayanworks/polygon-did-registry-contract" "4.0.1" + "@ayanworks/polygon-did-resolver" "1.0.3" + axios "^1.13.5" did-resolver "^4.1.0" ethers "^6.16.0" keccak256 "^1.0.6" @@ -3408,7 +3408,16 @@ available-typed-arrays@^1.0.7: dependencies: possible-typed-array-names "^1.0.0" -axios@^1.6.3, axios@^1.9.0: +axios@^1.13.5: + version "1.13.6" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.13.6.tgz#c3f92da917dc209a15dd29936d20d5089b6b6c98" + integrity sha512-ChTCHMouEe2kn713WHbQGcuYrr6fXTBiu460OTwWrWob16g1bXn4vtz07Ope7ewMozJAnEquLk5lWQWtBig9DQ== + dependencies: + follow-redirects "^1.15.11" + form-data "^4.0.5" + proxy-from-env "^1.1.0" + +axios@^1.9.0: version "1.13.2" resolved "https://registry.yarnpkg.com/axios/-/axios-1.13.2.tgz#9ada120b7b5ab24509553ec3e40123521117f687" integrity sha512-VPk9ebNqPcy5lRGuSlKx752IlDatOjT9paPlm8A7yOuW2Fbvp4X3JznJtT4f0GzGLLiWE9W8onz51SqLYwzGaA== @@ -4838,7 +4847,7 @@ flatted@^3.2.9: resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.3.3.tgz#67c8fad95454a7c7abebf74bb78ee74a44023358" integrity sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg== -follow-redirects@^1.15.6: +follow-redirects@^1.15.11, follow-redirects@^1.15.6: version "1.15.11" resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.11.tgz#777d73d72a92f8ec4d2e410eb47352a56b8e8340" integrity sha512-deG2P0JfjrTxl50XGCDyfI97ZGVCxIpfKYmfyrQ54n5FO/0gfIES8C/Psl6kWVDolizcaaxZJnTS0QSMxvnsBQ== @@ -4858,7 +4867,7 @@ foreground-child@^3.1.0: cross-spawn "^7.0.6" signal-exit "^4.0.1" -form-data@^4.0.0, form-data@^4.0.4: +form-data@^4.0.0, form-data@^4.0.4, form-data@^4.0.5: version "4.0.5" resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.5.tgz#b49e48858045ff4cbf6b03e1805cebcad3679053" integrity sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w== From 27b0a6b0eab7fa65397288d5db5b1f129bc7b83f Mon Sep 17 00:00:00 2001 From: Sagar Khole Date: Thu, 26 Mar 2026 16:20:16 +0530 Subject: [PATCH 093/152] feat: Add status list management and revocation for OpenID4VC issuance sessions and integrate SdJwtVcModule. Signed-off-by: Sagar Khole --- samples/cliConfig.json | 5 +- src/cli.ts | 9 ++ src/cliAgent.ts | 18 +++ .../issuance-sessions.Controller.ts | 15 ++ .../issuance-sessions.service.ts | 67 ++++++++- .../openid4vc/types/issuer.types.ts | 15 +- src/controllers/types.ts | 19 +++ src/controllers/x509/x509.types.ts | 23 ++- src/routes/routes.ts | 41 +++++ src/routes/swagger.json | 127 ++++++++++++++++ src/utils/statusListService.ts | 140 ++++++++++++++++++ tsconfig.build.json | 16 +- 12 files changed, 481 insertions(+), 14 deletions(-) create mode 100644 src/utils/statusListService.ts diff --git a/samples/cliConfig.json b/samples/cliConfig.json index 105845d7..d2155a11 100644 --- a/samples/cliConfig.json +++ b/samples/cliConfig.json @@ -44,5 +44,8 @@ "fileServerUrl": "https://schema.credebl.id", "fileServerToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJBeWFuV29ya3MiLCJpZCI6ImNhZDI3ZjhjLTMyNWYtNDRmZC04ZmZkLWExNGNhZTY3NTMyMSJ9.I3IR7abjWbfStnxzn1BhxhV0OEzt1x3mULjDdUcgWHk", "apiKey": "supersecret-that-too-16chars", - "updateJwtSecret": false + "updateJwtSecret": false, + "statusListServerUrl": "http://localhost:3000", + "statusListApiKey": "test_key", + "statusListDefaultSize": 131072 } diff --git a/src/cli.ts b/src/cli.ts index 533cd9e4..15ccf91e 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -45,6 +45,9 @@ interface Parsed { fileServerToken?: string apiKey?: string updateJwtSecret?: boolean + 'status-list-server-url'?: string + 'status-list-api-key'?: string + 'status-list-default-size'?: number } interface InboundTransport { @@ -163,6 +166,9 @@ async function parseArguments(): Promise { boolean: true, default: false, }) + .option('status-list-server-url', { string: true }) + .option('status-list-api-key', { string: true }) + .option('status-list-default-size', { number: true }) .config() .env('AFJ_REST') .parseAsync() as Promise @@ -211,5 +217,8 @@ export async function runCliServer() { fileServerToken: parsed.fileServerToken, apiKey: parsed['apiKey'], updateJwtSecret: parsed['updateJwtSecret'], + statusListServerUrl: parsed['status-list-server-url'], + statusListApiKey: parsed['status-list-api-key'], + statusListDefaultSize: parsed['status-list-default-size'], } as AriesRestConfig) } diff --git a/src/cliAgent.ts b/src/cliAgent.ts index 36a092bc..b44a728c 100644 --- a/src/cliAgent.ts +++ b/src/cliAgent.ts @@ -29,6 +29,7 @@ import { X509Module, JwkDidRegistrar, JwkDidResolver, + SdJwtVcModule, } from '@credo-ts/core' import { DidCommHttpOutboundTransport, @@ -115,6 +116,9 @@ export interface AriesRestConfig { schemaFileServerURL?: string apiKey: string updateJwtSecret?: boolean + statusListServerUrl?: string + statusListApiKey?: string + statusListDefaultSize?: number } export async function readRestConfig(path: string) { @@ -249,6 +253,7 @@ const getModules = ( rpcUrl: rpcUrl ? rpcUrl : (process.env.RPC_URL as string), serverUrl: fileServerUrl ? fileServerUrl : (process.env.SERVER_URL as string), }), + sdJwtVc: new SdJwtVcModule(), openid4vc: new OpenId4VcModule({ app: expressApp, issuer: { @@ -364,9 +369,22 @@ export async function runRestAgent(restConfig: AriesRestConfig) { walletScheme, apiKey, updateJwtSecret, + statusListServerUrl, + statusListApiKey, + statusListDefaultSize, ...afjConfig } = restConfig + if (statusListServerUrl) { + process.env.STATUS_LIST_SERVER_URL = statusListServerUrl + } + if (statusListApiKey) { + process.env.STATUS_LIST_API_KEY = statusListApiKey + } + if (statusListDefaultSize) { + process.env.STATUS_LIST_DEFAULT_SIZE = String(statusListDefaultSize) + } + const logger = new TsLogger(logLevel ?? LogLevel.error) const agentConfig: InitConfig = { diff --git a/src/controllers/openid4vc/issuance-sessions/issuance-sessions.Controller.ts b/src/controllers/openid4vc/issuance-sessions/issuance-sessions.Controller.ts index fd8d0ea1..01b1df1d 100644 --- a/src/controllers/openid4vc/issuance-sessions/issuance-sessions.Controller.ts +++ b/src/controllers/openid4vc/issuance-sessions/issuance-sessions.Controller.ts @@ -104,4 +104,19 @@ export class IssuanceSessionsController extends Controller { throw ErrorHandlingService.handle(error) } } + + /** + * Revoke credentials in an issuance session by session ID + */ + @Post('{issuanceSessionId}/revoke') + public async revokeSessionById( + @Request() request: Req, + @Path('issuanceSessionId') issuanceSessionId: string, + ) { + try { + return await issuanceSessionService.revokeBySessionId(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 1959379a..0282621c 100644 --- a/src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts +++ b/src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts @@ -7,6 +7,8 @@ import { OpenId4VcIssuanceSessionRepository } from '@credo-ts/openid4vc' import { SignerMethod } from '../../../enums/enum' import { BadRequestError, NotFoundError } from '../../../errors/errors' +import { checkAndCreateStatusList, getServerUrl } from '../../../utils/statusListService' + class IssuanceSessionsService { public async createCredentialOffer(options: OpenId4VcIssuanceSessionsCreateOffer, agentReq: Req) { const { credentials, publicIssuerId } = options @@ -15,7 +17,10 @@ class IssuanceSessionsService { if (!issuer) { throw new NotFoundError(`Issuer with id ${publicIssuerId} not found`) } - const mappedCredentials = credentials.map((cred) => { + + const offerStatusInfo: any[] = [] + + const mappedCredentials = await Promise.all(credentials.map(async (cred) => { const supported = issuer?.credentialConfigurationsSupported[cred.credentialSupportedId] if (!supported) { throw new Error(`CredentialSupportedId '${cred.credentialSupportedId}' is not supported by issuer`) @@ -45,20 +50,52 @@ class IssuanceSessionsService { ) } - const currentVct = cred.payload && 'vct' in cred.payload ? cred.payload.vct : undefined + const effectiveIssuerDid = cred.signerOptions?.method === SignerMethod.Did ? cred.signerOptions.did : undefined + const effectiveStatusList = cred.statusListDetails || options.statusListDetails + + let statusBlock = undefined + if (effectiveIssuerDid && effectiveStatusList) { + await checkAndCreateStatusList( + agentReq.agent as any, + effectiveStatusList.listId, + effectiveIssuerDid, + effectiveStatusList.listSize, + ) + const listUri = `${getServerUrl()}/status-lists/${effectiveStatusList.listId}` + + statusBlock = { + status_list: { + uri: listUri, + idx: effectiveStatusList.index + } + } + + offerStatusInfo.push({ + credentialSupportedId: cred.credentialSupportedId, + listId: effectiveStatusList.listId, + index: effectiveStatusList.index, + issuerDid: effectiveIssuerDid + }) + } + + const currentVct = cred.payload && 'vct' in cred.payload ? (cred.payload as any).vct : undefined return { ...cred, payload: { ...cred.payload, vct: currentVct ?? (typeof supported.vct === 'string' ? supported.vct : undefined), + ...(statusBlock ? { status: statusBlock } : {}) }, } - }) + })) options.issuanceMetadata ||= {} - options.issuanceMetadata.credentials = mappedCredentials + if (offerStatusInfo.length > 0) { + options.issuanceMetadata.StatusListInfo = offerStatusInfo + } + const issuerModule = agentReq.agent.modules.openid4vc.issuer if (!issuerModule) { @@ -144,6 +181,28 @@ class IssuanceSessionsService { const issuanceSessionRepository = agentReq.agent.dependencyManager.resolve(OpenId4VcIssuanceSessionRepository) await issuanceSessionRepository.deleteById(agentReq.agent.context, sessionId) } + + public async revokeBySessionId(agentReq: Req, sessionId: string) { + 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`) + } + + const statusInfo = record.issuanceMetadata?.StatusListInfo as any[] + if (!statusInfo || statusInfo.length === 0) { + throw new Error(`No status list information found for session ${sessionId}`) + } + + const { revokeCredentialInStatusList } = await import('../../../utils/statusListService') + + for (const info of statusInfo) { + await revokeCredentialInStatusList(agentReq.agent as any, info.listId, info.index, info.issuerDid) + } + + return { message: 'Credentials in session revoked successfully' } + } } export const issuanceSessionService = new IssuanceSessionsService() diff --git a/src/controllers/openid4vc/types/issuer.types.ts b/src/controllers/openid4vc/types/issuer.types.ts index 897dfca6..10ff3ef8 100644 --- a/src/controllers/openid4vc/types/issuer.types.ts +++ b/src/controllers/openid4vc/types/issuer.types.ts @@ -4,10 +4,7 @@ import type { OpenId4VciCredentialFormatProfile } from '@credo-ts/openid4vc' import { Kms } from '@credo-ts/core' import { OpenId4VciCreateCredentialOfferOptions, OpenId4VciSignCredentials } from '@credo-ts/openid4vc' -export enum SignerMethod { - Did = 'did', - X5c = 'x5c', -} +import { SignerMethod } from '../../../enums/enum' export interface OpenId4VciOfferCredentials { credentialSupportedId: string @@ -18,6 +15,11 @@ export interface OpenId4VciOfferCredentials { x5c?: string[] keyId?: string } + statusListDetails?: { + listId: string + index: number + listSize?: number + } } export interface DisclosureFrameForOffer { @@ -72,6 +74,11 @@ export interface OpenId4VcIssuanceSessionsCreateOffer { authorizationServerUrl: string } issuanceMetadata?: Record + statusListDetails?: { + listId: string + index: number + listSize?: number + } } export interface X509GenericRecordContent { diff --git a/src/controllers/types.ts b/src/controllers/types.ts index 19e4c635..36908bb8 100644 --- a/src/controllers/types.ts +++ b/src/controllers/types.ts @@ -51,6 +51,25 @@ export interface AgentToken { token: string } +export enum CredentialState { + ProposalSent = 'proposal-sent', + ProposalReceived = 'proposal-received', + OfferSent = 'offer-sent', + OfferReceived = 'offer-received', + Declined = 'declined', + RequestSent = 'request-sent', + RequestReceived = 'request-received', + CredentialIssued = 'credential-issued', + CredentialReceived = 'credential-received', + Done = 'done', + Abandoned = 'abandoned', +} + +export enum CredentialRole { + Issuer = 'issuer', + Holder = 'holder', +} + export interface AgentMessageType { '@id': string '@type': string diff --git a/src/controllers/x509/x509.types.ts b/src/controllers/x509/x509.types.ts index a642a0ae..274db1c4 100644 --- a/src/controllers/x509/x509.types.ts +++ b/src/controllers/x509/x509.types.ts @@ -1,5 +1,26 @@ import type { Curve } from '../types' -import type { X509ExtendedKeyUsage, X509KeyUsage } from '@credo-ts/core' + +export enum X509KeyUsage { + DigitalSignature = 1, + NonRepudiation = 2, + KeyEncipherment = 4, + DataEncipherment = 8, + KeyAgreement = 16, + KeyCertSign = 32, + CrlSign = 64, + EncipherOnly = 128, + DecipherOnly = 256, +} + +export enum X509ExtendedKeyUsage { + ServerAuth = '1.3.6.1.5.5.7.3.1', + ClientAuth = '1.3.6.1.5.5.7.3.2', + CodeSigning = '1.3.6.1.5.5.7.3.3', + EmailProtection = '1.3.6.1.5.5.7.3.4', + TimeStamping = '1.3.6.1.5.5.7.3.8', + OcspSigning = '1.3.6.1.5.5.7.3.9', + MdlDs = '1.0.18013.5.1.2', +} // Enum remains the same export enum GeneralNameType { diff --git a/src/routes/routes.ts b/src/routes/routes.ts index 55f296e3..58438768 100644 --- a/src/routes/routes.ts +++ b/src/routes/routes.ts @@ -812,6 +812,7 @@ const models: TsoaRoute.Models = { "credentialSupportedId": {"dataType":"string","required":true}, "format": {"ref":"OpenId4VciCredentialFormatProfile","required":true}, "signerOptions": {"dataType":"nestedObjectLiteral","nestedProperties":{"keyId":{"dataType":"string"},"x5c":{"dataType":"array","array":{"dataType":"string"}},"did":{"dataType":"string"},"method":{"ref":"SignerMethod","required":true}},"required":true}, + "statusListDetails": {"dataType":"nestedObjectLiteral","nestedProperties":{"listSize":{"dataType":"double"},"index":{"dataType":"double","required":true},"listId":{"dataType":"string","required":true}}}, "payload": {"dataType":"nestedObjectLiteral","nestedProperties":{"vct":{"dataType":"string"}},"additionalProperties":{"dataType":"any"},"required":true}, "disclosureFrame": {"ref":"DisclosureFrameForOffer"}, }, @@ -839,6 +840,7 @@ const models: TsoaRoute.Models = { "credentialSupportedId": {"dataType":"string","required":true}, "format": {"ref":"OpenId4VciCredentialFormatProfile","required":true}, "signerOptions": {"dataType":"nestedObjectLiteral","nestedProperties":{"keyId":{"dataType":"string"},"x5c":{"dataType":"array","array":{"dataType":"string"}},"did":{"dataType":"string"},"method":{"ref":"SignerMethod","required":true}},"required":true}, + "statusListDetails": {"dataType":"nestedObjectLiteral","nestedProperties":{"listSize":{"dataType":"double"},"index":{"dataType":"double","required":true},"listId":{"dataType":"string","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, @@ -928,6 +930,7 @@ const models: TsoaRoute.Models = { "credentialSupportedId": {"dataType":"string","required":true}, "format": {"ref":"OpenId4VciCredentialFormatProfile","required":true}, "signerOptions": {"dataType":"nestedObjectLiteral","nestedProperties":{"keyId":{"dataType":"string"},"x5c":{"dataType":"array","array":{"dataType":"string"}},"did":{"dataType":"string"},"method":{"ref":"SignerMethod","required":true}},"required":true}, + "statusListDetails": {"dataType":"nestedObjectLiteral","nestedProperties":{"listSize":{"dataType":"double"},"index":{"dataType":"double","required":true},"listId":{"dataType":"string","required":true}}}, "payload": {"dataType":"nestedObjectLiteral","nestedProperties":{"credential":{"ref":"W3cCredential","required":true},"verificationMethod":{"dataType":"string","required":true}},"required":true}, }, "additionalProperties": false, @@ -941,6 +944,7 @@ const models: TsoaRoute.Models = { "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_"}, + "statusListDetails": {"dataType":"nestedObjectLiteral","nestedProperties":{"listSize":{"dataType":"double"},"index":{"dataType":"double","required":true},"listId":{"dataType":"string","required":true}}}, }, "additionalProperties": false, }, @@ -2523,6 +2527,43 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This 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_revokeSessionById: Record = { + request: {"in":"request","name":"request","required":true,"dataType":"object"}, + issuanceSessionId: {"in":"path","name":"issuanceSessionId","required":true,"dataType":"string"}, + }; + app.post('/openid4vc/issuance-sessions/:issuanceSessionId/revoke', + authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), + ...(fetchMiddlewares(IssuanceSessionsController)), + ...(fetchMiddlewares(IssuanceSessionsController.prototype.revokeSessionById)), + + async function IssuanceSessionsController_revokeSessionById(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_revokeSessionById, 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: 'revokeSessionById', + 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"}, }; diff --git a/src/routes/swagger.json b/src/routes/swagger.json index 55f04345..b5a9f710 100644 --- a/src/routes/swagger.json +++ b/src/routes/swagger.json @@ -1720,6 +1720,26 @@ ], "type": "object" }, + "statusListDetails": { + "properties": { + "listSize": { + "type": "number", + "format": "double" + }, + "index": { + "type": "number", + "format": "double" + }, + "listId": { + "type": "string" + } + }, + "required": [ + "index", + "listId" + ], + "type": "object" + }, "payload": { "properties": { "vct": { @@ -1806,6 +1826,26 @@ ], "type": "object" }, + "statusListDetails": { + "properties": { + "listSize": { + "type": "number", + "format": "double" + }, + "index": { + "type": "number", + "format": "double" + }, + "listId": { + "type": "string" + } + }, + "required": [ + "index", + "listId" + ], + "type": "object" + }, "payload": { "properties": { "namespaces": { @@ -2059,6 +2099,26 @@ ], "type": "object" }, + "statusListDetails": { + "properties": { + "listSize": { + "type": "number", + "format": "double" + }, + "index": { + "type": "number", + "format": "double" + }, + "listId": { + "type": "string" + } + }, + "required": [ + "index", + "listId" + ], + "type": "object" + }, "payload": { "properties": { "credential": { @@ -2157,6 +2217,26 @@ }, "issuanceMetadata": { "$ref": "#/components/schemas/Record_string.unknown_" + }, + "statusListDetails": { + "properties": { + "listSize": { + "type": "number", + "format": "double" + }, + "index": { + "type": "number", + "format": "double" + }, + "listId": { + "type": "string" + } + }, + "required": [ + "index", + "listId" + ], + "type": "object" } }, "required": [ @@ -4974,6 +5054,53 @@ ] } }, + "/openid4vc/issuance-sessions/{issuanceSessionId}/revoke": { + "post": { + "operationId": "RevokeSessionById", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" + } + } + } + } + }, + "description": "Revoke credentials in an issuance session by session ID", + "tags": [ + "oid4vc issuance sessions" + ], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } + ], + "parameters": [ + { + "in": "path", + "name": "issuanceSessionId", + "required": true, + "schema": { + "type": "string" + } + } + ] + } + }, "/openid4vc/holder/sd-jwt-vcs": { "get": { "operationId": "GetSdJwtCredentials", diff --git a/src/utils/statusListService.ts b/src/utils/statusListService.ts new file mode 100644 index 00000000..02e4c88a --- /dev/null +++ b/src/utils/statusListService.ts @@ -0,0 +1,140 @@ +import { JwsProtectedHeaderOptions, JwsService, JwtPayload } from '@credo-ts/core'; +import { StatusList, getListFromStatusListJWT } from '@sd-jwt/jwt-status-list'; + +// We evaluate this at request-time instead of statically so cliAgent config is available +export function getServerUrl() { + return process.env.STATUS_LIST_SERVER_URL || 'http://localhost:3000'; +} + +function getApiKeyHeaders() { + const key = process.env.STATUS_LIST_API_KEY; + const headers: Record = { 'Content-Type': 'application/json' }; + if (key) { + headers['x-api-key'] = key; + } + return headers; +} + +async function getKmsKeyIdForDid(agent: any, did: string, verificationMethodId: string) { + const didRecords = await agent.dids.getCreatedDids({ did }); + const didRecord = didRecords[0]; + if (didRecord && didRecord.keys) { + const relativeId = verificationMethodId.includes('#') ? verificationMethodId.split('#')[1] : verificationMethodId; + const keyMap = didRecord.keys.find((k: any) => k.didDocumentRelativeKeyId === `#${relativeId}` || k.didDocumentRelativeKeyId === relativeId); + if (keyMap) { + return keyMap.kmsKeyId; + } + } + return verificationMethodId; +} + +async function signStatusList(agent: any, verificationMethodId: string, statusList: StatusList, listId: string, issuerDid: string): Promise { + const payload = new JwtPayload({ + iss: issuerDid, + sub: `${getServerUrl()}/status-lists/${listId}`, + iat: Math.floor(Date.now() / 1000), + additionalClaims: { + status_list: { + bits: statusList.getBitsPerStatus(), + lst: statusList.compressStatusList(), + } + } + }); + + const header: JwsProtectedHeaderOptions = { + alg: 'EdDSA', + typ: 'statuslist+jwt', + }; + + const jwsService = agent.dependencyManager.resolve(JwsService); + const kmsKeyId = await getKmsKeyIdForDid(agent, issuerDid, verificationMethodId); + + // In v0.6.x, createJwsCompact takes keyId instead of key + return jwsService.createJwsCompact(agent.context, { + keyId: kmsKeyId, + payload, + protectedHeaderOptions: header, + }); +} + +export async function checkAndCreateStatusList(agent: any, listId: string, issuerDid: string, listSize?: number) { + const uri = `${getServerUrl()}/status-lists/${listId}`; + + try { + const res = await fetch(uri); + + // If it does not exist (404), we need to create it + if (res.status === 404) { + console.log(`Status list ${listId} not found, creating a new one...`); + // Use provided listSize or fallback to env var (default to 131072) + const size = listSize || Number(process.env.STATUS_LIST_DEFAULT_SIZE) || 131072; + const statusList = new StatusList(new Array(size).fill(0), 1); + + const didDocument = await agent.dids.resolve(issuerDid); + const verificationMethod = didDocument.didDocument?.verificationMethod?.[0]; + + if (!verificationMethod) { + throw new Error(`Could not find verification method for DID ${issuerDid}`); + } + + // Hack to extract keyId + const keyId = verificationMethod.id; + + const jwt = await signStatusList(agent, keyId, statusList, listId, issuerDid); + + // Post the new status list back to the server + const postRes = await fetch(`${getServerUrl()}/status-lists`, { + method: 'POST', + headers: getApiKeyHeaders(), + body: JSON.stringify({ id: listId, jwt }), + }); + + if (!postRes.ok) { + const errBody = await postRes.text(); + throw new Error(`Failed to create list on server: ${postRes.status} ${errBody}`); + } + + console.log(`Successfully created and published new status list ${listId}`); + } else if (!res.ok) { + throw new Error(`Failed to check status list ${listId}: ${res.statusText}`); + } + } catch (error) { + console.error(`Error in checkAndCreateStatusList:`, error); + throw error; + } +} + +export async function revokeCredentialInStatusList(agent: any, listId: string, index: number, issuerDid: string) { + const uri = `${getServerUrl()}/status-lists/${listId}`; + + // 1. Fetch current + const res = await fetch(uri); + if (!res.ok) throw new Error(`Failed to fetch status list to revoke: ${res.statusText}`); + + const currentJwt = await res.text(); + const statusList = getListFromStatusListJWT(currentJwt); + + // 2. Flip the bit + statusList.setStatus(index, 1); + + // 3. Resolve keyId + const didDocument = await agent.dids.resolve(issuerDid); + const verificationMethod = didDocument.didDocument?.verificationMethod?.[0]; + if (!verificationMethod) throw new Error(`Could not find verification method for DID ${issuerDid}`); + const keyId = verificationMethod.id; + + // 4. Re-sign + const newJwt = await signStatusList(agent, keyId, statusList, listId, issuerDid); + + // 5. Update the server + const patchRes = await fetch(`${getServerUrl()}/status-lists/${listId}`, { + method: 'PATCH', + headers: getApiKeyHeaders(), + body: JSON.stringify({ jwt: newJwt }), + }); + + if (!patchRes.ok) { + const errBody = await patchRes.text(); + throw new Error(`Failed to update status list on server: ${patchRes.status} ${errBody}`); + } +} diff --git a/tsconfig.build.json b/tsconfig.build.json index 9543ae73..13879532 100644 --- a/tsconfig.build.json +++ b/tsconfig.build.json @@ -13,10 +13,18 @@ "emitDecoratorMetadata": true, "skipLibCheck": true, "outDir": "./build", - "types": ["node"], - "lib": ["ES2021.Promise"] + "types": [ + "node" + ], + "lib": [ + "ESNext", + "DOM" + ] }, - "include": ["src/**/*", "src/routes"], + "include": [ + "src/**/*", + "src/routes" + ], "exclude": [ "node_modules", "build", @@ -28,4 +36,4 @@ "**/*.d.ts", "scripts" ] -} +} \ No newline at end of file From a4bd2f8960200e9fb7869db745243d0f58a87297 Mon Sep 17 00:00:00 2001 From: Sagar Khole Date: Thu, 26 Mar 2026 16:25:23 +0530 Subject: [PATCH 094/152] feat: Add status list management and revocation for OpenID4VC issuance sessions and integrate SdJwtVcModule. Signed-off-by: Sagar Khole --- src/utils/statusListService.ts | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/utils/statusListService.ts b/src/utils/statusListService.ts index 02e4c88a..e26b8cbe 100644 --- a/src/utils/statusListService.ts +++ b/src/utils/statusListService.ts @@ -63,10 +63,8 @@ export async function checkAndCreateStatusList(agent: any, listId: string, issue try { const res = await fetch(uri); - // If it does not exist (404), we need to create it if (res.status === 404) { console.log(`Status list ${listId} not found, creating a new one...`); - // Use provided listSize or fallback to env var (default to 131072) const size = listSize || Number(process.env.STATUS_LIST_DEFAULT_SIZE) || 131072; const statusList = new StatusList(new Array(size).fill(0), 1); @@ -77,12 +75,9 @@ export async function checkAndCreateStatusList(agent: any, listId: string, issue throw new Error(`Could not find verification method for DID ${issuerDid}`); } - // Hack to extract keyId const keyId = verificationMethod.id; const jwt = await signStatusList(agent, keyId, statusList, listId, issuerDid); - - // Post the new status list back to the server const postRes = await fetch(`${getServerUrl()}/status-lists`, { method: 'POST', headers: getApiKeyHeaders(), From aede4265f9ad538cfaf7621bfd6f64d28a0cc29e Mon Sep 17 00:00:00 2001 From: Krishna Waske Date: Thu, 26 Mar 2026 12:56:36 +0530 Subject: [PATCH 095/152] fix: did, schema and cred-def controller (#350) * fix: did and schema controller Signed-off-by: Krishna Waske * fix: naming convention and remove comments Signed-off-by: Krishna Waske * fix: formatting Signed-off-by: Krishna Waske * fix: remove unused param Signed-off-by: Krishna Waske * fix: credential definition controller Signed-off-by: Krishna Waske * fix: error when cred-def failure Signed-off-by: Krishna Waske --------- Signed-off-by: Krishna Waske --- samples/cliConfig.json | 2 +- src/cliAgent.ts | 5 +- .../CredentialDefinitionController.ts | 264 +++--- .../anoncreds/schema/SchemaController.ts | 230 +++--- src/controllers/did/DidController.ts | 104 ++- src/controllers/types.ts | 57 +- src/enums/enum.ts | 6 +- src/routes/routes.ts | 331 ++++++++ src/routes/swagger.json | 753 ++++++++++++++++++ 9 files changed, 1465 insertions(+), 287 deletions(-) diff --git a/samples/cliConfig.json b/samples/cliConfig.json index d2155a11..092c3d79 100644 --- a/samples/cliConfig.json +++ b/samples/cliConfig.json @@ -19,7 +19,7 @@ "indyNamespace": "indicio:demonet" }, { - "genesisTransactions": "https://raw.githubusercontent.com/bcgov/von-network/main/BCovrin/genesis_test", + "genesisTransactions": "https://test.bcovrin.vonx.io/genesis", "indyNamespace": "bcovrin:testnet" } ], diff --git a/src/cliAgent.ts b/src/cliAgent.ts index b44a728c..e20f10ab 100644 --- a/src/cliAgent.ts +++ b/src/cliAgent.ts @@ -1,6 +1,7 @@ // 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 '@hyperledger/indy-vdr-nodejs' import type { AskarModuleConfigStoreOptions } from '@credo-ts/askar' import type { InitConfig } from '@credo-ts/core' import type { IndyVdrPoolConfig } from '@credo-ts/indy-vdr' @@ -199,10 +200,6 @@ const getModules = ( w3cCredentials: new W3cCredentialsModule(), didcomm: new DidCommModule({ processDidCommMessagesConcurrently: true, - anoncreds: new AnonCredsModule({ - registries: [new IndyVdrAnonCredsRegistry()], - anoncreds, - }), mediationRecipient: true, messagePickup: true, mediator: false, diff --git a/src/controllers/anoncreds/cred-def/CredentialDefinitionController.ts b/src/controllers/anoncreds/cred-def/CredentialDefinitionController.ts index 57f47061..663bec90 100644 --- a/src/controllers/anoncreds/cred-def/CredentialDefinitionController.ts +++ b/src/controllers/anoncreds/cred-def/CredentialDefinitionController.ts @@ -1,142 +1,148 @@ -// 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' +import { + CredentialDefinitionStates, + GetCredentialDefinitionReturn, + RegisterCredentialDefinitionReturn, +} from '../../types' -// @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, + ): Promise { + 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 + }, + ): Promise { + 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) { + const failureReason = registerCredentialDefinitionResult.credentialDefinitionState?.reason ?? 'Failed to register credential definition on ledger' + throw new InternalServerError(failureReason) + } -// 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/schema/SchemaController.ts b/src/controllers/anoncreds/schema/SchemaController.ts index 7a1e8577..9bb1f9fb 100644 --- a/src/controllers/anoncreds/schema/SchemaController.ts +++ b/src/controllers/anoncreds/schema/SchemaController.ts @@ -1,125 +1,133 @@ -// 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, RegisterSchemaReturnStateFinished } 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, RegisterSchemaReturn, SchemaResponseDTO } 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, + ): Promise { + 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, + ): Promise { + 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 + } + // If none of the above conditions are met, throw an error or return a default value + throw new InternalServerError('Unexpected schema creation state.') + } catch (error) { + throw ErrorHandlingService.handle(error) + } + } +} diff --git a/src/controllers/did/DidController.ts b/src/controllers/did/DidController.ts index 682c12bf..f5c56ce3 100644 --- a/src/controllers/did/DidController.ts +++ b/src/controllers/did/DidController.ts @@ -200,7 +200,9 @@ export class DidController extends Controller { } if (createDidOptions?.role?.toLowerCase() === Role.Endorser) { if (createDidOptions.did) { - await this.importDid(agent, didMethod, createDidOptions.did, createDidOptions.seed) + // Hint: Bcovrin uses seed as private key when creating key. But seed is written as a NYM transaction + // Triage: Make sure what to use, seed or privateKey when accepting from API itself + 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}`, @@ -224,7 +226,7 @@ export class DidController extends Controller { seed: createDidOptions.seed, }) const { did } = res?.data || {} - await this.importDid(agent, didMethod, did, createDidOptions.seed) + 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}`, @@ -270,11 +272,11 @@ export class DidController extends Controller { didDocument: didDocument, } } else { - const key = await this.createIndicioKey(agent, createDidOptions) + const { keyId, ...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) + await this.importDid(agent, didMethod, key.did, createDidOptions.seed, undefined, keyId) const didRecord = await agent.dids.getCreatedDids({ method: DidMethod.Indy, did: `${didMethod}:${key.did}`, @@ -326,34 +328,39 @@ export class DidController extends Controller { // 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 privateJwk = transformSeedToPrivateJwk({ + seed: TypedArrayEncoder.fromString(createDidOptions.seed), + type: { + crv: 'Ed25519', + kty: 'OKP', + }, + }).privateJwk - const verificationKey = Kms.PublicJwk.fromPublicJwk(_verificationKey) as Kms.PublicJwk + const key = await agent.kms.importKey({ + privateJwk, + }) + + const verificationKey = Kms.PublicJwk.fromPublicJwk(key.publicJwk) 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 publicKeyBytes = verificationKey.publicKey.publicKey - const did = TypedArrayEncoder.toBase58(buffer.slice(0, 16)) + const did = TypedArrayEncoder.toBase58(publicKeyBytes.slice(0, 16)) let body if (createDidOptions.network === Network.Indicio_Testnet) { body = { network: 'testnet', did, - verkey: TypedArrayEncoder.toBase58(buffer), + verkey: TypedArrayEncoder.toBase58(publicKeyBytes), + keyId: key.keyId, } } else if (createDidOptions.network === Network.Indicio_Demonet) { body = { network: 'demonet', did, - verkey: TypedArrayEncoder.toBase58(buffer), + verkey: TypedArrayEncoder.toBase58(publicKeyBytes), + keyId: key.keyId, } } else { throw new BadRequestError('Please provide a valid did method') @@ -361,36 +368,53 @@ export class DidController extends Controller { return body } - 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), - }) + private async importDid( + agent: AgentType, + didMethod: string, + did: string, + seed: string, + privateKey?: string, + keyId?: string, + ) { + let _keyId: string + + if (!keyId) { + const { privateJwk } = privateKey + ? transformPrivateKeyToPrivateJwk({ + type: { + crv: 'Ed25519', + kty: 'OKP', + }, + privateKey: TypedArrayEncoder.fromString(privateKey), + }) + : seed + ? transformSeedToPrivateJwk({ + seed: TypedArrayEncoder.fromString(seed), + type: { + crv: 'Ed25519', + kty: 'OKP', + }, + }) + : { + privateJwk: undefined, + } + + if (!privateJwk) { + throw new Error('Either privateKey or seed is required') + } - const key = await agent.kms.importKey({ privateJwk }) + const key = await agent.kms.importKey({ privateJwk }) + _keyId = key.keyId + } else { + _keyId = keyId + } - const publicJwk = Kms.PublicJwk.fromPublicJwk(key.publicJwk) const completeDid = `${didMethod}:${did}` await agent.dids.import({ did: completeDid, keys: [ { - kmsKeyId: key.keyId, + kmsKeyId: _keyId, didDocumentRelativeKeyId: verkey, }, ], diff --git a/src/controllers/types.ts b/src/controllers/types.ts index 36908bb8..b63e1114 100644 --- a/src/controllers/types.ts +++ b/src/controllers/types.ts @@ -1,5 +1,17 @@ import type { RecordId } from './examples' -import type { AnonCredsDidCommCredentialFormat, LegacyIndyCredentialFormat } from '@credo-ts/anoncreds' +import type { + AnonCredsCredentialDefinition, + AnonCredsDidCommCredentialFormat, + LegacyIndyCredentialFormat, + RegisterCredentialDefinitionReturnStateAction, + RegisterCredentialDefinitionReturnStateFailed, + RegisterCredentialDefinitionReturnStateFinished, + RegisterCredentialDefinitionReturnStateWait, + RegisterSchemaReturnStateAction, + RegisterSchemaReturnStateFailed, + RegisterSchemaReturnStateFinished, + RegisterSchemaReturnStateWait, +} from '@credo-ts/anoncreds' import type { DidResolutionMetadata, DidDocumentMetadata, @@ -512,3 +524,46 @@ export type EcType = { kty: 'EC' crv: 'P-256' | 'P-384' | 'P-521' | 'secp256k1' } + +export interface SchemaResponseDTO { + schemaId: string + schema?: { + issuerId: string + name: string + version: string + attrNames: string[] + } + resolutionMetadata: Record // Use Record or explicitly define what you need + schemaMetadata: Record +} + +export interface RegisterSchemaReturn { + jobId?: string + schemaState: + | RegisterSchemaReturnStateWait + | RegisterSchemaReturnStateAction + | RegisterSchemaReturnStateFinished + | RegisterSchemaReturnStateFailed + schemaMetadata: Record + registrationMetadata: Record +} + +export interface GetCredentialDefinitionReturn { + credentialDefinition?: AnonCredsCredentialDefinition + credentialDefinitionId: string + resolutionMetadata: Record + credentialDefinitionMetadata: Record +} + +export type CredentialDefinitionStates = + | RegisterCredentialDefinitionReturnStateWait + | RegisterCredentialDefinitionReturnStateAction + | RegisterCredentialDefinitionReturnStateFinished + | RegisterCredentialDefinitionReturnStateFailed + +export interface RegisterCredentialDefinitionReturn { + jobId?: string + credentialDefinitionState: CredentialDefinitionStates + credentialDefinitionMetadata: Record + registrationMetadata: Record +} diff --git a/src/enums/enum.ts b/src/enums/enum.ts index b58196a2..ed45ac7b 100644 --- a/src/enums/enum.ts +++ b/src/enums/enum.ts @@ -44,7 +44,11 @@ export enum NetworkTypes { export enum IndicioAcceptanceMechanism { Wallet_Agreement = 'wallet_agreement', - Accept = 'accept', + At_Submission = 'at_submission', + For_Session = 'for_session', + On_File = 'on_file', + Product_Eula = 'product_eula', + Service_Agreement = 'service_agreement', } export enum EndorserMode { diff --git a/src/routes/routes.ts b/src/routes/routes.ts index 58438768..13c13896 100644 --- a/src/routes/routes.ts +++ b/src/routes/routes.ts @@ -30,6 +30,10 @@ import { AuthController } from './../controllers/auth/AuthController'; // WARNING: This 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 { 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 { VerifierController } from './../controllers/openid4vc/verifiers/verifier.Controller'; import { expressAuthentication } from './../authentication'; // @ts-ignore - no great way to install types from subpackage @@ -1544,6 +1548,185 @@ const models: TsoaRoute.Models = { "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 + "SchemaResponseDTO": { + "dataType": "refObject", + "properties": { + "schemaId": {"dataType":"string","required":true}, + "schema": {"dataType":"nestedObjectLiteral","nestedProperties":{"attrNames":{"dataType":"array","array":{"dataType":"string"},"required":true},"version":{"dataType":"string","required":true},"name":{"dataType":"string","required":true},"issuerId":{"dataType":"string","required":true}}}, + "resolutionMetadata": {"ref":"Record_string.unknown_","required":true}, + "schemaMetadata": {"ref":"Record_string.unknown_","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 + "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 + "RegisterSchemaReturn": { + "dataType": "refObject", + "properties": { + "jobId": {"dataType":"string"}, + "schemaState": {"dataType":"union","subSchemas":[{"ref":"RegisterSchemaReturnStateWait"},{"ref":"RegisterSchemaReturnStateAction"},{"ref":"RegisterSchemaReturnStateFinished"},{"ref":"RegisterSchemaReturnStateFailed"}],"required":true}, + "schemaMetadata": {"ref":"Record_string.unknown_","required":true}, + "registrationMetadata": {"ref":"Record_string.unknown_","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 + "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 + "GetCredentialDefinitionReturn": { + "dataType": "refObject", + "properties": { + "credentialDefinition": {"ref":"AnonCredsCredentialDefinition"}, + "credentialDefinitionId": {"dataType":"string","required":true}, + "resolutionMetadata": {"ref":"Record_string.unknown_","required":true}, + "credentialDefinitionMetadata": {"ref":"Record_string.unknown_","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 + "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 + "CredentialDefinitionStates": { + "dataType": "refAlias", + "type": {"dataType":"union","subSchemas":[{"ref":"RegisterCredentialDefinitionReturnStateWait"},{"ref":"RegisterCredentialDefinitionReturnStateAction"},{"ref":"RegisterCredentialDefinitionReturnStateFinished"},{"ref":"RegisterCredentialDefinitionReturnStateFailed"}],"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": {"ref":"CredentialDefinitionStates","required":true}, + "credentialDefinitionMetadata": {"ref":"Record_string.unknown_","required":true}, + "registrationMetadata": {"ref":"Record_string.unknown_","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":{}}, @@ -4123,6 +4306,154 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This 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 argsVerifierController_createVerifier: Record = { request: {"in":"request","name":"request","required":true,"dataType":"object"}, options: {"in":"body","name":"options","required":true,"ref":"OpenId4VcSiopCreateVerifierOptions"}, diff --git a/src/routes/swagger.json b/src/routes/swagger.json index b5a9f710..725940a3 100644 --- a/src/routes/swagger.json +++ b/src/routes/swagger.json @@ -3557,6 +3557,459 @@ "type": "object", "additionalProperties": false }, + "SchemaResponseDTO": { + "properties": { + "schemaId": { + "type": "string" + }, + "schema": { + "properties": { + "attrNames": { + "items": { + "type": "string" + }, + "type": "array" + }, + "version": { + "type": "string" + }, + "name": { + "type": "string" + }, + "issuerId": { + "type": "string" + } + }, + "required": [ + "attrNames", + "version", + "name", + "issuerId" + ], + "type": "object" + }, + "resolutionMetadata": { + "$ref": "#/components/schemas/Record_string.unknown_" + }, + "schemaMetadata": { + "$ref": "#/components/schemas/Record_string.unknown_" + } + }, + "required": [ + "schemaId", + "resolutionMetadata", + "schemaMetadata" + ], + "type": "object", + "additionalProperties": false + }, + "SchemaId": { + "type": "string", + "example": "WgWxqztrNooG92RXvxSTWv:2:schema_name:1.0" + }, + "AnonCredsSchema": { + "properties": { + "issuerId": { + "type": "string" + }, + "name": { + "type": "string" + }, + "version": { + "type": "string" + }, + "attrNames": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "issuerId", + "name", + "version", + "attrNames" + ], + "type": "object", + "additionalProperties": false + }, + "RegisterSchemaReturnStateWait": { + "properties": { + "state": { + "type": "string", + "enum": [ + "wait" + ], + "nullable": false + }, + "schema": { + "$ref": "#/components/schemas/AnonCredsSchema" + }, + "schemaId": { + "type": "string" + } + }, + "required": [ + "state" + ], + "type": "object", + "additionalProperties": false + }, + "RegisterSchemaReturnStateAction": { + "properties": { + "state": { + "type": "string", + "enum": [ + "action" + ], + "nullable": false + }, + "action": { + "type": "string" + }, + "schema": { + "$ref": "#/components/schemas/AnonCredsSchema" + }, + "schemaId": { + "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" + }, + "schemaId": { + "type": "string" + } + }, + "required": [ + "state", + "schema", + "schemaId" + ], + "type": "object", + "additionalProperties": false + }, + "RegisterSchemaReturnStateFailed": { + "properties": { + "state": { + "type": "string", + "enum": [ + "failed" + ], + "nullable": false + }, + "reason": { + "type": "string" + }, + "schema": { + "$ref": "#/components/schemas/AnonCredsSchema" + }, + "schemaId": { + "type": "string" + } + }, + "required": [ + "state", + "reason" + ], + "type": "object", + "additionalProperties": false + }, + "RegisterSchemaReturn": { + "properties": { + "jobId": { + "type": "string" + }, + "schemaState": { + "anyOf": [ + { + "$ref": "#/components/schemas/RegisterSchemaReturnStateWait" + }, + { + "$ref": "#/components/schemas/RegisterSchemaReturnStateAction" + }, + { + "$ref": "#/components/schemas/RegisterSchemaReturnStateFinished" + }, + { + "$ref": "#/components/schemas/RegisterSchemaReturnStateFailed" + } + ] + }, + "schemaMetadata": { + "$ref": "#/components/schemas/Record_string.unknown_" + }, + "registrationMetadata": { + "$ref": "#/components/schemas/Record_string.unknown_" + } + }, + "required": [ + "schemaState", + "schemaMetadata", + "registrationMetadata" + ], + "type": "object", + "additionalProperties": false + }, + "CreateSchemaInput": { + "properties": { + "issuerId": { + "type": "string" + }, + "name": { + "type": "string" + }, + "version": { + "type": "string" + }, + "attributes": { + "items": { + "type": "string" + }, + "type": "array" + }, + "endorse": { + "type": "boolean" + }, + "endorserDid": { + "type": "string" + } + }, + "required": [ + "issuerId", + "name", + "version", + "attributes" + ], + "type": "object", + "additionalProperties": false + }, + "AnonCredsCredentialDefinition": { + "properties": { + "issuerId": { + "type": "string" + }, + "schemaId": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "CL" + ], + "nullable": false + }, + "tag": { + "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 + }, + "GetCredentialDefinitionReturn": { + "properties": { + "credentialDefinition": { + "$ref": "#/components/schemas/AnonCredsCredentialDefinition" + }, + "credentialDefinitionId": { + "type": "string" + }, + "resolutionMetadata": { + "$ref": "#/components/schemas/Record_string.unknown_" + }, + "credentialDefinitionMetadata": { + "$ref": "#/components/schemas/Record_string.unknown_" + } + }, + "required": [ + "credentialDefinitionId", + "resolutionMetadata", + "credentialDefinitionMetadata" + ], + "type": "object", + "additionalProperties": false + }, + "CredentialDefinitionId": { + "type": "string", + "example": "WgWxqztrNooG92RXvxSTWv:3:CL:20:tag" + }, + "RegisterCredentialDefinitionReturnStateWait": { + "properties": { + "state": { + "type": "string", + "enum": [ + "wait" + ], + "nullable": false + }, + "credentialDefinition": { + "$ref": "#/components/schemas/AnonCredsCredentialDefinition" + }, + "credentialDefinitionId": { + "type": "string" + } + }, + "required": [ + "state" + ], + "type": "object", + "additionalProperties": false + }, + "RegisterCredentialDefinitionReturnStateAction": { + "properties": { + "state": { + "type": "string", + "enum": [ + "action" + ], + "nullable": false + }, + "action": { + "type": "string" + }, + "credentialDefinitionId": { + "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 + }, + "credentialDefinition": { + "$ref": "#/components/schemas/AnonCredsCredentialDefinition" + }, + "credentialDefinitionId": { + "type": "string" + } + }, + "required": [ + "state", + "credentialDefinition", + "credentialDefinitionId" + ], + "type": "object", + "additionalProperties": false + }, + "RegisterCredentialDefinitionReturnStateFailed": { + "properties": { + "state": { + "type": "string", + "enum": [ + "failed" + ], + "nullable": false + }, + "reason": { + "type": "string" + }, + "credentialDefinition": { + "$ref": "#/components/schemas/AnonCredsCredentialDefinition" + }, + "credentialDefinitionId": { + "type": "string" + } + }, + "required": [ + "state", + "reason" + ], + "type": "object", + "additionalProperties": false + }, + "CredentialDefinitionStates": { + "anyOf": [ + { + "$ref": "#/components/schemas/RegisterCredentialDefinitionReturnStateWait" + }, + { + "$ref": "#/components/schemas/RegisterCredentialDefinitionReturnStateAction" + }, + { + "$ref": "#/components/schemas/RegisterCredentialDefinitionReturnStateFinished" + }, + { + "$ref": "#/components/schemas/RegisterCredentialDefinitionReturnStateFailed" + } + ] + }, + "RegisterCredentialDefinitionReturn": { + "properties": { + "jobId": { + "type": "string" + }, + "credentialDefinitionState": { + "$ref": "#/components/schemas/CredentialDefinitionStates" + }, + "credentialDefinitionMetadata": { + "$ref": "#/components/schemas/Record_string.unknown_" + }, + "registrationMetadata": { + "$ref": "#/components/schemas/Record_string.unknown_" + } + }, + "required": [ + "credentialDefinitionState", + "credentialDefinitionMetadata", + "registrationMetadata" + ], + "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" @@ -7529,6 +7982,306 @@ } } }, + "/anoncreds/schemas/{schemaId}": { + "get": { + "operationId": "GetSchemaById", + "responses": { + "200": { + "description": "get schema by Id", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SchemaResponseDTO" + }, + "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/CredentialDefinitionStates" + } + ] + }, + "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" + } + } + } + } + } + }, "/openid4vc/verifier": { "post": { "operationId": "CreateVerifier", From 3ad3b605467cbfe078406cbf5415a4c4ed66d3c4 Mon Sep 17 00:00:00 2001 From: Tipu_Singh Date: Tue, 24 Mar 2026 18:03:38 +0530 Subject: [PATCH 096/152] feat: added token caching and update token fetching logic Signed-off-by: Tipu_Singh --- src/cliAgent.ts | 18 +++++- src/utils/helpers.ts | 133 +++++++++++++++++++++----------------- src/utils/oid4vc-agent.ts | 43 ++++++------ 3 files changed, 108 insertions(+), 86 deletions(-) diff --git a/src/cliAgent.ts b/src/cliAgent.ts index e20f10ab..d7e1ab9d 100644 --- a/src/cliAgent.ts +++ b/src/cliAgent.ts @@ -28,6 +28,7 @@ import { LogLevel, Agent, X509Module, + X509Certificate, JwkDidRegistrar, JwkDidResolver, SdJwtVcModule, @@ -279,14 +280,25 @@ const getModules = ( x509: new X509Module({ getTrustedCertificatesForVerification: async ( agentContext, - { certificateChain: _certificateChain, verification: _verification }, + { certificateChain, verification: _verification }, ) => { //TODO: We need to trust the certificate tenant wise, for that we need to fetch those details from platform const tenantId = agentContext.contextCorrelationId console.log('[getTrustedCertificatesForVerification] tenantId from agentContext:', tenantId) - const certs: string[] = await getTrustedCerts(tenantId) - return certs + try { + const isTrusted = await getTrustedCerts(tenantId, certificateChain) + + if (!isTrusted) { + console.warn('[getTrustedCertificatesForVerification] certificate chain not trusted, returning empty') + return [] + } + + return certificateChain.map((cert: X509Certificate) => cert.toString('pem')) + } catch (error) { + console.error('[getTrustedCertificatesForVerification] unexpected error:', error instanceof Error ? error.message : error) + return [] + } }, }), } diff --git a/src/utils/helpers.ts b/src/utils/helpers.ts index ef33bafc..4e26c104 100644 --- a/src/utils/helpers.ts +++ b/src/utils/helpers.ts @@ -1,11 +1,33 @@ import type { Curve, EcCurve, EcType, OkpCurve, OkpType } from '../controllers/types' import type { KeyAlgorithm } from '@openwallet-foundation/askar-nodejs' -import { JsonEncoder, JsonTransformer } from '@credo-ts/core' +import { JsonEncoder, JsonTransformer, X509Certificate } from '@credo-ts/core' import axios from 'axios' import { randomBytes } from 'crypto' import { curveToKty, keyAlgorithmToCurve } from './constant' +const TOKEN_EXPIRY_BUFFER_SECONDS = 60 +const tokenCache = new Map() + +function getTokenExpiry(token: string): number { + try { + const payload = JSON.parse(Buffer.from(token.split('.')[1], 'base64url').toString('utf-8')) + return typeof payload.exp === 'number' ? payload.exp : 0 + } catch { + return 0 + } +} + +function getCachedToken(clientId: string): string | null { + const cached = tokenCache.get(clientId) + if (!cached) return null + const nowSeconds = Math.floor(Date.now() / 1000) + if (nowSeconds < cached.expiresAt - TOKEN_EXPIRY_BUFFER_SECONDS) { + return cached.token + } + tokenCache.delete(clientId) + return null +} export function objectToJson(result: T) { const serialized = JsonTransformer.serialize(result) @@ -104,6 +126,12 @@ async function fetchPlatformToken( if (!clientId) throw new Error(`[${label}] clientId is required`) if (!clientSecret) throw new Error(`[${label}] clientSecret is required`) + const cachedToken = getCachedToken(clientId) + if (cachedToken) { + console.log(`[${label}] using cached token for clientId:`, clientId) + return cachedToken + } + const tokenUrl = `${platformBaseUrl}/v1/orgs/${clientId}/token` console.log(`[${label}] fetching token from:`, tokenUrl) @@ -139,52 +167,59 @@ async function fetchPlatformToken( throw new Error(`[${label}] access_token not found in platform response`) } + const expiresAt = getTokenExpiry(token) + tokenCache.set(clientId, { token, expiresAt }) + console.log(`[${label}] token cached for clientId:`, clientId, '| expires at:', new Date(expiresAt * 1000).toISOString()) + return token } -async function fetchTrustServiceCertificates( +async function checkTrustCertificatesExist( trustServiceUrl: string, token: string, - ecosystemIds: string[], + x509: string[], label: string, -): Promise { - const certsUrl = `${trustServiceUrl}/api/x509-certificates/ecosystems` - console.log(`[${label}] fetching certificates from:`, certsUrl, 'ecosystemIds:', ecosystemIds) + tenantId?: string, +): Promise { + const matchUrl = `${trustServiceUrl}/api/x509-certificates/match` + console.log(`[${label}] calling match API:`, matchUrl) try { - const certResponse = await axios.get(certsUrl, { - params: { ecosystemIds: ecosystemIds.join(',') }, - headers: { accept: 'application/json', Authorization: `Bearer ${token}` }, - }) + const matchResponse = await axios.post( + matchUrl, + { x509, ...(tenantId && { tenantId }) }, + { headers: { 'Content-Type': 'application/json', accept: 'application/json', Authorization: `Bearer ${token}` } }, + ) - console.log(`[${label}] certificates response status:`, certResponse.status) - console.log(`[${label}] certificates response data:`, JSON.stringify(certResponse.data, null, 2)) + console.log(`[${label}] match response status:`, matchResponse.status) + console.log(`[${label}] match response data:`, matchResponse.data) - if (!Array.isArray(certResponse.data) || certResponse.data.length === 0) { - throw new Error('No certificates returned from trust-service') + if (!matchResponse.data) { + console.warn(`[${label}] certificate chain not trusted${tenantId ? ` for tenantId: ${tenantId}` : ''}`) + return false } - const certificates: string[] = certResponse.data.map((cert: { certificateData: string }) => cert.certificateData) - console.log(`[${label}] extracted certificates count:`, certificates.length) - - return certificates + return matchResponse.data } catch (error) { if (axios.isAxiosError(error)) { - console.error(`[${label}] certificates request failed:`, { + console.error(`[${label}] match request failed:`, { + url: matchUrl, status: error.response?.status, statusText: error.response?.statusText, data: error.response?.data, message: error.message, }) throw new Error( - `Failed to fetch certificates from trust-service: ${error.response?.status} ${JSON.stringify(error.response?.data)}`, + `[${label}] trust-service match request failed with status ${error.response?.status ?? 'no response'}: ${JSON.stringify(error.response?.data ?? error.message)}`, ) } throw error } } -export async function fetchDedicatedX509Certificates(): Promise { +export async function checkDedicatedX509Certificates(certificateChain: X509Certificate[]): Promise { + const label = 'checkDedicatedX509Certificates' + const platformBaseUrl = process.env.PLATFORM_BASE_URL const clientId = process.env.PLATFORM_DEDICATED_CLIENT_ID const clientSecret = process.env.PLATFORM_DEDICATED_CLIENT_SECRET @@ -195,12 +230,19 @@ export async function fetchDedicatedX509Certificates(): Promise { if (!clientSecret) throw new Error('PLATFORM_DEDICATED_CLIENT_SECRET is not configured') if (!trustServiceUrl) throw new Error('TRUST_SERVICE_URL is not configured') - const token = await fetchPlatformToken(platformBaseUrl, clientId, clientSecret, 'fetchDedicatedX509Certificates') - return fetchTrustServiceCertificates(trustServiceUrl, token, [], 'fetchDedicatedX509Certificates') + if (!certificateChain || certificateChain.length === 0) { + throw new Error(`[${label}] certificate chain is required but was not provided`) + } + + const token = await fetchPlatformToken(platformBaseUrl, clientId, clientSecret, label) + const x509 = certificateChain.map((cert) => cert.toString('base64')) + console.log(`[${label}] certificate chain length:`, x509.length) + + return checkTrustCertificatesExist(trustServiceUrl, token, x509, label) } -export async function fetchSharedAgentX509Certificates(tenantId?: string): Promise { - const label = 'fetchSharedAgentX509Certificates' +export async function checkSharedAgentX509Certificates(tenantId?: string, certificateChain?: X509Certificate[]): Promise { + const label = 'checkSharedAgentX509Certificates' const platformBaseUrl = process.env.PLATFORM_BASE_URL const clientId = process.env.PLATFORM_SHARED_AGENT_CLIENT_ID @@ -213,44 +255,17 @@ export async function fetchSharedAgentX509Certificates(tenantId?: string): Promi if (!clientSecret) throw new Error('PLATFORM_SHARED_AGENT_CLIENT_SECRET is not configured') if (!resolvedTenantId) throw new Error('tenantId not provided and PLATFORM_SHARED_AGENT_TENANT_ID is not configured') if (!trustServiceUrl) throw new Error('TRUST_SERVICE_URL is not configured') - console.log(`[${label}] starting certificate fetch for tenantId:`, resolvedTenantId) console.log(`[${label}] using tenantId:`, resolvedTenantId, tenantId ? '(from agent context)' : '(from .env)') - const token = await fetchPlatformToken(platformBaseUrl, clientId, clientSecret, label) - - const ecosystemsUrl = `${platformBaseUrl}/v1/orgs/tenant/${resolvedTenantId}/ecosystems` - console.log(`[${label}] fetching ecosystem IDs from:`, ecosystemsUrl) - - let ecosystemIds: string[] - try { - const ecosystemResponse = await axios.get<{ statusCode: number; message: string; data: string[] }>(ecosystemsUrl, { - headers: { accept: 'application/json', Authorization: `Bearer ${token}` }, - }) - - console.log(`[${label}] ecosystem response status:`, ecosystemResponse.status) - console.log(`[${label}] ecosystem response data:`, JSON.stringify(ecosystemResponse.data, null, 2)) + if (!certificateChain || certificateChain.length === 0) { + throw new Error(`[${label}] certificate chain is required but was not provided`) + } - ecosystemIds = ecosystemResponse.data.data - if (!Array.isArray(ecosystemIds) || ecosystemIds.length === 0) { - throw new Error(`No ecosystem IDs found for tenant: ${resolvedTenantId}`) - } + const token = await fetchPlatformToken(platformBaseUrl, clientId, clientSecret, label) - console.log(`[${label}] ecosystem IDs:`, ecosystemIds) - } catch (error) { - if (axios.isAxiosError(error)) { - console.error(`[${label}] ecosystem IDs request failed:`, { - status: error.response?.status, - statusText: error.response?.statusText, - data: error.response?.data, - message: error.message, - }) - throw new Error( - `Failed to fetch ecosystem IDs from platform: ${error.response?.status} ${JSON.stringify(error.response?.data)}`, - ) - } - throw error - } + const x509 = certificateChain.map((cert) => cert.toString('base64')) + console.log(`[${label}] certificate chain length:`, x509.length) - return fetchTrustServiceCertificates(trustServiceUrl, token, ecosystemIds, label) + return checkTrustCertificatesExist(trustServiceUrl, token, x509, label, resolvedTenantId) } diff --git a/src/utils/oid4vc-agent.ts b/src/utils/oid4vc-agent.ts index a07d5abc..b07fe3f4 100644 --- a/src/utils/oid4vc-agent.ts +++ b/src/utils/oid4vc-agent.ts @@ -3,7 +3,7 @@ import type { DisclosureFrame } from '../controllers/types' import { Agent, CredoError } from '@credo-ts/core' import { container } from 'tsyringe' -import { fetchDedicatedX509Certificates, fetchSharedAgentX509Certificates } from './helpers' +import { checkDedicatedX509Certificates, checkSharedAgentX509Certificates, fetchDedicatedX509Certificates } from './helpers' import type { OpenId4VcCredentialHolderBinding, OpenId4VcCredentialHolderDidBinding, @@ -234,31 +234,26 @@ export interface OpenId4VcIssuanceSessionCreateOfferSdJwtCredentialOptions { disclosureFrame: DisclosureFrame } -export async function getTrustedCerts(tenantId?: string): Promise { - try { - const agent = container.resolve(Agent) - if (!agent) { - console.error('[getTrustedCerts] agent not available in container') - return [] - } +export async function getTrustedCerts(tenantId?: string, certificateChain?: X509Certificate[]): Promise { + const agent = container.resolve(Agent) + if (!agent) { + throw new Error('[getTrustedCerts] agent not available in container') + } - const isDedicated = !('tenants' in agent.modules) - console.log('[getTrustedCerts] agent type:', isDedicated ? 'dedicated' : 'shared') + if (!certificateChain || certificateChain.length === 0) { + throw new Error('[getTrustedCerts] certificate chain is required but was not provided') + } - let certs: string[] - if (isDedicated) { - certs = await fetchDedicatedX509Certificates() - } else { - certs = await fetchSharedAgentX509Certificates(tenantId) - } + const isDedicated = !('tenants' in agent.modules) + console.log('[getTrustedCerts] agent type:', isDedicated ? 'dedicated' : 'shared') - if (!Array.isArray(certs) || certs.length === 0) { - console.warn('[getTrustedCerts] no certificates returned') - return [] - } - return certs - } catch (error) { - console.error('[getTrustedCerts] failed:', error instanceof Error ? error.message : error) - return [] + const isTrusted = isDedicated + ? await checkDedicatedX509Certificates(certificateChain) + : await checkSharedAgentX509Certificates(tenantId, certificateChain) + + if (!isTrusted) { + console.warn('[getTrustedCerts] certificate chain not trusted', isDedicated ? '' : `for tenantId: ${tenantId}`) } + + return isTrusted } From 9191d0dcfc300c4aa17a8640a75a1daefee19594 Mon Sep 17 00:00:00 2001 From: Tipu_Singh Date: Thu, 26 Mar 2026 13:14:56 +0530 Subject: [PATCH 097/152] refactor: removed ecosystem logic and updated authentication logic Signed-off-by: Tipu_Singh --- .env.demo | 10 +++ .env.sample | 20 ++--- src/cliAgent.ts | 15 ++-- src/controllers/auth/AuthController.ts | 30 ++----- src/routes/routes.ts | 105 ------------------------- src/routes/swagger.json | 76 ------------------ src/server.ts | 2 + src/utils/auth.ts | 57 ++++++++++++++ src/utils/constant.ts | 9 +++ src/utils/helpers.ts | 95 ++++++++++------------ src/utils/oid4vc-agent.ts | 60 ++++++++++++-- 11 files changed, 197 insertions(+), 282 deletions(-) create mode 100644 src/utils/auth.ts diff --git a/.env.demo b/.env.demo index b975dfba..e740afc4 100644 --- a/.env.demo +++ b/.env.demo @@ -64,6 +64,16 @@ DCS_START_FROM_CURRENT_MONTH=true NODE_ENV=DEV +# Authentication type for trust-service calls. Supported: NoAuth | ClientAuth (defaults to NoAuth if not set) +TRUST_SERVICE_AUTH_TYPE= +# Required for ClientAuth — CREDEBL platform base URL for token exchange +CLIENT_TOKEN_BASE_URL= +# Client credentials used for trust-service authentication (ClientAuth only) +TRUST_SERVICE_CLIENT_ID= +TRUST_SERVICE_CLIENT_SECRET= +# Tenant ID — required for shared agent (ClientAuth only) +SHARED_AGENT_TENANT_ID= +# Trust list URL — for NoAuth: GitHub/static JSON URL; for ClientAuth: trust-service base URL TRUST_LIST_URL= # Expiry is in seconds diff --git a/.env.sample b/.env.sample index 8838b5c1..a84609d0 100644 --- a/.env.sample +++ b/.env.sample @@ -47,15 +47,17 @@ INDICIO_TEST_GENESIS=`{"reqSignature":{},"txn":{"data":{"data":{"alias":"OpsNode {"reqSignature":{},"txn":{"data":{"data":{"alias":"lorica-identity-node1","blskey":"wUh24sVCQ8PHDgSb343g2eLxjD5vwxsrETfuV2sbwMNnYon9nhbaK5jcWTekvXtyiwxHxuiCCoZwKS97MQEAeC2oLbbMeKjYm212QwSnm7aKLEqTStXht35VqZvZLT7Q3mPQRYLjMGixdn4ocNHrBTMwPUQYycEqwaHWgE1ncDueXY","blskey_pop":"R2sMwF7UW6AaD4ALa1uB1YVPuP6JsdJ7LsUoViM9oySFqFt34C1x1tdHDysS9wwruzaaEFui6xNPqJ8eu3UBqcFKkoWhdsMqCALwe63ytxPwvtLtCffJLhHAcgrPC7DorXYdqhdG2cevdqc5oqFEAaKoFDBf12p5SsbbM4PYWCmVCb","client_ip":"35.225.220.151","client_port":"9702","node_ip":"35.224.26.110","node_port":"9701","services":["VALIDATOR"]},"dest":"k74ZsZuUaJEcB8RRxMwkCwdE5g1r9yzA3nx41qvYqYf"},"metadata":{"from":"Ex6hzsJFYzNJ7kzbfncNeU"},"type":"0"},"txnMetadata":{"seqNo":6,"txnId":"6880673ce4ae4a2352f103d2a6ae20469dd070f2027283a1da5e62a64a59d688"},"ver":"1"} {"reqSignature":{},"txn":{"data":{"data":{"alias":"cysecure-itn","blskey":"GdCvMLkkBYevRFi93b6qaj9G2u1W6Vnbg8QhRD1chhrWR8vRE8x9x7KXVeUBPFf6yW5qq2JCfA2frc8SGni2RwjtTagezfwAwnorLhVJqS5ZxTi4pgcw6smebnt4zWVhTkh6ugDHEypHwNQBcw5WhBZcEJKgNbyVLnHok9ob6cfr3u","blskey_pop":"RbH9mY7M5p3UB3oj4sT1skYwMkxjoUnja8eTYfcm83VcNbxC9zR9pCiRhk4q1dJT3wkDBPGNKnk2p83vaJYLcgMuJtzoWoJAWAxjb3Mcq8Agf6cgQpBuzBq2uCzFPuQCAhDS4Kv9iwA6FsRnfvoeFTs1hhgSJVxQzDWMVTVAD9uCqu","client_ip":"35.169.19.171","client_port":"9702","node_ip":"54.225.56.21","node_port":"9701","services":["VALIDATOR"]},"dest":"4ETBDmHzx8iDQB6Xygmo9nNXtMgq9f6hxGArNhQ6Hh3u"},"metadata":{"from":"uSXXXEdBicPHMMhr3ddNF"},"type":"0"},"txnMetadata":{"seqNo":7,"txnId":"3c21718b07806b2f193b35953dda5b68b288efd551dce4467ce890703d5ba549"},"ver":"1"}` -PLATFORM_BASE_URL= #CREDEBL BASE URL -#if the agent is dedicated -PLATFORM_DEDICATED_CLIENT_ID= -PLATFORM_DEDICATED_CLIENT_SECRET= -#If the agent is shared -PLATFORM_SHARED_AGENT_CLIENT_ID= -PLATFORM_SHARED_AGENT_CLIENT_SECRET= -#Trust service url to fetch trusted certificates for TLS pinning -TRUST_SERVICE_URL= +# Authentication type for trust-service calls. Supported: NoAuth | ClientAuth (defaults to NoAuth if not set) +TRUST_SERVICE_AUTH_TYPE= +# Required for ClientAuth — CREDEBL platform base URL for token exchange +CLIENT_TOKEN_BASE_URL= +# Client credentials used for trust-service authentication (ClientAuth only) +TRUST_SERVICE_CLIENT_ID= +TRUST_SERVICE_CLIENT_SECRET= +# Tenant ID — required for shared agent (ClientAuth only) +SHARED_AGENT_TENANT_ID= +# Trust list URL — for NoAuth: GitHub/static JSON URL; for ClientAuth: trust-service base URL +TRUST_LIST_URL= APP_URL= AGENT_HTTP_URL= diff --git a/src/cliAgent.ts b/src/cliAgent.ts index d7e1ab9d..a60e1556 100644 --- a/src/cliAgent.ts +++ b/src/cliAgent.ts @@ -28,7 +28,6 @@ import { LogLevel, Agent, X509Module, - X509Certificate, JwkDidRegistrar, JwkDidResolver, SdJwtVcModule, @@ -69,7 +68,8 @@ import { isCustomDocumentLoaderEnabled } from './utils/config' import { CustomDocumentLoader } from './utils/customDocumentLoader' import { generateSecretKey } from './utils/helpers' import { TsLogger } from './utils/logger' -import { getMixedCredentialRequestToCredentialMapper, getTrustedCerts } from './utils/oid4vc-agent' +import { getMixedCredentialRequestToCredentialMapper, getX509CertsByClientToken, getX509CertsByUrl } from './utils/oid4vc-agent' +import { AuthTypes, getAuthType } from './utils/auth' import { PolygonDidRegistrar, PolygonDidResolver, PolygonModule } from '@ayanworks/credo-polygon-w3c-module' export type Transports = 'ws' | 'http' @@ -287,14 +287,15 @@ const getModules = ( console.log('[getTrustedCertificatesForVerification] tenantId from agentContext:', tenantId) try { - const isTrusted = await getTrustedCerts(tenantId, certificateChain) + const authType = getAuthType() + console.log('[getTrustedCertificatesForVerification] authType:', authType) - if (!isTrusted) { - console.warn('[getTrustedCertificatesForVerification] certificate chain not trusted, returning empty') - return [] + if (authType === AuthTypes.ClientAuth) { + return await getX509CertsByClientToken(tenantId, certificateChain) } - return certificateChain.map((cert: X509Certificate) => cert.toString('pem')) + // NoAuth: return all certs from the static trust list URL + return await getX509CertsByUrl() } catch (error) { console.error('[getTrustedCertificatesForVerification] unexpected error:', error instanceof Error ? error.message : error) return [] diff --git a/src/controllers/auth/AuthController.ts b/src/controllers/auth/AuthController.ts index eba1e892..5a25f20e 100644 --- a/src/controllers/auth/AuthController.ts +++ b/src/controllers/auth/AuthController.ts @@ -1,11 +1,9 @@ import axios from 'axios' import { Request as Req } from 'express' -import { Body, Controller, Get, Path, Post, Request, Route, Tags } from 'tsoa' +import { Body, Controller, Path, Post, Request, Route, Tags } from 'tsoa' import { injectable } from 'tsyringe' import { BadRequestError } from '../../errors' -import { fetchDedicatedX509Certificates, fetchSharedAgentX509Certificates } from '../../utils/helpers' -import { getTrustedCerts } from '../../utils/oid4vc-agent' interface OrgTokenRequest { clientId: string @@ -30,35 +28,17 @@ export class AuthController extends Controller { @Path('orgId') orgId: string, @Body() body: OrgTokenRequest, ): Promise { - const platformBaseUrl = process.env.PLATFORM_BASE_URL - if (!platformBaseUrl) { - throw new BadRequestError('PLATFORM_BASE_URL is not configured') + const clientTokenBaseUrl = process.env.CLIENT_TOKEN_BASE_URL + if (!clientTokenBaseUrl) { + throw new BadRequestError('CLIENT_TOKEN_BASE_URL is not configured') } const response = await axios.post( - `${platformBaseUrl}/v1/orgs/${orgId}/token`, + `${clientTokenBaseUrl}/v1/orgs/${orgId}/token`, { clientId: body.clientId, clientSecret: body.clientSecret }, { headers: { 'Content-Type': 'application/json', accept: 'application/json' } }, ) return response.data } - // TODO: Remove these test endpoints after manual testing is done - @Get('/test/dedicated-x509-certificates') - public async testFetchDedicatedX509Certificates(@Request() _request: Req): Promise { - return fetchDedicatedX509Certificates() - } - - @Get('/test/shared-agent-x509-certificates') - public async testFetchSharedAgentX509Certificates(@Request() _request: Req): Promise { - return fetchSharedAgentX509Certificates() - } - - /** - * [TEMP] Manually trigger getTrustedCerts to test agent type detection and trust list fetch - */ - @Get('/test/trusted-certs') - public async testGetTrustedCerts(@Request() _request: Req): Promise { - return getTrustedCerts() - } } diff --git a/src/routes/routes.ts b/src/routes/routes.ts index 13c13896..2fc737d2 100644 --- a/src/routes/routes.ts +++ b/src/routes/routes.ts @@ -4092,111 +4092,6 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This 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 argsAuthController_testFetchDedicatedX509Certificates: Record = { - _request: {"in":"request","name":"_request","required":true,"dataType":"object"}, - }; - app.get('/v1/orgs/test/dedicated-x509-certificates', - ...(fetchMiddlewares(AuthController)), - ...(fetchMiddlewares(AuthController.prototype.testFetchDedicatedX509Certificates)), - - async function AuthController_testFetchDedicatedX509Certificates(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: argsAuthController_testFetchDedicatedX509Certificates, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(AuthController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'testFetchDedicatedX509Certificates', - 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 argsAuthController_testFetchSharedAgentX509Certificates: Record = { - _request: {"in":"request","name":"_request","required":true,"dataType":"object"}, - }; - app.get('/v1/orgs/test/shared-agent-x509-certificates', - ...(fetchMiddlewares(AuthController)), - ...(fetchMiddlewares(AuthController.prototype.testFetchSharedAgentX509Certificates)), - - async function AuthController_testFetchSharedAgentX509Certificates(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: argsAuthController_testFetchSharedAgentX509Certificates, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(AuthController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'testFetchSharedAgentX509Certificates', - 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 argsAuthController_testGetTrustedCerts: Record = { - _request: {"in":"request","name":"_request","required":true,"dataType":"object"}, - }; - app.get('/v1/orgs/test/trusted-certs', - ...(fetchMiddlewares(AuthController)), - ...(fetchMiddlewares(AuthController.prototype.testGetTrustedCerts)), - - async function AuthController_testGetTrustedCerts(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: argsAuthController_testGetTrustedCerts, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(AuthController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'testGetTrustedCerts', - 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"}, }; diff --git a/src/routes/swagger.json b/src/routes/swagger.json index 725940a3..f9741416 100644 --- a/src/routes/swagger.json +++ b/src/routes/swagger.json @@ -7804,82 +7804,6 @@ } } }, - "/v1/orgs/test/dedicated-x509-certificates": { - "get": { - "operationId": "TestFetchDedicatedX509Certificates", - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": { - "items": { - "type": "string" - }, - "type": "array" - } - } - } - } - }, - "tags": [ - "Auth" - ], - "security": [], - "parameters": [] - } - }, - "/v1/orgs/test/shared-agent-x509-certificates": { - "get": { - "operationId": "TestFetchSharedAgentX509Certificates", - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": { - "items": { - "type": "string" - }, - "type": "array" - } - } - } - } - }, - "tags": [ - "Auth" - ], - "security": [], - "parameters": [] - } - }, - "/v1/orgs/test/trusted-certs": { - "get": { - "operationId": "TestGetTrustedCerts", - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": { - "items": { - "type": "string" - }, - "type": "array" - } - } - } - } - }, - "description": "[TEMP] Manually trigger getTrustedCerts to test agent type detection and trust list fetch", - "tags": [ - "Auth" - ], - "security": [], - "parameters": [] - } - }, "/agent": { "get": { "operationId": "GetAgentInfo", diff --git a/src/server.ts b/src/server.ts index f94c23c6..75c315f6 100644 --- a/src/server.ts +++ b/src/server.ts @@ -18,6 +18,7 @@ import { ValidateError } from 'tsoa' import { container } from 'tsyringe' import { setDynamicApiKey } from './authentication' +import { validateAuthConfig } from './utils/auth' import { ErrorMessages } from './enums' import { BaseError } from './errors/errors' import { basicMessageEvents } from './events/BasicMessageEvents' @@ -41,6 +42,7 @@ export const setupServer = async ( ) => { await otelSDK.start() agent.config.logger.info('OpenTelemetry SDK started') + validateAuthConfig() container.registerInstance(Agent, agent as Agent) fs.writeFileSync('config.json', JSON.stringify(config, null, 2)) diff --git a/src/utils/auth.ts b/src/utils/auth.ts new file mode 100644 index 00000000..cc35d1bf --- /dev/null +++ b/src/utils/auth.ts @@ -0,0 +1,57 @@ +export interface NoAuth { + type: 'NoAuth' + trustListUrl: string +} + +export interface ClientAuth { + type: 'ClientAuth' + clientTokenBaseUrl: string + trustListUrl: string + trustServiceClientId: string + trustServiceClientSecret: string +} + +export type Auth = NoAuth | ClientAuth + +export type AuthType = Auth['type'] + +export const AuthTypes = { + NoAuth: 'NoAuth', + ClientAuth: 'ClientAuth', +} as const satisfies Record + +const SUPPORTED_AUTH_TYPES = Object.values(AuthTypes) satisfies AuthType[] + +export function getAuthType(): AuthType { + const authType = process.env.TRUST_SERVICE_AUTH_TYPE as AuthType + if (!authType) { + console.warn('[getAuthType] TRUST_SERVICE_AUTH_TYPE is not set — defaulting to NoAuth') + return AuthTypes.NoAuth + } + if (!SUPPORTED_AUTH_TYPES.includes(authType)) { + throw new Error( + `TRUST_SERVICE_AUTH_TYPE '${authType}' is not supported. Supported types: ${SUPPORTED_AUTH_TYPES.join(', ')}`, + ) + } + return authType +} + +export function validateAuthConfig(): void { + const authType = getAuthType() + console.log('[validateAuthConfig] TRUST_SERVICE_AUTH_TYPE:', authType) + + const validators: Record void> = { + NoAuth: () => { + if (!process.env.TRUST_LIST_URL) throw new Error('[validateAuthConfig] TRUST_LIST_URL is required for NoAuth') + }, + ClientAuth: () => { + if (!process.env.CLIENT_TOKEN_BASE_URL) throw new Error('[validateAuthConfig] CLIENT_TOKEN_BASE_URL is required for ClientAuth') + if (!process.env.TRUST_LIST_URL) throw new Error('[validateAuthConfig] TRUST_LIST_URL is required for ClientAuth') + if (!process.env.TRUST_SERVICE_CLIENT_ID) throw new Error('[validateAuthConfig] TRUST_SERVICE_CLIENT_ID is required for ClientAuth') + if (!process.env.TRUST_SERVICE_CLIENT_SECRET) throw new Error('[validateAuthConfig] TRUST_SERVICE_CLIENT_SECRET is required for ClientAuth') + }, + } + + validators[authType]() + console.log('[validateAuthConfig] configuration valid for auth type:', authType) +} diff --git a/src/utils/constant.ts b/src/utils/constant.ts index 7ffe094c..8264209c 100644 --- a/src/utils/constant.ts +++ b/src/utils/constant.ts @@ -3,6 +3,15 @@ import type { Curve } from '../controllers/types' import { KeyAlgorithm } from '@openwallet-foundation/askar-nodejs' export const X509_CERTIFICATE_RECORD = 'X509_CERTIFICATE' +export const TRUST_SERVICE_ROUTES = { + MATCH_CERTIFICATES: '/api/x509-certificates/match', +} as const + +export const TRUST_SERVICE_ENV_KEYS = { + CLIENT_ID: 'TRUST_SERVICE_CLIENT_ID', + CLIENT_SECRET: 'TRUST_SERVICE_CLIENT_SECRET', + TRUST_LIST_URL: 'TRUST_LIST_URL', +} as const export const keyAlgorithmToCurve: Partial> = { [KeyAlgorithm.Ed25519]: 'Ed25519', [KeyAlgorithm.X25519]: 'X25519', diff --git a/src/utils/helpers.ts b/src/utils/helpers.ts index 4e26c104..afc8d497 100644 --- a/src/utils/helpers.ts +++ b/src/utils/helpers.ts @@ -5,7 +5,7 @@ import { JsonEncoder, JsonTransformer, X509Certificate } from '@credo-ts/core' import axios from 'axios' import { randomBytes } from 'crypto' -import { curveToKty, keyAlgorithmToCurve } from './constant' +import { TRUST_SERVICE_ENV_KEYS, TRUST_SERVICE_ROUTES, curveToKty, keyAlgorithmToCurve } from './constant' const TOKEN_EXPIRY_BUFFER_SECONDS = 60 const tokenCache = new Map() @@ -117,12 +117,12 @@ export function getTypeFromCurve(key: Curve | KeyAlgorithm): OkpType | EcType { } async function fetchPlatformToken( - platformBaseUrl: string, + clientTokenBaseUrl: string, clientId: string, clientSecret: string, label: string, ): Promise { - if (!platformBaseUrl) throw new Error(`[${label}] platformBaseUrl is required`) + if (!clientTokenBaseUrl) throw new Error(`[${label}] clientTokenBaseUrl is required`) if (!clientId) throw new Error(`[${label}] clientId is required`) if (!clientSecret) throw new Error(`[${label}] clientSecret is required`) @@ -132,7 +132,7 @@ async function fetchPlatformToken( return cachedToken } - const tokenUrl = `${platformBaseUrl}/v1/orgs/${clientId}/token` + const tokenUrl = `${clientTokenBaseUrl}/v1/orgs/${clientId}/token` console.log(`[${label}] fetching token from:`, tokenUrl) let tokenResponse @@ -176,30 +176,33 @@ async function fetchPlatformToken( async function checkTrustCertificatesExist( trustServiceUrl: string, - token: string, x509: string[], label: string, tenantId?: string, + token?: string, ): Promise { - const matchUrl = `${trustServiceUrl}/api/x509-certificates/match` + const matchUrl = `${trustServiceUrl}${TRUST_SERVICE_ROUTES.MATCH_CERTIFICATES}` console.log(`[${label}] calling match API:`, matchUrl) + const authHeaders = token ? { Authorization: `Bearer ${token}` } : {} + try { - const matchResponse = await axios.post( + const matchResponse = await axios.post<{ matched: boolean }>( matchUrl, { x509, ...(tenantId && { tenantId }) }, - { headers: { 'Content-Type': 'application/json', accept: 'application/json', Authorization: `Bearer ${token}` } }, + { headers: { 'Content-Type': 'application/json', accept: 'application/json', ...authHeaders } }, ) console.log(`[${label}] match response status:`, matchResponse.status) - console.log(`[${label}] match response data:`, matchResponse.data) - if (!matchResponse.data) { + const isTrusted = matchResponse.data?.matched === true + console.log(`[${label}] isTrusted:`, isTrusted) + + if (!isTrusted) { console.warn(`[${label}] certificate chain not trusted${tenantId ? ` for tenantId: ${tenantId}` : ''}`) - return false } - return matchResponse.data + return isTrusted } catch (error) { if (axios.isAxiosError(error)) { console.error(`[${label}] match request failed:`, { @@ -217,55 +220,37 @@ async function checkTrustCertificatesExist( } } -export async function checkDedicatedX509Certificates(certificateChain: X509Certificate[]): Promise { - const label = 'checkDedicatedX509Certificates' - - const platformBaseUrl = process.env.PLATFORM_BASE_URL - const clientId = process.env.PLATFORM_DEDICATED_CLIENT_ID - const clientSecret = process.env.PLATFORM_DEDICATED_CLIENT_SECRET - const trustServiceUrl = process.env.TRUST_SERVICE_URL - - if (!platformBaseUrl) throw new Error('PLATFORM_BASE_URL is not configured') - if (!clientId) throw new Error('PLATFORM_DEDICATED_CLIENT_ID is not configured') - if (!clientSecret) throw new Error('PLATFORM_DEDICATED_CLIENT_SECRET is not configured') - if (!trustServiceUrl) throw new Error('TRUST_SERVICE_URL is not configured') +export async function checkX509Certificates( + x509Certificates: string[], + isDedicated: boolean, + tenantId?: string, +): Promise { + const label = 'checkX509Certificates' - if (!certificateChain || certificateChain.length === 0) { + if (!x509Certificates || x509Certificates.length === 0) { throw new Error(`[${label}] certificate chain is required but was not provided`) } - const token = await fetchPlatformToken(platformBaseUrl, clientId, clientSecret, label) - const x509 = certificateChain.map((cert) => cert.toString('base64')) - console.log(`[${label}] certificate chain length:`, x509.length) - - return checkTrustCertificatesExist(trustServiceUrl, token, x509, label) -} - -export async function checkSharedAgentX509Certificates(tenantId?: string, certificateChain?: X509Certificate[]): Promise { - const label = 'checkSharedAgentX509Certificates' - - const platformBaseUrl = process.env.PLATFORM_BASE_URL - const clientId = process.env.PLATFORM_SHARED_AGENT_CLIENT_ID - const clientSecret = process.env.PLATFORM_SHARED_AGENT_CLIENT_SECRET - const resolvedTenantId = tenantId ?? process.env.PLATFORM_SHARED_AGENT_TENANT_ID - const trustServiceUrl = process.env.TRUST_SERVICE_URL - - if (!platformBaseUrl) throw new Error('PLATFORM_BASE_URL is not configured') - if (!clientId) throw new Error('PLATFORM_SHARED_AGENT_CLIENT_ID is not configured') - if (!clientSecret) throw new Error('PLATFORM_SHARED_AGENT_CLIENT_SECRET is not configured') - if (!resolvedTenantId) throw new Error('tenantId not provided and PLATFORM_SHARED_AGENT_TENANT_ID is not configured') - if (!trustServiceUrl) throw new Error('TRUST_SERVICE_URL is not configured') - - console.log(`[${label}] using tenantId:`, resolvedTenantId, tenantId ? '(from agent context)' : '(from .env)') - - if (!certificateChain || certificateChain.length === 0) { - throw new Error(`[${label}] certificate chain is required but was not provided`) + const clientTokenBaseUrl = process.env.CLIENT_TOKEN_BASE_URL + const clientId = process.env[TRUST_SERVICE_ENV_KEYS.CLIENT_ID] + const clientSecret = process.env[TRUST_SERVICE_ENV_KEYS.CLIENT_SECRET] + const trustListUrl = process.env[TRUST_SERVICE_ENV_KEYS.TRUST_LIST_URL] + + if (!clientTokenBaseUrl) throw new Error(`[${label}] CLIENT_TOKEN_BASE_URL is not configured`) + if (!clientId) throw new Error(`[${label}] ${TRUST_SERVICE_ENV_KEYS.CLIENT_ID} is not configured`) + if (!clientSecret) throw new Error(`[${label}] ${TRUST_SERVICE_ENV_KEYS.CLIENT_SECRET} is not configured`) + if (!trustListUrl) throw new Error(`[${label}] ${TRUST_SERVICE_ENV_KEYS.TRUST_LIST_URL} is not configured`) + + let resolvedTenantId: string | undefined + if (!isDedicated) { + resolvedTenantId = tenantId + if (!resolvedTenantId) throw new Error(`[${label}] tenantId is required for shared agent but was not provided`) + console.log(`[${label}] using tenantId:`, resolvedTenantId) } - const token = await fetchPlatformToken(platformBaseUrl, clientId, clientSecret, label) + console.log(`[${label}] agent type: ${isDedicated ? 'dedicated' : 'shared'}, certificates:`, x509Certificates) - const x509 = certificateChain.map((cert) => cert.toString('base64')) - console.log(`[${label}] certificate chain length:`, x509.length) + const token = await fetchPlatformToken(clientTokenBaseUrl, clientId, clientSecret, label) - return checkTrustCertificatesExist(trustServiceUrl, token, x509, label, resolvedTenantId) + return checkTrustCertificatesExist(trustListUrl, x509Certificates, label, resolvedTenantId, token) } diff --git a/src/utils/oid4vc-agent.ts b/src/utils/oid4vc-agent.ts index b07fe3f4..f4eb6eba 100644 --- a/src/utils/oid4vc-agent.ts +++ b/src/utils/oid4vc-agent.ts @@ -3,7 +3,8 @@ import type { DisclosureFrame } from '../controllers/types' import { Agent, CredoError } from '@credo-ts/core' import { container } from 'tsyringe' -import { checkDedicatedX509Certificates, checkSharedAgentX509Certificates, fetchDedicatedX509Certificates } from './helpers' +import { checkX509Certificates } from './helpers' +import { validateAuthConfig } from './auth' import type { OpenId4VcCredentialHolderBinding, OpenId4VcCredentialHolderDidBinding, @@ -234,6 +235,15 @@ export interface OpenId4VcIssuanceSessionCreateOfferSdJwtCredentialOptions { disclosureFrame: DisclosureFrame } +async function verifyX509CertificateTrust( + certificateChain: X509Certificate[], + isDedicated: boolean, + tenantId?: string, +): Promise { + const x509Certificates = certificateChain.map((cert) => cert.toString('base64')) + return checkX509Certificates(x509Certificates, isDedicated, tenantId) +} + export async function getTrustedCerts(tenantId?: string, certificateChain?: X509Certificate[]): Promise { const agent = container.resolve(Agent) if (!agent) { @@ -247,13 +257,53 @@ export async function getTrustedCerts(tenantId?: string, certificateChain?: X509 const isDedicated = !('tenants' in agent.modules) console.log('[getTrustedCerts] agent type:', isDedicated ? 'dedicated' : 'shared') - const isTrusted = isDedicated - ? await checkDedicatedX509Certificates(certificateChain) - : await checkSharedAgentX509Certificates(tenantId, certificateChain) - + const isTrusted = await verifyX509CertificateTrust(certificateChain, isDedicated, tenantId) if (!isTrusted) { console.warn('[getTrustedCerts] certificate chain not trusted', isDedicated ? '' : `for tenantId: ${tenantId}`) } return isTrusted } + +/** + * ClientAuth flow: verifies the certificate chain against the trust-service using a platform token. + * Returns the PEM certs if trusted, empty array if not. + */ +export async function getX509CertsByClientToken( + tenantId: string, + certificateChain: X509Certificate[], +): Promise { + const isTrusted = await getTrustedCerts(tenantId, certificateChain) + + if (!isTrusted) { + console.warn('[getX509CertsByClientToken] certificate chain not trusted for tenantId:', tenantId) + return [] + } + + return certificateChain.map((cert) => cert.toString('pem')) +} + +export async function getX509CertsByUrl(): Promise { + const trustListUrl = process.env.TRUST_LIST_URL + if (!trustListUrl) throw new Error('[getX509CertsByUrl] TRUST_LIST_URL is not configured') + + console.log('[getX509CertsByUrl] fetching trust list from:', trustListUrl) + + const response = await fetch(trustListUrl) + + if (!response.ok) { + throw new Error(`[getX509CertsByUrl] failed to fetch trust list: HTTP ${response.status}`) + } + + const data = await response.json() + + if (!Array.isArray(data) || data.length === 0) { + throw new Error('[getX509CertsByUrl] trust list is empty or invalid') + } + + console.log('[getX509CertsByUrl] fetched certificates count:', data.length) + + return data as string[] +} + +export { validateAuthConfig } From 35707725748e4e087dbf23f54ab77935c3d85e10 Mon Sep 17 00:00:00 2001 From: Tipu_Singh Date: Thu, 26 Mar 2026 16:05:29 +0530 Subject: [PATCH 098/152] refactor: review changes Signed-off-by: Tipu_Singh --- .env.demo | 6 ++-- .env.sample | 7 ++--- src/cliAgent.ts | 7 +---- src/controllers/auth/AuthController.ts | 8 ++--- src/utils/auth.ts | 4 +-- src/utils/constant.ts | 5 +-- src/utils/helpers.ts | 19 ++++++------ src/utils/oid4vc-agent.ts | 42 ++++++++++++++++---------- 8 files changed, 47 insertions(+), 51 deletions(-) diff --git a/.env.demo b/.env.demo index e740afc4..7829a476 100644 --- a/.env.demo +++ b/.env.demo @@ -66,13 +66,11 @@ NODE_ENV=DEV # Authentication type for trust-service calls. Supported: NoAuth | ClientAuth (defaults to NoAuth if not set) TRUST_SERVICE_AUTH_TYPE= -# Required for ClientAuth — CREDEBL platform base URL for token exchange -CLIENT_TOKEN_BASE_URL= +# Full token endpoint URL for ClientAuth (e.g. http://host:5000/v1/orgs/{clientId}/token) +TRUST_SERVICE_TOKEN_URL= # Client credentials used for trust-service authentication (ClientAuth only) TRUST_SERVICE_CLIENT_ID= TRUST_SERVICE_CLIENT_SECRET= -# Tenant ID — required for shared agent (ClientAuth only) -SHARED_AGENT_TENANT_ID= # Trust list URL — for NoAuth: GitHub/static JSON URL; for ClientAuth: trust-service base URL TRUST_LIST_URL= diff --git a/.env.sample b/.env.sample index a84609d0..bf4b5400 100644 --- a/.env.sample +++ b/.env.sample @@ -49,13 +49,11 @@ INDICIO_TEST_GENESIS=`{"reqSignature":{},"txn":{"data":{"data":{"alias":"OpsNode # Authentication type for trust-service calls. Supported: NoAuth | ClientAuth (defaults to NoAuth if not set) TRUST_SERVICE_AUTH_TYPE= -# Required for ClientAuth — CREDEBL platform base URL for token exchange -CLIENT_TOKEN_BASE_URL= +# Full token endpoint URL for ClientAuth (e.g. http://host:5000/v1/orgs/{clientId}/token) +TRUST_SERVICE_TOKEN_URL= # Client credentials used for trust-service authentication (ClientAuth only) TRUST_SERVICE_CLIENT_ID= TRUST_SERVICE_CLIENT_SECRET= -# Tenant ID — required for shared agent (ClientAuth only) -SHARED_AGENT_TENANT_ID= # Trust list URL — for NoAuth: GitHub/static JSON URL; for ClientAuth: trust-service base URL TRUST_LIST_URL= @@ -73,7 +71,6 @@ ROOT_CA_START_FROM_CURRENT_MONTH= DCS_START_FROM_CURRENT_MONTH= NODE_ENV= -TRUST_LIST_URL= # Expiry is in seconds OID4VCI_CRED_OFFER_EXPIRY=3600 diff --git a/src/cliAgent.ts b/src/cliAgent.ts index a60e1556..03699c8f 100644 --- a/src/cliAgent.ts +++ b/src/cliAgent.ts @@ -286,8 +286,7 @@ const getModules = ( const tenantId = agentContext.contextCorrelationId console.log('[getTrustedCertificatesForVerification] tenantId from agentContext:', tenantId) - try { - const authType = getAuthType() + const authType = getAuthType() console.log('[getTrustedCertificatesForVerification] authType:', authType) if (authType === AuthTypes.ClientAuth) { @@ -296,10 +295,6 @@ const getModules = ( // NoAuth: return all certs from the static trust list URL return await getX509CertsByUrl() - } catch (error) { - console.error('[getTrustedCertificatesForVerification] unexpected error:', error instanceof Error ? error.message : error) - return [] - } }, }), } diff --git a/src/controllers/auth/AuthController.ts b/src/controllers/auth/AuthController.ts index 5a25f20e..c87b8453 100644 --- a/src/controllers/auth/AuthController.ts +++ b/src/controllers/auth/AuthController.ts @@ -28,13 +28,13 @@ export class AuthController extends Controller { @Path('orgId') orgId: string, @Body() body: OrgTokenRequest, ): Promise { - const clientTokenBaseUrl = process.env.CLIENT_TOKEN_BASE_URL - if (!clientTokenBaseUrl) { - throw new BadRequestError('CLIENT_TOKEN_BASE_URL is not configured') + const trustServiceTokenUrl = process.env.TRUST_SERVICE_TOKEN_URL + if (!trustServiceTokenUrl) { + throw new BadRequestError('TRUST_SERVICE_TOKEN_URL is not configured') } const response = await axios.post( - `${clientTokenBaseUrl}/v1/orgs/${orgId}/token`, + `${trustServiceTokenUrl}/v1/orgs/${orgId}/token`, { clientId: body.clientId, clientSecret: body.clientSecret }, { headers: { 'Content-Type': 'application/json', accept: 'application/json' } }, ) diff --git a/src/utils/auth.ts b/src/utils/auth.ts index cc35d1bf..f3f677da 100644 --- a/src/utils/auth.ts +++ b/src/utils/auth.ts @@ -5,7 +5,7 @@ export interface NoAuth { export interface ClientAuth { type: 'ClientAuth' - clientTokenBaseUrl: string + trustServiceTokenUrl: string trustListUrl: string trustServiceClientId: string trustServiceClientSecret: string @@ -45,7 +45,7 @@ export function validateAuthConfig(): void { if (!process.env.TRUST_LIST_URL) throw new Error('[validateAuthConfig] TRUST_LIST_URL is required for NoAuth') }, ClientAuth: () => { - if (!process.env.CLIENT_TOKEN_BASE_URL) throw new Error('[validateAuthConfig] CLIENT_TOKEN_BASE_URL is required for ClientAuth') + if (!process.env.TRUST_SERVICE_TOKEN_URL) throw new Error('[validateAuthConfig] TRUST_SERVICE_TOKEN_URL is required for ClientAuth') if (!process.env.TRUST_LIST_URL) throw new Error('[validateAuthConfig] TRUST_LIST_URL is required for ClientAuth') if (!process.env.TRUST_SERVICE_CLIENT_ID) throw new Error('[validateAuthConfig] TRUST_SERVICE_CLIENT_ID is required for ClientAuth') if (!process.env.TRUST_SERVICE_CLIENT_SECRET) throw new Error('[validateAuthConfig] TRUST_SERVICE_CLIENT_SECRET is required for ClientAuth') diff --git a/src/utils/constant.ts b/src/utils/constant.ts index 8264209c..737b1e54 100644 --- a/src/utils/constant.ts +++ b/src/utils/constant.ts @@ -3,11 +3,8 @@ import type { Curve } from '../controllers/types' import { KeyAlgorithm } from '@openwallet-foundation/askar-nodejs' export const X509_CERTIFICATE_RECORD = 'X509_CERTIFICATE' -export const TRUST_SERVICE_ROUTES = { - MATCH_CERTIFICATES: '/api/x509-certificates/match', -} as const - export const TRUST_SERVICE_ENV_KEYS = { + TOKEN_URL: 'TRUST_SERVICE_TOKEN_URL', CLIENT_ID: 'TRUST_SERVICE_CLIENT_ID', CLIENT_SECRET: 'TRUST_SERVICE_CLIENT_SECRET', TRUST_LIST_URL: 'TRUST_LIST_URL', diff --git a/src/utils/helpers.ts b/src/utils/helpers.ts index afc8d497..e94bb9a5 100644 --- a/src/utils/helpers.ts +++ b/src/utils/helpers.ts @@ -1,11 +1,11 @@ import type { Curve, EcCurve, EcType, OkpCurve, OkpType } from '../controllers/types' import type { KeyAlgorithm } from '@openwallet-foundation/askar-nodejs' -import { JsonEncoder, JsonTransformer, X509Certificate } from '@credo-ts/core' +import { JsonEncoder, JsonTransformer } from '@credo-ts/core' import axios from 'axios' import { randomBytes } from 'crypto' -import { TRUST_SERVICE_ENV_KEYS, TRUST_SERVICE_ROUTES, curveToKty, keyAlgorithmToCurve } from './constant' +import { TRUST_SERVICE_ENV_KEYS, curveToKty, keyAlgorithmToCurve } from './constant' const TOKEN_EXPIRY_BUFFER_SECONDS = 60 const tokenCache = new Map() @@ -117,12 +117,12 @@ export function getTypeFromCurve(key: Curve | KeyAlgorithm): OkpType | EcType { } async function fetchPlatformToken( - clientTokenBaseUrl: string, + tokenUrl: string, clientId: string, clientSecret: string, label: string, ): Promise { - if (!clientTokenBaseUrl) throw new Error(`[${label}] clientTokenBaseUrl is required`) + if (!tokenUrl) throw new Error(`[${label}] tokenUrl is required`) if (!clientId) throw new Error(`[${label}] clientId is required`) if (!clientSecret) throw new Error(`[${label}] clientSecret is required`) @@ -132,14 +132,13 @@ async function fetchPlatformToken( return cachedToken } - const tokenUrl = `${clientTokenBaseUrl}/v1/orgs/${clientId}/token` console.log(`[${label}] fetching token from:`, tokenUrl) let tokenResponse try { tokenResponse = await axios.post( tokenUrl, - { clientSecret }, + { clientId, clientSecret }, { headers: { 'Content-Type': 'application/json', accept: 'application/json' } }, ) } catch (error) { @@ -181,7 +180,7 @@ async function checkTrustCertificatesExist( tenantId?: string, token?: string, ): Promise { - const matchUrl = `${trustServiceUrl}${TRUST_SERVICE_ROUTES.MATCH_CERTIFICATES}` + const matchUrl = trustServiceUrl console.log(`[${label}] calling match API:`, matchUrl) const authHeaders = token ? { Authorization: `Bearer ${token}` } : {} @@ -231,12 +230,12 @@ export async function checkX509Certificates( throw new Error(`[${label}] certificate chain is required but was not provided`) } - const clientTokenBaseUrl = process.env.CLIENT_TOKEN_BASE_URL + const tokenUrl = process.env[TRUST_SERVICE_ENV_KEYS.TOKEN_URL] const clientId = process.env[TRUST_SERVICE_ENV_KEYS.CLIENT_ID] const clientSecret = process.env[TRUST_SERVICE_ENV_KEYS.CLIENT_SECRET] const trustListUrl = process.env[TRUST_SERVICE_ENV_KEYS.TRUST_LIST_URL] - if (!clientTokenBaseUrl) throw new Error(`[${label}] CLIENT_TOKEN_BASE_URL is not configured`) + if (!tokenUrl) throw new Error(`[${label}] ${TRUST_SERVICE_ENV_KEYS.TOKEN_URL} is not configured`) if (!clientId) throw new Error(`[${label}] ${TRUST_SERVICE_ENV_KEYS.CLIENT_ID} is not configured`) if (!clientSecret) throw new Error(`[${label}] ${TRUST_SERVICE_ENV_KEYS.CLIENT_SECRET} is not configured`) if (!trustListUrl) throw new Error(`[${label}] ${TRUST_SERVICE_ENV_KEYS.TRUST_LIST_URL} is not configured`) @@ -250,7 +249,7 @@ export async function checkX509Certificates( console.log(`[${label}] agent type: ${isDedicated ? 'dedicated' : 'shared'}, certificates:`, x509Certificates) - const token = await fetchPlatformToken(clientTokenBaseUrl, clientId, clientSecret, label) + const token = await fetchPlatformToken(tokenUrl, clientId, clientSecret, label) return checkTrustCertificatesExist(trustListUrl, x509Certificates, label, resolvedTenantId, token) } diff --git a/src/utils/oid4vc-agent.ts b/src/utils/oid4vc-agent.ts index f4eb6eba..e3e31350 100644 --- a/src/utils/oid4vc-agent.ts +++ b/src/utils/oid4vc-agent.ts @@ -1,10 +1,4 @@ import type { SdJwtVcHolderBinding } from '@credo-ts/core' -import type { DisclosureFrame } from '../controllers/types' -import { Agent, CredoError } from '@credo-ts/core' -import { container } from 'tsyringe' - -import { checkX509Certificates } from './helpers' -import { validateAuthConfig } from './auth' import type { OpenId4VcCredentialHolderBinding, OpenId4VcCredentialHolderDidBinding, @@ -13,11 +7,18 @@ import type { OpenId4VciSignSdJwtCredentials, } from '@credo-ts/openid4vc' -import { DidsApi, X509Certificate, X509Service } from '@credo-ts/core' -import { ClaimFormat, X509ModuleConfig } from '@credo-ts/core' +import { Agent, ClaimFormat, CredoError, DidsApi, LogLevel, X509Certificate, X509ModuleConfig, X509Service } from '@credo-ts/core' import { OpenId4VciCredentialFormatProfile } from '@credo-ts/openid4vc' +import { container } from 'tsyringe' + +import type { DisclosureFrame } from '../controllers/types' import { SignerMethod } from '../enums/enum' +import { validateAuthConfig } from './auth' +import { checkX509Certificates } from './helpers' +import { TsLogger } from './logger' + +const logger = new TsLogger(LogLevel.info) export function getMixedCredentialRequestToCredentialMapper(): OpenId4VciCredentialRequestToCredentialMapper { return async ({ @@ -244,22 +245,31 @@ async function verifyX509CertificateTrust( return checkX509Certificates(x509Certificates, isDedicated, tenantId) } -export async function getTrustedCerts(tenantId?: string, certificateChain?: X509Certificate[]): Promise { +export async function getTrustedCerts(params: { + certificateChain: X509Certificate[] + tenantId?: string +}): Promise { + const { tenantId, certificateChain } = params + const agent = container.resolve(Agent) if (!agent) { throw new Error('[getTrustedCerts] agent not available in container') } - if (!certificateChain || certificateChain.length === 0) { + if (certificateChain.length === 0) { throw new Error('[getTrustedCerts] certificate chain is required but was not provided') } const isDedicated = !('tenants' in agent.modules) - console.log('[getTrustedCerts] agent type:', isDedicated ? 'dedicated' : 'shared') + logger.info(`[getTrustedCerts] agent type: ${isDedicated ? 'dedicated' : 'shared'}`) + + if (!isDedicated && !tenantId) { + throw new Error('[getTrustedCerts] tenantId is required for shared agents') + } const isTrusted = await verifyX509CertificateTrust(certificateChain, isDedicated, tenantId) if (!isTrusted) { - console.warn('[getTrustedCerts] certificate chain not trusted', isDedicated ? '' : `for tenantId: ${tenantId}`) + logger.warn(`[getTrustedCerts] certificate chain not trusted${isDedicated ? '' : ` for tenantId: ${tenantId}`}`) } return isTrusted @@ -273,10 +283,10 @@ export async function getX509CertsByClientToken( tenantId: string, certificateChain: X509Certificate[], ): Promise { - const isTrusted = await getTrustedCerts(tenantId, certificateChain) + const isTrusted = await getTrustedCerts({ certificateChain, tenantId }) if (!isTrusted) { - console.warn('[getX509CertsByClientToken] certificate chain not trusted for tenantId:', tenantId) + logger.warn(`[getX509CertsByClientToken] certificate chain not trusted for tenantId: ${tenantId}`) return [] } @@ -287,7 +297,7 @@ export async function getX509CertsByUrl(): Promise { const trustListUrl = process.env.TRUST_LIST_URL if (!trustListUrl) throw new Error('[getX509CertsByUrl] TRUST_LIST_URL is not configured') - console.log('[getX509CertsByUrl] fetching trust list from:', trustListUrl) + logger.info(`[getX509CertsByUrl] fetching trust list from: ${trustListUrl}`) const response = await fetch(trustListUrl) @@ -301,7 +311,7 @@ export async function getX509CertsByUrl(): Promise { throw new Error('[getX509CertsByUrl] trust list is empty or invalid') } - console.log('[getX509CertsByUrl] fetched certificates count:', data.length) + logger.info(`[getX509CertsByUrl] fetched certificates count: ${data.length}`) return data as string[] } From 3912fa2cd40ec74f8a8916005f25f98c1317a480 Mon Sep 17 00:00:00 2001 From: Tipu_Singh Date: Thu, 26 Mar 2026 16:07:58 +0530 Subject: [PATCH 099/152] refactor: review changes for get token Signed-off-by: Tipu_Singh --- src/controllers/auth/AuthController.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/controllers/auth/AuthController.ts b/src/controllers/auth/AuthController.ts index c87b8453..9f7c66d5 100644 --- a/src/controllers/auth/AuthController.ts +++ b/src/controllers/auth/AuthController.ts @@ -34,7 +34,7 @@ export class AuthController extends Controller { } const response = await axios.post( - `${trustServiceTokenUrl}/v1/orgs/${orgId}/token`, + `${trustServiceTokenUrl}`, { clientId: body.clientId, clientSecret: body.clientSecret }, { headers: { 'Content-Type': 'application/json', accept: 'application/json' } }, ) From acb808755d15820031ecbdd352feb7026d4e270d Mon Sep 17 00:00:00 2001 From: Sagar Khole Date: Thu, 26 Mar 2026 18:15:42 +0530 Subject: [PATCH 100/152] feat: Add property to credential offer types and issuance logic Signed-off-by: Sagar Khole --- .../openid4vc/issuance-sessions/issuance-sessions.service.ts | 3 ++- src/controllers/openid4vc/types/issuer.types.ts | 1 + src/routes/routes.ts | 1 + src/routes/swagger.json | 3 +++ 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts b/src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts index 0282621c..7a9e2cd9 100644 --- a/src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts +++ b/src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts @@ -54,7 +54,7 @@ class IssuanceSessionsService { const effectiveStatusList = cred.statusListDetails || options.statusListDetails let statusBlock = undefined - if (effectiveIssuerDid && effectiveStatusList) { + if (options.isRevocable && effectiveIssuerDid && effectiveStatusList) { await checkAndCreateStatusList( agentReq.agent as any, effectiveStatusList.listId, @@ -91,6 +91,7 @@ class IssuanceSessionsService { options.issuanceMetadata ||= {} options.issuanceMetadata.credentials = mappedCredentials + options.issuanceMetadata.isRevocable = options.isRevocable if (offerStatusInfo.length > 0) { options.issuanceMetadata.StatusListInfo = offerStatusInfo diff --git a/src/controllers/openid4vc/types/issuer.types.ts b/src/controllers/openid4vc/types/issuer.types.ts index 10ff3ef8..987a0543 100644 --- a/src/controllers/openid4vc/types/issuer.types.ts +++ b/src/controllers/openid4vc/types/issuer.types.ts @@ -79,6 +79,7 @@ export interface OpenId4VcIssuanceSessionsCreateOffer { index: number listSize?: number } + isRevocable?: boolean } export interface X509GenericRecordContent { diff --git a/src/routes/routes.ts b/src/routes/routes.ts index 2fc737d2..d170b56b 100644 --- a/src/routes/routes.ts +++ b/src/routes/routes.ts @@ -949,6 +949,7 @@ const models: TsoaRoute.Models = { "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_"}, "statusListDetails": {"dataType":"nestedObjectLiteral","nestedProperties":{"listSize":{"dataType":"double"},"index":{"dataType":"double","required":true},"listId":{"dataType":"string","required":true}}}, + "isRevocable": {"dataType":"boolean"}, }, "additionalProperties": false, }, diff --git a/src/routes/swagger.json b/src/routes/swagger.json index f9741416..1c5ed875 100644 --- a/src/routes/swagger.json +++ b/src/routes/swagger.json @@ -2237,6 +2237,9 @@ "listId" ], "type": "object" + }, + "isRevocable": { + "type": "boolean" } }, "required": [ From b23cd84642628fb8eebd691217e837008db34380 Mon Sep 17 00:00:00 2001 From: Sagar Khole Date: Thu, 26 Mar 2026 21:19:15 +0530 Subject: [PATCH 101/152] making status list server URL mandatory Signed-off-by: Sagar Khole --- src/cliAgent.ts | 2 ++ src/utils/statusListService.ts | 22 +++++++++++++++++----- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/src/cliAgent.ts b/src/cliAgent.ts index 03699c8f..21c5335b 100644 --- a/src/cliAgent.ts +++ b/src/cliAgent.ts @@ -382,6 +382,8 @@ export async function runRestAgent(restConfig: AriesRestConfig) { if (statusListServerUrl) { process.env.STATUS_LIST_SERVER_URL = statusListServerUrl + } else { + throw new Error('statusListServerUrl is required in the configuration') } if (statusListApiKey) { process.env.STATUS_LIST_API_KEY = statusListApiKey diff --git a/src/utils/statusListService.ts b/src/utils/statusListService.ts index e26b8cbe..7b528014 100644 --- a/src/utils/statusListService.ts +++ b/src/utils/statusListService.ts @@ -3,7 +3,11 @@ import { StatusList, getListFromStatusListJWT } from '@sd-jwt/jwt-status-list'; // We evaluate this at request-time instead of statically so cliAgent config is available export function getServerUrl() { - return process.env.STATUS_LIST_SERVER_URL || 'http://localhost:3000'; + const url = process.env.STATUS_LIST_SERVER_URL; + if (!url) { + throw new Error('STATUS_LIST_SERVER_URL is not configured'); + } + return url.endsWith('/') ? url.slice(0, -1) : url; } function getApiKeyHeaders() { @@ -61,7 +65,9 @@ export async function checkAndCreateStatusList(agent: any, listId: string, issue const uri = `${getServerUrl()}/status-lists/${listId}`; try { - const res = await fetch(uri); + const res = await fetch(uri, { + headers: getApiKeyHeaders() + }); if (res.status === 404) { console.log(`Status list ${listId} not found, creating a new one...`); @@ -91,7 +97,8 @@ export async function checkAndCreateStatusList(agent: any, listId: string, issue console.log(`Successfully created and published new status list ${listId}`); } else if (!res.ok) { - throw new Error(`Failed to check status list ${listId}: ${res.statusText}`); + const errBody = await res.text().catch(() => ''); + throw new Error(`Failed to check status list ${listId} at ${uri}: ${res.status} ${res.statusText} ${errBody}`); } } catch (error) { console.error(`Error in checkAndCreateStatusList:`, error); @@ -103,8 +110,13 @@ export async function revokeCredentialInStatusList(agent: any, listId: string, i const uri = `${getServerUrl()}/status-lists/${listId}`; // 1. Fetch current - const res = await fetch(uri); - if (!res.ok) throw new Error(`Failed to fetch status list to revoke: ${res.statusText}`); + const res = await fetch(uri, { + headers: getApiKeyHeaders() + }); + if (!res.ok) { + const errBody = await res.text().catch(() => ''); + throw new Error(`Failed to fetch status list to revoke at ${uri}: ${res.status} ${res.statusText} ${errBody}`); + } const currentJwt = await res.text(); const statusList = getListFromStatusListJWT(currentJwt); From 11497cf565316ad113fcd9ea35e0a136b566e91d Mon Sep 17 00:00:00 2001 From: Sagar Khole Date: Mon, 30 Mar 2026 12:07:16 +0530 Subject: [PATCH 102/152] feat: concurrency handled in the status list service. Signed-off-by: Sagar Khole --- samples/cliConfig.json | 8 ++-- src/utils/statusListService.ts | 72 +++++++++++++++++++++------------- 2 files changed, 48 insertions(+), 32 deletions(-) diff --git a/samples/cliConfig.json b/samples/cliConfig.json index 092c3d79..17001d25 100644 --- a/samples/cliConfig.json +++ b/samples/cliConfig.json @@ -1,6 +1,6 @@ { - "label": "AFJ Rest Agent 1", - "walletId": "sample", + "label": "platform-admin-agent", + "walletId": "platform_admin_agent", "walletKey": "sample", "walletType": "postgres", "walletUrl": "localhost:5432", @@ -23,7 +23,7 @@ "indyNamespace": "bcovrin:testnet" } ], - "endpoint": ["http://localhost:4002"], + "endpoint": ["https://e70b-122-170-198-40.ngrok-free.app"], "autoAcceptConnections": true, "autoAcceptCredentials": "always", "autoAcceptProofs": "contentApproved", @@ -45,7 +45,7 @@ "fileServerToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJBeWFuV29ya3MiLCJpZCI6ImNhZDI3ZjhjLTMyNWYtNDRmZC04ZmZkLWExNGNhZTY3NTMyMSJ9.I3IR7abjWbfStnxzn1BhxhV0OEzt1x3mULjDdUcgWHk", "apiKey": "supersecret-that-too-16chars", "updateJwtSecret": false, - "statusListServerUrl": "http://localhost:3000", + "statusListServerUrl": "https://dev-status-list.sovio.id/", "statusListApiKey": "test_key", "statusListDefaultSize": 131072 } diff --git a/src/utils/statusListService.ts b/src/utils/statusListService.ts index 7b528014..aca9ea8e 100644 --- a/src/utils/statusListService.ts +++ b/src/utils/statusListService.ts @@ -1,6 +1,9 @@ import { JwsProtectedHeaderOptions, JwsService, JwtPayload } from '@credo-ts/core'; import { StatusList, getListFromStatusListJWT } from '@sd-jwt/jwt-status-list'; +const statusListLocks = new Map>(); + + // We evaluate this at request-time instead of statically so cliAgent config is available export function getServerUrl() { const url = process.env.STATUS_LIST_SERVER_URL; @@ -107,41 +110,54 @@ export async function checkAndCreateStatusList(agent: any, listId: string, issue } export async function revokeCredentialInStatusList(agent: any, listId: string, index: number, issuerDid: string) { - const uri = `${getServerUrl()}/status-lists/${listId}`; + const previousLock = statusListLocks.get(listId) || Promise.resolve(); - // 1. Fetch current - const res = await fetch(uri, { - headers: getApiKeyHeaders() + let releaseLock: () => void; + const currentLock = new Promise((resolve) => { + releaseLock = resolve; }); - if (!res.ok) { - const errBody = await res.text().catch(() => ''); - throw new Error(`Failed to fetch status list to revoke at ${uri}: ${res.status} ${res.statusText} ${errBody}`); - } - const currentJwt = await res.text(); - const statusList = getListFromStatusListJWT(currentJwt); + statusListLocks.set(listId, currentLock); - // 2. Flip the bit - statusList.setStatus(index, 1); + try { + await previousLock; - // 3. Resolve keyId - const didDocument = await agent.dids.resolve(issuerDid); - const verificationMethod = didDocument.didDocument?.verificationMethod?.[0]; - if (!verificationMethod) throw new Error(`Could not find verification method for DID ${issuerDid}`); - const keyId = verificationMethod.id; + const uri = `${getServerUrl()}/status-lists/${listId}`; - // 4. Re-sign - const newJwt = await signStatusList(agent, keyId, statusList, listId, issuerDid); + const res = await fetch(uri, { + headers: getApiKeyHeaders(), + }); + if (!res.ok) { + const errBody = await res.text().catch(() => ''); + throw new Error(`Failed to fetch status list to revoke at ${uri}: ${res.status} ${res.statusText} ${errBody}`); + } - // 5. Update the server - const patchRes = await fetch(`${getServerUrl()}/status-lists/${listId}`, { - method: 'PATCH', - headers: getApiKeyHeaders(), - body: JSON.stringify({ jwt: newJwt }), - }); + const currentJwt = await res.text(); + const statusList = getListFromStatusListJWT(currentJwt); + + statusList.setStatus(index, 1); + + const didDocument = await agent.dids.resolve(issuerDid); + const verificationMethod = didDocument.didDocument?.verificationMethod?.[0]; + if (!verificationMethod) throw new Error(`Could not find verification method for DID ${issuerDid}`); + const keyId = verificationMethod.id; + + const newJwt = await signStatusList(agent, keyId, statusList, listId, issuerDid); - if (!patchRes.ok) { - const errBody = await patchRes.text(); - throw new Error(`Failed to update status list on server: ${patchRes.status} ${errBody}`); + const patchRes = await fetch(`${getServerUrl()}/status-lists/${listId}`, { + method: 'PATCH', + headers: getApiKeyHeaders(), + body: JSON.stringify({ jwt: newJwt }), + }); + + if (!patchRes.ok) { + const errBody = await patchRes.text(); + throw new Error(`Failed to update status list on server: ${patchRes.status} ${errBody}`); + } + } finally { + releaseLock!(); + if (statusListLocks.get(listId) === currentLock) { + statusListLocks.delete(listId); + } } } From bcbc82e79aee654e195465c84ea087f094c4a9dd Mon Sep 17 00:00:00 2001 From: Deepak Nemade Date: Fri, 27 Mar 2026 16:15:34 +0530 Subject: [PATCH 103/152] Fix/Docker-vulnerability (#354) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * ### SUMMARY • **Total HIGH/CRITICAL Vulnerabilities:** 3 • **OS Vulnerabilities:** 3 (HIGH: 2, CRITICAL: 1) • **Application Vulnerabilities:** 0 ### REMAINING VULNERABILITIES | Library | CVE ID | Severity | Installed Version | Fixed Version | Description | |---------|--------|----------|-------------------|---------------|-------------| | libc-bin | CVE-2026-0861 | HIGH | 2.36-9+deb12u13 | - | glibc: Integer overflow in memalign leads to heap corruption | | libc6 | CVE-2026-0861 | HIGH | 2.36-9+deb12u13 | - | glibc: Integer overflow in memalign leads to heap corruption | | zlib1g | CVE-2023-45853 | CRITICAL | 1:1.2.13.dfsg-1 | - | zlib: integer overflow and resultant heap-based buffer overflow | ### FIXED VULNERABILITIES • **axios:** Updated to 1.13.5 (CVE-2026-25639) • **flatted:** Updated to 3.4.0 (CVE-2026-32141) • **undici:** Updated to 6.24.0 (CVE-2026-1526, CVE-2026-1528, CVE-2026-2229) • **All Node.js packages:** 0 vulnerabilities detected ### REMEDIATION STATUS • **97% vulnerability reduction** achieved • **All application-level vulnerabilities fixed** • **Remaining vulnerabilities are OS-level only** ### SECURITY ENHANCEMENTS IMPLEMENTED • Non-root user execution (appuser) • System package updates • CA certificates installed • Temporary files cleaned • Proper file permissions Signed-off-by: DeepakNemad * Update yarn install command with --frozen-lockfile Signed-off-by: DeepakNemad * Added Yarn file Signed-off-by: DeepakNemad --------- Signed-off-by: DeepakNemad --- Dockerfile | 16 +++++++++++++++- package.json | 7 +++++-- yarn.lock | 36 ++++++++++++++++++------------------ 3 files changed, 38 insertions(+), 21 deletions(-) diff --git a/Dockerfile b/Dockerfile index dd506c11..6be76a6c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,9 +18,16 @@ RUN yarn global add patch-package # Build the application RUN yarn build -# Stage 2: Production stage +# Stage 2: Production stage FROM node:22.22.0-slim +# Update system packages and install security updates +RUN apt-get update && apt-get upgrade -y && \ + apt-get install -y --no-install-recommends \ + ca-certificates && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + WORKDIR /app # Copy built files and node_modules from the builder stage @@ -30,5 +37,12 @@ COPY --from=builder /app/package.json ./ COPY --from=builder /app/node_modules ./node_modules COPY --from=builder /app/patches ./patches +# Create non-root user for security +RUN groupadd -r appuser && useradd -r -g appuser appuser && \ + chown -R appuser:appuser /app && \ + chmod -R 755 /app + +USER appuser + # Set entry point ENTRYPOINT ["node", "./bin/afj-rest.js", "start"] diff --git a/package.json b/package.json index 6ed17522..ef84dfa7 100644 --- a/package.json +++ b/package.json @@ -68,7 +68,7 @@ "@types/ref-struct-di": "^1.1.12", "@types/uuid": "^10.0.0", "@types/ws": "^8.18.1", - "axios": "^1.9.0", + "axios": "^1.13.5", "body-parser": "^2.2.0", "cors": "^2.8.5", "dotenv": "^16.5.0", @@ -119,6 +119,9 @@ }, "resolutions": { "@credo-ts/core": "0.6.2", - "@credo-ts/askar": "0.6.2" + "@credo-ts/askar": "0.6.2", + "axios": "1.13.5", + "flatted": "3.4.0", + "undici": "6.24.0" } } diff --git a/yarn.lock b/yarn.lock index bbf92326..aa85bf41 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3408,6 +3408,15 @@ available-typed-arrays@^1.0.7: dependencies: possible-typed-array-names "^1.0.0" +axios@1.13.5: + version "1.13.5" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.13.5.tgz#5e464688fa127e11a660a2c49441c009f6567a43" + integrity sha512-cz4ur7Vb0xS4/KUN0tPWe44eqxrIu31me+fbang3ijiNscE129POzipJJA6zniq2C/Z6sJCjMimjS8Lc/GAs8Q== + dependencies: + follow-redirects "^1.15.11" + form-data "^4.0.5" + proxy-from-env "^1.1.0" + axios@^1.13.5: version "1.13.6" resolved "https://registry.yarnpkg.com/axios/-/axios-1.13.6.tgz#c3f92da917dc209a15dd29936d20d5089b6b6c98" @@ -3417,15 +3426,6 @@ axios@^1.13.5: form-data "^4.0.5" proxy-from-env "^1.1.0" -axios@^1.9.0: - version "1.13.2" - resolved "https://registry.yarnpkg.com/axios/-/axios-1.13.2.tgz#9ada120b7b5ab24509553ec3e40123521117f687" - integrity sha512-VPk9ebNqPcy5lRGuSlKx752IlDatOjT9paPlm8A7yOuW2Fbvp4X3JznJtT4f0GzGLLiWE9W8onz51SqLYwzGaA== - dependencies: - follow-redirects "^1.15.6" - form-data "^4.0.4" - proxy-from-env "^1.1.0" - babel-jest@^29.7.0: version "29.7.0" resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.7.0.tgz#f4369919225b684c56085998ac63dbd05be020d5" @@ -4842,12 +4842,12 @@ flat-cache@^4.0.0: flatted "^3.2.9" keyv "^4.5.4" -flatted@^3.2.9: - version "3.3.3" - resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.3.3.tgz#67c8fad95454a7c7abebf74bb78ee74a44023358" - integrity sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg== +flatted@3.4.0, flatted@^3.2.9: + version "3.4.0" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.4.0.tgz#92ab2efec9b272eb85a3a25a106c3afbbc990d8b" + integrity sha512-kC6Bb+ooptOIvWj5B63EQWkF0FEnNjV2ZNkLMLZRDDduIiWeFF4iKnslwhiWxjAdbg4NzTNo6h0qLuvFrcx+Sw== -follow-redirects@^1.15.11, follow-redirects@^1.15.6: +follow-redirects@^1.15.11: version "1.15.11" resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.11.tgz#777d73d72a92f8ec4d2e410eb47352a56b8e8340" integrity sha512-deG2P0JfjrTxl50XGCDyfI97ZGVCxIpfKYmfyrQ54n5FO/0gfIES8C/Psl6kWVDolizcaaxZJnTS0QSMxvnsBQ== @@ -8143,10 +8143,10 @@ undici-types@~7.16.0: resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-7.16.0.tgz#ffccdff36aea4884cbfce9a750a0580224f58a46" integrity sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw== -undici@^6.6.2: - version "6.22.0" - resolved "https://registry.yarnpkg.com/undici/-/undici-6.22.0.tgz#281adbc157af41da8e75393c9d75a1b788811bc3" - integrity sha512-hU/10obOIu62MGYjdskASR3CUAiYaFTtC9Pa6vHyf//mAipSvSQg6od2CnJswq7fvzNS3zJhxoRkgNVaHurWKw== +undici@6.24.0, undici@^6.6.2: + version "6.24.0" + resolved "https://registry.yarnpkg.com/undici/-/undici-6.24.0.tgz#ad36b879b4882d14addc13dd641da7ed7ac7623a" + integrity sha512-lVLNosgqo5EkGqh5XUDhGfsMSoO8K0BAN0TyJLvwNRSl4xWGZlCVYsAIpa/OpA3TvmnM01GWcoKmc3ZWo5wKKA== universalify@^2.0.0: version "2.0.1" From 5112c8c717a02b20341bed632cd4baa0f6beab9a Mon Sep 17 00:00:00 2001 From: RinkalBhojani Date: Fri, 6 Mar 2026 11:14:24 +0530 Subject: [PATCH 104/152] fix:fixed cbor date format issue in Mdoc validityInfo Signed-off-by: RinkalBhojani --- src/utils/oid4vc-agent.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/utils/oid4vc-agent.ts b/src/utils/oid4vc-agent.ts index e3e31350..002ffe8c 100644 --- a/src/utils/oid4vc-agent.ts +++ b/src/utils/oid4vc-agent.ts @@ -112,6 +112,7 @@ export function getMixedCredentialRequestToCredentialMapper(): OpenId4VciCredent const parsedCertificate = X509Service.parseCertificate(agentContext, { encodedCertificate: issuerx509certificate[0], }) + console.log(`\n credential validityInfo for mdoc: ${JSON.stringify(credential.payload.validityInfo)} \n`) parsedCertificate.publicJwk.keyId = credential.signerOptions.keyId return { type: 'credentials', @@ -120,6 +121,11 @@ export function getMixedCredentialRequestToCredentialMapper(): OpenId4VciCredent issuerCertificate: parsedCertificate, holderKey: holderBindingDetails.jwk, ...credential.payload, + validityInfo: { + ...credential.payload.validityInfo, + validFrom: new Date(credential.payload.validityInfo.validFrom), + validUntil: new Date(credential.payload.validityInfo.validUntil), + }, docType: credentialConfiguration.doctype, })), } satisfies OpenId4VciSignMdocCredentials @@ -179,7 +185,6 @@ function assertDidBasedHolderBinding( throw new CredoError('Only did based holder bindings supported for this credential type') } } - export interface OpenId4VcIssuanceSessionCreateOfferSdJwtCredentialOptions { /** * The id of the `credential_supported` entry that is present in the issuer From e93de19d4d77a7c78898d7d13e21eb3373b1f3f1 Mon Sep 17 00:00:00 2001 From: RinkalBhojani Date: Fri, 20 Mar 2026 15:29:33 +0530 Subject: [PATCH 105/152] fix: fixed issue with portrait attribute data type for photoid credential Signed-off-by: RinkalBhojani --- src/utils/helpers.ts | 46 +++++++++++++++++++++++++++++++++++++++ src/utils/oid4vc-agent.ts | 19 ++++++++++++---- 2 files changed, 61 insertions(+), 4 deletions(-) diff --git a/src/utils/helpers.ts b/src/utils/helpers.ts index e94bb9a5..78675983 100644 --- a/src/utils/helpers.ts +++ b/src/utils/helpers.ts @@ -253,3 +253,49 @@ export async function checkX509Certificates( return checkTrustCertificatesExist(trustListUrl, x509Certificates, label, resolvedTenantId, token) } +type Namespaces = Record + +export function processIsoImages(namespaces: Namespaces): Namespaces { + const IMAGE_FIELDS = ['portrait', 'enrolment_portrait_image'] + + for (const [nsKey, nsValue] of Object.entries(namespaces)) { + if (!nsKey.includes('org.iso')) continue + + for (const field of IMAGE_FIELDS) { + const value = nsValue[field] + + if (value && typeof value === 'string') { + nsValue[field] = safeBase64DataUrlToUint8Array(value) + } + } + } + + return namespaces +} + +function safeBase64DataUrlToUint8Array(dataUrl: string): Uint8Array | string { + try { + if (typeof dataUrl !== 'string') return dataUrl + + // Must contain base64 data + if (!dataUrl.includes('base64,')) return dataUrl + + const parts = dataUrl.split(',') + if (parts.length < 2) return dataUrl + + const base64 = parts[1] + + // Node.js safe decode (will throw if invalid) + const buffer = Buffer.from(base64, 'base64') + + // Extra validation: ensure it decoded something meaningful + if (!buffer || buffer.length === 0) { + return dataUrl + } + + return new Uint8Array(buffer) + } catch (err) { + // fallback → keep original string + return dataUrl + } +} diff --git a/src/utils/oid4vc-agent.ts b/src/utils/oid4vc-agent.ts index 002ffe8c..fcc37f86 100644 --- a/src/utils/oid4vc-agent.ts +++ b/src/utils/oid4vc-agent.ts @@ -1,3 +1,4 @@ +import type { DisclosureFrame } from '../controllers/types' import type { SdJwtVcHolderBinding } from '@credo-ts/core' import type { OpenId4VcCredentialHolderBinding, @@ -7,15 +8,23 @@ import type { OpenId4VciSignSdJwtCredentials, } from '@credo-ts/openid4vc' -import { Agent, ClaimFormat, CredoError, DidsApi, LogLevel, X509Certificate, X509ModuleConfig, X509Service } from '@credo-ts/core' +import { + Agent, + ClaimFormat, + CredoError, + DidsApi, + LogLevel, + X509Certificate, + X509ModuleConfig, + X509Service, +} from '@credo-ts/core' import { OpenId4VciCredentialFormatProfile } from '@credo-ts/openid4vc' import { container } from 'tsyringe' -import type { DisclosureFrame } from '../controllers/types' - import { SignerMethod } from '../enums/enum' + import { validateAuthConfig } from './auth' -import { checkX509Certificates } from './helpers' +import { checkX509Certificates, processIsoImages } from './helpers' import { TsLogger } from './logger' const logger = new TsLogger(LogLevel.info) @@ -114,6 +123,8 @@ export function getMixedCredentialRequestToCredentialMapper(): OpenId4VciCredent }) console.log(`\n credential validityInfo for mdoc: ${JSON.stringify(credential.payload.validityInfo)} \n`) parsedCertificate.publicJwk.keyId = credential.signerOptions.keyId + const updatedNamespaces = processIsoImages(credential.payload.namespaces) + credential.payload.namespaces = updatedNamespaces return { type: 'credentials', format: ClaimFormat.MsoMdoc, From 166170facb06c87103de85357760e2247b22dc16 Mon Sep 17 00:00:00 2001 From: Tipu_Singh Date: Tue, 3 Mar 2026 15:56:09 +0530 Subject: [PATCH 106/152] feat: added x509 certificates logic with auth Signed-off-by: Tipu_Singh --- src/cliAgent.ts | 18 +++++++++++------- src/utils/oid4vc-agent.ts | 5 +++++ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/cliAgent.ts b/src/cliAgent.ts index 21c5335b..6b8a3734 100644 --- a/src/cliAgent.ts +++ b/src/cliAgent.ts @@ -68,7 +68,11 @@ import { isCustomDocumentLoaderEnabled } from './utils/config' import { CustomDocumentLoader } from './utils/customDocumentLoader' import { generateSecretKey } from './utils/helpers' import { TsLogger } from './utils/logger' -import { getMixedCredentialRequestToCredentialMapper, getX509CertsByClientToken, getX509CertsByUrl } from './utils/oid4vc-agent' +import { + getMixedCredentialRequestToCredentialMapper, + getX509CertsByClientToken, + getX509CertsByUrl, +} from './utils/oid4vc-agent' import { AuthTypes, getAuthType } from './utils/auth' import { PolygonDidRegistrar, PolygonDidResolver, PolygonModule } from '@ayanworks/credo-polygon-w3c-module' @@ -287,14 +291,14 @@ const getModules = ( console.log('[getTrustedCertificatesForVerification] tenantId from agentContext:', tenantId) const authType = getAuthType() - console.log('[getTrustedCertificatesForVerification] authType:', authType) + console.log('[getTrustedCertificatesForVerification] authType:', authType) - if (authType === AuthTypes.ClientAuth) { - return await getX509CertsByClientToken(tenantId, certificateChain) - } + if (authType === AuthTypes.ClientAuth) { + return await getX509CertsByClientToken(tenantId, certificateChain) + } - // NoAuth: return all certs from the static trust list URL - return await getX509CertsByUrl() + // NoAuth: return all certs from the static trust list URL + return await getX509CertsByUrl() }, }), } diff --git a/src/utils/oid4vc-agent.ts b/src/utils/oid4vc-agent.ts index fcc37f86..d45b1bbc 100644 --- a/src/utils/oid4vc-agent.ts +++ b/src/utils/oid4vc-agent.ts @@ -1,5 +1,10 @@ import type { DisclosureFrame } from '../controllers/types' import type { SdJwtVcHolderBinding } from '@credo-ts/core' +import type { DisclosureFrame } from '../controllers/types' +import { Agent, CredoError } from '@credo-ts/core' +import { container } from 'tsyringe' + +import { fetchDedicatedX509Certificates, fetchSharedAgentX509Certificates } from './helpers' import type { OpenId4VcCredentialHolderBinding, OpenId4VcCredentialHolderDidBinding, From 3204391655ef94722a0a65efcc2b2ae0130dfd90 Mon Sep 17 00:00:00 2001 From: Tipu_Singh Date: Tue, 24 Mar 2026 18:03:38 +0530 Subject: [PATCH 107/152] feat: added token caching and update token fetching logic Signed-off-by: Tipu_Singh --- src/cliAgent.ts | 1 + src/utils/oid4vc-agent.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cliAgent.ts b/src/cliAgent.ts index 6b8a3734..b9fa6a71 100644 --- a/src/cliAgent.ts +++ b/src/cliAgent.ts @@ -28,6 +28,7 @@ import { LogLevel, Agent, X509Module, + X509Certificate, JwkDidRegistrar, JwkDidResolver, SdJwtVcModule, diff --git a/src/utils/oid4vc-agent.ts b/src/utils/oid4vc-agent.ts index d45b1bbc..e2a1184a 100644 --- a/src/utils/oid4vc-agent.ts +++ b/src/utils/oid4vc-agent.ts @@ -4,7 +4,7 @@ import type { DisclosureFrame } from '../controllers/types' import { Agent, CredoError } from '@credo-ts/core' import { container } from 'tsyringe' -import { fetchDedicatedX509Certificates, fetchSharedAgentX509Certificates } from './helpers' +import { checkDedicatedX509Certificates, checkSharedAgentX509Certificates, fetchDedicatedX509Certificates } from './helpers' import type { OpenId4VcCredentialHolderBinding, OpenId4VcCredentialHolderDidBinding, From 957ad835a14f43fe13b2b57a6aa0878028fefab6 Mon Sep 17 00:00:00 2001 From: Tipu_Singh Date: Thu, 26 Mar 2026 13:14:56 +0530 Subject: [PATCH 108/152] refactor: removed ecosystem logic and updated authentication logic Signed-off-by: Tipu_Singh --- src/cliAgent.ts | 1 - src/utils/oid4vc-agent.ts | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cliAgent.ts b/src/cliAgent.ts index b9fa6a71..6b8a3734 100644 --- a/src/cliAgent.ts +++ b/src/cliAgent.ts @@ -28,7 +28,6 @@ import { LogLevel, Agent, X509Module, - X509Certificate, JwkDidRegistrar, JwkDidResolver, SdJwtVcModule, diff --git a/src/utils/oid4vc-agent.ts b/src/utils/oid4vc-agent.ts index e2a1184a..d8740158 100644 --- a/src/utils/oid4vc-agent.ts +++ b/src/utils/oid4vc-agent.ts @@ -4,7 +4,8 @@ import type { DisclosureFrame } from '../controllers/types' import { Agent, CredoError } from '@credo-ts/core' import { container } from 'tsyringe' -import { checkDedicatedX509Certificates, checkSharedAgentX509Certificates, fetchDedicatedX509Certificates } from './helpers' +import { checkX509Certificates } from './helpers' +import { validateAuthConfig } from './auth' import type { OpenId4VcCredentialHolderBinding, OpenId4VcCredentialHolderDidBinding, From db7b717b177f500e717d0a86c7fb07a46d21d850 Mon Sep 17 00:00:00 2001 From: Tipu_Singh Date: Thu, 26 Mar 2026 16:05:29 +0530 Subject: [PATCH 109/152] refactor: review changes Signed-off-by: Tipu_Singh --- src/utils/helpers.ts | 143 ++++++++++++++++++++++++++++++++++++++ src/utils/oid4vc-agent.ts | 6 -- 2 files changed, 143 insertions(+), 6 deletions(-) diff --git a/src/utils/helpers.ts b/src/utils/helpers.ts index 78675983..2c5abad9 100644 --- a/src/utils/helpers.ts +++ b/src/utils/helpers.ts @@ -299,3 +299,146 @@ function safeBase64DataUrlToUint8Array(dataUrl: string): Uint8Array | string { return dataUrl } } + +async function fetchPlatformToken( + tokenUrl: string, + clientId: string, + clientSecret: string, + label: string, +): Promise { + if (!tokenUrl) throw new Error(`[${label}] tokenUrl is required`) + if (!clientId) throw new Error(`[${label}] clientId is required`) + if (!clientSecret) throw new Error(`[${label}] clientSecret is required`) + + const cachedToken = getCachedToken(clientId) + if (cachedToken) { + console.log(`[${label}] using cached token for clientId:`, clientId) + return cachedToken + } + + console.log(`[${label}] fetching token from:`, tokenUrl) + + let tokenResponse + try { + tokenResponse = await axios.post( + tokenUrl, + { clientId, clientSecret }, + { headers: { 'Content-Type': 'application/json', accept: 'application/json' } }, + ) + } catch (error) { + if (axios.isAxiosError(error)) { + console.error(`[${label}] token request failed:`, { + url: tokenUrl, + status: error.response?.status, + statusText: error.response?.statusText, + data: error.response?.data, + message: error.message, + }) + throw new Error( + `[${label}] platform token request failed with status ${error.response?.status ?? 'no response'}: ${JSON.stringify(error.response?.data ?? error.message)}`, + ) + } + throw error + } + + console.log(`[${label}] token response status:`, tokenResponse.status) + console.log(`[${label}] token response data:`, JSON.stringify(tokenResponse.data, null, 2)) + + const token: string = tokenResponse.data?.data?.access_token + if (!token) { + console.error(`[${label}] unexpected token response shape:`, JSON.stringify(tokenResponse.data, null, 2)) + throw new Error(`[${label}] access_token not found in platform response`) + } + + const expiresAt = getTokenExpiry(token) + tokenCache.set(clientId, { token, expiresAt }) + console.log( + `[${label}] token cached for clientId:`, + clientId, + '| expires at:', + new Date(expiresAt * 1000).toISOString(), + ) + + return token +} + +async function checkTrustCertificatesExist( + trustServiceUrl: string, + x509: string[], + label: string, + tenantId?: string, + token?: string, +): Promise { + const matchUrl = trustServiceUrl + console.log(`[${label}] calling match API:`, matchUrl) + + const authHeaders = token ? { Authorization: `Bearer ${token}` } : {} + + try { + const matchResponse = await axios.post<{ matched: boolean }>( + matchUrl, + { x509, ...(tenantId && { tenantId }) }, + { headers: { 'Content-Type': 'application/json', accept: 'application/json', ...authHeaders } }, + ) + + console.log(`[${label}] match response status:`, matchResponse.status) + + const isTrusted = matchResponse.data?.matched === true + console.log(`[${label}] isTrusted:`, isTrusted) + + if (!isTrusted) { + console.warn(`[${label}] certificate chain not trusted${tenantId ? ` for tenantId: ${tenantId}` : ''}`) + } + + return isTrusted + } catch (error) { + if (axios.isAxiosError(error)) { + console.error(`[${label}] match request failed:`, { + url: matchUrl, + status: error.response?.status, + statusText: error.response?.statusText, + data: error.response?.data, + message: error.message, + }) + throw new Error( + `[${label}] trust-service match request failed with status ${error.response?.status ?? 'no response'}: ${JSON.stringify(error.response?.data ?? error.message)}`, + ) + } + throw error + } +} + +export async function checkX509Certificates( + x509Certificates: string[], + isDedicated: boolean, + tenantId?: string, +): Promise { + const label = 'checkX509Certificates' + + if (!x509Certificates || x509Certificates.length === 0) { + throw new Error(`[${label}] certificate chain is required but was not provided`) + } + + const tokenUrl = process.env[TRUST_SERVICE_ENV_KEYS.TOKEN_URL] + const clientId = process.env[TRUST_SERVICE_ENV_KEYS.CLIENT_ID] + const clientSecret = process.env[TRUST_SERVICE_ENV_KEYS.CLIENT_SECRET] + const trustListUrl = process.env[TRUST_SERVICE_ENV_KEYS.TRUST_LIST_URL] + + if (!tokenUrl) throw new Error(`[${label}] ${TRUST_SERVICE_ENV_KEYS.TOKEN_URL} is not configured`) + if (!clientId) throw new Error(`[${label}] ${TRUST_SERVICE_ENV_KEYS.CLIENT_ID} is not configured`) + if (!clientSecret) throw new Error(`[${label}] ${TRUST_SERVICE_ENV_KEYS.CLIENT_SECRET} is not configured`) + if (!trustListUrl) throw new Error(`[${label}] ${TRUST_SERVICE_ENV_KEYS.TRUST_LIST_URL} is not configured`) + + let resolvedTenantId: string | undefined + if (!isDedicated) { + resolvedTenantId = tenantId + if (!resolvedTenantId) throw new Error(`[${label}] tenantId is required for shared agent but was not provided`) + console.log(`[${label}] using tenantId:`, resolvedTenantId) + } + + console.log(`[${label}] agent type: ${isDedicated ? 'dedicated' : 'shared'}, certificates:`, x509Certificates) + + const token = await fetchPlatformToken(tokenUrl, clientId, clientSecret, label) + + return checkTrustCertificatesExist(trustListUrl, x509Certificates, label, resolvedTenantId, token) +} diff --git a/src/utils/oid4vc-agent.ts b/src/utils/oid4vc-agent.ts index d8740158..fcc37f86 100644 --- a/src/utils/oid4vc-agent.ts +++ b/src/utils/oid4vc-agent.ts @@ -1,11 +1,5 @@ import type { DisclosureFrame } from '../controllers/types' import type { SdJwtVcHolderBinding } from '@credo-ts/core' -import type { DisclosureFrame } from '../controllers/types' -import { Agent, CredoError } from '@credo-ts/core' -import { container } from 'tsyringe' - -import { checkX509Certificates } from './helpers' -import { validateAuthConfig } from './auth' import type { OpenId4VcCredentialHolderBinding, OpenId4VcCredentialHolderDidBinding, From 66003455b638b713d09685a42d7eca102ad2543e Mon Sep 17 00:00:00 2001 From: RinkalBhojani Date: Sat, 28 Mar 2026 23:30:55 +0530 Subject: [PATCH 110/152] fix: added specific iso spec for mdoc valiation Signed-off-by: RinkalBhojani --- src/utils/helpers.ts | 2 +- src/utils/oid4vc-agent.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/helpers.ts b/src/utils/helpers.ts index 2c5abad9..f83ccbd2 100644 --- a/src/utils/helpers.ts +++ b/src/utils/helpers.ts @@ -259,7 +259,7 @@ export function processIsoImages(namespaces: Namespaces): Namespaces { const IMAGE_FIELDS = ['portrait', 'enrolment_portrait_image'] for (const [nsKey, nsValue] of Object.entries(namespaces)) { - if (!nsKey.includes('org.iso')) continue + if (!nsKey.includes('org.iso.18013.5') && !nsKey.includes('org.iso.23220')) continue for (const field of IMAGE_FIELDS) { const value = nsValue[field] diff --git a/src/utils/oid4vc-agent.ts b/src/utils/oid4vc-agent.ts index fcc37f86..e8de5aee 100644 --- a/src/utils/oid4vc-agent.ts +++ b/src/utils/oid4vc-agent.ts @@ -121,7 +121,7 @@ export function getMixedCredentialRequestToCredentialMapper(): OpenId4VciCredent const parsedCertificate = X509Service.parseCertificate(agentContext, { encodedCertificate: issuerx509certificate[0], }) - console.log(`\n credential validityInfo for mdoc: ${JSON.stringify(credential.payload.validityInfo)} \n`) + parsedCertificate.publicJwk.keyId = credential.signerOptions.keyId const updatedNamespaces = processIsoImages(credential.payload.namespaces) credential.payload.namespaces = updatedNamespaces From a5a6a303dec5cac5b39eceef250f8dda503c16e1 Mon Sep 17 00:00:00 2001 From: RinkalBhojani Date: Sat, 28 Mar 2026 23:59:49 +0530 Subject: [PATCH 111/152] fix: removed duplicated function while resolving conflicts Signed-off-by: RinkalBhojani --- yarn.lock | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/yarn.lock b/yarn.lock index aa85bf41..a77152d3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3418,13 +3418,13 @@ axios@1.13.5: proxy-from-env "^1.1.0" axios@^1.13.5: - version "1.13.6" - resolved "https://registry.yarnpkg.com/axios/-/axios-1.13.6.tgz#c3f92da917dc209a15dd29936d20d5089b6b6c98" - integrity sha512-ChTCHMouEe2kn713WHbQGcuYrr6fXTBiu460OTwWrWob16g1bXn4vtz07Ope7ewMozJAnEquLk5lWQWtBig9DQ== + version "1.14.0" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.14.0.tgz#7c29f4cf2ea91ef05018d5aa5399bf23ed3120eb" + integrity sha512-3Y8yrqLSwjuzpXuZ0oIYZ/XGgLwUIBU3uLvbcpb0pidD9ctpShJd43KSlEEkVQg6DS0G9NKyzOvBfUtDKEyHvQ== dependencies: follow-redirects "^1.15.11" form-data "^4.0.5" - proxy-from-env "^1.1.0" + proxy-from-env "^2.1.0" babel-jest@^29.7.0: version "29.7.0" @@ -7053,6 +7053,11 @@ proxy-from-env@^1.1.0: resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg== +proxy-from-env@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-2.1.0.tgz#a7487568adad577cfaaa7e88c49cab3ab3081aba" + integrity sha512-cJ+oHTW1VAEa8cJslgmUZrc+sjRKgAKl3Zyse6+PV38hZe/V6Z14TbCuXcan9F9ghlz4QrFr2c92TNF82UkYHA== + pump@^3.0.0: version "3.0.3" resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.3.tgz#151d979f1a29668dc0025ec589a455b53282268d" From 31c9035ee8fae4fdec8574b0942623108003367b Mon Sep 17 00:00:00 2001 From: RinkalBhojani Date: Sun, 29 Mar 2026 00:00:30 +0530 Subject: [PATCH 112/152] fix: removed duplicated function while resolving conflicts Signed-off-by: RinkalBhojani --- src/utils/helpers.ts | 137 ------------------------------------------- 1 file changed, 137 deletions(-) diff --git a/src/utils/helpers.ts b/src/utils/helpers.ts index f83ccbd2..fc2eff3f 100644 --- a/src/utils/helpers.ts +++ b/src/utils/helpers.ts @@ -116,143 +116,6 @@ export function getTypeFromCurve(key: Curve | KeyAlgorithm): OkpType | EcType { return keyTypeInfo } -async function fetchPlatformToken( - tokenUrl: string, - clientId: string, - clientSecret: string, - label: string, -): Promise { - if (!tokenUrl) throw new Error(`[${label}] tokenUrl is required`) - if (!clientId) throw new Error(`[${label}] clientId is required`) - if (!clientSecret) throw new Error(`[${label}] clientSecret is required`) - - const cachedToken = getCachedToken(clientId) - if (cachedToken) { - console.log(`[${label}] using cached token for clientId:`, clientId) - return cachedToken - } - - console.log(`[${label}] fetching token from:`, tokenUrl) - - let tokenResponse - try { - tokenResponse = await axios.post( - tokenUrl, - { clientId, clientSecret }, - { headers: { 'Content-Type': 'application/json', accept: 'application/json' } }, - ) - } catch (error) { - if (axios.isAxiosError(error)) { - console.error(`[${label}] token request failed:`, { - url: tokenUrl, - status: error.response?.status, - statusText: error.response?.statusText, - data: error.response?.data, - message: error.message, - }) - throw new Error( - `[${label}] platform token request failed with status ${error.response?.status ?? 'no response'}: ${JSON.stringify(error.response?.data ?? error.message)}`, - ) - } - throw error - } - - console.log(`[${label}] token response status:`, tokenResponse.status) - console.log(`[${label}] token response data:`, JSON.stringify(tokenResponse.data, null, 2)) - - const token: string = tokenResponse.data?.data?.access_token - if (!token) { - console.error(`[${label}] unexpected token response shape:`, JSON.stringify(tokenResponse.data, null, 2)) - throw new Error(`[${label}] access_token not found in platform response`) - } - - const expiresAt = getTokenExpiry(token) - tokenCache.set(clientId, { token, expiresAt }) - console.log(`[${label}] token cached for clientId:`, clientId, '| expires at:', new Date(expiresAt * 1000).toISOString()) - - return token -} - -async function checkTrustCertificatesExist( - trustServiceUrl: string, - x509: string[], - label: string, - tenantId?: string, - token?: string, -): Promise { - const matchUrl = trustServiceUrl - console.log(`[${label}] calling match API:`, matchUrl) - - const authHeaders = token ? { Authorization: `Bearer ${token}` } : {} - - try { - const matchResponse = await axios.post<{ matched: boolean }>( - matchUrl, - { x509, ...(tenantId && { tenantId }) }, - { headers: { 'Content-Type': 'application/json', accept: 'application/json', ...authHeaders } }, - ) - - console.log(`[${label}] match response status:`, matchResponse.status) - - const isTrusted = matchResponse.data?.matched === true - console.log(`[${label}] isTrusted:`, isTrusted) - - if (!isTrusted) { - console.warn(`[${label}] certificate chain not trusted${tenantId ? ` for tenantId: ${tenantId}` : ''}`) - } - - return isTrusted - } catch (error) { - if (axios.isAxiosError(error)) { - console.error(`[${label}] match request failed:`, { - url: matchUrl, - status: error.response?.status, - statusText: error.response?.statusText, - data: error.response?.data, - message: error.message, - }) - throw new Error( - `[${label}] trust-service match request failed with status ${error.response?.status ?? 'no response'}: ${JSON.stringify(error.response?.data ?? error.message)}`, - ) - } - throw error - } -} - -export async function checkX509Certificates( - x509Certificates: string[], - isDedicated: boolean, - tenantId?: string, -): Promise { - const label = 'checkX509Certificates' - - if (!x509Certificates || x509Certificates.length === 0) { - throw new Error(`[${label}] certificate chain is required but was not provided`) - } - - const tokenUrl = process.env[TRUST_SERVICE_ENV_KEYS.TOKEN_URL] - const clientId = process.env[TRUST_SERVICE_ENV_KEYS.CLIENT_ID] - const clientSecret = process.env[TRUST_SERVICE_ENV_KEYS.CLIENT_SECRET] - const trustListUrl = process.env[TRUST_SERVICE_ENV_KEYS.TRUST_LIST_URL] - - if (!tokenUrl) throw new Error(`[${label}] ${TRUST_SERVICE_ENV_KEYS.TOKEN_URL} is not configured`) - if (!clientId) throw new Error(`[${label}] ${TRUST_SERVICE_ENV_KEYS.CLIENT_ID} is not configured`) - if (!clientSecret) throw new Error(`[${label}] ${TRUST_SERVICE_ENV_KEYS.CLIENT_SECRET} is not configured`) - if (!trustListUrl) throw new Error(`[${label}] ${TRUST_SERVICE_ENV_KEYS.TRUST_LIST_URL} is not configured`) - - let resolvedTenantId: string | undefined - if (!isDedicated) { - resolvedTenantId = tenantId - if (!resolvedTenantId) throw new Error(`[${label}] tenantId is required for shared agent but was not provided`) - console.log(`[${label}] using tenantId:`, resolvedTenantId) - } - - console.log(`[${label}] agent type: ${isDedicated ? 'dedicated' : 'shared'}, certificates:`, x509Certificates) - - const token = await fetchPlatformToken(tokenUrl, clientId, clientSecret, label) - - return checkTrustCertificatesExist(trustListUrl, x509Certificates, label, resolvedTenantId, token) -} type Namespaces = Record export function processIsoImages(namespaces: Namespaces): Namespaces { From f258ca0185a9f82bfb153f0089a5584c5a4b27a7 Mon Sep 17 00:00:00 2001 From: Sagar Khole Date: Mon, 30 Mar 2026 12:56:28 +0530 Subject: [PATCH 113/152] feat: update CLI configuration and refine status list service logic Signed-off-by: Sagar Khole --- samples/cliConfig.json | 6 +++--- src/utils/statusListService.ts | 4 +--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/samples/cliConfig.json b/samples/cliConfig.json index 17001d25..f4d2a2d1 100644 --- a/samples/cliConfig.json +++ b/samples/cliConfig.json @@ -1,6 +1,6 @@ { - "label": "platform-admin-agent", - "walletId": "platform_admin_agent", + "label": "AFJ Rest Agent 1", + "walletId": "sample", "walletKey": "sample", "walletType": "postgres", "walletUrl": "localhost:5432", @@ -23,7 +23,7 @@ "indyNamespace": "bcovrin:testnet" } ], - "endpoint": ["https://e70b-122-170-198-40.ngrok-free.app"], + "endpoint": ["http://localhost:4002"], "autoAcceptConnections": true, "autoAcceptCredentials": "always", "autoAcceptProofs": "contentApproved", diff --git a/src/utils/statusListService.ts b/src/utils/statusListService.ts index aca9ea8e..f57891a4 100644 --- a/src/utils/statusListService.ts +++ b/src/utils/statusListService.ts @@ -4,7 +4,6 @@ import { StatusList, getListFromStatusListJWT } from '@sd-jwt/jwt-status-list'; const statusListLocks = new Map>(); -// We evaluate this at request-time instead of statically so cliAgent config is available export function getServerUrl() { const url = process.env.STATUS_LIST_SERVER_URL; if (!url) { @@ -56,7 +55,6 @@ async function signStatusList(agent: any, verificationMethodId: string, statusLi const jwsService = agent.dependencyManager.resolve(JwsService); const kmsKeyId = await getKmsKeyIdForDid(agent, issuerDid, verificationMethodId); - // In v0.6.x, createJwsCompact takes keyId instead of key return jwsService.createJwsCompact(agent.context, { keyId: kmsKeyId, payload, @@ -74,7 +72,7 @@ export async function checkAndCreateStatusList(agent: any, listId: string, issue if (res.status === 404) { console.log(`Status list ${listId} not found, creating a new one...`); - const size = listSize || Number(process.env.STATUS_LIST_DEFAULT_SIZE) || 131072; + const size = listSize || Number(process.env.STATUS_LIST_DEFAULT_SIZE); const statusList = new StatusList(new Array(size).fill(0), 1); const didDocument = await agent.dids.resolve(issuerDid); From ef5bca064dd65a8f0f506768c7b47c203ae567b7 Mon Sep 17 00:00:00 2001 From: Sagar Khole Date: Tue, 7 Apr 2026 18:36:39 +0530 Subject: [PATCH 114/152] refactor:code review changes Signed-off-by: Sagar Khole --- .env.sample | 11 +++++++- samples/cliConfig.json | 7 +---- src/cli.ts | 15 ++++++---- .../issuance-sessions.service.ts | 7 ++--- src/utils/constant.ts | 1 + src/utils/statusListService.ts | 28 ++++++++++--------- tsconfig.build.json | 3 +- 7 files changed, 41 insertions(+), 31 deletions(-) diff --git a/.env.sample b/.env.sample index bf4b5400..f89e4b19 100644 --- a/.env.sample +++ b/.env.sample @@ -82,4 +82,13 @@ OID4VCI_CNONCE_EXPIRY=3600 OID4VP_AUTH_REQUEST_PROOF_REQUEST_EXPIRY=3600 APP_JSON_BODY_SIZE=5mb -APP_URL_ENCODED_BODY_SIZE=5mb \ No newline at end of file +APP_URL_ENCODED_BODY_SIZE=5mb + +# Security +API_KEY=supersecret-that-too-16chars +UPDATE_JWT_SECRET=false + +# Status List +STATUS_LIST_SERVER_URL=https://dev-status-list.sovio.id/ +STATUS_LIST_API_KEY=test_key +STATUS_LIST_DEFAULT_SIZE=131072 \ No newline at end of file diff --git a/samples/cliConfig.json b/samples/cliConfig.json index f4d2a2d1..b924aa21 100644 --- a/samples/cliConfig.json +++ b/samples/cliConfig.json @@ -42,10 +42,5 @@ "schemaManagerContractAddress": "0x4742d43C2dFCa5a1d4238240Afa8547Daf87Ee7a", "rpcUrl": "https://rpc-amoy.polygon.technology", "fileServerUrl": "https://schema.credebl.id", - "fileServerToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJBeWFuV29ya3MiLCJpZCI6ImNhZDI3ZjhjLTMyNWYtNDRmZC04ZmZkLWExNGNhZTY3NTMyMSJ9.I3IR7abjWbfStnxzn1BhxhV0OEzt1x3mULjDdUcgWHk", - "apiKey": "supersecret-that-too-16chars", - "updateJwtSecret": false, - "statusListServerUrl": "https://dev-status-list.sovio.id/", - "statusListApiKey": "test_key", - "statusListDefaultSize": 131072 + "fileServerToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJBeWFuV29ya3MiLCJpZCI6ImNhZDI3ZjhjLTMyNWYtNDRmZC04ZmZkLWExNGNhZTY3NTMyMSJ9.I3IR7abjWbfStnxzn1BhxhV0OEzt1x3mULjDdUcgWHk" } diff --git a/src/cli.ts b/src/cli.ts index 15ccf91e..4454cb4d 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -2,6 +2,9 @@ import type { AriesRestConfig } from './cliAgent.js' import yargs from 'yargs' import { hideBin } from 'yargs/helpers' +import dotenv from 'dotenv' + +dotenv.config() import { runRestAgent } from './cliAgent.js' @@ -154,7 +157,9 @@ async function parseArguments(): Promise { .option('wallet-idle-timeout', { number: true }) .option('apiKey', { string: true, - coerce: (input: string) => { + default: process.env.API_KEY, + coerce: (input: string | undefined) => { + if (!input) return input input = input.trim() if (input && input.length < 16) { throw new Error('API key must be at least 16 characters long') @@ -164,11 +169,11 @@ async function parseArguments(): Promise { }) .option('updateJwtSecret', { boolean: true, - default: false, + default: process.env.UPDATE_JWT_SECRET === 'true', }) - .option('status-list-server-url', { string: true }) - .option('status-list-api-key', { string: true }) - .option('status-list-default-size', { number: true }) + .option('status-list-server-url', { string: true, default: process.env.STATUS_LIST_SERVER_URL }) + .option('status-list-api-key', { string: true, default: process.env.STATUS_LIST_API_KEY }) + .option('status-list-default-size', { number: true, default: process.env.STATUS_LIST_DEFAULT_SIZE ? Number(process.env.STATUS_LIST_DEFAULT_SIZE) : undefined }) .config() .env('AFJ_REST') .parseAsync() as Promise diff --git a/src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts b/src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts index 7a9e2cd9..278896ae 100644 --- a/src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts +++ b/src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts @@ -7,7 +7,8 @@ import { OpenId4VcIssuanceSessionRepository } from '@credo-ts/openid4vc' import { SignerMethod } from '../../../enums/enum' import { BadRequestError, NotFoundError } from '../../../errors/errors' -import { checkAndCreateStatusList, getServerUrl } from '../../../utils/statusListService' +import { checkAndCreateStatusList, getServerUrl, revokeCredentialInStatusList } from '../../../utils/statusListService' +import { STATUS_LISTS_PATH } from '../../../utils/constant' class IssuanceSessionsService { public async createCredentialOffer(options: OpenId4VcIssuanceSessionsCreateOffer, agentReq: Req) { @@ -61,7 +62,7 @@ class IssuanceSessionsService { effectiveIssuerDid, effectiveStatusList.listSize, ) - const listUri = `${getServerUrl()}/status-lists/${effectiveStatusList.listId}` + const listUri = `${getServerUrl()}/${STATUS_LISTS_PATH}/${effectiveStatusList.listId}` statusBlock = { status_list: { @@ -196,8 +197,6 @@ class IssuanceSessionsService { throw new Error(`No status list information found for session ${sessionId}`) } - const { revokeCredentialInStatusList } = await import('../../../utils/statusListService') - for (const info of statusInfo) { await revokeCredentialInStatusList(agentReq.agent as any, info.listId, info.index, info.issuerDid) } diff --git a/src/utils/constant.ts b/src/utils/constant.ts index 737b1e54..179b75bf 100644 --- a/src/utils/constant.ts +++ b/src/utils/constant.ts @@ -28,3 +28,4 @@ export const curveToKty = { export const verkey = '#verkey' export const p521 = 'p521' +export const STATUS_LISTS_PATH = 'status-lists' diff --git a/src/utils/statusListService.ts b/src/utils/statusListService.ts index f57891a4..105a7d17 100644 --- a/src/utils/statusListService.ts +++ b/src/utils/statusListService.ts @@ -1,5 +1,6 @@ -import { JwsProtectedHeaderOptions, JwsService, JwtPayload } from '@credo-ts/core'; +import { Agent, JwsProtectedHeaderOptions, JwsService, JwtPayload } from '@credo-ts/core'; import { StatusList, getListFromStatusListJWT } from '@sd-jwt/jwt-status-list'; +import { STATUS_LISTS_PATH } from './constant'; const statusListLocks = new Map>(); @@ -14,14 +15,15 @@ export function getServerUrl() { function getApiKeyHeaders() { const key = process.env.STATUS_LIST_API_KEY; - const headers: Record = { 'Content-Type': 'application/json' }; - if (key) { - headers['x-api-key'] = key; + if (!key) { + throw new Error('STATUS_LIST_API_KEY is not configured'); } + const headers: Record = { 'Content-Type': 'application/json' }; + headers['x-api-key'] = key; return headers; } -async function getKmsKeyIdForDid(agent: any, did: string, verificationMethodId: string) { +async function getKmsKeyIdForDid(agent: Agent, did: string, verificationMethodId: string) { const didRecords = await agent.dids.getCreatedDids({ did }); const didRecord = didRecords[0]; if (didRecord && didRecord.keys) { @@ -34,10 +36,10 @@ async function getKmsKeyIdForDid(agent: any, did: string, verificationMethodId: return verificationMethodId; } -async function signStatusList(agent: any, verificationMethodId: string, statusList: StatusList, listId: string, issuerDid: string): Promise { +async function signStatusList(agent: Agent, verificationMethodId: string, statusList: StatusList, listId: string, issuerDid: string): Promise { const payload = new JwtPayload({ iss: issuerDid, - sub: `${getServerUrl()}/status-lists/${listId}`, + sub: `${getServerUrl()}/${STATUS_LISTS_PATH}/${listId}`, iat: Math.floor(Date.now() / 1000), additionalClaims: { status_list: { @@ -62,8 +64,8 @@ async function signStatusList(agent: any, verificationMethodId: string, statusLi }); } -export async function checkAndCreateStatusList(agent: any, listId: string, issuerDid: string, listSize?: number) { - const uri = `${getServerUrl()}/status-lists/${listId}`; +export async function checkAndCreateStatusList(agent: Agent, listId: string, issuerDid: string, listSize?: number) { + const uri = `${getServerUrl()}/${STATUS_LISTS_PATH}/${listId}`; try { const res = await fetch(uri, { @@ -85,7 +87,7 @@ export async function checkAndCreateStatusList(agent: any, listId: string, issue const keyId = verificationMethod.id; const jwt = await signStatusList(agent, keyId, statusList, listId, issuerDid); - const postRes = await fetch(`${getServerUrl()}/status-lists`, { + const postRes = await fetch(`${getServerUrl()}/${STATUS_LISTS_PATH}`, { method: 'POST', headers: getApiKeyHeaders(), body: JSON.stringify({ id: listId, jwt }), @@ -107,7 +109,7 @@ export async function checkAndCreateStatusList(agent: any, listId: string, issue } } -export async function revokeCredentialInStatusList(agent: any, listId: string, index: number, issuerDid: string) { +export async function revokeCredentialInStatusList(agent: Agent, listId: string, index: number, issuerDid: string) { const previousLock = statusListLocks.get(listId) || Promise.resolve(); let releaseLock: () => void; @@ -120,7 +122,7 @@ export async function revokeCredentialInStatusList(agent: any, listId: string, i try { await previousLock; - const uri = `${getServerUrl()}/status-lists/${listId}`; + const uri = `${getServerUrl()}/${STATUS_LISTS_PATH}/${listId}`; const res = await fetch(uri, { headers: getApiKeyHeaders(), @@ -142,7 +144,7 @@ export async function revokeCredentialInStatusList(agent: any, listId: string, i const newJwt = await signStatusList(agent, keyId, statusList, listId, issuerDid); - const patchRes = await fetch(`${getServerUrl()}/status-lists/${listId}`, { + const patchRes = await fetch(`${getServerUrl()}/${STATUS_LISTS_PATH}/${listId}`, { method: 'PATCH', headers: getApiKeyHeaders(), body: JSON.stringify({ jwt: newJwt }), diff --git a/tsconfig.build.json b/tsconfig.build.json index 13879532..f64e3ff5 100644 --- a/tsconfig.build.json +++ b/tsconfig.build.json @@ -17,8 +17,7 @@ "node" ], "lib": [ - "ESNext", - "DOM" + "ESNext" ] }, "include": [ From e1da533cf3beb08618ec3823c19625c3c6e5f607 Mon Sep 17 00:00:00 2001 From: Krishna Waske Date: Fri, 3 Apr 2026 13:06:59 +0530 Subject: [PATCH 115/152] fix: credential controller (#359) * fix: endpoints unavailable Signed-off-by: Krishna Waske * fix: issuance controller typing Signed-off-by: Krishna Waske * fix: anoncreds undefined and schema resolution issue Signed-off-by: Krishna Waske * fix: did web key import Signed-off-by: Krishna Waske * fix: linting Signed-off-by: Krishna Waske * fix: remove comments and add todo Signed-off-by: Krishna Waske * fix: return invitationDid Signed-off-by: Krishna Waske --------- Signed-off-by: Krishna Waske --- package.json | 4 +- ...ng type-import esm-export interface.patch} | 41 + ...credentials+jsonld-signatures+12.0.1.patch | 22 + src/cliAgent.ts | 8 + .../CredentialDefinitionController.ts | 6 +- src/controllers/did/DidController.ts | 41 +- .../credentials/CredentialController.ts | 604 +- src/controllers/types.ts | 10 +- src/routes/routes.ts | 754 ++ src/routes/swagger.json | 6630 ++++++++++------- yarn.lock | 243 +- 11 files changed, 5188 insertions(+), 3175 deletions(-) rename patches/{@credo-ts+core+0.6.0+001+fix: change version string type.patch => @credo-ts+core+0.6.2+001+fix: change version string type-import esm-export interface.patch} (57%) create mode 100644 patches/@digitalcredentials+jsonld-signatures+12.0.1.patch diff --git a/package.json b/package.json index ef84dfa7..ee77db50 100644 --- a/package.json +++ b/package.json @@ -50,8 +50,8 @@ "@credo-ts/push-notifications": "^0.7.1", "@credo-ts/question-answer": "0.6.2", "@credo-ts/tenants": "0.6.2", - "@hyperledger/anoncreds-nodejs": "0.3.1", - "@hyperledger/indy-vdr-nodejs": "0.2.2", + "@hyperledger/anoncreds-nodejs": "^0.3.4", + "@hyperledger/indy-vdr-nodejs": "^0.2.3", "@opentelemetry/api": "^1.9.0", "@opentelemetry/exporter-logs-otlp-http": "^0.202.0", "@opentelemetry/exporter-trace-otlp-http": "^0.202.0", diff --git a/patches/@credo-ts+core+0.6.0+001+fix: change version string type.patch b/patches/@credo-ts+core+0.6.2+001+fix: change version string type-import esm-export interface.patch similarity index 57% rename from patches/@credo-ts+core+0.6.0+001+fix: change version string type.patch rename to patches/@credo-ts+core+0.6.2+001+fix: change version string type-import esm-export interface.patch index d0791805..276af6b3 100644 --- a/patches/@credo-ts+core+0.6.0+001+fix: change version string type.patch +++ b/patches/@credo-ts+core+0.6.2+001+fix: change version string type-import esm-export interface.patch @@ -1,3 +1,44 @@ +diff --git a/node_modules/@credo-ts/core/build/modules/vc/data-integrity/jsonldUtil.d.mts b/node_modules/@credo-ts/core/build/modules/vc/data-integrity/jsonldUtil.d.mts +index 5a311c1..4d640d0 100644 +--- a/node_modules/@credo-ts/core/build/modules/vc/data-integrity/jsonldUtil.d.mts ++++ b/node_modules/@credo-ts/core/build/modules/vc/data-integrity/jsonldUtil.d.mts +@@ -14,7 +14,7 @@ interface Proof extends JsonObject { + verificationMethod: string | VerificationMethod; + [key: string]: JsonValue; + } +-interface DocumentLoaderResult { ++export interface DocumentLoaderResult { + contextUrl?: string | null; + documentUrl: string; + document: Record; +diff --git a/node_modules/@credo-ts/core/build/modules/vc/data-integrity/libraries/nativeDocumentLoader.mjs b/node_modules/@credo-ts/core/build/modules/vc/data-integrity/libraries/nativeDocumentLoader.mjs +index 49ee03f..aa7e43a 100644 +--- a/node_modules/@credo-ts/core/build/modules/vc/data-integrity/libraries/nativeDocumentLoader.mjs ++++ b/node_modules/@credo-ts/core/build/modules/vc/data-integrity/libraries/nativeDocumentLoader.mjs +@@ -2,7 +2,7 @@ + + //#region src/modules/vc/data-integrity/libraries/nativeDocumentLoader.ts + async function getNativeDocumentLoader() { +- const loader = await import("@digitalcredentials/jsonld/lib/documentLoaders/node"); ++ const loader = await import("@digitalcredentials/jsonld/lib/documentLoaders/node.js"); + if (!loader) throw new Error("Could not load node document loader. Module did not contain a loader function"); + if (typeof loader === "function") return loader; + if (typeof loader === "object" && typeof loader.default === "function") return loader.default; +diff --git a/node_modules/@credo-ts/core/build/modules/vc/data-integrity/libraries/nativeDocumentLoader.native.mjs b/node_modules/@credo-ts/core/build/modules/vc/data-integrity/libraries/nativeDocumentLoader.native.mjs +index 6a8ca37..0287e99 100644 +--- a/node_modules/@credo-ts/core/build/modules/vc/data-integrity/libraries/nativeDocumentLoader.native.mjs ++++ b/node_modules/@credo-ts/core/build/modules/vc/data-integrity/libraries/nativeDocumentLoader.native.mjs +@@ -1,8 +1,9 @@ + + ++ + //#region src/modules/vc/data-integrity/libraries/nativeDocumentLoader.native.ts + async function getNativeDocumentLoader() { +- const loader = await import("@digitalcredentials/jsonld/lib/documentLoaders/xhr"); ++ const loader = await import("@digitalcredentials/jsonld/lib/documentLoaders/xhr.js"); + if (!loader) throw new Error("Could not load node document loader. Module did not contain a loader function"); + if (typeof loader === "function") return loader; + if (typeof loader === "object" && typeof loader.default === "function") return loader.default; diff --git a/node_modules/@credo-ts/core/build/utils/version.d.mts b/node_modules/@credo-ts/core/build/utils/version.d.mts index a71659d..8ed88e2 100644 --- a/node_modules/@credo-ts/core/build/utils/version.d.mts diff --git a/patches/@digitalcredentials+jsonld-signatures+12.0.1.patch b/patches/@digitalcredentials+jsonld-signatures+12.0.1.patch new file mode 100644 index 00000000..e5ade717 --- /dev/null +++ b/patches/@digitalcredentials+jsonld-signatures+12.0.1.patch @@ -0,0 +1,22 @@ +diff --git a/node_modules/@digitalcredentials/jsonld-signatures/lib/suites/LinkedDataSignature.js b/node_modules/@digitalcredentials/jsonld-signatures/lib/suites/LinkedDataSignature.js +index 3aec367..4bb5517 100644 +--- a/node_modules/@digitalcredentials/jsonld-signatures/lib/suites/LinkedDataSignature.js ++++ b/node_modules/@digitalcredentials/jsonld-signatures/lib/suites/LinkedDataSignature.js +@@ -204,7 +204,7 @@ module.exports = class LinkedDataSignature extends LinkedDataProof { + documentLoader, + // throw errors if any values would be dropped due to missing + // definitions or relative URLs +- safe: true, ++ safe: false, + skipExpansion, + useNative: this.useNativeCanonize, + ...this.canonizeOptions +@@ -301,7 +301,7 @@ module.exports = class LinkedDataSignature extends LinkedDataProof { + '@context': constants.SECURITY_CONTEXT_URL, + '@embed': '@always', + id: verificationMethod +- }, {documentLoader, compactToRelative: false, safe: true}); ++ }, {documentLoader, compactToRelative: false, safe: false}); + if(!framed) { + throw new Error(`Verification method ${verificationMethod} not found.`); + } diff --git a/src/cliAgent.ts b/src/cliAgent.ts index 6b8a3734..beaca1cd 100644 --- a/src/cliAgent.ts +++ b/src/cliAgent.ts @@ -2,6 +2,7 @@ // Refer from: https://github.com/credebl/mobile-sdk/blob/main/packages/ssi/src/wallet/wallet.ts import '@openwallet-foundation/askar-nodejs' import '@hyperledger/indy-vdr-nodejs' +import '@hyperledger/anoncreds-nodejs' import type { AskarModuleConfigStoreOptions } from '@credo-ts/askar' import type { InitConfig } from '@credo-ts/core' import type { IndyVdrPoolConfig } from '@credo-ts/indy-vdr' @@ -161,6 +162,7 @@ const getModules = ( autoAcceptProofs: DidCommAutoAcceptProof, walletScheme: AskarMultiWalletDatabaseScheme, storeOptions: AskarModuleConfigStoreOptions, + endpoints: string[], ) => { const legacyIndyCredentialFormat = new LegacyIndyDidCommCredentialFormatService() const legacyIndyProofFormat = new LegacyIndyDidCommProofFormatService() @@ -208,6 +210,7 @@ const getModules = ( mediationRecipient: true, messagePickup: true, mediator: false, + endpoints: endpoints || [], basicMessages: true, connections: { @@ -317,6 +320,7 @@ const getWithTenantModules = ( autoAcceptProofs: DidCommAutoAcceptProof, walletScheme: AskarMultiWalletDatabaseScheme, walletConfig: AskarModuleConfigStoreOptions, + endpoints: string[], ) => { const modules = getModules( networkConfig, @@ -330,6 +334,7 @@ const getWithTenantModules = ( autoAcceptProofs, walletScheme, walletConfig, + endpoints, ) return { tenants: new TenantsModule({ @@ -360,6 +365,7 @@ const getWithTenantModules = ( export async function runRestAgent(restConfig: AriesRestConfig) { const { + endpoints, schemaFileServerURL, logLevel, inboundTransports = [], @@ -477,6 +483,7 @@ export async function runRestAgent(restConfig: AriesRestConfig) { autoAcceptProofs || DidCommAutoAcceptProof.ContentApproved, walletScheme || AskarMultiWalletDatabaseScheme.ProfilePerWallet, walletConfig, + endpoints || [], ) } else { modules = getModules( @@ -491,6 +498,7 @@ export async function runRestAgent(restConfig: AriesRestConfig) { autoAcceptProofs || DidCommAutoAcceptProof.ContentApproved, walletScheme || AskarMultiWalletDatabaseScheme.ProfilePerWallet, walletConfig, + endpoints || [], ) } diff --git a/src/controllers/anoncreds/cred-def/CredentialDefinitionController.ts b/src/controllers/anoncreds/cred-def/CredentialDefinitionController.ts index 663bec90..3578956e 100644 --- a/src/controllers/anoncreds/cred-def/CredentialDefinitionController.ts +++ b/src/controllers/anoncreds/cred-def/CredentialDefinitionController.ts @@ -113,8 +113,10 @@ export class CredentialDefinitionController extends Controller { await request.agent.modules.anoncreds.registerCredentialDefinition(credentialDefinitionPayload) if (registerCredentialDefinitionResult.credentialDefinitionState.state === CredentialEnum.Failed) { - const failureReason = registerCredentialDefinitionResult.credentialDefinitionState?.reason ?? 'Failed to register credential definition on ledger' - throw new InternalServerError(failureReason) + const failureReason = + registerCredentialDefinitionResult.credentialDefinitionState?.reason ?? + 'Failed to register credential definition on ledger' + throw new InternalServerError(failureReason) } if (registerCredentialDefinitionResult.credentialDefinitionState.state === CredentialEnum.Wait) { diff --git a/src/controllers/did/DidController.ts b/src/controllers/did/DidController.ts index f5c56ce3..f1bf0077 100644 --- a/src/controllers/did/DidController.ts +++ b/src/controllers/did/DidController.ts @@ -510,6 +510,7 @@ export class DidController extends Controller { return { did: did, didDocument: didDocument } } + // TODO: Right now we are using seed as privateKey for did creation. Fix this is API payload public async handleWeb(agent: AgentType, didOptions: DidCreate) { let didDocument: DidDocument if (!didOptions.domain) { @@ -532,44 +533,24 @@ export class DidController extends Controller { 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), - // }) + let key + let publicJwk if (didOptions.keyType === KeyAlgorithm.Ed25519) { - const { privateJwk } = transformSeedToPrivateJwk({ + const { privateJwk } = transformPrivateKeyToPrivateJwk({ type: { crv: 'Ed25519', kty: 'OKP', }, - seed: TypedArrayEncoder.fromString(didOptions.seed), + privateKey: TypedArrayEncoder.fromString(didOptions.seed), }) - const key = await agent.kms.importKey({ privateJwk }) + key = await agent.kms.importKey({ privateJwk }) - const publicJwk = Kms.PublicJwk.fromPublicJwk(key.publicJwk) + 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 })) + .addVerificationMethod(getEd25519VerificationKey2018({ id: keyId, publicJwk, controller: did })) .addAuthentication(keyId) .addAssertionMethod(keyId) .build() @@ -584,6 +565,12 @@ export class DidController extends Controller { did, overwrite: true, didDocument, + keys: [ + { + didDocumentRelativeKeyId: `#key-1`, + kmsKeyId: key.keyId, + }, + ], }) return { did, didDocument } } diff --git a/src/controllers/didcomm/credentials/CredentialController.ts b/src/controllers/didcomm/credentials/CredentialController.ts index 8b9b1d57..315a2c0e 100644 --- a/src/controllers/didcomm/credentials/CredentialController.ts +++ b/src/controllers/didcomm/credentials/CredentialController.ts @@ -1,325 +1,323 @@ -// 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 { + DidCommCredentialExchangeRecordProps, + CredentialProtocolVersionType, + DidCommCredentialState, + DidCommCredentialRole, + DidCommRouting, +} 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?: DidCommCredentialState, + @Query('role') role?: DidCommCredentialRole, + ) { + try { + const credentials = await request.agent.modules.didcomm.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.didcomm.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.didcomm.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.didcomm.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.didcomm.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: DidCommRouting + 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.didcomm.mediationRecipient.getRouting({}) + const { didDocument, keys } = createPeerDidDocumentFromServices( + [ + { + id: 'didcomm', + recipientKeys: [routing.recipientKey], + routingKeys: routing.routingKeys, + serviceEndpoint: routing.endpoints[0], + }, + ], + true, + ) + const did = await request.agent.dids.create({ + didDocument, + method: 'peer', + options: { + keys, + 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.didcomm.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.didcomm.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.credentialExchangeRecord.threadId, + 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.didcomm.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.didcomm.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.didcomm.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.didcomm.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/types.ts b/src/controllers/types.ts index b63e1114..e90e828a 100644 --- a/src/controllers/types.ts +++ b/src/controllers/types.ts @@ -115,7 +115,7 @@ export interface ProposeCredentialOptions { } export interface AcceptCredentialProposalOptions { - credentialRecordId: string + credentialExchangeRecordId: string credentialFormats?: DidCommCredentialFormatPayload autoAcceptCredential?: DidCommAutoAcceptCredential comment?: string @@ -137,7 +137,7 @@ type CredentialFormatType = | AnonCredsDidCommCredentialFormat export interface CreateOfferOobOptions { - protocolVersion: string + protocolVersion: ProtocolVersion credentialFormats: DidCommCredentialFormatPayload autoAcceptCredential?: DidCommAutoAcceptCredential comment?: string @@ -201,18 +201,18 @@ export interface V2OfferCredentialOptions { } export interface AcceptCredential { - credentialRecordId: RecordId + credentialExchangeRecordId: RecordId } export interface CredentialOfferOptions { - credentialRecordId: RecordId + credentialExchangeRecordId: RecordId credentialFormats?: DidCommCredentialFormatPayload autoAcceptCredential?: DidCommAutoAcceptCredential comment?: string } export interface AcceptCredentialRequestOptions { - credentialRecordId: RecordId + credentialExchangeRecordId: RecordId credentialFormats?: DidCommCredentialFormatPayload autoAcceptCredential?: DidCommAutoAcceptCredential comment?: string diff --git a/src/routes/routes.ts b/src/routes/routes.ts index d170b56b..227c5e70 100644 --- a/src/routes/routes.ts +++ b/src/routes/routes.ts @@ -34,6 +34,8 @@ import { SchemaController } from './../controllers/anoncreds/schema/SchemaContro // WARNING: This 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 { 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 { VerifierController } from './../controllers/openid4vc/verifiers/verifier.Controller'; import { expressAuthentication } from './../authentication'; // @ts-ignore - no great way to install types from subpackage @@ -1728,6 +1730,311 @@ const models: TsoaRoute.Models = { "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 + "DidCommCredentialState": { + "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 + "DidCommCredentialRole": { + "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 + "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 + "DidCommCredentialExchangeRecord": { + "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 + "DidCommCredentialPreviewAttributeOptions": { + "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 + "Pick_AnonCredsDidCommProposeCredentialFormat.Exclude_keyofAnonCredsDidCommProposeCredentialFormat.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":"DidCommCredentialPreviewAttributeOptions"}},"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_AnonCredsDidCommProposeCredentialFormat.schemaIssuerId-or-issuerId_": { + "dataType": "refAlias", + "type": {"ref":"Pick_AnonCredsDidCommProposeCredentialFormat.Exclude_keyofAnonCredsDidCommProposeCredentialFormat.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 + "LegacyIndyDidCommProposeCredentialFormat": { + "dataType": "refAlias", + "type": {"ref":"Omit_AnonCredsDidCommProposeCredentialFormat.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}, + }, + "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 + "DidCommJsonLdCredentialDetailFormat": { + "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 + "AnonCredsDidCommProposeCredentialFormat": { + "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":"DidCommCredentialPreviewAttributeOptions"}}, + "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 + "DidCommCredentialFormatPayload_CredentialFormatType-Array.createProposal_": { + "dataType": "refAlias", + "type": {"dataType":"nestedObjectLiteral","nestedProperties":{"indy":{"ref":"LegacyIndyDidCommProposeCredentialFormat"},"jsonld":{"ref":"DidCommJsonLdCredentialDetailFormat"},"anoncreds":{"ref":"AnonCredsDidCommProposeCredentialFormat"}},"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 + "DidCommAutoAcceptCredential": { + "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":"DidCommCredentialFormatPayload_CredentialFormatType-Array.createProposal_","required":true}, + "autoAcceptCredential": {"ref":"DidCommAutoAcceptCredential"}, + "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 + "AnonCredsDidCommAcceptProposalFormat": { + "dataType": "refObject", + "properties": { + "credentialDefinitionId": {"dataType":"string"}, + "revocationRegistryDefinitionId": {"dataType":"string"}, + "revocationRegistryIndex": {"dataType":"double"}, + "attributes": {"dataType":"array","array":{"dataType":"refObject","ref":"DidCommCredentialPreviewAttributeOptions"}}, + }, + "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 + "DidCommCredentialFormatPayload_CredentialFormats.acceptProposal_": { + "dataType": "refAlias", + "type": {"dataType":"nestedObjectLiteral","nestedProperties":{"indy":{"ref":"AnonCredsDidCommAcceptProposalFormat"},"jsonld":{"ref":"EmptyObject"},"anoncreds":{"ref":"AnonCredsDidCommAcceptProposalFormat"}},"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": { + "credentialExchangeRecordId": {"dataType":"string","required":true}, + "credentialFormats": {"ref":"DidCommCredentialFormatPayload_CredentialFormats.acceptProposal_"}, + "autoAcceptCredential": {"ref":"DidCommAutoAcceptCredential"}, + "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 + "AnonCredsDidCommOfferCredentialFormat": { + "dataType": "refObject", + "properties": { + "credentialDefinitionId": {"dataType":"string","required":true}, + "revocationRegistryDefinitionId": {"dataType":"string"}, + "revocationRegistryIndex": {"dataType":"double"}, + "attributes": {"dataType":"array","array":{"dataType":"refObject","ref":"DidCommCredentialPreviewAttributeOptions"},"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 + "DidCommCredentialFormatPayload_CredentialFormats.createOffer_": { + "dataType": "refAlias", + "type": {"dataType":"nestedObjectLiteral","nestedProperties":{"indy":{"ref":"AnonCredsDidCommOfferCredentialFormat"},"jsonld":{"ref":"DidCommJsonLdCredentialDetailFormat"},"anoncreds":{"ref":"AnonCredsDidCommOfferCredentialFormat"}},"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":"DidCommCredentialFormatPayload_CredentialFormats.createOffer_","required":true}, + "autoAcceptCredential": {"ref":"DidCommAutoAcceptCredential"}, + "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 + "DidCommCredentialFormatPayload_CredentialFormatType-Array.createOffer_": { + "dataType": "refAlias", + "type": {"dataType":"nestedObjectLiteral","nestedProperties":{"indy":{"ref":"AnonCredsDidCommOfferCredentialFormat"},"jsonld":{"ref":"DidCommJsonLdCredentialDetailFormat"},"anoncreds":{"ref":"AnonCredsDidCommOfferCredentialFormat"}},"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": {"ref":"ProtocolVersion","required":true}, + "credentialFormats": {"ref":"DidCommCredentialFormatPayload_CredentialFormatType-Array.createOffer_","required":true}, + "autoAcceptCredential": {"ref":"DidCommAutoAcceptCredential"}, + "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 + "AnonCredsDidCommAcceptOfferFormat": { + "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 + "DidCommCredentialFormatPayload_CredentialFormats.acceptOffer_": { + "dataType": "refAlias", + "type": {"dataType":"nestedObjectLiteral","nestedProperties":{"indy":{"ref":"AnonCredsDidCommAcceptOfferFormat"},"jsonld":{"ref":"EmptyObject"},"anoncreds":{"ref":"AnonCredsDidCommAcceptOfferFormat"}},"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": { + "credentialExchangeRecordId": {"ref":"RecordId","required":true}, + "credentialFormats": {"ref":"DidCommCredentialFormatPayload_CredentialFormats.acceptOffer_"}, + "autoAcceptCredential": {"ref":"DidCommAutoAcceptCredential"}, + "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 + "AnonCredsDidCommAcceptRequestFormat": { + "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 + "DidCommJsonLdAcceptRequestFormat": { + "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 + "DidCommCredentialFormatPayload_CredentialFormats.acceptRequest_": { + "dataType": "refAlias", + "type": {"dataType":"nestedObjectLiteral","nestedProperties":{"indy":{"ref":"AnonCredsDidCommAcceptRequestFormat"},"jsonld":{"ref":"DidCommJsonLdAcceptRequestFormat"},"anoncreds":{"ref":"AnonCredsDidCommAcceptRequestFormat"}},"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": { + "credentialExchangeRecordId": {"ref":"RecordId","required":true}, + "credentialFormats": {"ref":"DidCommCredentialFormatPayload_CredentialFormats.acceptRequest_"}, + "autoAcceptCredential": {"ref":"DidCommAutoAcceptCredential"}, + "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": { + "credentialExchangeRecordId": {"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-DidCommJsonLdCredentialFormat-or-AnonCredsDidCommCredentialFormat_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-DidCommJsonLdCredentialFormat-or-AnonCredsDidCommCredentialFormat_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-DidCommJsonLdCredentialFormat-or-AnonCredsDidCommCredentialFormat_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-DidCommJsonLdCredentialFormat-or-AnonCredsDidCommCredentialFormat_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-DidCommJsonLdCredentialFormat-or-AnonCredsDidCommCredentialFormat_41_-Array_": { + "dataType": "refAlias", + "type": {"dataType":"nestedObjectLiteral","nestedProperties":{"credential":{"ref":"CredentialFormatDataMessagePayload__40_LegacyIndyCredentialFormat-or-DidCommJsonLdCredentialFormat-or-AnonCredsDidCommCredentialFormat_41_-Array.credential_"},"request":{"ref":"CredentialFormatDataMessagePayload__40_LegacyIndyCredentialFormat-or-DidCommJsonLdCredentialFormat-or-AnonCredsDidCommCredentialFormat_41_-Array.request_"},"offerAttributes":{"dataType":"array","array":{"dataType":"refObject","ref":"DidCommCredentialPreviewAttributeOptions"}},"offer":{"ref":"CredentialFormatDataMessagePayload__40_LegacyIndyCredentialFormat-or-DidCommJsonLdCredentialFormat-or-AnonCredsDidCommCredentialFormat_41_-Array.offer_"},"proposal":{"ref":"CredentialFormatDataMessagePayload__40_LegacyIndyCredentialFormat-or-DidCommJsonLdCredentialFormat-or-AnonCredsDidCommCredentialFormat_41_-Array.proposal_"},"proposalAttributes":{"dataType":"array","array":{"dataType":"refObject","ref":"DidCommCredentialPreviewAttributeOptions"}}},"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 "OpenId4VcVerifierRecord": { "dataType": "refAlias", "type": {"ref":"Record_string.unknown_","validators":{}}, @@ -4350,6 +4657,453 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This 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":"DidCommCredentialState"}, + role: {"in":"query","name":"role","ref":"DidCommCredentialRole"}, + }; + 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 argsVerifierController_createVerifier: Record = { request: {"in":"request","name":"request","required":true,"dataType":"object"}, options: {"in":"body","name":"options","required":true,"ref":"OpenId4VcSiopCreateVerifierOptions"}, diff --git a/src/routes/swagger.json b/src/routes/swagger.json index 1c5ed875..ca583f96 100644 --- a/src/routes/swagger.json +++ b/src/routes/swagger.json @@ -4013,605 +4013,745 @@ "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" + "ThreadId": { + "type": "string", + "example": "ea4e5e69-fc04-465a-90d2-9f8ff78aa71d" }, - "OpenId4VcSiopVerifierClientMetadata": { + "DidCommCredentialState": { + "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" + }, + "DidCommCredentialRole": { + "enum": [ + "issuer", + "holder" + ], + "type": "string" + }, + "W3cCredentialRecord": { + "$ref": "#/components/schemas/Record_string.unknown_" + }, + "DidCommCredentialExchangeRecord": { + "$ref": "#/components/schemas/Record_string.unknown_" + }, + "ProtocolVersion": { + "enum": [ + "v1", + "v2" + ], + "type": "string" + }, + "DidCommCredentialPreviewAttributeOptions": { "properties": { - "client_name": { + "name": { "type": "string" }, - "logo_uri": { + "mimeType": { + "type": "string" + }, + "value": { "type": "string" } }, + "required": [ + "name", + "value" + ], "type": "object", "additionalProperties": false }, - "OpenId4VcSiopCreateVerifierOptions": { + "Pick_AnonCredsDidCommProposeCredentialFormat.Exclude_keyofAnonCredsDidCommProposeCredentialFormat.schemaIssuerId-or-issuerId__": { "properties": { - "verifierId": { + "schemaId": { "type": "string" }, - "clientMetadata": { - "$ref": "#/components/schemas/OpenId4VcSiopVerifierClientMetadata" + "schemaName": { + "type": "string" + }, + "schemaVersion": { + "type": "string" + }, + "credentialDefinitionId": { + "type": "string" + }, + "attributes": { + "items": { + "$ref": "#/components/schemas/DidCommCredentialPreviewAttributeOptions" + }, + "type": "array" + }, + "schemaIssuerDid": { + "type": "string" + }, + "issuerDid": { + "type": "string" } }, "type": "object", - "additionalProperties": false + "description": "From T, pick a set of properties whose keys are in the union K" }, - "OpenId4VcUpdateVerifierRecordOptions": { + "Omit_AnonCredsDidCommProposeCredentialFormat.schemaIssuerId-or-issuerId_": { + "$ref": "#/components/schemas/Pick_AnonCredsDidCommProposeCredentialFormat.Exclude_keyofAnonCredsDidCommProposeCredentialFormat.schemaIssuerId-or-issuerId__", + "description": "Construct a type with the properties of T except for those in type K." + }, + "LegacyIndyDidCommProposeCredentialFormat": { + "$ref": "#/components/schemas/Omit_AnonCredsDidCommProposeCredentialFormat.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": { - "clientMetadata": { - "$ref": "#/components/schemas/OpenId4VcSiopVerifierClientMetadata" + "id": { + "type": "string" } }, + "required": [ + "id" + ], "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": { - "keyId": {}, - "publicCertificateBase64": { - "type": "string" - } - }, - "required": [ - "keyId", - "publicCertificateBase64" - ], - "type": "object" - } - } - } - } - }, - "tags": [ - "x509" - ], - "security": [ + "SingleOrArray_JsonObject_": { + "anyOf": [ { - "jwt": [ - "tenant", - "dedicated" - ] + "$ref": "#/components/schemas/JsonObject" + }, + { + "items": { + "$ref": "#/components/schemas/JsonObject" + }, + "type": "array" } - ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/X509CreateCertificateOptionsDto" + ] + }, + "JsonCredential": { + "properties": { + "@context": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "$ref": "#/components/schemas/JsonObject" } - } - } - } - } - }, - "/x509/import": { - "post": { - "operationId": "ImportX509Certificates", - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": { - "properties": { - "keyId": {}, - "issuerCertificate": { - "type": "string" - } - }, - "required": [ - "keyId", - "issuerCertificate" - ], - "type": "object" - } + ] + }, + "id": { + "type": "string" + }, + "type": { + "items": { + "type": "string" + }, + "type": "array" + }, + "issuer": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/components/schemas/W3cIssuerOptions" } - } - } - }, - "tags": [ - "x509" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" ] + }, + "issuanceDate": { + "type": "string" + }, + "expirationDate": { + "type": "string" + }, + "credentialSubject": { + "$ref": "#/components/schemas/SingleOrArray_JsonObject_" } + }, + "required": [ + "@context", + "type", + "issuer", + "issuanceDate", + "credentialSubject" ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/X509ImportCertificateOptionsDto" + "type": "object", + "additionalProperties": {} + }, + "DidCommJsonLdCredentialDetailFormat": { + "description": "Format for creating a jsonld proposal, offer or request.", + "properties": { + "credential": { + "$ref": "#/components/schemas/JsonCredential" + }, + "options": { + "properties": { + "proofType": { + "type": "string" + }, + "proofPurpose": { + "type": "string" } - } - } - } - } - }, - "/x509/trusted": { - "post": { - "operationId": "AddTrustedCertificate", - "responses": { - "204": { - "description": "No content" + }, + "required": [ + "proofType", + "proofPurpose" + ], + "type": "object" } }, - "tags": [ - "x509" + "required": [ + "credential", + "options" ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "properties": { - "certificate": { - "type": "string" - } - }, - "required": [ - "certificate" - ], - "type": "object" - } - } - } - } + "type": "object", + "additionalProperties": false }, - "get": { - "operationId": "GetTrustedCertificates", - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": { - "items": { - "type": "string" - }, - "type": "array" - } - } - } + "AnonCredsDidCommProposeCredentialFormat": { + "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/DidCommCredentialPreviewAttributeOptions" + }, + "type": "array" + }, + "schemaIssuerDid": { + "type": "string" + }, + "issuerDid": { + "type": "string" } }, - "tags": [ - "x509" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [] - } - }, - "/x509/decode": { - "post": { - "operationId": "DecodeCertificate", - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/X509Certificate" - } - } - } + "type": "object", + "additionalProperties": false + }, + "DidCommCredentialFormatPayload_CredentialFormatType-Array.createProposal_": { + "properties": { + "indy": { + "$ref": "#/components/schemas/LegacyIndyDidCommProposeCredentialFormat" + }, + "jsonld": { + "$ref": "#/components/schemas/DidCommJsonLdCredentialDetailFormat" + }, + "anoncreds": { + "$ref": "#/components/schemas/AnonCredsDidCommProposeCredentialFormat" } }, - "tags": [ - "x509" + "type": "object", + "description": "Get the payload for a specific method from a list of CredentialFormat interfaces and a method" + }, + "DidCommAutoAcceptCredential": { + "description": "Typing of the state for auto acceptance", + "enum": [ + "always", + "contentApproved", + "never" ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] + "type": "string" + }, + "ProposeCredentialOptions": { + "properties": { + "protocolVersion": { + "$ref": "#/components/schemas/ProtocolVersion" + }, + "credentialFormats": { + "$ref": "#/components/schemas/DidCommCredentialFormatPayload_CredentialFormatType-Array.createProposal_" + }, + "autoAcceptCredential": { + "$ref": "#/components/schemas/DidCommAutoAcceptCredential" + }, + "comment": { + "type": "string" + }, + "connectionId": { + "$ref": "#/components/schemas/RecordId" } + }, + "required": [ + "protocolVersion", + "credentialFormats", + "connectionId" ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "properties": { - "certificate": { - "type": "string" - } - }, - "required": [ - "certificate" - ], - "type": "object" - } - } + "type": "object", + "additionalProperties": false + }, + "AnonCredsDidCommAcceptProposalFormat": { + "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/DidCommCredentialPreviewAttributeOptions" + }, + "type": "array" } - } - } - }, - "/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" - } - } - } + }, + "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_" + }, + "DidCommCredentialFormatPayload_CredentialFormats.acceptProposal_": { + "properties": { + "indy": { + "$ref": "#/components/schemas/AnonCredsDidCommAcceptProposalFormat" + }, + "jsonld": { + "$ref": "#/components/schemas/EmptyObject" + }, + "anoncreds": { + "$ref": "#/components/schemas/AnonCredsDidCommAcceptProposalFormat" } }, - "description": "Create Secp256k1 key pair for polygon DID", - "tags": [ - "Polygon" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated", - "Basewallet" - ] + "type": "object", + "description": "Get the payload for a specific method from a list of CredentialFormat interfaces and a method" + }, + "AcceptCredentialProposalOptions": { + "properties": { + "credentialExchangeRecordId": { + "type": "string" + }, + "credentialFormats": { + "$ref": "#/components/schemas/DidCommCredentialFormatPayload_CredentialFormats.acceptProposal_" + }, + "autoAcceptCredential": { + "$ref": "#/components/schemas/DidCommAutoAcceptCredential" + }, + "comment": { + "type": "string" } + }, + "required": [ + "credentialExchangeRecordId" ], - "parameters": [] - } - }, - "/polygon/create-schema": { - "post": { - "operationId": "CreateSchema", - "responses": { - "200": { - "description": "Schema JSON", - "content": { - "application/json": { - "schema": {} - } - } + "type": "object", + "additionalProperties": false + }, + "AnonCredsDidCommOfferCredentialFormat": { + "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/DidCommCredentialPreviewAttributeOptions" + }, + "type": "array" } }, - "description": "Create polygon based W3C schema", - "tags": [ - "Polygon" + "required": [ + "credentialDefinitionId", + "attributes" ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] + "type": "object", + "additionalProperties": false + }, + "DidCommCredentialFormatPayload_CredentialFormats.createOffer_": { + "properties": { + "indy": { + "$ref": "#/components/schemas/AnonCredsDidCommOfferCredentialFormat" + }, + "jsonld": { + "$ref": "#/components/schemas/DidCommJsonLdCredentialDetailFormat" + }, + "anoncreds": { + "$ref": "#/components/schemas/AnonCredsDidCommOfferCredentialFormat" + } + }, + "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/DidCommCredentialFormatPayload_CredentialFormats.createOffer_" + }, + "autoAcceptCredential": { + "$ref": "#/components/schemas/DidCommAutoAcceptCredential" + }, + "comment": { + "type": "string" + }, + "goalCode": { + "type": "string" + }, + "goal": { + "type": "string" } + }, + "required": [ + "protocolVersion", + "connectionId", + "credentialFormats" ], - "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" - } - } + "type": "object", + "additionalProperties": false + }, + "DidCommCredentialFormatPayload_CredentialFormatType-Array.createOffer_": { + "properties": { + "indy": { + "$ref": "#/components/schemas/AnonCredsDidCommOfferCredentialFormat" + }, + "jsonld": { + "$ref": "#/components/schemas/DidCommJsonLdCredentialDetailFormat" + }, + "anoncreds": { + "$ref": "#/components/schemas/AnonCredsDidCommOfferCredentialFormat" } - } - } - }, - "/polygon/estimate-transaction": { - "post": { - "operationId": "EstimateTransaction", - "responses": { - "200": { - "description": "Transaction Object", - "content": { - "application/json": { - "schema": {} - } - } + }, + "type": "object", + "description": "Get the payload for a specific method from a list of CredentialFormat interfaces and a method" + }, + "CreateOfferOobOptions": { + "properties": { + "protocolVersion": { + "$ref": "#/components/schemas/ProtocolVersion" + }, + "credentialFormats": { + "$ref": "#/components/schemas/DidCommCredentialFormatPayload_CredentialFormatType-Array.createOffer_" + }, + "autoAcceptCredential": { + "$ref": "#/components/schemas/DidCommAutoAcceptCredential" + }, + "comment": { + "type": "string" + }, + "goalCode": { + "type": "string" + }, + "parentThreadId": { + "type": "string" + }, + "willConfirm": { + "type": "boolean" + }, + "label": { + "type": "string" + }, + "imageUrl": { + "type": "string" + }, + "recipientKey": { + "type": "string" + }, + "invitationDid": { + "type": "string" } }, - "description": "Estimate transaction", - "tags": [ - "Polygon" + "required": [ + "protocolVersion", + "credentialFormats" ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated", - "Basewallet" - ] + "type": "object", + "additionalProperties": false + }, + "AnonCredsDidCommAcceptOfferFormat": { + "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" } - ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DidOperationOptions" - } - } + }, + "type": "object", + "additionalProperties": false + }, + "DidCommCredentialFormatPayload_CredentialFormats.acceptOffer_": { + "properties": { + "indy": { + "$ref": "#/components/schemas/AnonCredsDidCommAcceptOfferFormat" + }, + "jsonld": { + "$ref": "#/components/schemas/EmptyObject" + }, + "anoncreds": { + "$ref": "#/components/schemas/AnonCredsDidCommAcceptOfferFormat" } - } - } - }, - "/polygon/{did}/{schemaId}": { - "get": { - "operationId": "GetSchemaById", - "responses": { - "200": { - "description": "Schema Object", - "content": { - "application/json": { - "schema": {} - } - } + }, + "type": "object", + "description": "Get the payload for a specific method from a list of CredentialFormat interfaces and a method" + }, + "CredentialOfferOptions": { + "properties": { + "credentialExchangeRecordId": { + "$ref": "#/components/schemas/RecordId" + }, + "credentialFormats": { + "$ref": "#/components/schemas/DidCommCredentialFormatPayload_CredentialFormats.acceptOffer_" + }, + "autoAcceptCredential": { + "$ref": "#/components/schemas/DidCommAutoAcceptCredential" + }, + "comment": { + "type": "string" } }, - "description": "Fetch schema details", - "tags": [ - "Polygon" + "required": [ + "credentialExchangeRecordId" ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] + "type": "object", + "additionalProperties": false + }, + "AnonCredsDidCommAcceptRequestFormat": { + "$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" + }, + "DidCommJsonLdAcceptRequestFormat": { + "description": "Format for accepting a jsonld credential request. Optionally allows the verification\nmethod to use to sign the credential.", + "properties": { + "verificationMethod": { + "type": "string" } - ], - "parameters": [ - { - "in": "path", - "name": "did", - "required": true, - "schema": { - "type": "string" - } + }, + "type": "object", + "additionalProperties": false + }, + "DidCommCredentialFormatPayload_CredentialFormats.acceptRequest_": { + "properties": { + "indy": { + "$ref": "#/components/schemas/AnonCredsDidCommAcceptRequestFormat" }, - { - "in": "path", - "name": "schemaId", - "required": true, - "schema": { - "type": "string" - } + "jsonld": { + "$ref": "#/components/schemas/DidCommJsonLdAcceptRequestFormat" + }, + "anoncreds": { + "$ref": "#/components/schemas/AnonCredsDidCommAcceptRequestFormat" } - ] - } - }, - "/openid4vc/verification-sessions/create-presentation-request": { - "post": { - "operationId": "CreateProofRequest", - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": {} - } - } + }, + "type": "object", + "description": "Get the payload for a specific method from a list of CredentialFormat interfaces and a method" + }, + "AcceptCredentialRequestOptions": { + "properties": { + "credentialExchangeRecordId": { + "$ref": "#/components/schemas/RecordId" + }, + "credentialFormats": { + "$ref": "#/components/schemas/DidCommCredentialFormatPayload_CredentialFormats.acceptRequest_" + }, + "autoAcceptCredential": { + "$ref": "#/components/schemas/DidCommAutoAcceptCredential" + }, + "comment": { + "type": "string" } }, - "description": "Create an authorization request, acting as a Relying Party (RP)", - "tags": [ - "oid4vc verification sessions" + "required": [ + "credentialExchangeRecordId" ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] + "type": "object", + "additionalProperties": false + }, + "AcceptCredential": { + "properties": { + "credentialExchangeRecordId": { + "$ref": "#/components/schemas/RecordId" } + }, + "required": [ + "credentialExchangeRecordId" ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateAuthorizationRequest" - } - } - } - } - } - }, - "/openid4vc/verification-sessions": { - "get": { - "operationId": "GetAllVerificationSessions", - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": { - "items": { - "$ref": "#/components/schemas/OpenId4VcVerificationSessionRecord" - }, - "type": "array" - } - } - } - } - }, - "description": "Retrieve all verification session records", - "tags": [ - "oid4vc verification sessions" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [ - { - "in": "query", - "name": "publicVerifierId", - "required": false, - "schema": { - "type": "string" - } + "type": "object", + "additionalProperties": false + }, + "CredentialFormatDataMessagePayload__40_LegacyIndyCredentialFormat-or-DidCommJsonLdCredentialFormat-or-AnonCredsDidCommCredentialFormat_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-DidCommJsonLdCredentialFormat-or-AnonCredsDidCommCredentialFormat_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-DidCommJsonLdCredentialFormat-or-AnonCredsDidCommCredentialFormat_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-DidCommJsonLdCredentialFormat-or-AnonCredsDidCommCredentialFormat_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-DidCommJsonLdCredentialFormat-or-AnonCredsDidCommCredentialFormat_41_-Array_": { + "properties": { + "credential": { + "$ref": "#/components/schemas/CredentialFormatDataMessagePayload__40_LegacyIndyCredentialFormat-or-DidCommJsonLdCredentialFormat-or-AnonCredsDidCommCredentialFormat_41_-Array.credential_" }, - { - "in": "query", - "name": "payloadState", - "required": false, - "schema": { - "type": "string" - } + "request": { + "$ref": "#/components/schemas/CredentialFormatDataMessagePayload__40_LegacyIndyCredentialFormat-or-DidCommJsonLdCredentialFormat-or-AnonCredsDidCommCredentialFormat_41_-Array.request_" }, - { - "in": "query", - "name": "state", - "required": false, - "schema": { - "$ref": "#/components/schemas/OpenId4VcVerificationSessionState" - } + "offerAttributes": { + "items": { + "$ref": "#/components/schemas/DidCommCredentialPreviewAttributeOptions" + }, + "type": "array" }, - { - "in": "query", - "name": "authorizationRequestUri", - "required": false, - "schema": { - "type": "string" - } + "offer": { + "$ref": "#/components/schemas/CredentialFormatDataMessagePayload__40_LegacyIndyCredentialFormat-or-DidCommJsonLdCredentialFormat-or-AnonCredsDidCommCredentialFormat_41_-Array.offer_" }, - { - "in": "query", - "name": "authorizationRequestId", - "required": false, - "schema": { - "type": "string" - } + "proposal": { + "$ref": "#/components/schemas/CredentialFormatDataMessagePayload__40_LegacyIndyCredentialFormat-or-DidCommJsonLdCredentialFormat-or-AnonCredsDidCommCredentialFormat_41_-Array.proposal_" }, - { - "in": "query", - "name": "nonce", - "required": false, - "schema": { - "type": "string" - } + "proposalAttributes": { + "items": { + "$ref": "#/components/schemas/DidCommCredentialPreviewAttributeOptions" + }, + "type": "array" } - ] + }, + "type": "object", + "description": "Get format data return value. Each key holds a mapping of credential format key to format data." + }, + "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": { + "clientMetadata": { + "$ref": "#/components/schemas/OpenId4VcSiopVerifierClientMetadata" + } + }, + "type": "object", + "additionalProperties": false } }, - "/openid4vc/verification-sessions/{verificationSessionId}": { - "get": { - "operationId": "GetVerificationSessionsById", + "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": { - "$ref": "#/components/schemas/OpenId4VcVerificationSessionRecord" + "properties": { + "keyId": {}, + "publicCertificateBase64": { + "type": "string" + } + }, + "required": [ + "keyId", + "publicCertificateBase64" + ], + "type": "object" } } } } }, - "description": "Get verification session by ID", "tags": [ - "oid4vc verification sessions" + "x509" ], "security": [ { @@ -4621,33 +4761,46 @@ ] } ], - "parameters": [ - { - "in": "path", - "name": "verificationSessionId", - "required": true, - "schema": { - "type": "string" + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/X509CreateCertificateOptionsDto" + } } } - ] + } } }, - "/openid4vc/verification-sessions/response/{verificationSessionId}": { - "get": { - "operationId": "GetVerifiedAuthorizationResponse", + "/x509/import": { + "post": { + "operationId": "ImportX509Certificates", "responses": { "200": { "description": "Ok", "content": { "application/json": { - "schema": {} + "schema": { + "properties": { + "keyId": {}, + "issuerCertificate": { + "type": "string" + } + }, + "required": [ + "keyId", + "issuerCertificate" + ], + "type": "object" + } } } } }, "tags": [ - "oid4vc verification sessions" + "x509" ], "security": [ { @@ -4657,34 +4810,29 @@ ] } ], - "parameters": [ - { - "in": "path", - "name": "verificationSessionId", - "required": true, - "schema": { - "type": "string" + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/X509ImportCertificateOptionsDto" + } } } - ] + } } }, - "/openid4vc/verification-sessions/verify-authorization-response": { + "/x509/trusted": { "post": { - "operationId": "VerifyDcqlProofRequest", + "operationId": "AddTrustedCertificate", "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": {} - } - } + "204": { + "description": "No content" } }, - "description": "Verify authorization response for a DCAPI proof request", "tags": [ - "oid4vc verification sessions" + "x509" ], "security": [ { @@ -4700,327 +4848,1448 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/OpenId4VCDCQLVerificationSessionRecord" + "properties": { + "certificate": { + "type": "string" + } + }, + "required": [ + "certificate" + ], + "type": "object" } } } } - } - }, - "/openid4vc/issuer": { + }, + "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": "CreateIssuer", + "operationId": "DecodeCertificate", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/OpenId4VcIssuerRecord" + "$ref": "#/components/schemas/X509Certificate" + } + } + } + } + }, + "tags": [ + "x509" + ], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "properties": { + "certificate": { + "type": "string" + } }, - "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" - } - ] - }, - "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" - ], - "cryptographic_binding_methods_supported": [ - "did:key" - ], - "display": [ - { - "name": "University Degree Credential", - "description": "Issued by a recognized educational institution", - "locale": "en" - } - ] - }, - "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" - } - ] - } - } + "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" + } + } + ] + } + }, + "/openid4vc/verification-sessions/create-presentation-request": { + "post": { + "operationId": "CreateProofRequest", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": {} + } + } + } + }, + "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" + } + } + } + } + } + }, + "/openid4vc/verification-sessions": { + "get": { + "operationId": "GetAllVerificationSessions", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/OpenId4VcVerificationSessionRecord" + }, + "type": "array" + } + } + } + } + }, + "description": "Retrieve all verification session records", + "tags": [ + "oid4vc verification sessions" + ], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } + ], + "parameters": [ + { + "in": "query", + "name": "publicVerifierId", + "required": false, + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "payloadState", + "required": false, + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "state", + "required": false, + "schema": { + "$ref": "#/components/schemas/OpenId4VcVerificationSessionState" + } + }, + { + "in": "query", + "name": "authorizationRequestUri", + "required": false, + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "authorizationRequestId", + "required": false, + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "nonce", + "required": false, + "schema": { + "type": "string" + } + } + ] + } + }, + "/openid4vc/verification-sessions/{verificationSessionId}": { + "get": { + "operationId": "GetVerificationSessionsById", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenId4VcVerificationSessionRecord" + } + } + } + } + }, + "description": "Get verification session by ID", + "tags": [ + "oid4vc verification sessions" + ], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } + ], + "parameters": [ + { + "in": "path", + "name": "verificationSessionId", + "required": true, + "schema": { + "type": "string" + } + } + ] + } + }, + "/openid4vc/verification-sessions/response/{verificationSessionId}": { + "get": { + "operationId": "GetVerifiedAuthorizationResponse", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": {} + } + } + } + }, + "tags": [ + "oid4vc verification sessions" + ], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } + ], + "parameters": [ + { + "in": "path", + "name": "verificationSessionId", + "required": true, + "schema": { + "type": "string" + } + } + ] + } + }, + "/openid4vc/verification-sessions/verify-authorization-response": { + "post": { + "operationId": "VerifyDcqlProofRequest", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": {} + } + } + } + }, + "description": "Verify authorization response for a DCAPI proof request", + "tags": [ + "oid4vc verification sessions" + ], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenId4VCDCQLVerificationSessionRecord" + } + } + } + } + } + }, + "/openid4vc/issuer": { + "post": { + "operationId": "CreateIssuer", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenId4VcIssuerRecord" + }, + "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" + } + ] + }, + "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" + ], + "cryptographic_binding_methods_supported": [ + "did:key" + ], + "display": [ + { + "name": "University Degree Credential", + "description": "Issued by a recognized educational institution", + "locale": "en" + } + ] + }, + "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" + } + ] + } + } + } + } + } + } + } + } + }, + "description": "Creates an issuer with issuer metadata.", + "tags": [ + "oid4vc issuers" + ], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateIssuerOptions" + } + } + } + } + }, + "get": { + "operationId": "GetIssuersByQuery", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenId4VcIssuerRecord" + }, + { + "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", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenId4VcIssuerRecord" + } + } + } + } + }, + "description": "Updates issuer metadata for a given publicIssuerId.", + "tags": [ + "oid4vc issuers" + ], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } + ], + "parameters": [ + { + "in": "path", + "name": "publicIssuerId", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateIssuerRecordOptions" + } + } + } + } + }, + "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", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": {} + } + } + } + }, + "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": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" + } + } + } + } + }, + "description": "Deletes a specific issuer by record id.", + "tags": [ + "oid4vc issuers" + ], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + } + } + ] + } + }, + "/openid4vc/issuance-sessions/create-credential-offer": { + "post": { + "operationId": "CreateCredentialOffer", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "properties": { + "issuanceSession": { + "$ref": "#/components/schemas/OpenId4VcIssuanceSessionRecord" + }, + "credentialOffer": { + "type": "string" + } + }, + "required": [ + "issuanceSession", + "credentialOffer" + ], + "type": "object" + } + } + } + } + }, + "description": "Creates a credential offer with the specified credential configurations and authorization type.", + "tags": [ + "oid4vc issuance sessions" + ], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenId4VcIssuanceSessionsCreateOffer" + } + } + } + } + } + }, + "/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", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenId4VcIssuanceSessionRecord" + } + } + } + } + }, + "description": "Update issuance session metadata by session ID", + "tags": [ + "oid4vc issuance sessions" + ], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } + ], + "parameters": [ + { + "in": "path", + "name": "issuanceSessionId", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "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" + }, + "type": "array" + } + } + } + } + }, + "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/issuance-sessions/{issuanceSessionId}/revoke": { + "post": { + "operationId": "RevokeSessionById", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" + } + } + } + } + }, + "description": "Revoke credentials in an issuance session by session ID", + "tags": [ + "oid4vc issuance sessions" + ], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } + ], + "parameters": [ + { + "in": "path", + "name": "issuanceSessionId", + "required": true, + "schema": { + "type": "string" + } + } + ] + } + }, + "/openid4vc/holder/sd-jwt-vcs": { + "get": { + "operationId": "GetSdJwtCredentials", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/SdJwtVcRecord" + }, + "type": "array" } } } } }, - "description": "Creates an issuer with issuer metadata.", + "description": "Get SdJwt type of credentials", "tags": [ - "oid4vc issuers" + "oid4vc holders" + ], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } + ], + "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": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } + ], + "parameters": [] + } + }, + "/openid4vc/holder/mdoc-vcs/decode": { + "post": { + "operationId": "DecodeMdocCredential", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": {} + } + } + } + }, + "description": "Decode mso mdoc credential in wallet", + "tags": [ + "oid4vc holders" ], "security": [ { @@ -5036,39 +6305,37 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateIssuerOptions" + "properties": { + "base64Url": { + "type": "string" + } + }, + "required": [ + "base64Url" + ], + "type": "object" } } } } - }, - "get": { - "operationId": "GetIssuersByQuery", + } + }, + "/openid4vc/holder/resolve-credential-offer": { + "post": { + "operationId": "ResolveCredOffer", "responses": { "200": { "description": "Ok", "content": { "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenId4VcIssuerRecord" - }, - { - "items": { - "$ref": "#/components/schemas/OpenId4VcIssuerRecord" - }, - "type": "array" - } - ] - } + "schema": {} } } } }, - "description": "Query issuers by optional publicIssuerId.", + "description": "Resolve a credential offer", "tags": [ - "oid4vc issuers" + "oid4vc holders" ], "security": [ { @@ -5078,36 +6345,148 @@ ] } ], - "parameters": [ + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResolveCredentialOfferBody" + } + } + } + } + } + }, + "/openid4vc/holder/authorization-request": { + "post": { + "operationId": "RequestAuthorizationForCredential", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": {} + } + } + } + }, + "tags": [ + "oid4vc holders" + ], + "security": [ { - "in": "query", - "name": "publicIssuerId", - "required": false, - "schema": { - "type": "string" + "jwt": [ + "tenant", + "dedicated" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthorizeRequestCredentialOffer" + } } } - ] + } } }, - "/openid4vc/issuer/{publicIssuerId}": { - "put": { - "operationId": "UpdateIssuerMetadata", + "/openid4vc/holder/request-credential": { + "post": { + "operationId": "RequestCredential", "responses": { "200": { "description": "Ok", "content": { "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenId4VcIssuerRecord" - } + "schema": {} + } + } + } + }, + "description": "Initiates a token request, then requests credentials from issuer", + "tags": [ + "oid4vc holders" + ], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RequestCredentialBody" + } + } + } + } + } + }, + "/openid4vc/holder/resolve-proof-request": { + "post": { + "operationId": "ResolveProofRequest", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": {} + } + } + } + }, + "description": "Resolve a proof request", + "tags": [ + "oid4vc holders" + ], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResolveProofRequest" + } + } + } + } + } + }, + "/openid4vc/holder/accept-proof-request": { + "post": { + "operationId": "AcceptProofRequest", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": {} } } } }, - "description": "Updates issuer metadata for a given publicIssuerId.", + "description": "Accept a proof request", "tags": [ - "oid4vc issuers" + "oid4vc holders" ], "security": [ { @@ -5117,44 +6496,34 @@ ] } ], - "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/ResolveProofRequest" } } } } - }, - "get": { - "operationId": "GetIssuer", + } + }, + "/openid4vc/holder/decode-sdjwt": { + "post": { + "operationId": "DecodeSdJwt", "responses": { "200": { "description": "Ok", "content": { "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenId4VcIssuerRecord" - } + "schema": {} } } } }, - "description": "Returns a specific issuer by publicIssuerId.", "tags": [ - "oid4vc issuers" + "oid4vc holders" ], "security": [ { @@ -5164,34 +6533,37 @@ ] } ], - "parameters": [ - { - "in": "path", - "name": "publicIssuerId", - "required": true, - "schema": { - "type": "string" + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "properties": { + "jwt": { + "type": "string" + } + }, + "required": [ + "jwt" + ], + "type": "object" + } } } - ] + } } }, - "/openid4vc/issuer/{issuerId}/metadata": { - "get": { - "operationId": "GetIssuerAgentMetaData", + "/openid4vc/holder/credential": { + "delete": { + "operationId": "Delete", "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": {} - } - } + "204": { + "description": "No content" } }, - "description": "Returns metadata for a specific issuer.", "tags": [ - "oid4vc issuers" + "oid4vc holders" ], "security": [ { @@ -5201,21 +6573,22 @@ ] } ], - "parameters": [ - { - "in": "path", - "name": "issuerId", - "required": true, - "schema": { - "type": "string" + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteCredentialBody" + } } } - ] + } } }, - "/openid4vc/issuer/{id}": { - "delete": { - "operationId": "DeleteIssuer", + "/multi-tenancy/create-tenant": { + "post": { + "operationId": "CreateTenant", "responses": { "200": { "description": "Ok", @@ -5223,12 +6596,47 @@ "application/json": { "schema": { "properties": { - "message": { + "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": [ - "message" + "token", + "metadata", + "allowCache", + "createdAt", + "id", + "storageVersion", + "config", + "type" ], "type": "object" } @@ -5236,50 +6644,71 @@ } } }, - "description": "Deletes a specific issuer by record id.", "tags": [ - "oid4vc issuers" + "MultiTenancy" ], "security": [ { "jwt": [ - "tenant", - "dedicated" + "Basewallet" ] } ], - "parameters": [ - { - "in": "path", - "name": "id", - "required": true, - "schema": { - "type": "string" + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateTenantOptions" + } } } - ] + } } }, - "/openid4vc/issuance-sessions/create-credential-offer": { + "/multi-tenancy/get-token/{tenantId}": { "post": { - "operationId": "CreateCredentialOffer", + "operationId": "GetTenantToken", "responses": { "200": { "description": "Ok", + "content": { + "application/json": { + "schema": {} + } + } + }, + "404": { + "description": "", "content": { "application/json": { "schema": { "properties": { - "issuanceSession": { - "$ref": "#/components/schemas/OpenId4VcIssuanceSessionRecord" - }, - "credentialOffer": { + "reason": { "type": "string" } }, "required": [ - "issuanceSession", - "credentialOffer" + "reason" + ], + "type": "object" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" ], "type": "object" } @@ -5287,62 +6716,91 @@ } } }, - "description": "Creates a credential offer with the specified credential configurations and authorization type.", "tags": [ - "oid4vc issuance sessions" + "MultiTenancy" ], "security": [ { "jwt": [ - "tenant", - "dedicated" + "Basewallet" ] } ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenId4VcIssuanceSessionsCreateOffer" - } + "parameters": [ + { + "in": "path", + "name": "tenantId", + "required": true, + "schema": { + "type": "string" } } - } + ] } }, - "/openid4vc/issuance-sessions/{issuanceSessionId}": { + "/multi-tenancy/{tenantId}": { "get": { - "operationId": "GetIssuanceSessionsById", + "operationId": "GetTenantById", "responses": { "200": { "description": "Ok", + "content": { + "application/json": { + "schema": {} + } + } + }, + "404": { + "description": "", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/OpenId4VcIssuanceSessionRecord" + "properties": { + "reason": { + "type": "string" + } + }, + "required": [ + "reason" + ], + "type": "object" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" } } } } }, - "description": "Get issuance details by issuance SessionId", "tags": [ - "oid4vc issuance sessions" + "MultiTenancy" ], "security": [ { "jwt": [ - "tenant", - "dedicated" + "Basewallet" ] } ], "parameters": [ { "in": "path", - "name": "issuanceSessionId", + "name": "tenantId", "required": true, "schema": { "type": "string" @@ -5350,76 +6808,68 @@ } ] }, - "put": { - "operationId": "UpdateSessionById", + "delete": { + "operationId": "DeleteTenantById", "responses": { "200": { "description": "Ok", + "content": { + "application/json": { + "schema": {} + } + } + }, + "404": { + "description": "", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/OpenId4VcIssuanceSessionRecord" + "properties": { + "reason": { + "type": "string" + } + }, + "required": [ + "reason" + ], + "type": "object" } } } - } - }, - "description": "Update issuance session metadata by session ID", - "tags": [ - "oid4vc issuance sessions" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [ - { - "in": "path", - "name": "issuanceSessionId", - "required": true, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Record_string.unknown_" + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" + } } } } - } - }, - "delete": { - "operationId": "DeleteIssuanceSessionById", - "responses": { - "204": { - "description": "No content" - } }, - "description": "Delete issuance session by session ID", "tags": [ - "oid4vc issuance sessions" + "MultiTenancy" ], "security": [ { "jwt": [ - "tenant", - "dedicated" + "Basewallet" ] } ], "parameters": [ { "in": "path", - "name": "issuanceSessionId", + "name": "tenantId", "required": true, "schema": { "type": "string" @@ -5428,27 +6878,25 @@ ] } }, - "/openid4vc/issuance-sessions": { + "/didcomm/question-answer": { "get": { - "operationId": "GetIssuanceSessionsByQuery", + "operationId": "GetQuestionAnswerRecords", "responses": { "200": { - "description": "Ok", + "description": "QuestionAnswerRecord[]", "content": { "application/json": { "schema": { - "items": { - "$ref": "#/components/schemas/OpenId4VcIssuanceSessionRecord" - }, + "items": {}, "type": "array" } } } } }, - "description": "Fetch all issuance sessions by query", + "description": "Retrieve question and answer records by query", "tags": [ - "oid4vc issuance sessions" + "DIDComm - Question Answer" ], "security": [ { @@ -5460,48 +6908,36 @@ ], "parameters": [ { + "description": "Connection identifier", "in": "query", - "name": "cNonce", - "required": false, - "schema": { - "type": "string" - } - }, - { - "in": "query", - "name": "publicIssuerId", + "name": "connectionId", "required": false, "schema": { "type": "string" } }, { + "description": "Role of the question", "in": "query", - "name": "preAuthorizedCode", + "name": "role", "required": false, "schema": { - "type": "string" + "$ref": "#/components/schemas/QuestionAnswerRole" } }, { + "description": "State of the question", "in": "query", "name": "state", "required": false, "schema": { - "$ref": "#/components/schemas/OpenId4VcIssuanceSessionState" - } - }, - { - "in": "query", - "name": "credentialOfferUri", - "required": false, - "schema": { - "type": "string" + "$ref": "#/components/schemas/QuestionAnswerState" } }, { + "description": "Thread identifier", "in": "query", - "name": "authorizationCode", + "name": "threadId", "required": false, "schema": { "type": "string" @@ -5510,32 +6946,27 @@ ] } }, - "/openid4vc/issuance-sessions/{issuanceSessionId}/revoke": { + "/didcomm/question-answer/question/{connectionId}": { "post": { - "operationId": "RevokeSessionById", + "operationId": "SendQuestion", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "properties": { - "message": { - "type": "string" - } - }, - "required": [ - "message" - ], - "type": "object" + "$ref": "#/components/schemas/Record_string.unknown_" + }, + "examples": { + "Example 1": {} } } } } }, - "description": "Revoke credentials in an issuance session by session ID", + "description": "Send a question to a connection", "tags": [ - "oid4vc issuance sessions" + "DIDComm - Question Answer" ], "security": [ { @@ -5547,98 +6978,63 @@ ], "parameters": [ { + "description": "Connection identifier", "in": "path", - "name": "issuanceSessionId", + "name": "connectionId", "required": true, "schema": { - "type": "string" - } - } - ] - } - }, - "/openid4vc/holder/sd-jwt-vcs": { - "get": { - "operationId": "GetSdJwtCredentials", - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": { - "items": { - "$ref": "#/components/schemas/SdJwtVcRecord" - }, - "type": "array" - } - } + "$ref": "#/components/schemas/RecordId" } } - }, - "description": "Get SdJwt type of credentials", - "tags": [ - "oid4vc holders" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } ], - "parameters": [] - } - }, - "/openid4vc/holder/mdoc-vcs": { - "get": { - "operationId": "GetMdocCredentials", - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": { - "items": { - "$ref": "#/components/schemas/MdocRecord" + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "properties": { + "detail": { + "type": "string" }, - "type": "array" - } + "validResponses": { + "items": { + "$ref": "#/components/schemas/ValidResponse" + }, + "type": "array" + }, + "question": { + "type": "string" + } + }, + "required": [ + "validResponses", + "question" + ], + "type": "object" } } - } - }, - "description": "Fetch all mso mdoc credentials in wallet", - "tags": [ - "oid4vc holders" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [] + } + } } }, - "/openid4vc/holder/mdoc-vcs/decode": { + "/didcomm/question-answer/answer/{id}": { "post": { - "operationId": "DecodeMdocCredential", + "operationId": "SendAnswer", "responses": { "200": { "description": "Ok", "content": { "application/json": { - "schema": {} + "schema": { + "$ref": "#/components/schemas/Record_string.unknown_" + } } } } }, - "description": "Decode mso mdoc credential in wallet", + "description": "Send a answer to question", "tags": [ - "oid4vc holders" + "DIDComm - Question Answer" ], "security": [ { @@ -5648,43 +7044,47 @@ ] } ], - "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": { - "properties": { - "base64Url": { - "type": "string" - } - }, - "required": [ - "base64Url" - ], - "type": "object" + "$ref": "#/components/schemas/Record_response.string_" } } } } } }, - "/openid4vc/holder/resolve-credential-offer": { - "post": { - "operationId": "ResolveCredOffer", + "/didcomm/question-answer/{id}": { + "get": { + "operationId": "GetQuestionAnswerRecordById", "responses": { "200": { - "description": "Ok", + "description": "ConnectionRecord", "content": { "application/json": { - "schema": {} + "schema": { + "$ref": "#/components/schemas/Record_string.unknown_" + } } } } }, - "description": "Resolve a credential offer", + "description": "Retrieve question answer record by id", "tags": [ - "oid4vc holders" + "DIDComm - Question Answer" ], "security": [ { @@ -5694,34 +7094,81 @@ ] } ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ResolveCredentialOfferBody" - } + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "schema": { + "$ref": "#/components/schemas/RecordId" } } - } + ] } }, - "/openid4vc/holder/authorization-request": { - "post": { - "operationId": "RequestAuthorizationForCredential", + "/didcomm/oob": { + "get": { + "operationId": "GetAllOutOfBandRecords", "responses": { "200": { - "description": "Ok", + "description": "OutOfBandRecord[]", "content": { "application/json": { - "schema": {} + "schema": { + "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": [ - "oid4vc holders" + "DIDComm - Out Of Band" ], "security": [ { @@ -5731,35 +7178,79 @@ ] } ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AuthorizeRequestCredentialOffer" - } + "parameters": [ + { + "description": "invitation identifier", + "in": "query", + "name": "invitationId", + "required": false, + "schema": { + "$ref": "#/components/schemas/RecordId" } } - } + ] } }, - "/openid4vc/holder/request-credential": { - "post": { - "operationId": "RequestCredential", + "/didcomm/oob/{outOfBandId}": { + "get": { + "operationId": "GetOutOfBandRecordById", "responses": { "200": { - "description": "Ok", + "description": "OutOfBandRecord", "content": { "application/json": { - "schema": {} + "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": "Initiates a token request, then requests credentials from issuer", + "description": "Retrieve an out of band record by id", "tags": [ - "oid4vc holders" + "DIDComm - Out Of Band" ], "security": [ { @@ -5769,35 +7260,156 @@ ] } ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RequestCredentialBody" - } + "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" + } + } + ] } }, - "/openid4vc/holder/resolve-proof-request": { + "/didcomm/oob/create-invitation": { "post": { - "operationId": "ResolveProofRequest", + "operationId": "CreateInvitation", "responses": { "200": { - "description": "Ok", + "description": "Out of band record", "content": { "application/json": { - "schema": {} + "schema": { + "properties": { + "invitationDid": { + "type": "string" + }, + "outOfBandRecord": { + "$ref": "#/components/schemas/Record_string.unknown_" + }, + "invitation": { + "$ref": "#/components/schemas/DidCommPlaintextMessage" + }, + "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": "Resolve a proof request", + "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 holders" + "DIDComm - Out Of Band" ], "security": [ { @@ -5809,33 +7421,71 @@ ], "parameters": [], "requestBody": { + "description": "configuration of how out-of-band invitation should be created", "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ResolveProofRequest" + "allOf": [ + { + "$ref": "#/components/schemas/CreateInvitationOptions" + }, + { + "$ref": "#/components/schemas/RecipientKeyOption" + } + ], + "description": "configuration of how out-of-band invitation should be created" } } } } } }, - "/openid4vc/holder/accept-proof-request": { + "/didcomm/oob/create-legacy-connectionless-invitation": { "post": { - "operationId": "AcceptProofRequest", + "operationId": "CreateLegacyConnectionlessInvitation", "responses": { "200": { - "description": "Ok", + "description": "a message and a invitationUrl", "content": { "application/json": { - "schema": {} + "schema": { + "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": "Accept a proof request", + "description": "Creates a new connectionless legacy invitation.", "tags": [ - "oid4vc holders" + "DIDComm - Out Of Band" ], "security": [ { @@ -5847,72 +7497,127 @@ ], "parameters": [], "requestBody": { + "description": "configuration of how a connection invitation should be created", "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ResolveProofRequest" + "properties": { + "routing": { + "$ref": "#/components/schemas/DidCommRouting" + }, + "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" } } } } } }, - "/openid4vc/holder/decode-sdjwt": { + "/didcomm/oob/receive-invitation": { "post": { - "operationId": "DecodeSdJwt", + "operationId": "ReceiveInvitation", "responses": { "200": { - "description": "Ok", + "description": "out-of-band record and connection record if one has been created.", "content": { "application/json": { - "schema": {} - } - } - } - }, - "tags": [ - "oid4vc holders" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "properties": { - "jwt": { - "type": "string" + "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" + } + } } - }, - "required": [ - "jwt" - ], - "type": "object" + } } } } - } - } - }, - "/openid4vc/holder/credential": { - "delete": { - "operationId": "Delete", - "responses": { - "204": { - "description": "No content" - } }, + "description": "Creates inbound out-of-band record and assigns out-of-band invitation message to it if the\nmessage is valid.", "tags": [ - "oid4vc holders" + "DIDComm - Out Of Band" ], "security": [ { @@ -5928,78 +7633,108 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DeleteCredentialBody" + "$ref": "#/components/schemas/ReceiveInvitationProps" } } } } } }, - "/multi-tenancy/create-tenant": { + "/didcomm/oob/receive-invitation-url": { "post": { - "operationId": "CreateTenant", + "operationId": "ReceiveInvitationFromUrl", "responses": { "200": { - "description": "Ok", + "description": "out-of-band record and connection record if one has been created.", "content": { "application/json": { "schema": { "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" + "connectionRecord": { + "$ref": "#/components/schemas/Record_string.unknown_" }, - "type": { - "type": "string", - "enum": [ - "TenantRecord" - ], - "nullable": false + "outOfBandRecord": { + "$ref": "#/components/schemas/Record_string.unknown_" } }, "required": [ - "token", - "metadata", - "allowCache", - "createdAt", - "id", - "storageVersion", - "config", - "type" + "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": [ - "MultiTenancy" + "DIDComm - Out Of Band" ], "security": [ { "jwt": [ - "Basewallet" + "tenant", + "dedicated" ] } ], @@ -6009,217 +7744,234 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateTenantOptions" + "$ref": "#/components/schemas/ReceiveInvitationByUrlProps" } } } } } }, - "/multi-tenancy/get-token/{tenantId}": { + "/didcomm/oob/{outOfBandId}/accept-invitation": { "post": { - "operationId": "GetTenantToken", + "operationId": "AcceptInvitation", "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" + "connectionRecord": { + "$ref": "#/components/schemas/Record_string.unknown_" + }, + "outOfBandRecord": { + "$ref": "#/components/schemas/Record_string.unknown_" } }, "required": [ - "message" + "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": [ - "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" } } - ] + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AcceptInvitationConfig" + } + } + } + } } }, - "/multi-tenancy/{tenantId}": { + "/didcomm/connections": { "get": { - "operationId": "GetTenantById", + "operationId": "GetAllConnections", "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": "ConnectionRecord[]", "content": { "application/json": { "schema": { - "properties": { - "message": { - "type": "string" - } + "items": { + "$ref": "#/components/schemas/Record_string.unknown_" }, - "required": [ - "message" - ], - "type": "object" + "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": [ - "MultiTenancy" + "DIDComm - Connections" ], "security": [ { "jwt": [ - "Basewallet" + "tenant", + "dedicated" ] } ], "parameters": [ { - "in": "path", - "name": "tenantId", - "required": true, + "in": "query", + "name": "outOfBandId", + "required": false, "schema": { "type": "string" } - } - ] - }, - "delete": { - "operationId": "DeleteTenantById", - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": {} - } + }, + { + "description": "Alias", + "in": "query", + "name": "alias", + "required": false, + "schema": { + "type": "string" } }, - "404": { - "description": "", - "content": { - "application/json": { - "schema": { - "properties": { - "reason": { - "type": "string" - } - }, - "required": [ - "reason" - ], - "type": "object" - } - } + { + "description": "Connection state", + "in": "query", + "name": "state", + "required": false, + "schema": { + "$ref": "#/components/schemas/DidCommDidExchangeState" } }, - "500": { - "description": "", - "content": { - "application/json": { - "schema": { - "properties": { - "message": { - "type": "string" - } - }, - "required": [ - "message" - ], - "type": "object" - } - } + { + "description": "My DID", + "in": "query", + "name": "myDid", + "required": false, + "schema": { + "type": "string" } - } - }, - "tags": [ - "MultiTenancy" - ], - "security": [ + }, { - "jwt": [ - "Basewallet" - ] - } - ], - "parameters": [ + "description": "Their DID", + "in": "query", + "name": "theirDid", + "required": false, + "schema": { + "type": "string" + } + }, { - "in": "path", - "name": "tenantId", - "required": true, + "description": "Their label", + "in": "query", + "name": "theirLabel", + "required": false, "schema": { "type": "string" } @@ -6227,25 +7979,43 @@ ] } }, - "/didcomm/question-answer": { + "/didcomm/connections/{connectionId}": { "get": { - "operationId": "GetQuestionAnswerRecords", + "operationId": "GetConnectionById", "responses": { "200": { - "description": "QuestionAnswerRecord[]", + "description": "ConnectionRecord", "content": { "application/json": { "schema": { - "items": {}, - "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": "Retrieve question and answer records by query", + "description": "Retrieve connection record by connection id", "tags": [ - "DIDComm - Question Answer" + "DIDComm - Connections" ], "security": [ { @@ -6258,64 +8028,84 @@ "parameters": [ { "description": "Connection identifier", - "in": "query", + "in": "path", "name": "connectionId", - "required": false, - "schema": { - "type": "string" - } - }, - { - "description": "Role of the question", - "in": "query", - "name": "role", - "required": false, + "required": true, "schema": { - "$ref": "#/components/schemas/QuestionAnswerRole" + "$ref": "#/components/schemas/RecordId" } - }, + } + ] + }, + "delete": { + "operationId": "DeleteConnection", + "responses": { + "204": { + "description": "No content" + } + }, + "description": "Deletes a connection record from the connection repository.", + "tags": [ + "DIDComm - Connections" + ], + "security": [ { - "description": "State of the question", - "in": "query", - "name": "state", - "required": false, - "schema": { - "$ref": "#/components/schemas/QuestionAnswerState" - } - }, + "jwt": [ + "tenant", + "dedicated" + ] + } + ], + "parameters": [ { - "description": "Thread identifier", - "in": "query", - "name": "threadId", - "required": false, + "description": "Connection identifier", + "in": "path", + "name": "connectionId", + "required": true, "schema": { - "type": "string" + "$ref": "#/components/schemas/RecordId" } } ] } }, - "/didcomm/question-answer/question/{connectionId}": { + "/didcomm/connections/{connectionId}/accept-request": { "post": { - "operationId": "SendQuestion", + "operationId": "AcceptRequest", "responses": { "200": { - "description": "Ok", + "description": "ConnectionRecord", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Record_string.unknown_" }, "examples": { - "Example 1": {} + "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": "Send a question to a connection", + "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 - Question Answer" + "DIDComm - Connections" ], "security": [ { @@ -6335,55 +8125,46 @@ "$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}": { + "/didcomm/connections/{connectionId}/accept-response": { "post": { - "operationId": "SendAnswer", + "operationId": "AcceptResponse", "responses": { "200": { - "description": "Ok", + "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" + } + } } } } } }, - "description": "Send a answer to question", + "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 - Question Answer" + "DIDComm - Connections" ], "security": [ { @@ -6395,129 +8176,130 @@ ], "parameters": [ { - "description": "The id of the question answer record", + "description": "Connection identifier", "in": "path", - "name": "id", + "name": "connectionId", "required": true, "schema": { "$ref": "#/components/schemas/RecordId" } } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Record_response.string_" - } - } - } - } + ] } }, - "/didcomm/question-answer/{id}": { + "/didcomm/url/{invitationId}": { "get": { - "operationId": "GetQuestionAnswerRecordById", + "operationId": "GetInvitation", "responses": { "200": { - "description": "ConnectionRecord", + "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Record_string.unknown_" + "items": { + "$ref": "#/components/schemas/DidCommConnectionRecord" + }, + "type": "array" } } } } }, - "description": "Retrieve question answer record by id", "tags": [ - "DIDComm - Question Answer" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } + "DIDComm - Connections" ], + "security": [], "parameters": [ { "in": "path", - "name": "id", + "name": "invitationId", "required": true, "schema": { - "$ref": "#/components/schemas/RecordId" + "type": "string" } } ] } }, - "/didcomm/oob": { + "/dids/{did}": { "get": { - "operationId": "GetAllOutOfBandRecords", + "operationId": "GetDidRecordByDid", "responses": { "200": { - "description": "OutOfBandRecord[]", + "description": "Ok", "content": { "application/json": { "schema": { - "items": {}, - "type": "array" + "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": [ - { - "_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 + "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": "Retrieve all out of band records", "tags": [ - "DIDComm - Out Of Band" + "Dids" ], "security": [ { @@ -6529,67 +8311,47 @@ ], "parameters": [ { - "description": "invitation identifier", - "in": "query", - "name": "invitationId", - "required": false, + "in": "path", + "name": "did", + "required": true, "schema": { - "$ref": "#/components/schemas/RecordId" + "$ref": "#/components/schemas/Did" } } ] } }, - "/didcomm/oob/{outOfBandId}": { - "get": { - "operationId": "GetOutOfBandRecordById", + "/dids/write": { + "post": { + "operationId": "WriteDid", "responses": { "200": { - "description": "OutOfBandRecord", + "description": "DidResolutionResult", "content": { "application/json": { - "schema": { - "$ref": "#/components/schemas/Record_string.unknown_" - }, + "schema": {}, "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" + "did": "did:indy:bcovrin:testnet:LRCUFcizUL74AGgLqdJHK7", + "didDocument": { + "@context": [ + "https://w3id.org/did/v1", + "https://w3id.org/security/suites/ed25519-2018/v1" ], - "services": [ + "id": "did:indy:bcovrin:testnet:LRCUFcizUL74AGgLqdJHK7", + "verificationMethod": [ { - "id": "#inline-0", - "serviceEndpoint": "https://6b77-89-20-162-146.ngrok.io", - "type": "did-communication", - "recipientKeys": [ - "did:key:z6MkmTBHTWrvLPN8pBmUj7Ye5ww9GiacXCYMNVvpScSpf1DM" - ], - "routingKeys": [] + "id": "did:indy:bcovrin:testnet:LRCUFcizUL74AGgLqdJHK7#verkey", + "type": "Ed25519VerificationKey2018", + "controller": "did:indy:bcovrin:testnet:LRCUFcizUL74AGgLqdJHK7", + "publicKeyBase58": "BapLDK4dEY88vWcQgNbpAPVVP4r3CHs4MvShmmhqkxXM" } + ], + "authentication": [ + "did:indy:bcovrin:testnet:LRCUFcizUL74AGgLqdJHK7#verkey" ] - }, - "metadata": {}, - "id": "42a95528-0e30-4f86-a462-0efb02178b53", - "createdAt": "2022-01-01T00:00:00.000Z", - "reusable": false + } } } } @@ -6597,9 +8359,9 @@ } } }, - "description": "Retrieve an out of band record by id", + "description": "Did nym registration", "tags": [ - "DIDComm - Out Of Band" + "Dids" ], "security": [ { @@ -6609,27 +8371,39 @@ ] } ], - "parameters": [ - { - "in": "path", - "name": "outOfBandId", - "required": true, - "schema": { - "$ref": "#/components/schemas/RecordId" + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DidCreate" + } } } - ] - }, - "delete": { - "operationId": "DeleteOutOfBandRecord", + } + } + }, + "/dids": { + "get": { + "operationId": "GetDids", "responses": { - "204": { - "description": "No content" + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/DidRecord" + }, + "type": "array" + } + } + } } }, - "description": "Deletes an out of band record from the repository.", "tags": [ - "DIDComm - Out Of Band" + "Dids" ], "security": [ { @@ -6639,126 +8413,126 @@ ] } ], - "parameters": [ - { - "description": "Record identifier", - "in": "path", - "name": "outOfBandId", - "required": true, - "schema": { - "$ref": "#/components/schemas/RecordId" - } - } - ] + "parameters": [] } }, - "/didcomm/oob/create-invitation": { + "/v1/orgs/{orgId}/token": { "post": { - "operationId": "CreateInvitation", + "operationId": "GetOrgToken", "responses": { "200": { - "description": "Out of band record", + "description": "Ok", "content": { "application/json": { "schema": { - "properties": { - "invitationDid": { - "type": "string" - }, - "outOfBandRecord": { - "$ref": "#/components/schemas/Record_string.unknown_" - }, - "invitation": { - "$ref": "#/components/schemas/DidCommPlaintextMessage" - }, - "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 - } - } - } + "$ref": "#/components/schemas/OrgTokenResponse" + } + } + } + } + }, + "description": "Generate an organization token by forwarding credentials to the platform", + "tags": [ + "Auth" + ], + "security": [], + "parameters": [ + { + "in": "path", + "name": "orgId", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OrgTokenRequest" + } + } + } + } + } + }, + "/agent": { + "get": { + "operationId": "GetAgentInfo", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AgentInfo" } } } } }, - "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.", + "description": "Retrieve basic agent information", "tags": [ - "DIDComm - Out Of Band" + "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/credential/verify": { + "post": { + "operationId": "VerifyCredential", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/W3cVerifyCredentialResult" + } + } + } + } + }, + "tags": [ + "Agent" ], "security": [ { @@ -6770,61 +8544,44 @@ ], "parameters": [], "requestBody": { - "description": "configuration of how out-of-band invitation should be created", "required": true, "content": { "application/json": { "schema": { - "allOf": [ + "anyOf": [ { - "$ref": "#/components/schemas/CreateInvitationOptions" + "$ref": "#/components/schemas/SafeW3cJsonLdVerifyCredentialOptions" }, - { - "$ref": "#/components/schemas/RecipientKeyOption" - } - ], - "description": "configuration of how out-of-band invitation should be created" + {} + ] } } } } } }, - "/didcomm/oob/create-legacy-connectionless-invitation": { - "post": { - "operationId": "CreateLegacyConnectionlessInvitation", + "/anoncreds/schemas/{schemaId}": { + "get": { + "operationId": "GetSchemaById", "responses": { "200": { - "description": "a message and a invitationUrl", + "description": "get schema by Id", "content": { "application/json": { "schema": { - "properties": { - "outOfBandRecord": { - "$ref": "#/components/schemas/DidCommOutOfBandRecord" - }, - "invitationUrl": { - "type": "string" - }, - "message": { - "$ref": "#/components/schemas/DidCommMessage" - } - }, - "required": [ - "outOfBandRecord", - "invitationUrl", - "message" - ], - "type": "object" + "$ref": "#/components/schemas/SchemaResponseDTO" }, "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" + "ver": "1.0", + "id": "WgWxqztrNooG92RXvxSTWv:2:schema_name:1.0", + "name": "schema", + "version": "1.0", + "attrNames": [ + "string" + ], + "seqNo": 351936 } } } @@ -6832,9 +8589,9 @@ } } }, - "description": "Creates a new connectionless legacy invitation.", + "description": "Get schema by schemaId", "tags": [ - "DIDComm - Out Of Band" + "Anoncreds - Schemas" ], "security": [ { @@ -6844,119 +8601,50 @@ ] } ], - "parameters": [], - "requestBody": { - "description": "configuration of how a connection invitation should be created", - "required": true, - "content": { - "application/json": { - "schema": { - "properties": { - "routing": { - "$ref": "#/components/schemas/DidCommRouting" - }, - "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" - } + "parameters": [ + { + "in": "path", + "name": "schemaId", + "required": true, + "schema": { + "$ref": "#/components/schemas/SchemaId" } } - } + ] } }, - "/didcomm/oob/receive-invitation": { + "/anoncreds/schemas": { "post": { - "operationId": "ReceiveInvitation", + "operationId": "CreateSchema", "responses": { "200": { - "description": "out-of-band record and connection record if one has been created.", + "description": "get schema", "content": { "application/json": { "schema": { - "properties": { - "connectionRecord": { - "$ref": "#/components/schemas/Record_string.unknown_" + "anyOf": [ + { + "$ref": "#/components/schemas/RegisterSchemaReturn" }, - "outOfBandRecord": { - "$ref": "#/components/schemas/Record_string.unknown_" + { + "$ref": "#/components/schemas/RegisterSchemaReturnStateFinished" } - }, - "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" - } + "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" } } } @@ -6964,9 +8652,9 @@ } } }, - "description": "Creates inbound out-of-band record and assigns out-of-band invitation message to it if the\nmessage is valid.", + "description": "Create schema", "tags": [ - "DIDComm - Out Of Band" + "Anoncreds - Schemas" ], "security": [ { @@ -6982,91 +8670,56 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ReceiveInvitationProps" + "$ref": "#/components/schemas/CreateSchemaInput" } } } } } }, - "/didcomm/oob/receive-invitation-url": { - "post": { - "operationId": "ReceiveInvitationFromUrl", + "/anoncreds/credential-definitions/{credentialDefinitionId}": { + "get": { + "operationId": "GetCredentialDefinitionById", "responses": { "200": { - "description": "out-of-band record and connection record if one has been created.", + "description": "CredDef", "content": { "application/json": { "schema": { - "properties": { - "connectionRecord": { - "$ref": "#/components/schemas/Record_string.unknown_" - }, - "outOfBandRecord": { - "$ref": "#/components/schemas/Record_string.unknown_" - } - }, - "required": [ - "connectionRecord", - "outOfBandRecord" - ], - "type": "object" + "$ref": "#/components/schemas/GetCredentialDefinitionReturn" }, "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" + "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" }, - "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" + "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" + } } } } @@ -7075,9 +8728,9 @@ } } }, - "description": "Creates inbound out-of-band record and assigns out-of-band invitation message to it if the\nmessage is valid.", + "description": "Retrieve credential definition by credential definition id", "tags": [ - "DIDComm - Out Of Band" + "Anoncreds - Credential Definitions" ], "security": [ { @@ -7087,145 +8740,132 @@ ] } ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ReceiveInvitationByUrlProps" - } + "parameters": [ + { + "in": "path", + "name": "credentialDefinitionId", + "required": true, + "schema": { + "$ref": "#/components/schemas/CredentialDefinitionId" } } - } + ] } }, - "/didcomm/oob/{outOfBandId}/accept-invitation": { + "/anoncreds/credential-definitions": { "post": { - "operationId": "AcceptInvitation", + "operationId": "CreateCredentialDefinition", "responses": { "200": { - "description": "Ok", + "description": "CredDef", "content": { "application/json": { "schema": { - "properties": { - "connectionRecord": { - "$ref": "#/components/schemas/Record_string.unknown_" + "anyOf": [ + { + "$ref": "#/components/schemas/RegisterCredentialDefinitionReturn" }, - "outOfBandRecord": { - "$ref": "#/components/schemas/Record_string.unknown_" + { + "$ref": "#/components/schemas/CredentialDefinitionStates" } - }, - "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" + "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" }, - "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" + "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": "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.", + "description": "Creates a new credential definition.", "tags": [ - "DIDComm - Out Of Band" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [ - { - "in": "path", - "name": "outOfBandId", - "required": true, - "schema": { - "$ref": "#/components/schemas/RecordId" - } + "Anoncreds - Credential Definitions" + ], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] } ], + "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AcceptInvitationConfig" + "properties": { + "endorserDid": { + "type": "string" + }, + "endorse": { + "type": "boolean" + }, + "tag": { + "type": "string" + }, + "schemaId": { + "$ref": "#/components/schemas/SchemaId" + }, + "issuerId": { + "type": "string" + } + }, + "required": [ + "tag", + "schemaId", + "issuerId" + ], + "type": "object" } } } } } }, - "/didcomm/connections": { + "/didcomm/credentials": { "get": { - "operationId": "GetAllConnections", + "operationId": "GetAllCredentials", "responses": { "200": { - "description": "ConnectionRecord[]", + "description": "CredentialExchangeRecord[]", "content": { "application/json": { "schema": { @@ -7239,18 +8879,23 @@ "value": [ { "_tags": { - "invitationDid": "did:peer:2.SeyJzIjoiaHR0cHM6Ly9kYTIzLTg5LTIwLTE2Mi0xNDYubmdyb2suaW8iLCJ0IjoiZGlkLWNvbW11bmljYXRpb24iLCJwcmlvcml0eSI6MCwicmVjaXBpZW50S2V5cyI6WyJkaWQ6a2V5Ono2TWtualg3U1lXRmdHMThCYkNEZHJnemhuQnA0UlhyOGVITHZxQ3FvRXllckxiTiN6Nk1rbmpYN1NZV0ZnRzE4QmJDRGRyZ3pobkJwNFJYcjhlSEx2cUNxb0V5ZXJMYk4iXSwiciI6W119", - "did": "did:peer:1zQmfQh1T3rSqarP2FZ37uKjdQHPKFdVyo2mGiAPHZ8Ep7hv", - "invitationKey": "9HG4rJFpLiWf56MWxHj9rgdpErFzim2zEpHuxy1dw7oz", - "outOfBandId": "edbc89fe-785f-4774-a288-46012486881d", - "verkey": "9HG4rJFpLiWf56MWxHj9rgdpErFzim2zEpHuxy1dw7oz" + "state": "offer-sent", + "threadId": "82701488-b43c-4d7b-9244-4bb204a7ae26", + "connectionId": "ac6d0fdd-0db8-4f52-8a3d-de7ff8ddc14b" }, - "metadata": {}, + "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", - "did": "did:peer:1zQmfQh1T3rSqarP2FZ37uKjdQHPKFdVyo2mGiAPHZ8Ep7hv", - "invitationDid": "did:peer:2.SeyJzIjoiaHR0cHM6Ly9kYTIzLTg5LTIwLTE2Mi0xNDYubmdyb2suaW8iLCJ0IjoiZGlkLWNvbW11bmljYXRpb24iLCJwcmlvcml0eSI6MCwicmVjaXBpZW50S2V5cyI6WyJkaWQ6a2V5Ono2TWtualg3U1lXRmdHMThCYkNEZHJnemhuQnA0UlhyOGVITHZxQ3FvRXllckxiTiN6Nk1rbmpYN1NZV0ZnRzE4QmJDRGRyZ3pobkJwNFJYcjhlSEx2cUNxb0V5ZXJMYk4iXSwiciI6W119", - "outOfBandId": "edbc89fe-785f-4774-a288-46012486881d" + "connectionId": "ac6d0fdd-0db8-4f52-8a3d-de7ff8ddc14b", + "threadId": "82701488-b43c-4d7b-9244-4bb204a7ae26", + "credentialAttributes": [], + "protocolVersion": "v1" } ] } @@ -7259,9 +8904,9 @@ } } }, - "description": "Retrieve all connections records", + "description": "Retrieve all credential exchange records", "tags": [ - "DIDComm - Connections" + "DIDComm - Credentials" ], "security": [ { @@ -7274,246 +8919,67 @@ "parameters": [ { "in": "query", - "name": "outOfBandId", - "required": false, - "schema": { - "type": "string" - } - }, - { - "description": "Alias", - "in": "query", - "name": "alias", + "name": "threadId", "required": false, "schema": { - "type": "string" + "$ref": "#/components/schemas/ThreadId" } }, { - "description": "Connection state", "in": "query", - "name": "state", + "name": "parentThreadId", "required": false, "schema": { - "$ref": "#/components/schemas/DidCommDidExchangeState" + "$ref": "#/components/schemas/ThreadId" } }, { - "description": "My DID", "in": "query", - "name": "myDid", + "name": "connectionId", "required": false, "schema": { - "type": "string" + "$ref": "#/components/schemas/RecordId" } }, { - "description": "Their DID", "in": "query", - "name": "theirDid", + "name": "state", "required": false, "schema": { - "type": "string" + "$ref": "#/components/schemas/DidCommCredentialState" } }, { - "description": "Their label", "in": "query", - "name": "theirLabel", + "name": "role", "required": false, "schema": { - "type": "string" - } - } - ] - } - }, - "/didcomm/connections/{connectionId}": { - "get": { - "operationId": "GetConnectionById", - "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" - } - } - } - } - } - } - }, - "description": "Retrieve connection record by connection id", - "tags": [ - "DIDComm - Connections" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [ - { - "description": "Connection identifier", - "in": "path", - "name": "connectionId", - "required": true, - "schema": { - "$ref": "#/components/schemas/RecordId" - } - } - ] - }, - "delete": { - "operationId": "DeleteConnection", - "responses": { - "204": { - "description": "No content" - } - }, - "description": "Deletes a connection record from the connection repository.", - "tags": [ - "DIDComm - Connections" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [ - { - "description": "Connection identifier", - "in": "path", - "name": "connectionId", - "required": true, - "schema": { - "$ref": "#/components/schemas/RecordId" - } - } - ] - } - }, - "/didcomm/connections/{connectionId}/accept-request": { - "post": { - "operationId": "AcceptRequest", - "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" - } - } - } - } - } - } - }, - "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" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [ - { - "description": "Connection identifier", - "in": "path", - "name": "connectionId", - "required": true, - "schema": { - "$ref": "#/components/schemas/RecordId" + "$ref": "#/components/schemas/DidCommCredentialRole" } } ] - } - }, - "/didcomm/connections/{connectionId}/accept-response": { - "post": { - "operationId": "AcceptResponse", - "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" - } - } + } + }, + "/didcomm/credentials/w3c": { + "get": { + "operationId": "GetAllW3c", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/W3cCredentialRecord" + }, + "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" + "DIDComm - Credentials" ], "security": [ { @@ -7523,45 +8989,39 @@ ] } ], - "parameters": [ - { - "description": "Connection identifier", - "in": "path", - "name": "connectionId", - "required": true, - "schema": { - "$ref": "#/components/schemas/RecordId" - } - } - ] + "parameters": [] } }, - "/didcomm/url/{invitationId}": { + "/didcomm/credentials/w3c/{id}": { "get": { - "operationId": "GetInvitation", + "operationId": "GetW3cById", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "items": { - "$ref": "#/components/schemas/DidCommConnectionRecord" - }, - "type": "array" + "$ref": "#/components/schemas/W3cCredentialRecord" } } } } }, "tags": [ - "DIDComm - Connections" + "DIDComm - Credentials" + ], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } ], - "security": [], "parameters": [ { "in": "path", - "name": "invitationId", + "name": "id", "required": true, "schema": { "type": "string" @@ -7570,76 +9030,38 @@ ] } }, - "/dids/{did}": { + "/didcomm/credentials/{credentialRecordId}": { "get": { - "operationId": "GetDidRecordByDid", + "operationId": "GetCredentialById", "responses": { "200": { - "description": "Ok", + "description": "CredentialExchangeRecord", "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" + "$ref": "#/components/schemas/Record_string.unknown_" }, "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" - } - ] + "_tags": { + "state": "offer-sent", + "threadId": "82701488-b43c-4d7b-9244-4bb204a7ae26", + "connectionId": "ac6d0fdd-0db8-4f52-8a3d-de7ff8ddc14b" }, - "didDocumentMetadata": {}, - "didResolutionMetadata": { - "contentType": "application/did+ld+json" - } + "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" } } } @@ -7647,8 +9069,9 @@ } } }, + "description": "Retrieve credential exchange record by credential record id", "tags": [ - "Dids" + "DIDComm - Credentials" ], "security": [ { @@ -7661,46 +9084,47 @@ "parameters": [ { "in": "path", - "name": "did", + "name": "credentialRecordId", "required": true, "schema": { - "$ref": "#/components/schemas/Did" + "$ref": "#/components/schemas/RecordId" } } ] } }, - "/dids/write": { + "/didcomm/credentials/propose-credential": { "post": { - "operationId": "WriteDid", + "operationId": "ProposeCredential", "responses": { "200": { - "description": "DidResolutionResult", + "description": "CredentialExchangeRecord", "content": { "application/json": { - "schema": {}, + "schema": { + "$ref": "#/components/schemas/DidCommCredentialExchangeRecord" + }, "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" - ] - } + "_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" } } } @@ -7708,9 +9132,9 @@ } } }, - "description": "Did nym registration", + "description": "Initiate a new credential exchange as holder by sending a propose credential message\nto the connection with a specified connection id.", "tags": [ - "Dids" + "DIDComm - Credentials" ], "security": [ { @@ -7726,33 +9150,55 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DidCreate" + "$ref": "#/components/schemas/ProposeCredentialOptions" } } } } } }, - "/dids": { - "get": { - "operationId": "GetDids", + "/didcomm/credentials/accept-proposal": { + "post": { + "operationId": "AcceptProposal", "responses": { "200": { - "description": "Ok", + "description": "CredentialExchangeRecord", "content": { "application/json": { "schema": { - "items": { - "$ref": "#/components/schemas/DidRecord" - }, - "type": "array" + "$ref": "#/components/schemas/DidCommCredentialExchangeRecord" + }, + "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": [ - "Dids" + "DIDComm - Credentials" ], "security": [ { @@ -7762,126 +9208,128 @@ ] } ], - "parameters": [] - } - }, - "/v1/orgs/{orgId}/token": { - "post": { - "operationId": "GetOrgToken", - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OrgTokenResponse" - } - } - } - } - }, - "description": "Generate an organization token by forwarding credentials to the platform", - "tags": [ - "Auth" - ], - "security": [], - "parameters": [ - { - "in": "path", - "name": "orgId", - "required": true, - "schema": { - "type": "string" - } - } - ], + "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/OrgTokenRequest" + "$ref": "#/components/schemas/AcceptCredentialProposalOptions" } } } } } }, - "/agent": { - "get": { - "operationId": "GetAgentInfo", + "/didcomm/credentials/create-offer": { + "post": { + "operationId": "CreateOffer", "responses": { "200": { - "description": "Ok", + "description": "AgentMessage, CredentialExchangeRecord", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AgentInfo" + "$ref": "#/components/schemas/DidCommCredentialExchangeRecord" + }, + "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 basic agent information", + "description": "Initiate a new credential exchange as issuer by creating a credential offer\nwithout specifying a connection id", "tags": [ - "Agent" + "DIDComm - Credentials" ], "security": [ { "jwt": [ "tenant", - "dedicated", - "Basewallet" + "dedicated" ] } ], - "parameters": [] - } - }, - "/agent/token": { - "post": { - "operationId": "GetAgentToken", - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AgentToken" - } + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateOfferOptions" } } } - }, - "description": "Retrieve agent token", - "tags": [ - "Agent" - ], - "security": [ - { - "apiKey": [] - } - ], - "parameters": [] + } } }, - "/agent/credential/verify": { + "/didcomm/credentials/create-offer-oob": { "post": { - "operationId": "VerifyCredential", + "operationId": "CreateOfferOob", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/W3cVerifyCredentialResult" + "properties": { + "invitationDid": { + "type": "string" + }, + "credentialRequestThId": { + "type": "string" + }, + "outOfBandRecordId": { + "type": "string" + }, + "outOfBandRecord": { + "$ref": "#/components/schemas/Record_string.unknown_" + }, + "invitation": { + "$ref": "#/components/schemas/DidCommPlaintextMessage" + }, + "invitationUrl": { + "type": "string" + } + }, + "required": [ + "invitationDid", + "credentialRequestThId", + "outOfBandRecordId", + "outOfBandRecord", + "invitation", + "invitationUrl" + ], + "type": "object" } } } } }, "tags": [ - "Agent" + "DIDComm - Credentials" ], "security": [ { @@ -7897,40 +9345,45 @@ "content": { "application/json": { "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/SafeW3cJsonLdVerifyCredentialOptions" - }, - {} - ] + "$ref": "#/components/schemas/CreateOfferOobOptions" } } } } } }, - "/anoncreds/schemas/{schemaId}": { - "get": { - "operationId": "GetSchemaById", + "/didcomm/credentials/accept-offer": { + "post": { + "operationId": "AcceptOffer", "responses": { "200": { - "description": "get schema by Id", + "description": "CredentialExchangeRecord", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SchemaResponseDTO" + "$ref": "#/components/schemas/DidCommCredentialExchangeRecord" }, "examples": { "Example 1": { "value": { - "ver": "1.0", - "id": "WgWxqztrNooG92RXvxSTWv:2:schema_name:1.0", - "name": "schema", - "version": "1.0", - "attrNames": [ - "string" - ], - "seqNo": 351936 + "_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" } } } @@ -7938,9 +9391,9 @@ } } }, - "description": "Get schema by schemaId", + "description": "Accept a credential offer as holder by sending an accept offer message\nto the connection associated with the credential exchange record.", "tags": [ - "Anoncreds - Schemas" + "DIDComm - Credentials" ], "security": [ { @@ -7950,50 +9403,51 @@ ] } ], - "parameters": [ - { - "in": "path", - "name": "schemaId", - "required": true, - "schema": { - "$ref": "#/components/schemas/SchemaId" + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CredentialOfferOptions" + } } } - ] + } } }, - "/anoncreds/schemas": { + "/didcomm/credentials/accept-request": { "post": { - "operationId": "CreateSchema", + "operationId": "AcceptRequest", "responses": { "200": { - "description": "get schema", + "description": "CredentialExchangeRecord", "content": { "application/json": { "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/RegisterSchemaReturn" - }, - { - "$ref": "#/components/schemas/RegisterSchemaReturnStateFinished" - } - ] + "$ref": "#/components/schemas/DidCommCredentialExchangeRecord" }, "examples": { "Example 1": { "value": { - "state": "finished", - "schema": { - "issuerId": "did:indy:bcovrin:testnet:LRCUFcizUL74AGgLqdJHK7", - "name": "Test Schema", - "version": "1.0.0", - "attrNames": [ - "Name", - "Age" - ] + "_tags": { + "state": "offer-sent", + "threadId": "82701488-b43c-4d7b-9244-4bb204a7ae26", + "connectionId": "ac6d0fdd-0db8-4f52-8a3d-de7ff8ddc14b" }, - "schemaId": "LRCUFcizUL74AGgLqdJHK7:2:Test Schema:1.0.0" + "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" } } } @@ -8001,9 +9455,9 @@ } } }, - "description": "Create schema", + "description": "Accept a credential request as issuer by sending an accept request message\nto the connection associated with the credential exchange record.", "tags": [ - "Anoncreds - Schemas" + "DIDComm - Credentials" ], "security": [ { @@ -8019,57 +9473,45 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateSchemaInput" + "$ref": "#/components/schemas/AcceptCredentialRequestOptions" } } } } } }, - "/anoncreds/credential-definitions/{credentialDefinitionId}": { - "get": { - "operationId": "GetCredentialDefinitionById", + "/didcomm/credentials/accept-credential": { + "post": { + "operationId": "AcceptCredential", "responses": { "200": { - "description": "CredDef", + "description": "CredentialExchangeRecord", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GetCredentialDefinitionReturn" + "$ref": "#/components/schemas/DidCommCredentialExchangeRecord" }, "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" + "_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" } } } @@ -8077,9 +9519,9 @@ } } }, - "description": "Retrieve credential definition by credential definition id", + "description": "Accept a credential as holder by sending an accept credential message\nto the connection associated with the credential exchange record.", "tags": [ - "Anoncreds - Credential Definitions" + "DIDComm - Credentials" ], "security": [ { @@ -8089,82 +9531,37 @@ ] } ], - "parameters": [ - { - "in": "path", - "name": "credentialDefinitionId", - "required": true, - "schema": { - "$ref": "#/components/schemas/CredentialDefinitionId" + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AcceptCredential" + } } } - ] + } } }, - "/anoncreds/credential-definitions": { - "post": { - "operationId": "CreateCredentialDefinition", + "/didcomm/credentials/{credentialRecordId}/form-data": { + "get": { + "operationId": "CredentialFormData", "responses": { "200": { - "description": "CredDef", + "description": "credentialRecord", "content": { "application/json": { "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/RegisterCredentialDefinitionReturn" - }, - { - "$ref": "#/components/schemas/CredentialDefinitionStates" - } - ] - }, - "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" - } - } - } - } + "$ref": "#/components/schemas/GetCredentialFormatDataReturn__40_LegacyIndyCredentialFormat-or-DidCommJsonLdCredentialFormat-or-AnonCredsDidCommCredentialFormat_41_-Array_" } } } - }, - "202": { - "description": "Wait for action to complete" } }, - "description": "Creates a new credential definition.", + "description": "Return credentialRecord", "tags": [ - "Anoncreds - Credential Definitions" + "DIDComm - Credentials" ], "security": [ { @@ -8174,39 +9571,16 @@ ] } ], - "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" - } + "parameters": [ + { + "in": "path", + "name": "credentialRecordId", + "required": true, + "schema": { + "type": "string" } } - } + ] } }, "/openid4vc/verifier": { diff --git a/yarn.lock b/yarn.lock index a77152d3..1f60614e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1252,40 +1252,42 @@ resolved "https://registry.yarnpkg.com/@humanwhocodes/retry/-/retry-0.4.3.tgz#c2b9d2e374ee62c586d3adbea87199b1d7a7a6ba" integrity sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ== -"@hyperledger/anoncreds-nodejs@0.3.1": - version "0.3.1" - resolved "https://registry.yarnpkg.com/@hyperledger/anoncreds-nodejs/-/anoncreds-nodejs-0.3.1.tgz#72777755c6debd6aacaeb41eaeb6e7a3f1570760" - integrity sha512-/oWmWgcOPqjAtd2+dKASPYL84Qd7sAFyCBfEKM7PAgVbObaZUZc0kqA7hkEz/qyiqUvcP/JwKTc1v4zVZi6BTg== +"@hyperledger/anoncreds-nodejs@^0.3.4": + version "0.3.4" + resolved "https://registry.yarnpkg.com/@hyperledger/anoncreds-nodejs/-/anoncreds-nodejs-0.3.4.tgz#8fb060a0d783c43129812f82b3c8b356a87928d6" + integrity sha512-im5hRRvICM3hoyoJb4RJ7Mape7wIjDR8Tk+g/tHcg9GSPcEsJi+fJdxaHb7WVneycdZXeF6xky8BZwnQD2+Baw== dependencies: "@2060.io/ffi-napi" "^4.0.9" "@2060.io/ref-napi" "^3.0.6" - "@hyperledger/anoncreds-shared" "0.3.1" + "@hyperledger/anoncreds-shared" "0.3.4" ref-array-di "1.2.2" ref-struct-di "1.1.1" -"@hyperledger/anoncreds-shared@0.3.1": - version "0.3.1" - resolved "https://registry.yarnpkg.com/@hyperledger/anoncreds-shared/-/anoncreds-shared-0.3.1.tgz#b227bc068c965ce6a6ce821b0a49832dd27c1461" - integrity sha512-pJNIMvineGpNsyEqsMR+tkRNy5+PQAnMkNgnefJlscCjVsTMqJnOtoNl18pk0LzjVKdGtwJtpg5N+lRx81hfAQ== +"@hyperledger/anoncreds-shared@0.3.4": + version "0.3.4" + resolved "https://registry.yarnpkg.com/@hyperledger/anoncreds-shared/-/anoncreds-shared-0.3.4.tgz#d6b62aa2720f3da8a8f7e79bd8cc167aeb5009cb" + integrity sha512-XRyX39yWjn+ymUxy+4BvE0gdRIkfTmHtj1A19aOE8gALaDIAMiBbe0HxO8dkM+iAUXntBtqRJEL87Kwcx6xd8g== dependencies: tar "^7.4.3" -"@hyperledger/indy-vdr-nodejs@0.2.2": - version "0.2.2" - resolved "https://registry.yarnpkg.com/@hyperledger/indy-vdr-nodejs/-/indy-vdr-nodejs-0.2.2.tgz#f1f5ed1b9c34103703882dbc6c10fe480d33b0e6" - integrity sha512-mc0iKuHCtKuOV0sMnGOTVWnQrpfBMS+1tIRyob+CvGCvwC2llGo3Hu5AvgPcR9nqCo/wJ0LoKBo66dYYb0uZbw== +"@hyperledger/indy-vdr-nodejs@^0.2.3": + version "0.2.4" + resolved "https://registry.yarnpkg.com/@hyperledger/indy-vdr-nodejs/-/indy-vdr-nodejs-0.2.4.tgz#ff4be94dbdcfdc6c391f05f8ab06e787a5024c41" + integrity sha512-oJgzj4XGsPWHtkszdQpwSisRbWMdNVnV0zB8Q68gWgWU2vODcevA9Ad/GwNQce2D2TbieYc1TJiFEnBIoN2MeQ== dependencies: "@2060.io/ffi-napi" "^4.0.9" "@2060.io/ref-napi" "^3.0.6" - "@hyperledger/indy-vdr-shared" "0.2.2" - "@mapbox/node-pre-gyp" "^1.0.10" + "@hyperledger/indy-vdr-shared" "0.2.4" + "@types/ref-array-di" "^1.2.8" ref-array-di "^1.2.2" ref-struct-di "^1.1.1" -"@hyperledger/indy-vdr-shared@0.2.2": - version "0.2.2" - resolved "https://registry.yarnpkg.com/@hyperledger/indy-vdr-shared/-/indy-vdr-shared-0.2.2.tgz#9ca8b56cd89ab18792d129a0358b641e211274e3" - integrity sha512-9425MHU3K+/ahccCRjOIX3Z/51gqxvp3Nmyujyqlx9cd7PWG2Rianx7iNWecFBkdAEqS0DfHsb6YqqH39YZp/A== +"@hyperledger/indy-vdr-shared@0.2.4": + version "0.2.4" + resolved "https://registry.yarnpkg.com/@hyperledger/indy-vdr-shared/-/indy-vdr-shared-0.2.4.tgz#4290877cf751a55430160ef95c886bcc9d309e44" + integrity sha512-4+Yv7m6h79ov6WxkaSprd3uoPM6HjaZXAjtYgrG4N1pBMPbxsUy9ZRmmngwvRxlyT8R8p2EBh8kDG5rDIxfHFw== + dependencies: + tar "^7.4.3" "@isaacs/cliui@^8.0.2": version "8.0.2" @@ -1571,21 +1573,6 @@ resolved "https://registry.yarnpkg.com/@js-sdsl/ordered-map/-/ordered-map-4.4.2.tgz#9299f82874bab9e4c7f9c48d865becbfe8d6907c" integrity sha512-iUKgm52T8HOE/makSxjqoWhe95ZJA1/G1sYsGev2JDKUSS14KAgg1LHb+Ba+IPow0xflbnSkOsZcO08C7w1gYw== -"@mapbox/node-pre-gyp@^1.0.10": - version "1.0.11" - resolved "https://registry.yarnpkg.com/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.11.tgz#417db42b7f5323d79e93b34a6d7a2a12c0df43fa" - integrity sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ== - dependencies: - detect-libc "^2.0.0" - https-proxy-agent "^5.0.0" - make-dir "^3.1.0" - node-fetch "^2.6.7" - nopt "^5.0.0" - npmlog "^5.0.1" - rimraf "^3.0.2" - semver "^7.3.5" - tar "^6.1.11" - "@multiformats/base-x@^4.0.1": version "4.0.1" resolved "https://registry.yarnpkg.com/@multiformats/base-x/-/base-x-4.0.1.tgz#95ff0fa58711789d53aefb2590a8b7a4e715d121" @@ -3130,11 +3117,6 @@ resolved "https://registry.yarnpkg.com/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz#e77a97fbd345b76d83245edcd17d393b1b41fb31" integrity sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ== -abbrev@1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" - integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== - accepts@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/accepts/-/accepts-2.0.0.tgz#bbcf4ba5075467f3f2131eab3cffc73c2f5d7895" @@ -3183,13 +3165,6 @@ aes-js@4.0.0-beta.5: resolved "https://registry.yarnpkg.com/aes-js/-/aes-js-4.0.0-beta.5.tgz#8d2452c52adedebc3a3e28465d858c11ca315873" integrity sha512-G965FqalsNyrPqgEGON7nIx1e/OVENSgiEIzyC63haUMuvNnwIgIjMs52hlTCKhkBny7A2ORNlfY9Zu+jmGk1Q== -agent-base@6: - version "6.0.2" - resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77" - integrity sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ== - dependencies: - debug "4" - ajv-formats@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/ajv-formats/-/ajv-formats-2.1.1.tgz#6e669400659eb74973bbf2e33327180a0996b520" @@ -3259,19 +3234,6 @@ anymatch@^3.0.3, anymatch@~3.1.2: normalize-path "^3.0.0" picomatch "^2.0.4" -"aproba@^1.0.3 || ^2.0.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/aproba/-/aproba-2.1.0.tgz#75500a190313d95c64e871e7e4284c6ac219f0b1" - integrity sha512-tLIEcj5GuR2RSTnxNKdkK0dJ/GrC7P38sUkiDmDuHfsHmbagTFAxDVIBltoklXEVIQ/f14IL8IMJ5pn9Hez1Ew== - -are-we-there-yet@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz#372e0e7bd279d8e94c653aaa1f67200884bf3e1c" - integrity sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw== - dependencies: - delegates "^1.0.0" - readable-stream "^3.6.0" - arg@^4.1.0: version "4.1.3" resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089" @@ -3729,11 +3691,6 @@ chokidar@^3.5.1: optionalDependencies: fsevents "~2.3.2" -chownr@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/chownr/-/chownr-2.0.0.tgz#15bfbe53d2eab4cf70f18a8cd68ebe5b3cb1dece" - integrity sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ== - chownr@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/chownr/-/chownr-3.0.0.tgz#9855e64ecd240a9cc4267ce8a4aa5d24a1da15e4" @@ -3810,11 +3767,6 @@ color-name@~1.1.4: resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== -color-support@^1.1.2: - version "1.1.3" - resolved "https://registry.yarnpkg.com/color-support/-/color-support-1.1.3.tgz#93834379a1cc9a0c61f82f52f0d04322251bd5a2" - integrity sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg== - combined-stream@^1.0.8: version "1.0.8" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" @@ -3837,11 +3789,6 @@ concat-map@0.0.1: resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== -console-control-strings@^1.0.0, console-control-strings@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" - integrity sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ== - content-disposition@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-1.0.1.tgz#a8b7bbeb2904befdfb6787e5c0c086959f605f9b" @@ -3980,13 +3927,6 @@ debug@2.6.9, debug@^2.2.0: dependencies: ms "2.0.0" -debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.4, debug@^4.3.5, debug@^4.3.7, debug@^4.4.0, debug@^4.4.1, debug@^4.4.3: - version "4.4.3" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.4.3.tgz#c6ae432d9bd9662582fce08709b038c58e9e3d6a" - integrity sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA== - dependencies: - ms "^2.1.3" - debug@^3.1.0, debug@^3.2.7: version "3.2.7" resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a" @@ -3994,6 +3934,13 @@ debug@^3.1.0, debug@^3.2.7: dependencies: ms "^2.1.1" +debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.4, debug@^4.3.5, debug@^4.3.7, debug@^4.4.0, debug@^4.4.1, debug@^4.4.3: + version "4.4.3" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.4.3.tgz#c6ae432d9bd9662582fce08709b038c58e9e3d6a" + integrity sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA== + dependencies: + ms "^2.1.3" + decode-uri-component@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.4.1.tgz#2ac4859663c704be22bf7db760a1494a49ab2cc5" @@ -4049,11 +3996,6 @@ delayed-stream@~1.0.0: resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== -delegates@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" - integrity sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ== - depd@2.0.0, depd@^2.0.0, depd@~2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df" @@ -4064,11 +4006,6 @@ destroy@1.2.0, destroy@~1.2.0: resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.2.0.tgz#4803735509ad8be552934c67df614f94e66fa015" integrity sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg== -detect-libc@^2.0.0: - version "2.1.2" - resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-2.1.2.tgz#689c5dcdc1900ef5583a4cb9f6d7b473742074ad" - integrity sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ== - detect-newline@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-3.1.0.tgz#576f5dfc63ae1a192ff192d8ad3af6308991b651" @@ -4930,13 +4867,6 @@ fs-extra@^11.2.0: jsonfile "^6.0.1" universalify "^2.0.0" -fs-minipass@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-2.1.0.tgz#7f5036fdbf12c63c169190cbe4199c852271f9fb" - integrity sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg== - dependencies: - minipass "^3.0.0" - fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" @@ -4969,21 +4899,6 @@ functions-have-names@^1.2.3: resolved "https://registry.yarnpkg.com/functions-have-names/-/functions-have-names-1.2.3.tgz#0404fe4ee2ba2f607f0e0ec3c80bae994133b834" integrity sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ== -gauge@^3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/gauge/-/gauge-3.0.2.tgz#03bf4441c044383908bcfa0656ad91803259b395" - integrity sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q== - dependencies: - aproba "^1.0.3 || ^2.0.0" - color-support "^1.1.2" - console-control-strings "^1.0.0" - has-unicode "^2.0.1" - object-assign "^4.1.1" - signal-exit "^3.0.0" - string-width "^4.2.3" - strip-ansi "^6.0.1" - wide-align "^1.1.2" - generator-function@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/generator-function/-/generator-function-2.0.1.tgz#0e75dd410d1243687a0ba2e951b94eedb8f737a2" @@ -5199,11 +5114,6 @@ has-tostringtag@^1.0.2: dependencies: has-symbols "^1.0.3" -has-unicode@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" - integrity sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ== - hash.js@1.1.7, hash.js@^1.0.0, hash.js@^1.0.3: version "1.1.7" resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.7.tgz#0babca538e8d4ee4a0f8988d68866537a003cf42" @@ -5273,14 +5183,6 @@ http2-wrapper@^1.0.0-beta.5.2: quick-lru "^5.1.1" resolve-alpn "^1.0.0" -https-proxy-agent@^5.0.0: - version "5.0.1" - resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz#c59ef224a04fe8b754f3db0063a25ea30d0005d6" - integrity sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA== - dependencies: - agent-base "6" - debug "4" - human-signals@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0" @@ -6374,13 +6276,6 @@ luxon@^3.7.2: resolved "https://registry.yarnpkg.com/luxon/-/luxon-3.7.2.tgz#d697e48f478553cca187a0f8436aff468e3ba0ba" integrity sha512-vtEhXh/gNjI9Yg1u4jX/0YVPMvxzHuGgCm6tC5kZyb08yjGWGnqAjGJvcXbqQR2P3MyMEFnRbpcdFS6PBcLqew== -make-dir@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f" - integrity sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw== - dependencies: - semver "^6.0.0" - make-dir@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-4.0.0.tgz#c3c2307a771277cd9638305f915c29ae741b614e" @@ -6528,31 +6423,11 @@ minimist@^1.2.0, minimist@^1.2.5, minimist@^1.2.6: resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== -minipass@^3.0.0: - version "3.3.6" - resolved "https://registry.yarnpkg.com/minipass/-/minipass-3.3.6.tgz#7bba384db3a1520d18c9c0e5251c3444e95dd94a" - integrity sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw== - dependencies: - yallist "^4.0.0" - -minipass@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/minipass/-/minipass-5.0.0.tgz#3e9788ffb90b694a5d0ec94479a45b5d8738133d" - integrity sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ== - "minipass@^5.0.0 || ^6.0.2 || ^7.0.0", minipass@^7.0.4, minipass@^7.1.2: version "7.1.2" resolved "https://registry.yarnpkg.com/minipass/-/minipass-7.1.2.tgz#93a9626ce5e5e66bd4db86849e7515e92340a707" integrity sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw== -minizlib@^2.1.1: - version "2.1.2" - resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-2.1.2.tgz#e90d3466ba209b932451508a11ce3d3632145931" - integrity sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg== - dependencies: - minipass "^3.0.0" - yallist "^4.0.0" - minizlib@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-3.1.0.tgz#6ad76c3a8f10227c9b51d1c9ac8e30b27f5a251c" @@ -6560,7 +6435,7 @@ minizlib@^3.1.0: dependencies: minipass "^7.1.2" -mkdirp@^1.0.3, mkdirp@^1.0.4: +mkdirp@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== @@ -6644,7 +6519,7 @@ node-addon-api@^3.0.0: resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-3.2.1.tgz#81325e0a2117789c0128dab65e7e38f07ceba161" integrity sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A== -node-fetch@2, node-fetch@^2.6.7, node-fetch@^2.7.0: +node-fetch@2, node-fetch@^2.7.0: version "2.7.0" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d" integrity sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A== @@ -6666,13 +6541,6 @@ node-releases@^2.0.27: resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.27.tgz#eedca519205cf20f650f61d56b070db111231e4e" integrity sha512-nmh3lCkYZ3grZvqcCH+fjmQ7X+H0OeZgP40OierEaAptX4XofMh5kwNbWh7lBduUzCcV/8kZ+NDLCwm2iorIlA== -nopt@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/nopt/-/nopt-5.0.0.tgz#530942bb58a512fccafe53fe210f13a25355dc88" - integrity sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ== - dependencies: - abbrev "1" - normalize-path@^3.0.0, normalize-path@~3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" @@ -6690,17 +6558,7 @@ npm-run-path@^4.0.1: dependencies: path-key "^3.0.0" -npmlog@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-5.0.1.tgz#f06678e80e29419ad67ab964e0fa69959c1eb8b0" - integrity sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw== - dependencies: - are-we-there-yet "^2.0.0" - console-control-strings "^1.1.0" - gauge "^3.0.0" - set-blocking "^2.0.0" - -object-assign@^4, object-assign@^4.1.1: +object-assign@^4: version "4.1.1" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" integrity sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg== @@ -7282,13 +7140,6 @@ rimraf@^2.6.1: dependencies: glob "^7.1.3" -rimraf@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" - integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== - dependencies: - glob "^7.1.3" - router@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/router/-/router-2.2.0.tgz#019be620b711c87641167cc79b99090f00b146ef" @@ -7350,12 +7201,12 @@ scrypt-js@3.0.1: resolved "https://registry.yarnpkg.com/scrypt-js/-/scrypt-js-3.0.1.tgz#d314a57c2aef69d1ad98a138a21fe9eafa9ee312" integrity sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA== -semver@^6.0.0, semver@^6.3.0, semver@^6.3.1: +semver@^6.3.0, semver@^6.3.1: version "6.3.1" resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== -semver@^7.3.5, semver@^7.5.3, semver@^7.5.4, semver@^7.6.0, semver@^7.7.1, semver@^7.7.3: +semver@^7.5.3, semver@^7.5.4, semver@^7.6.0, semver@^7.7.1, semver@^7.7.3: version "7.7.3" resolved "https://registry.yarnpkg.com/semver/-/semver-7.7.3.tgz#4b5f4143d007633a8dc671cd0a6ef9147b8bb946" integrity sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q== @@ -7442,11 +7293,6 @@ serve-static@~1.16.2: parseurl "~1.3.3" send "0.19.0" -set-blocking@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" - integrity sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw== - set-function-length@^1.2.2: version "1.2.2" resolved "https://registry.yarnpkg.com/set-function-length/-/set-function-length-1.2.2.tgz#aac72314198eaed975cf77b2c3b6b880695e5449" @@ -7540,7 +7386,7 @@ side-channel@^1.1.0: side-channel-map "^1.0.1" side-channel-weakmap "^1.0.2" -signal-exit@^3.0.0, signal-exit@^3.0.3, signal-exit@^3.0.7: +signal-exit@^3.0.3, signal-exit@^3.0.7: version "3.0.7" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== @@ -7650,7 +7496,7 @@ string-length@^4.0.1: is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.1" -"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: +string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -7816,18 +7662,6 @@ synckit@^0.11.7: dependencies: "@pkgr/core" "^0.2.9" -tar@^6.1.11: - version "6.2.1" - resolved "https://registry.yarnpkg.com/tar/-/tar-6.2.1.tgz#717549c541bc3c2af15751bea94b1dd068d4b03a" - integrity sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A== - dependencies: - chownr "^2.0.0" - fs-minipass "^2.0.0" - minipass "^5.0.0" - minizlib "^2.1.1" - mkdirp "^1.0.3" - yallist "^4.0.0" - tar@^7.4.3: version "7.5.2" resolved "https://registry.yarnpkg.com/tar/-/tar-7.5.2.tgz#115c061495ec51ff3c6745ff8f6d0871c5b1dedc" @@ -8363,13 +8197,6 @@ which@^2.0.1: dependencies: isexe "^2.0.0" -wide-align@^1.1.2: - version "1.1.5" - resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.5.tgz#df1d4c206854369ecf3c9a4898f1b23fbd9d15d3" - integrity sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg== - dependencies: - string-width "^1.0.2 || 2 || 3 || 4" - word-wrap@^1.2.5, word-wrap@~1.2.3: version "1.2.5" resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.5.tgz#d2c45c6dd4fbce621a66f136cbe328afd0410b34" From 61d8caf5e41b031bafda925fb2f6aa6fc7c2a16a Mon Sep 17 00:00:00 2001 From: Krishna Waske Date: Fri, 3 Apr 2026 16:03:35 +0530 Subject: [PATCH 116/152] fix: proof controller (#360) * fix: proof controller Signed-off-by: Krishna Waske * fix: add proof format types Signed-off-by: Krishna Waske * fix: coderabbit comments Signed-off-by: Krishna Waske * fix: autogenerated files Signed-off-by: Krishna Waske --------- Signed-off-by: Krishna Waske --- .../didcomm/proofs/ProofController.ts | 523 +- src/controllers/types.ts | 12 +- src/routes/routes.ts | 565 ++ src/routes/swagger.json | 5758 ++++++++++------- 4 files changed, 4245 insertions(+), 2613 deletions(-) diff --git a/src/controllers/didcomm/proofs/ProofController.ts b/src/controllers/didcomm/proofs/ProofController.ts index a4f4a9f9..01832fb2 100644 --- a/src/controllers/didcomm/proofs/ProofController.ts +++ b/src/controllers/didcomm/proofs/ProofController.ts @@ -1,283 +1,286 @@ -// 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, + DidCommProofExchangeRecordProps, + ProofsProtocolVersionType, + DidCommRouting, +} 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.didcomm.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.didcomm.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.didcomm.proofs.proposeProof({ + connectionId: requestProofProposalOptions.connectionId, + protocolVersion: requestProofProposalOptions.protocolVersion 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('/accept-proposal') + @Example(ProofRecordExample) + public async acceptProposal(@Request() request: Req, @Body() acceptProposal: AcceptProofProposal) { + try { + const proof = await request.agent.modules.didcomm.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.didcomm.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: DidCommRouting + 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.didcomm.mediationRecipient.getRouting({}) + const {didDocument, keys} = createPeerDidDocumentFromServices([ + { + id: 'didcomm', + recipientKeys: [routing.recipientKey], + routingKeys: routing.routingKeys, + serviceEndpoint: routing.endpoints[0], + } + ], + true) + const did = await request.agent.dids.create({ + didDocument, + method: 'peer', + options: { + numAlgo: PeerDidNumAlgo.MultipleInceptionKeyWithoutDoc, + keys + }, + }) + 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.didcomm.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.didcomm.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, + 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: { + // TODO: Check if we can remove the below body options as they are not used + filterByPresentationPreview?: boolean + filterByNonRevocationRequirements?: boolean + comment?: string + }, + ) { + try { + const requestedCredentials = await request.agent.modules.didcomm.proofs.selectCredentialsForRequest({ + proofExchangeRecordId: proofRecordId, + }) -// const acceptProofRequest: AcceptProofRequestOptions = { -// proofRecordId, -// comment: body.comment, -// proofFormats: requestedCredentials.proofFormats, -// } + const acceptProofRequest: AcceptProofRequestOptions = { + proofExchangeRecordId: proofRecordId, + comment: body.comment, + proofFormats: requestedCredentials.proofFormats, + } -// const proof = await request.agent.modules.proofs.acceptRequest(acceptProofRequest) + const proof = await request.agent.modules.didcomm.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.didcomm.proofs.acceptPresentation({ proofExchangeRecordId: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.didcomm.proofs.getFormatData(proofRecordId) + return proof + } catch (error) { + throw ErrorHandlingService.handle(error) + } + } +} diff --git a/src/controllers/types.ts b/src/controllers/types.ts index e90e828a..a267b0ec 100644 --- a/src/controllers/types.ts +++ b/src/controllers/types.ts @@ -2,7 +2,9 @@ import type { RecordId } from './examples' import type { AnonCredsCredentialDefinition, AnonCredsDidCommCredentialFormat, + AnonCredsDidCommProofFormat, LegacyIndyCredentialFormat, + LegacyIndyDidCommProofFormat, RegisterCredentialDefinitionReturnStateAction, RegisterCredentialDefinitionReturnStateFailed, RegisterCredentialDefinitionReturnStateFinished, @@ -42,6 +44,8 @@ import type { DidCommMessage, DidCommRouting, DidCommAttachment, + DidCommProofFormatPayload, + DidCommDifPresentationExchangeProofFormat, } from '@credo-ts/didcomm' import type { KeyAlgorithm } from '@openwallet-foundation/askar-nodejs' import type { DIDDocument } from 'did-resolver' @@ -101,6 +105,7 @@ export interface ProofRequestMessageResponse { // type CredentialFormats = [CredentialFormat] type CredentialFormats = [LegacyIndyCredentialFormat, AnonCredsDidCommCredentialFormat, DidCommJsonLdCredentialFormat] +type ProofFormats = [LegacyIndyDidCommProofFormat, AnonCredsDidCommProofFormat, DidCommDifPresentationExchangeProofFormat] enum ProtocolVersion { v1 = 'v1', @@ -273,8 +278,9 @@ export interface RequestProofOptions { // TODO: added type in protocolVersion export interface RequestProofProposalOptions { + protocolVersion: ProtocolVersion connectionId: string - proofFormats: any + proofFormats: DidCommProofFormatPayload goalCode?: string parentThreadId?: string autoAcceptProof?: DidCommAutoAcceptProof @@ -282,8 +288,8 @@ export interface RequestProofProposalOptions { } export interface AcceptProofProposal { - proofRecordId: string - proofFormats: any + proofExchangeRecordId: string + proofFormats: DidCommProofFormatPayload comment?: string autoAcceptProof?: DidCommAutoAcceptProof goalCode?: string diff --git a/src/routes/routes.ts b/src/routes/routes.ts index 227c5e70..e1bb1f99 100644 --- a/src/routes/routes.ts +++ b/src/routes/routes.ts @@ -36,6 +36,8 @@ import { CredentialDefinitionController } from './../controllers/anoncreds/cred- // WARNING: This 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 { 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 { VerifierController } from './../controllers/openid4vc/verifiers/verifier.Controller'; import { expressAuthentication } from './../authentication'; // @ts-ignore - no great way to install types from subpackage @@ -2035,6 +2037,235 @@ const models: TsoaRoute.Models = { "type": {"dataType":"nestedObjectLiteral","nestedProperties":{"credential":{"ref":"CredentialFormatDataMessagePayload__40_LegacyIndyCredentialFormat-or-DidCommJsonLdCredentialFormat-or-AnonCredsDidCommCredentialFormat_41_-Array.credential_"},"request":{"ref":"CredentialFormatDataMessagePayload__40_LegacyIndyCredentialFormat-or-DidCommJsonLdCredentialFormat-or-AnonCredsDidCommCredentialFormat_41_-Array.request_"},"offerAttributes":{"dataType":"array","array":{"dataType":"refObject","ref":"DidCommCredentialPreviewAttributeOptions"}},"offer":{"ref":"CredentialFormatDataMessagePayload__40_LegacyIndyCredentialFormat-or-DidCommJsonLdCredentialFormat-or-AnonCredsDidCommCredentialFormat_41_-Array.offer_"},"proposal":{"ref":"CredentialFormatDataMessagePayload__40_LegacyIndyCredentialFormat-or-DidCommJsonLdCredentialFormat-or-AnonCredsDidCommCredentialFormat_41_-Array.proposal_"},"proposalAttributes":{"dataType":"array","array":{"dataType":"refObject","ref":"DidCommCredentialPreviewAttributeOptions"}}},"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 + "DidCommProofExchangeRecord": { + "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 + "AnonCredsPresentationPreviewAttribute": { + "dataType": "refObject", + "properties": { + "name": {"dataType":"string","required":true}, + "credentialDefinitionId": {"dataType":"string"}, + "mimeType": {"dataType":"string"}, + "value": {"dataType":"string"}, + "referent": {"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 + "AnonCredsPredicateType": { + "dataType": "refAlias", + "type": {"dataType":"union","subSchemas":[{"dataType":"enum","enums":[">="]},{"dataType":"enum","enums":[">"]},{"dataType":"enum","enums":["<="]},{"dataType":"enum","enums":["<"]}],"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 + "AnonCredsPresentationPreviewPredicate": { + "dataType": "refObject", + "properties": { + "name": {"dataType":"string","required":true}, + "credentialDefinitionId": {"dataType":"string","required":true}, + "predicate": {"ref":"AnonCredsPredicateType","required":true}, + "threshold": {"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 + "AnonCredsNonRevokedInterval": { + "dataType": "refObject", + "properties": { + "from": {"dataType":"double"}, + "to": {"dataType":"double"}, + }, + "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 + "AnonCredsProposeProofFormat": { + "dataType": "refObject", + "properties": { + "name": {"dataType":"string"}, + "version": {"dataType":"string"}, + "attributes": {"dataType":"array","array":{"dataType":"refObject","ref":"AnonCredsPresentationPreviewAttribute"}}, + "predicates": {"dataType":"array","array":{"dataType":"refObject","ref":"AnonCredsPresentationPreviewPredicate"}}, + "nonRevokedInterval": {"ref":"AnonCredsNonRevokedInterval"}, + }, + "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 + "Schema": { + "dataType": "refObject", + "properties": { + "uri": {"dataType":"string","required":true}, + "required": {"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 + "FilterV1": { + "dataType": "refObject", + "properties": { + "const": {"ref":"OneOfNumberStringBoolean"}, + "enum": {"dataType":"array","array":{"dataType":"refAlias","ref":"OneOfNumberStringBoolean"}}, + "exclusiveMinimum": {"ref":"OneOfNumberString"}, + "exclusiveMaximum": {"ref":"OneOfNumberString"}, + "format": {"dataType":"string"}, + "minLength": {"dataType":"double"}, + "maxLength": {"dataType":"double"}, + "minimum": {"ref":"OneOfNumberString"}, + "maximum": {"ref":"OneOfNumberString"}, + "not": {"dataType":"object"}, + "pattern": {"dataType":"string"}, + "type": {"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 + "FieldV1": { + "dataType": "refObject", + "properties": { + "id": {"dataType":"string"}, + "path": {"dataType":"array","array":{"dataType":"string"},"required":true}, + "purpose": {"dataType":"string"}, + "filter": {"ref":"FilterV1"}, + "predicate": {"ref":"Optionality"}, + }, + "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 + "ConstraintsV1": { + "dataType": "refObject", + "properties": { + "limit_disclosure": {"ref":"Optionality"}, + "statuses": {"ref":"Statuses"}, + "fields": {"dataType":"array","array":{"dataType":"refObject","ref":"FieldV1"}}, + "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 + "InputDescriptorV1": { + "dataType": "refObject", + "properties": { + "id": {"dataType":"string","required":true}, + "name": {"dataType":"string"}, + "purpose": {"dataType":"string"}, + "group": {"dataType":"array","array":{"dataType":"string"}}, + "schema": {"dataType":"array","array":{"dataType":"refObject","ref":"Schema"},"required":true}, + "issuance": {"dataType":"array","array":{"dataType":"refObject","ref":"Issuance"}}, + "constraints": {"ref":"ConstraintsV1"}, + }, + "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 + "PresentationDefinitionV1": { + "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":"InputDescriptorV1"},"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 + "DidCommProofFormatPayload_ProofFormats.createProposal_": { + "dataType": "refAlias", + "type": {"dataType":"nestedObjectLiteral","nestedProperties":{"indy":{"ref":"AnonCredsProposeProofFormat"},"anoncreds":{"ref":"AnonCredsProposeProofFormat"},"presentationExchange":{"dataType":"nestedObjectLiteral","nestedProperties":{"presentationDefinition":{"ref":"PresentationDefinitionV1","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 + "DidCommAutoAcceptProof": { + "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": { + "protocolVersion": {"ref":"ProtocolVersion","required":true}, + "connectionId": {"dataType":"string","required":true}, + "proofFormats": {"ref":"DidCommProofFormatPayload_ProofFormats.createProposal_","required":true}, + "goalCode": {"dataType":"string"}, + "parentThreadId": {"dataType":"string"}, + "autoAcceptProof": {"ref":"DidCommAutoAcceptProof"}, + "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 + "DidCommProofFormatPayload_ProofFormats.acceptProposal_": { + "dataType": "refAlias", + "type": {"dataType":"nestedObjectLiteral","nestedProperties":{"indy":{"dataType":"nestedObjectLiteral","nestedProperties":{"version":{"dataType":"string"},"name":{"dataType":"string"}}},"anoncreds":{"dataType":"nestedObjectLiteral","nestedProperties":{"version":{"dataType":"string"},"name":{"dataType":"string"}}},"presentationExchange":{"dataType":"nestedObjectLiteral","nestedProperties":{"options":{"dataType":"nestedObjectLiteral","nestedProperties":{"domain":{"dataType":"string"},"challenge":{"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 + "AcceptProofProposal": { + "dataType": "refObject", + "properties": { + "proofExchangeRecordId": {"dataType":"string","required":true}, + "proofFormats": {"ref":"DidCommProofFormatPayload_ProofFormats.acceptProposal_","required":true}, + "comment": {"dataType":"string"}, + "autoAcceptProof": {"ref":"DidCommAutoAcceptProof"}, + "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":"DidCommAutoAcceptProof","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 + "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":"DidCommAutoAcceptProof"}, + "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_LegacyIndyDidCommProofFormat-or-AnonCredsDidCommProofFormat-or-DidCommDifPresentationExchangeProofFormat_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_LegacyIndyDidCommProofFormat-or-AnonCredsDidCommProofFormat-or-DidCommDifPresentationExchangeProofFormat_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_LegacyIndyDidCommProofFormat-or-AnonCredsDidCommProofFormat-or-DidCommDifPresentationExchangeProofFormat_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_LegacyIndyDidCommProofFormat-or-AnonCredsDidCommProofFormat-or-DidCommDifPresentationExchangeProofFormat_41_-Array_": { + "dataType": "refAlias", + "type": {"dataType":"nestedObjectLiteral","nestedProperties":{"presentation":{"ref":"ProofFormatDataMessagePayload__40_LegacyIndyDidCommProofFormat-or-AnonCredsDidCommProofFormat-or-DidCommDifPresentationExchangeProofFormat_41_-Array.presentation_"},"request":{"ref":"ProofFormatDataMessagePayload__40_LegacyIndyDidCommProofFormat-or-AnonCredsDidCommProofFormat-or-DidCommDifPresentationExchangeProofFormat_41_-Array.request_"},"proposal":{"ref":"ProofFormatDataMessagePayload__40_LegacyIndyDidCommProofFormat-or-AnonCredsDidCommProofFormat-or-DidCommDifPresentationExchangeProofFormat_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 "OpenId4VcVerifierRecord": { "dataType": "refAlias", "type": {"ref":"Record_string.unknown_","validators":{}}, @@ -5104,6 +5335,340 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This 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/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 argsVerifierController_createVerifier: Record = { request: {"in":"request","name":"request","required":true,"dataType":"object"}, options: {"in":"body","name":"options","required":true,"ref":"OpenId4VcSiopCreateVerifierOptions"}, diff --git a/src/routes/swagger.json b/src/routes/swagger.json index ca583f96..1e988b5f 100644 --- a/src/routes/swagger.json +++ b/src/routes/swagger.json @@ -4664,306 +4664,626 @@ "type": "object", "description": "Get format data return value. Each key holds a mapping of credential format key to format data." }, - "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" + "DidCommProofExchangeRecord": { + "$ref": "#/components/schemas/Record_string.unknown_" }, - "OpenId4VcSiopVerifierClientMetadata": { + "AnonCredsPresentationPreviewAttribute": { "properties": { - "client_name": { + "name": { "type": "string" }, - "logo_uri": { + "credentialDefinitionId": { + "type": "string" + }, + "mimeType": { + "type": "string" + }, + "value": { + "type": "string" + }, + "referent": { "type": "string" } }, + "required": [ + "name" + ], "type": "object", "additionalProperties": false }, - "OpenId4VcSiopCreateVerifierOptions": { + "AnonCredsPredicateType": { + "type": "string", + "enum": [ + ">=", + ">", + "<=", + "<" + ] + }, + "AnonCredsPresentationPreviewPredicate": { "properties": { - "verifierId": { + "name": { "type": "string" }, - "clientMetadata": { - "$ref": "#/components/schemas/OpenId4VcSiopVerifierClientMetadata" + "credentialDefinitionId": { + "type": "string" + }, + "predicate": { + "$ref": "#/components/schemas/AnonCredsPredicateType" + }, + "threshold": { + "type": "number", + "format": "double" } }, + "required": [ + "name", + "credentialDefinitionId", + "predicate", + "threshold" + ], "type": "object", "additionalProperties": false }, - "OpenId4VcUpdateVerifierRecordOptions": { + "AnonCredsNonRevokedInterval": { "properties": { - "clientMetadata": { - "$ref": "#/components/schemas/OpenId4VcSiopVerifierClientMetadata" + "from": { + "type": "number", + "format": "double" + }, + "to": { + "type": "number", + "format": "double" } }, "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": { - "keyId": {}, - "publicCertificateBase64": { - "type": "string" - } - }, - "required": [ - "keyId", - "publicCertificateBase64" - ], - "type": "object" - } - } - } + "AnonCredsProposeProofFormat": { + "description": "Interface for creating an anoncreds proof proposal.", + "properties": { + "name": { + "type": "string" + }, + "version": { + "type": "string" + }, + "attributes": { + "items": { + "$ref": "#/components/schemas/AnonCredsPresentationPreviewAttribute" + }, + "type": "array" + }, + "predicates": { + "items": { + "$ref": "#/components/schemas/AnonCredsPresentationPreviewPredicate" + }, + "type": "array" + }, + "nonRevokedInterval": { + "$ref": "#/components/schemas/AnonCredsNonRevokedInterval" } }, - "tags": [ - "x509" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] + "type": "object", + "additionalProperties": false + }, + "Schema": { + "properties": { + "uri": { + "type": "string" + }, + "required": { + "type": "boolean" } + }, + "required": [ + "uri" ], - "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": { - "keyId": {}, - "issuerCertificate": { - "type": "string" - } - }, - "required": [ - "keyId", - "issuerCertificate" - ], - "type": "object" - } - } - } + "type": "object", + "additionalProperties": false + }, + "FilterV1": { + "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" + }, + "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" } }, - "tags": [ - "x509" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] + "type": "object", + "additionalProperties": false + }, + "FieldV1": { + "properties": { + "id": { + "type": "string" + }, + "path": { + "items": { + "type": "string" + }, + "type": "array" + }, + "purpose": { + "type": "string" + }, + "filter": { + "$ref": "#/components/schemas/FilterV1" + }, + "predicate": { + "$ref": "#/components/schemas/Optionality" } + }, + "required": [ + "path" ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/X509ImportCertificateOptionsDto" - } - } - } - } - } - }, - "/x509/trusted": { - "post": { - "operationId": "AddTrustedCertificate", - "responses": { - "204": { - "description": "No content" + "type": "object", + "additionalProperties": false + }, + "ConstraintsV1": { + "properties": { + "limit_disclosure": { + "$ref": "#/components/schemas/Optionality" + }, + "statuses": { + "$ref": "#/components/schemas/Statuses" + }, + "fields": { + "items": { + "$ref": "#/components/schemas/FieldV1" + }, + "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" } }, - "tags": [ - "x509" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "properties": { - "certificate": { - "type": "string" - } - }, - "required": [ - "certificate" - ], - "type": "object" - } - } - } - } + "type": "object", + "additionalProperties": false }, - "get": { - "operationId": "GetTrustedCertificates", - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": { - "items": { - "type": "string" - }, - "type": "array" - } - } - } + "InputDescriptorV1": { + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "purpose": { + "type": "string" + }, + "group": { + "items": { + "type": "string" + }, + "type": "array" + }, + "schema": { + "items": { + "$ref": "#/components/schemas/Schema" + }, + "type": "array" + }, + "issuance": { + "items": { + "$ref": "#/components/schemas/Issuance" + }, + "type": "array" + }, + "constraints": { + "$ref": "#/components/schemas/ConstraintsV1" } }, - "tags": [ - "x509" + "required": [ + "id", + "schema" ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] + "type": "object", + "additionalProperties": false + }, + "PresentationDefinitionV1": { + "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/InputDescriptorV1" + }, + "type": "array" } + }, + "required": [ + "id", + "input_descriptors" ], - "parameters": [] - } - }, - "/x509/decode": { - "post": { - "operationId": "DecodeCertificate", - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/X509Certificate" - } + "type": "object", + "additionalProperties": false + }, + "DidCommProofFormatPayload_ProofFormats.createProposal_": { + "properties": { + "indy": { + "$ref": "#/components/schemas/AnonCredsProposeProofFormat" + }, + "anoncreds": { + "$ref": "#/components/schemas/AnonCredsProposeProofFormat" + }, + "presentationExchange": { + "properties": { + "presentationDefinition": { + "$ref": "#/components/schemas/PresentationDefinitionV1" } - } + }, + "required": [ + "presentationDefinition" + ], + "type": "object" } }, - "tags": [ - "x509" + "type": "object", + "description": "Get the payload for a specific method from a list of ProofFormat interfaces and a method" + }, + "DidCommAutoAcceptProof": { + "description": "Typing of the state for auto acceptance", + "enum": [ + "always", + "contentApproved", + "never" ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] + "type": "string" + }, + "RequestProofProposalOptions": { + "properties": { + "protocolVersion": { + "$ref": "#/components/schemas/ProtocolVersion" + }, + "connectionId": { + "type": "string" + }, + "proofFormats": { + "$ref": "#/components/schemas/DidCommProofFormatPayload_ProofFormats.createProposal_" + }, + "goalCode": { + "type": "string" + }, + "parentThreadId": { + "type": "string" + }, + "autoAcceptProof": { + "$ref": "#/components/schemas/DidCommAutoAcceptProof" + }, + "comment": { + "type": "string" } + }, + "required": [ + "protocolVersion", + "connectionId", + "proofFormats" ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { + "type": "object", + "additionalProperties": false + }, + "DidCommProofFormatPayload_ProofFormats.acceptProposal_": { + "properties": { + "indy": { + "properties": { + "version": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "type": "object" + }, + "anoncreds": { + "properties": { + "version": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "type": "object" + }, + "presentationExchange": { + "properties": { + "options": { "properties": { - "certificate": { + "domain": { + "type": "string" + }, + "challenge": { "type": "string" } }, - "required": [ - "certificate" - ], "type": "object" } - } + }, + "type": "object" } - } + }, + "type": "object", + "description": "Get the payload for a specific method from a list of ProofFormat interfaces and a method" + }, + "AcceptProofProposal": { + "properties": { + "proofExchangeRecordId": { + "type": "string" + }, + "proofFormats": { + "$ref": "#/components/schemas/DidCommProofFormatPayload_ProofFormats.acceptProposal_" + }, + "comment": { + "type": "string" + }, + "autoAcceptProof": { + "$ref": "#/components/schemas/DidCommAutoAcceptProof" + }, + "goalCode": { + "type": "string" + }, + "willConfirm": { + "type": "boolean" + } + }, + "required": [ + "proofExchangeRecordId", + "proofFormats" + ], + "type": "object", + "additionalProperties": false + }, + "RequestProofOptions": { + "properties": { + "connectionId": { + "type": "string" + }, + "protocolVersion": { + "type": "string" + }, + "proofFormats": {}, + "comment": { + "type": "string" + }, + "autoAcceptProof": { + "$ref": "#/components/schemas/DidCommAutoAcceptProof" + }, + "goalCode": { + "type": "string" + }, + "parentThreadId": { + "type": "string" + }, + "willConfirm": { + "type": "boolean" + } + }, + "required": [ + "connectionId", + "protocolVersion", + "proofFormats", + "comment", + "autoAcceptProof" + ], + "type": "object", + "additionalProperties": false + }, + "CreateProofRequestOobOptions": { + "properties": { + "protocolVersion": { + "type": "string" + }, + "proofFormats": {}, + "goalCode": { + "type": "string" + }, + "parentThreadId": { + "type": "string" + }, + "willConfirm": { + "type": "boolean" + }, + "autoAcceptProof": { + "$ref": "#/components/schemas/DidCommAutoAcceptProof" + }, + "comment": { + "type": "string" + }, + "label": { + "type": "string" + }, + "imageUrl": { + "type": "string" + }, + "recipientKey": { + "type": "string" + }, + "invitationDid": { + "type": "string" + } + }, + "required": [ + "protocolVersion", + "proofFormats" + ], + "type": "object", + "additionalProperties": false + }, + "ProofFormatDataMessagePayload__40_LegacyIndyDidCommProofFormat-or-AnonCredsDidCommProofFormat-or-DidCommDifPresentationExchangeProofFormat_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_LegacyIndyDidCommProofFormat-or-AnonCredsDidCommProofFormat-or-DidCommDifPresentationExchangeProofFormat_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_LegacyIndyDidCommProofFormat-or-AnonCredsDidCommProofFormat-or-DidCommDifPresentationExchangeProofFormat_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_LegacyIndyDidCommProofFormat-or-AnonCredsDidCommProofFormat-or-DidCommDifPresentationExchangeProofFormat_41_-Array_": { + "properties": { + "presentation": { + "$ref": "#/components/schemas/ProofFormatDataMessagePayload__40_LegacyIndyDidCommProofFormat-or-AnonCredsDidCommProofFormat-or-DidCommDifPresentationExchangeProofFormat_41_-Array.presentation_" + }, + "request": { + "$ref": "#/components/schemas/ProofFormatDataMessagePayload__40_LegacyIndyDidCommProofFormat-or-AnonCredsDidCommProofFormat-or-DidCommDifPresentationExchangeProofFormat_41_-Array.request_" + }, + "proposal": { + "$ref": "#/components/schemas/ProofFormatDataMessagePayload__40_LegacyIndyDidCommProofFormat-or-AnonCredsDidCommProofFormat-or-DidCommDifPresentationExchangeProofFormat_41_-Array.proposal_" + } + }, + "type": "object" + }, + "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": { + "clientMetadata": { + "$ref": "#/components/schemas/OpenId4VcSiopVerifierClientMetadata" + } + }, + "type": "object", + "additionalProperties": false } }, - "/polygon/create-keys": { + "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": "CreateKeyPair", + "operationId": "CreateX509Certificate", "responses": { "200": { - "description": "Secp256k1KeyPair", + "description": "Ok", "content": { "application/json": { "schema": { "properties": { - "address": { - "type": "string" - }, - "publicKeyBase58": { - "type": "string" - }, - "privateKey": { + "keyId": {}, + "publicCertificateBase64": { "type": "string" } }, "required": [ - "address", - "publicKeyBase58", - "privateKey" + "keyId", + "publicCertificateBase64" ], "type": "object" } @@ -4971,38 +5291,57 @@ } } }, - "description": "Create Secp256k1 key pair for polygon DID", "tags": [ - "Polygon" + "x509" ], "security": [ { "jwt": [ "tenant", - "dedicated", - "Basewallet" + "dedicated" ] } ], - "parameters": [] + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/X509CreateCertificateOptionsDto" + } + } + } + } } }, - "/polygon/create-schema": { + "/x509/import": { "post": { - "operationId": "CreateSchema", + "operationId": "ImportX509Certificates", "responses": { "200": { - "description": "Schema JSON", + "description": "Ok", "content": { "application/json": { - "schema": {} + "schema": { + "properties": { + "keyId": {}, + "issuerCertificate": { + "type": "string" + } + }, + "required": [ + "keyId", + "issuerCertificate" + ], + "type": "object" + } } } } }, - "description": "Create polygon based W3C schema", "tags": [ - "Polygon" + "x509" ], "security": [ { @@ -5018,35 +5357,237 @@ "content": { "application/json": { "schema": { - "properties": { - "schema": { - "$ref": "#/components/schemas/Record_string.unknown_" - }, - "schemaName": { - "type": "string" - }, - "did": { - "type": "string" - } - }, - "required": [ - "schema", - "schemaName", - "did" - ], - "type": "object" + "$ref": "#/components/schemas/X509ImportCertificateOptionsDto" } } } } } }, - "/polygon/estimate-transaction": { + "/x509/trusted": { "post": { - "operationId": "EstimateTransaction", + "operationId": "AddTrustedCertificate", "responses": { - "200": { - "description": "Transaction Object", + "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": {} @@ -5669,9 +6210,524 @@ } } }, - "description": "Creates an issuer with issuer metadata.", + "description": "Creates an issuer with issuer metadata.", + "tags": [ + "oid4vc issuers" + ], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateIssuerOptions" + } + } + } + } + }, + "get": { + "operationId": "GetIssuersByQuery", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenId4VcIssuerRecord" + }, + { + "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", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenId4VcIssuerRecord" + } + } + } + } + }, + "description": "Updates issuer metadata for a given publicIssuerId.", + "tags": [ + "oid4vc issuers" + ], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } + ], + "parameters": [ + { + "in": "path", + "name": "publicIssuerId", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateIssuerRecordOptions" + } + } + } + } + }, + "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", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": {} + } + } + } + }, + "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": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" + } + } + } + } + }, + "description": "Deletes a specific issuer by record id.", + "tags": [ + "oid4vc issuers" + ], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + } + } + ] + } + }, + "/openid4vc/issuance-sessions/create-credential-offer": { + "post": { + "operationId": "CreateCredentialOffer", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "properties": { + "issuanceSession": { + "$ref": "#/components/schemas/OpenId4VcIssuanceSessionRecord" + }, + "credentialOffer": { + "type": "string" + } + }, + "required": [ + "issuanceSession", + "credentialOffer" + ], + "type": "object" + } + } + } + } + }, + "description": "Creates a credential offer with the specified credential configurations and authorization type.", + "tags": [ + "oid4vc issuance sessions" + ], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenId4VcIssuanceSessionsCreateOffer" + } + } + } + } + } + }, + "/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", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenId4VcIssuanceSessionRecord" + } + } + } + } + }, + "description": "Update issuance session metadata by session ID", + "tags": [ + "oid4vc issuance sessions" + ], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } + ], + "parameters": [ + { + "in": "path", + "name": "issuanceSessionId", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "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" + }, + "type": "array" + } + } + } + } + }, + "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/issuance-sessions/{issuanceSessionId}/revoke": { + "post": { + "operationId": "RevokeSessionById", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" + } + } + } + } + }, + "description": "Revoke credentials in an issuance session by session ID", "tags": [ - "oid4vc issuers" + "oid4vc issuance sessions" ], "security": [ { @@ -5681,45 +6737,39 @@ ] } ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateIssuerOptions" - } + "parameters": [ + { + "in": "path", + "name": "issuanceSessionId", + "required": true, + "schema": { + "type": "string" } } - } - }, + ] + } + }, + "/openid4vc/holder/sd-jwt-vcs": { "get": { - "operationId": "GetIssuersByQuery", + "operationId": "GetSdJwtCredentials", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenId4VcIssuerRecord" - }, - { - "items": { - "$ref": "#/components/schemas/OpenId4VcIssuerRecord" - }, - "type": "array" - } - ] + "items": { + "$ref": "#/components/schemas/SdJwtVcRecord" + }, + "type": "array" } } } } }, - "description": "Query issuers by optional publicIssuerId.", + "description": "Get SdJwt type of credentials", "tags": [ - "oid4vc issuers" + "oid4vc holders" ], "security": [ { @@ -5729,36 +6779,30 @@ ] } ], - "parameters": [ - { - "in": "query", - "name": "publicIssuerId", - "required": false, - "schema": { - "type": "string" - } - } - ] + "parameters": [] } }, - "/openid4vc/issuer/{publicIssuerId}": { - "put": { - "operationId": "UpdateIssuerMetadata", + "/openid4vc/holder/mdoc-vcs": { + "get": { + "operationId": "GetMdocCredentials", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/OpenId4VcIssuerRecord" + "items": { + "$ref": "#/components/schemas/MdocRecord" + }, + "type": "array" } } } } }, - "description": "Updates issuer metadata for a given publicIssuerId.", + "description": "Fetch all mso mdoc credentials in wallet", "tags": [ - "oid4vc issuers" + "oid4vc holders" ], "security": [ { @@ -5768,44 +6812,71 @@ ] } ], - "parameters": [ - { - "in": "path", - "name": "publicIssuerId", - "required": true, - "schema": { - "type": "string" + "parameters": [] + } + }, + "/openid4vc/holder/mdoc-vcs/decode": { + "post": { + "operationId": "DecodeMdocCredential", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": {} + } } } + }, + "description": "Decode mso mdoc credential in wallet", + "tags": [ + "oid4vc holders" + ], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } ], + "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UpdateIssuerRecordOptions" + "properties": { + "base64Url": { + "type": "string" + } + }, + "required": [ + "base64Url" + ], + "type": "object" } } } } - }, - "get": { - "operationId": "GetIssuer", + } + }, + "/openid4vc/holder/resolve-credential-offer": { + "post": { + "operationId": "ResolveCredOffer", "responses": { "200": { "description": "Ok", "content": { "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenId4VcIssuerRecord" - } + "schema": {} } } } }, - "description": "Returns a specific issuer by publicIssuerId.", + "description": "Resolve a credential offer", "tags": [ - "oid4vc issuers" + "oid4vc holders" ], "security": [ { @@ -5815,21 +6886,22 @@ ] } ], - "parameters": [ - { - "in": "path", - "name": "publicIssuerId", - "required": true, - "schema": { - "type": "string" + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResolveCredentialOfferBody" + } } } - ] + } } }, - "/openid4vc/issuer/{issuerId}/metadata": { - "get": { - "operationId": "GetIssuerAgentMetaData", + "/openid4vc/holder/authorization-request": { + "post": { + "operationId": "RequestAuthorizationForCredential", "responses": { "200": { "description": "Ok", @@ -5840,9 +6912,8 @@ } } }, - "description": "Returns metadata for a specific issuer.", "tags": [ - "oid4vc issuers" + "oid4vc holders" ], "security": [ { @@ -5852,44 +6923,35 @@ ] } ], - "parameters": [ - { - "in": "path", - "name": "issuerId", - "required": true, - "schema": { - "type": "string" + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthorizeRequestCredentialOffer" + } } } - ] + } } }, - "/openid4vc/issuer/{id}": { - "delete": { - "operationId": "DeleteIssuer", + "/openid4vc/holder/request-credential": { + "post": { + "operationId": "RequestCredential", "responses": { "200": { "description": "Ok", "content": { "application/json": { - "schema": { - "properties": { - "message": { - "type": "string" - } - }, - "required": [ - "message" - ], - "type": "object" - } + "schema": {} } } } }, - "description": "Deletes a specific issuer by record id.", + "description": "Initiates a token request, then requests credentials from issuer", "tags": [ - "oid4vc issuers" + "oid4vc holders" ], "security": [ { @@ -5899,48 +6961,35 @@ ] } ], - "parameters": [ - { - "in": "path", - "name": "id", - "required": true, - "schema": { - "type": "string" + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RequestCredentialBody" + } } } - ] + } } }, - "/openid4vc/issuance-sessions/create-credential-offer": { + "/openid4vc/holder/resolve-proof-request": { "post": { - "operationId": "CreateCredentialOffer", + "operationId": "ResolveProofRequest", "responses": { "200": { "description": "Ok", "content": { "application/json": { - "schema": { - "properties": { - "issuanceSession": { - "$ref": "#/components/schemas/OpenId4VcIssuanceSessionRecord" - }, - "credentialOffer": { - "type": "string" - } - }, - "required": [ - "issuanceSession", - "credentialOffer" - ], - "type": "object" - } + "schema": {} } } } }, - "description": "Creates a credential offer with the specified credential configurations and authorization type.", + "description": "Resolve a proof request", "tags": [ - "oid4vc issuance sessions" + "oid4vc holders" ], "security": [ { @@ -5956,31 +7005,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/OpenId4VcIssuanceSessionsCreateOffer" + "$ref": "#/components/schemas/ResolveProofRequest" } } } } } }, - "/openid4vc/issuance-sessions/{issuanceSessionId}": { - "get": { - "operationId": "GetIssuanceSessionsById", + "/openid4vc/holder/accept-proof-request": { + "post": { + "operationId": "AcceptProofRequest", "responses": { "200": { "description": "Ok", "content": { "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenId4VcIssuanceSessionRecord" - } + "schema": {} } } } }, - "description": "Get issuance details by issuance SessionId", + "description": "Accept a proof request", "tags": [ - "oid4vc issuance sessions" + "oid4vc holders" ], "security": [ { @@ -5990,34 +7037,34 @@ ] } ], - "parameters": [ - { - "in": "path", - "name": "issuanceSessionId", - "required": true, - "schema": { - "type": "string" + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResolveProofRequest" + } } } - ] - }, - "put": { - "operationId": "UpdateSessionById", + } + } + }, + "/openid4vc/holder/decode-sdjwt": { + "post": { + "operationId": "DecodeSdJwt", "responses": { "200": { "description": "Ok", "content": { "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenId4VcIssuanceSessionRecord" - } + "schema": {} } } } }, - "description": "Update issuance session metadata by session ID", "tags": [ - "oid4vc issuance sessions" + "oid4vc holders" ], "security": [ { @@ -6027,37 +7074,37 @@ ] } ], - "parameters": [ - { - "in": "path", - "name": "issuanceSessionId", - "required": true, - "schema": { - "type": "string" - } - } - ], + "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Record_string.unknown_" + "properties": { + "jwt": { + "type": "string" + } + }, + "required": [ + "jwt" + ], + "type": "object" } } } } - }, + } + }, + "/openid4vc/holder/credential": { "delete": { - "operationId": "DeleteIssuanceSessionById", + "operationId": "Delete", "responses": { "204": { "description": "No content" } }, - "description": "Delete issuance session by session ID", "tags": [ - "oid4vc issuance sessions" + "oid4vc holders" ], "security": [ { @@ -6067,262 +7114,243 @@ ] } ], - "parameters": [ - { - "in": "path", - "name": "issuanceSessionId", - "required": true, - "schema": { - "type": "string" + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteCredentialBody" + } } } - ] + } } }, - "/openid4vc/issuance-sessions": { - "get": { - "operationId": "GetIssuanceSessionsByQuery", + "/multi-tenancy/create-tenant": { + "post": { + "operationId": "CreateTenant", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "items": { - "$ref": "#/components/schemas/OpenId4VcIssuanceSessionRecord" + "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 + } }, - "type": "array" + "required": [ + "token", + "metadata", + "allowCache", + "createdAt", + "id", + "storageVersion", + "config", + "type" + ], + "type": "object" } } } } }, - "description": "Fetch all issuance sessions by query", "tags": [ - "oid4vc issuance sessions" + "MultiTenancy" ], "security": [ { "jwt": [ - "tenant", - "dedicated" + "Basewallet" ] } ], - "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" + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateTenantOptions" + } } } - ] + } } }, - "/openid4vc/issuance-sessions/{issuanceSessionId}/revoke": { + "/multi-tenancy/get-token/{tenantId}": { "post": { - "operationId": "RevokeSessionById", + "operationId": "GetTenantToken", "responses": { "200": { "description": "Ok", + "content": { + "application/json": { + "schema": {} + } + } + }, + "404": { + "description": "", "content": { "application/json": { "schema": { "properties": { - "message": { + "reason": { "type": "string" } }, "required": [ - "message" + "reason" ], "type": "object" } } } - } - }, - "description": "Revoke credentials in an issuance session by session ID", - "tags": [ - "oid4vc issuance sessions" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [ - { - "in": "path", - "name": "issuanceSessionId", - "required": true, - "schema": { - "type": "string" - } - } - ] - } - }, - "/openid4vc/holder/sd-jwt-vcs": { - "get": { - "operationId": "GetSdJwtCredentials", - "responses": { - "200": { - "description": "Ok", + }, + "500": { + "description": "", "content": { "application/json": { "schema": { - "items": { - "$ref": "#/components/schemas/SdJwtVcRecord" + "properties": { + "message": { + "type": "string" + } }, - "type": "array" + "required": [ + "message" + ], + "type": "object" } } } } }, - "description": "Get SdJwt type of credentials", "tags": [ - "oid4vc holders" + "MultiTenancy" ], "security": [ { "jwt": [ - "tenant", - "dedicated" + "Basewallet" ] } ], - "parameters": [] + "parameters": [ + { + "in": "path", + "name": "tenantId", + "required": true, + "schema": { + "type": "string" + } + } + ] } }, - "/openid4vc/holder/mdoc-vcs": { + "/multi-tenancy/{tenantId}": { "get": { - "operationId": "GetMdocCredentials", + "operationId": "GetTenantById", "responses": { "200": { "description": "Ok", + "content": { + "application/json": { + "schema": {} + } + } + }, + "404": { + "description": "", "content": { "application/json": { "schema": { - "items": { - "$ref": "#/components/schemas/MdocRecord" + "properties": { + "reason": { + "type": "string" + } }, - "type": "array" + "required": [ + "reason" + ], + "type": "object" } } } - } - }, - "description": "Fetch all mso mdoc credentials in wallet", - "tags": [ - "oid4vc holders" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [] - } - }, - "/openid4vc/holder/mdoc-vcs/decode": { - "post": { - "operationId": "DecodeMdocCredential", - "responses": { - "200": { - "description": "Ok", + }, + "500": { + "description": "", "content": { "application/json": { - "schema": {} + "schema": { + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" + } } } } }, - "description": "Decode mso mdoc credential in wallet", "tags": [ - "oid4vc holders" + "MultiTenancy" ], "security": [ { "jwt": [ - "tenant", - "dedicated" + "Basewallet" ] } ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "properties": { - "base64Url": { - "type": "string" - } - }, - "required": [ - "base64Url" - ], - "type": "object" - } + "parameters": [ + { + "in": "path", + "name": "tenantId", + "required": true, + "schema": { + "type": "string" } } - } - } - }, - "/openid4vc/holder/resolve-credential-offer": { - "post": { - "operationId": "ResolveCredOffer", + ] + }, + "delete": { + "operationId": "DeleteTenantById", "responses": { "200": { "description": "Ok", @@ -6331,86 +7359,85 @@ "schema": {} } } - } - }, - "description": "Resolve a credential offer", - "tags": [ - "oid4vc holders" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ResolveCredentialOfferBody" + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "reason": { + "type": "string" + } + }, + "required": [ + "reason" + ], + "type": "object" + } } } - } - } - } - }, - "/openid4vc/holder/authorization-request": { - "post": { - "operationId": "RequestAuthorizationForCredential", - "responses": { - "200": { - "description": "Ok", + }, + "500": { + "description": "", "content": { "application/json": { - "schema": {} + "schema": { + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" + } } } } }, "tags": [ - "oid4vc holders" + "MultiTenancy" ], "security": [ { "jwt": [ - "tenant", - "dedicated" + "Basewallet" ] } ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AuthorizeRequestCredentialOffer" - } + "parameters": [ + { + "in": "path", + "name": "tenantId", + "required": true, + "schema": { + "type": "string" } } - } + ] } }, - "/openid4vc/holder/request-credential": { - "post": { - "operationId": "RequestCredential", + "/didcomm/question-answer": { + "get": { + "operationId": "GetQuestionAnswerRecords", "responses": { "200": { - "description": "Ok", + "description": "QuestionAnswerRecord[]", "content": { "application/json": { - "schema": {} + "schema": { + "items": {}, + "type": "array" + } } } } }, - "description": "Initiates a token request, then requests credentials from issuer", + "description": "Retrieve question and answer records by query", "tags": [ - "oid4vc holders" + "DIDComm - Question Answer" ], "security": [ { @@ -6420,35 +7447,67 @@ ] } ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RequestCredentialBody" - } + "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" } } - } + ] } }, - "/openid4vc/holder/resolve-proof-request": { + "/didcomm/question-answer/question/{connectionId}": { "post": { - "operationId": "ResolveProofRequest", + "operationId": "SendQuestion", "responses": { "200": { "description": "Ok", "content": { "application/json": { - "schema": {} + "schema": { + "$ref": "#/components/schemas/Record_string.unknown_" + }, + "examples": { + "Example 1": {} + } } } } }, - "description": "Resolve a proof request", + "description": "Send a question to a connection", "tags": [ - "oid4vc holders" + "DIDComm - Question Answer" ], "security": [ { @@ -6458,35 +7517,65 @@ ] } ], - "parameters": [], + "parameters": [ + { + "description": "Connection identifier", + "in": "path", + "name": "connectionId", + "required": true, + "schema": { + "$ref": "#/components/schemas/RecordId" + } + } + ], "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ResolveProofRequest" + "properties": { + "detail": { + "type": "string" + }, + "validResponses": { + "items": { + "$ref": "#/components/schemas/ValidResponse" + }, + "type": "array" + }, + "question": { + "type": "string" + } + }, + "required": [ + "validResponses", + "question" + ], + "type": "object" } } } } } }, - "/openid4vc/holder/accept-proof-request": { + "/didcomm/question-answer/answer/{id}": { "post": { - "operationId": "AcceptProofRequest", + "operationId": "SendAnswer", "responses": { "200": { "description": "Ok", "content": { "application/json": { - "schema": {} + "schema": { + "$ref": "#/components/schemas/Record_string.unknown_" + } } } } }, - "description": "Accept a proof request", + "description": "Send a answer to question", "tags": [ - "oid4vc holders" + "DIDComm - Question Answer" ], "security": [ { @@ -6496,34 +7585,47 @@ ] } ], - "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/ResolveProofRequest" + "$ref": "#/components/schemas/Record_response.string_" } } } } } }, - "/openid4vc/holder/decode-sdjwt": { - "post": { - "operationId": "DecodeSdJwt", + "/didcomm/question-answer/{id}": { + "get": { + "operationId": "GetQuestionAnswerRecordById", "responses": { "200": { - "description": "Ok", + "description": "ConnectionRecord", "content": { "application/json": { - "schema": {} + "schema": { + "$ref": "#/components/schemas/Record_string.unknown_" + } } } } }, + "description": "Retrieve question answer record by id", "tags": [ - "oid4vc holders" + "DIDComm - Question Answer" ], "security": [ { @@ -6533,370 +7635,398 @@ ] } ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "properties": { - "jwt": { - "type": "string" - } - }, - "required": [ - "jwt" - ], - "type": "object" - } - } - } - } - } - }, - "/openid4vc/holder/credential": { - "delete": { - "operationId": "Delete", - "responses": { - "204": { - "description": "No content" - } - }, - "tags": [ - "oid4vc holders" - ], - "security": [ + "parameters": [ { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DeleteCredentialBody" - } + "in": "path", + "name": "id", + "required": true, + "schema": { + "$ref": "#/components/schemas/RecordId" } } - } + ] } }, - "/multi-tenancy/create-tenant": { - "post": { - "operationId": "CreateTenant", + "/didcomm/oob": { + "get": { + "operationId": "GetAllOutOfBandRecords", "responses": { "200": { - "description": "Ok", + "description": "OutOfBandRecord[]", "content": { "application/json": { "schema": { - "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" + "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": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateTenantOptions" - } + "parameters": [ + { + "description": "invitation identifier", + "in": "query", + "name": "invitationId", + "required": false, + "schema": { + "$ref": "#/components/schemas/RecordId" } } - } + ] } }, - "/multi-tenancy/get-token/{tenantId}": { - "post": { - "operationId": "GetTenantToken", + "/didcomm/oob/{outOfBandId}": { + "get": { + "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" } } ] - } - }, - "/multi-tenancy/{tenantId}": { - "get": { - "operationId": "GetTenantById", + }, + "delete": { + "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" } } ] - }, - "delete": { - "operationId": "DeleteTenantById", + } + }, + "/didcomm/oob/create-invitation": { + "post": { + "operationId": "CreateInvitation", "responses": { "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": {} - } - } - }, - "404": { - "description": "", + "description": "Out of band record", "content": { "application/json": { "schema": { "properties": { - "reason": { + "invitationDid": { + "type": "string" + }, + "outOfBandRecord": { + "$ref": "#/components/schemas/Record_string.unknown_" + }, + "invitation": { + "$ref": "#/components/schemas/DidCommPlaintextMessage" + }, + "invitationUrl": { "type": "string" } }, "required": [ - "reason" + "invitationDid", + "outOfBandRecord", + "invitation", + "invitationUrl" ], "type": "object" - } - } - } - }, - "500": { - "description": "", - "content": { - "application/json": { - "schema": { - "properties": { - "message": { - "type": "string" + }, + "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 + } } - }, - "required": [ - "message" - ], - "type": "object" + } } } } } }, + "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": [ - "MultiTenancy" + "DIDComm - Out Of Band" ], "security": [ { "jwt": [ - "Basewallet" + "tenant", + "dedicated" ] } ], - "parameters": [ - { - "in": "path", - "name": "tenantId", - "required": true, - "schema": { - "type": "string" + "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/question-answer": { - "get": { - "operationId": "GetQuestionAnswerRecords", + "/didcomm/oob/create-legacy-connectionless-invitation": { + "post": { + "operationId": "CreateLegacyConnectionlessInvitation", "responses": { "200": { - "description": "QuestionAnswerRecord[]", + "description": "a message and a invitationUrl", "content": { "application/json": { "schema": { - "items": {}, - "type": "array" + "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": "Retrieve question and answer records by query", + "description": "Creates a new connectionless legacy invitation.", "tags": [ - "DIDComm - Question Answer" + "DIDComm - Out Of Band" ], "security": [ { @@ -6906,67 +8036,129 @@ ] } ], - "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" + "parameters": [], + "requestBody": { + "description": "configuration of how a connection invitation should be created", + "required": true, + "content": { + "application/json": { + "schema": { + "properties": { + "routing": { + "$ref": "#/components/schemas/DidCommRouting" + }, + "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/question-answer/question/{connectionId}": { + "/didcomm/oob/receive-invitation": { "post": { - "operationId": "SendQuestion", + "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/Record_string.unknown_" + "properties": { + "connectionRecord": { + "$ref": "#/components/schemas/Record_string.unknown_" + }, + "outOfBandRecord": { + "$ref": "#/components/schemas/Record_string.unknown_" + } + }, + "required": [ + "connectionRecord", + "outOfBandRecord" + ], + "type": "object" }, "examples": { - "Example 1": {} + "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": "Send a question to a connection", + "description": "Creates inbound out-of-band record and assigns out-of-band invitation message to it if the\nmessage is valid.", "tags": [ - "DIDComm - Question Answer" + "DIDComm - Out Of Band" ], "security": [ { @@ -6976,65 +8168,108 @@ ] } ], - "parameters": [ - { - "description": "Connection identifier", - "in": "path", - "name": "connectionId", - "required": true, - "schema": { - "$ref": "#/components/schemas/RecordId" - } - } - ], + "parameters": [], "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" + "$ref": "#/components/schemas/ReceiveInvitationProps" } } } } } }, - "/didcomm/question-answer/answer/{id}": { + "/didcomm/oob/receive-invitation-url": { "post": { - "operationId": "SendAnswer", + "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/Record_string.unknown_" + "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": "Send a answer to question", + "description": "Creates inbound out-of-band record and assigns out-of-band invitation message to it if the\nmessage is valid.", "tags": [ - "DIDComm - Question Answer" + "DIDComm - Out Of Band" ], "security": [ { @@ -7044,84 +8279,46 @@ ] } ], - "parameters": [ - { - "description": "The id of the question answer record", - "in": "path", - "name": "id", - "required": true, - "schema": { - "$ref": "#/components/schemas/RecordId" - } - } - ], + "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Record_response.string_" + "$ref": "#/components/schemas/ReceiveInvitationByUrlProps" } } } } } }, - "/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/oob": { - "get": { - "operationId": "GetAllOutOfBandRecords", + "/didcomm/oob/{outOfBandId}/accept-invitation": { + "post": { + "operationId": "AcceptInvitation", "responses": { "200": { - "description": "OutOfBandRecord[]", + "description": "Ok", "content": { "application/json": { "schema": { - "items": {}, - "type": "array" + "properties": { + "connectionRecord": { + "$ref": "#/components/schemas/Record_string.unknown_" + }, + "outOfBandRecord": { + "$ref": "#/components/schemas/Record_string.unknown_" + } + }, + "required": [ + "connectionRecord", + "outOfBandRecord" + ], + "type": "object" }, "examples": { "Example 1": { - "value": [ - { + "value": { + "outOfBandRecord": { "_tags": { "invitationId": "1cbd22e4-1906-41e9-8807-83d84437f978", "state": "await-response", @@ -7155,9 +8352,97 @@ ] }, "metadata": {}, - "id": "42a95528-0e30-4f86-a462-0efb02178b53", + "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/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", - "reusable": false + "did": "did:peer:1zQmfQh1T3rSqarP2FZ37uKjdQHPKFdVyo2mGiAPHZ8Ep7hv", + "invitationDid": "did:peer:2.SeyJzIjoiaHR0cHM6Ly9kYTIzLTg5LTIwLTE2Mi0xNDYubmdyb2suaW8iLCJ0IjoiZGlkLWNvbW11bmljYXRpb24iLCJwcmlvcml0eSI6MCwicmVjaXBpZW50S2V5cyI6WyJkaWQ6a2V5Ono2TWtualg3U1lXRmdHMThCYkNEZHJnemhuQnA0UlhyOGVITHZxQ3FvRXllckxiTiN6Nk1rbmpYN1NZV0ZnRzE4QmJDRGRyZ3pobkJwNFJYcjhlSEx2cUNxb0V5ZXJMYk4iXSwiciI6W119", + "outOfBandId": "edbc89fe-785f-4774-a288-46012486881d" } ] } @@ -7166,9 +8451,9 @@ } } }, - "description": "Retrieve all out of band records", + "description": "Retrieve all connections records", "tags": [ - "DIDComm - Out Of Band" + "DIDComm - Connections" ], "security": [ { @@ -7180,23 +8465,67 @@ ], "parameters": [ { - "description": "invitation identifier", "in": "query", - "name": "invitationId", + "name": "outOfBandId", "required": false, "schema": { - "$ref": "#/components/schemas/RecordId" + "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/DidCommDidExchangeState" + } + }, + { + "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/oob/{outOfBandId}": { + "/didcomm/connections/{connectionId}": { "get": { - "operationId": "GetOutOfBandRecordById", + "operationId": "GetConnectionById", "responses": { "200": { - "description": "OutOfBandRecord", + "description": "ConnectionRecord", "content": { "application/json": { "schema": { @@ -7206,41 +8535,18 @@ "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": [] - } - ] + "invitationDid": "did:peer:2.SeyJzIjoiaHR0cHM6Ly9kYTIzLTg5LTIwLTE2Mi0xNDYubmdyb2suaW8iLCJ0IjoiZGlkLWNvbW11bmljYXRpb24iLCJwcmlvcml0eSI6MCwicmVjaXBpZW50S2V5cyI6WyJkaWQ6a2V5Ono2TWtualg3U1lXRmdHMThCYkNEZHJnemhuQnA0UlhyOGVITHZxQ3FvRXllckxiTiN6Nk1rbmpYN1NZV0ZnRzE4QmJDRGRyZ3pobkJwNFJYcjhlSEx2cUNxb0V5ZXJMYk4iXSwiciI6W119", + "did": "did:peer:1zQmfQh1T3rSqarP2FZ37uKjdQHPKFdVyo2mGiAPHZ8Ep7hv", + "invitationKey": "9HG4rJFpLiWf56MWxHj9rgdpErFzim2zEpHuxy1dw7oz", + "outOfBandId": "edbc89fe-785f-4774-a288-46012486881d", + "verkey": "9HG4rJFpLiWf56MWxHj9rgdpErFzim2zEpHuxy1dw7oz" }, "metadata": {}, - "id": "42a95528-0e30-4f86-a462-0efb02178b53", + "id": "821f9b26-ad04-4f56-89b6-e2ef9c72b36e", "createdAt": "2022-01-01T00:00:00.000Z", - "reusable": false + "did": "did:peer:1zQmfQh1T3rSqarP2FZ37uKjdQHPKFdVyo2mGiAPHZ8Ep7hv", + "invitationDid": "did:peer:2.SeyJzIjoiaHR0cHM6Ly9kYTIzLTg5LTIwLTE2Mi0xNDYubmdyb2suaW8iLCJ0IjoiZGlkLWNvbW11bmljYXRpb24iLCJwcmlvcml0eSI6MCwicmVjaXBpZW50S2V5cyI6WyJkaWQ6a2V5Ono2TWtualg3U1lXRmdHMThCYkNEZHJnemhuQnA0UlhyOGVITHZxQ3FvRXllckxiTiN6Nk1rbmpYN1NZV0ZnRzE4QmJDRGRyZ3pobkJwNFJYcjhlSEx2cUNxb0V5ZXJMYk4iXSwiciI6W119", + "outOfBandId": "edbc89fe-785f-4774-a288-46012486881d" } } } @@ -7248,9 +8554,9 @@ } } }, - "description": "Retrieve an out of band record by id", + "description": "Retrieve connection record by connection id", "tags": [ - "DIDComm - Out Of Band" + "DIDComm - Connections" ], "security": [ { @@ -7262,8 +8568,9 @@ ], "parameters": [ { + "description": "Connection identifier", "in": "path", - "name": "outOfBandId", + "name": "connectionId", "required": true, "schema": { "$ref": "#/components/schemas/RecordId" @@ -7272,15 +8579,15 @@ ] }, "delete": { - "operationId": "DeleteOutOfBandRecord", + "operationId": "DeleteConnection", "responses": { "204": { "description": "No content" } }, - "description": "Deletes an out of band record from the repository.", + "description": "Deletes a connection record from the connection repository.", "tags": [ - "DIDComm - Out Of Band" + "DIDComm - Connections" ], "security": [ { @@ -7292,114 +8599,44 @@ ], "parameters": [ { - "description": "Record identifier", + "description": "Connection identifier", "in": "path", - "name": "outOfBandId", + "name": "connectionId", "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/DidCommPlaintextMessage" - }, - "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 - } + } + } + ] + } + }, + "/didcomm/connections/{connectionId}/accept-request": { + "post": { + "operationId": "AcceptRequest", + "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" } } } @@ -7407,9 +8644,9 @@ } } }, - "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.", + "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 - Out Of Band" + "DIDComm - Connections" ], "security": [ { @@ -7419,63 +8656,46 @@ ] } ], - "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" - } + "parameters": [ + { + "description": "Connection identifier", + "in": "path", + "name": "connectionId", + "required": true, + "schema": { + "$ref": "#/components/schemas/RecordId" } } - } + ] } }, - "/didcomm/oob/create-legacy-connectionless-invitation": { + "/didcomm/connections/{connectionId}/accept-response": { "post": { - "operationId": "CreateLegacyConnectionlessInvitation", + "operationId": "AcceptResponse", "responses": { "200": { - "description": "a message and a invitationUrl", + "description": "ConnectionRecord", "content": { "application/json": { "schema": { - "properties": { - "outOfBandRecord": { - "$ref": "#/components/schemas/DidCommOutOfBandRecord" - }, - "invitationUrl": { - "type": "string" - }, - "message": { - "$ref": "#/components/schemas/DidCommMessage" - } - }, - "required": [ - "outOfBandRecord", - "invitationUrl", - "message" - ], - "type": "object" + "$ref": "#/components/schemas/Record_string.unknown_" }, "examples": { "Example 1": { "value": { - "message": { - "@id": "eac4ff4e-b4fb-4c1d-aef3-b29c89d1cc00", - "@type": "https://didcomm.org/connections/1.0/invitation" + "_tags": { + "invitationDid": "did:peer:2.SeyJzIjoiaHR0cHM6Ly9kYTIzLTg5LTIwLTE2Mi0xNDYubmdyb2suaW8iLCJ0IjoiZGlkLWNvbW11bmljYXRpb24iLCJwcmlvcml0eSI6MCwicmVjaXBpZW50S2V5cyI6WyJkaWQ6a2V5Ono2TWtualg3U1lXRmdHMThCYkNEZHJnemhuQnA0UlhyOGVITHZxQ3FvRXllckxiTiN6Nk1rbmpYN1NZV0ZnRzE4QmJDRGRyZ3pobkJwNFJYcjhlSEx2cUNxb0V5ZXJMYk4iXSwiciI6W119", + "did": "did:peer:1zQmfQh1T3rSqarP2FZ37uKjdQHPKFdVyo2mGiAPHZ8Ep7hv", + "invitationKey": "9HG4rJFpLiWf56MWxHj9rgdpErFzim2zEpHuxy1dw7oz", + "outOfBandId": "edbc89fe-785f-4774-a288-46012486881d", + "verkey": "9HG4rJFpLiWf56MWxHj9rgdpErFzim2zEpHuxy1dw7oz" }, - "invitationUrl": "http://example.com/invitation_url" + "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" } } } @@ -7483,9 +8703,9 @@ } } }, - "description": "Creates a new connectionless legacy invitation.", + "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 - Out Of Band" + "DIDComm - Connections" ], "security": [ { @@ -7495,118 +8715,122 @@ ] } ], - "parameters": [], - "requestBody": { - "description": "configuration of how a connection invitation should be created", - "required": true, - "content": { - "application/json": { - "schema": { - "properties": { - "routing": { - "$ref": "#/components/schemas/DidCommRouting" - }, - "domain": { - "type": "string" - }, - "message": { - "$ref": "#/components/schemas/Record_string.unknown_" + "parameters": [ + { + "description": "Connection identifier", + "in": "path", + "name": "connectionId", + "required": true, + "schema": { + "$ref": "#/components/schemas/RecordId" + } + } + ] + } + }, + "/didcomm/url/{invitationId}": { + "get": { + "operationId": "GetInvitation", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/DidCommConnectionRecord" }, - "recordId": { - "type": "string" - } - }, - "required": [ - "domain", - "message", - "recordId" - ], - "type": "object", - "description": "configuration of how a connection invitation should be created" + "type": "array" + } } } } - } + }, + "tags": [ + "DIDComm - Connections" + ], + "security": [], + "parameters": [ + { + "in": "path", + "name": "invitationId", + "required": true, + "schema": { + "type": "string" + } + } + ] } }, - "/didcomm/oob/receive-invitation": { - "post": { - "operationId": "ReceiveInvitation", + "/dids/{did}": { + "get": { + "operationId": "GetDidRecordByDid", "responses": { "200": { - "description": "out-of-band record and connection record if one has been created.", + "description": "Ok", "content": { "application/json": { "schema": { "properties": { - "connectionRecord": { - "$ref": "#/components/schemas/Record_string.unknown_" + "didDocumentMetadata": { + "$ref": "#/components/schemas/DIDDocumentMetadata" }, - "outOfBandRecord": { - "$ref": "#/components/schemas/Record_string.unknown_" + "didResolutionMetadata": { + "$ref": "#/components/schemas/DidResolutionMetadata" + }, + "didDocument": { + "$ref": "#/components/schemas/Record_string.any_" } }, "required": [ - "connectionRecord", - "outOfBandRecord" + "didDocumentMetadata", + "didResolutionMetadata", + "didDocument" ], "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 + "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" + } + ] }, - "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" + "didDocumentMetadata": {}, + "didResolutionMetadata": { + "contentType": "application/did+ld+json" } } } @@ -7615,9 +8839,8 @@ } } }, - "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" + "Dids" ], "security": [ { @@ -7627,97 +8850,48 @@ ] } ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ReceiveInvitationProps" - } + "parameters": [ + { + "in": "path", + "name": "did", + "required": true, + "schema": { + "$ref": "#/components/schemas/Did" } } - } + ] } }, - "/didcomm/oob/receive-invitation-url": { + "/dids/write": { "post": { - "operationId": "ReceiveInvitationFromUrl", + "operationId": "WriteDid", "responses": { "200": { - "description": "out-of-band record and connection record if one has been created.", + "description": "DidResolutionResult", "content": { "application/json": { - "schema": { - "properties": { - "connectionRecord": { - "$ref": "#/components/schemas/Record_string.unknown_" - }, - "outOfBandRecord": { - "$ref": "#/components/schemas/Record_string.unknown_" - } - }, - "required": [ - "connectionRecord", - "outOfBandRecord" - ], - "type": "object" - }, + "schema": {}, "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" + "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" + ] } } } @@ -7726,9 +8900,9 @@ } } }, - "description": "Creates inbound out-of-band record and assigns out-of-band invitation message to it if the\nmessage is valid.", + "description": "Did nym registration", "tags": [ - "DIDComm - Out Of Band" + "Dids" ], "security": [ { @@ -7744,102 +8918,33 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ReceiveInvitationByUrlProps" + "$ref": "#/components/schemas/DidCreate" } } } } } }, - "/didcomm/oob/{outOfBandId}/accept-invitation": { - "post": { - "operationId": "AcceptInvitation", + "/dids": { + "get": { + "operationId": "GetDids", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "properties": { - "connectionRecord": { - "$ref": "#/components/schemas/Record_string.unknown_" - }, - "outOfBandRecord": { - "$ref": "#/components/schemas/Record_string.unknown_" - } + "items": { + "$ref": "#/components/schemas/DidRecord" }, - "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" - } - } - } + "type": "array" } } } } }, - "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" + "Dids" ], "security": [ { @@ -7849,13 +8954,36 @@ ] } ], + "parameters": [] + } + }, + "/v1/orgs/{orgId}/token": { + "post": { + "operationId": "GetOrgToken", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OrgTokenResponse" + } + } + } + } + }, + "description": "Generate an organization token by forwarding credentials to the platform", + "tags": [ + "Auth" + ], + "security": [], "parameters": [ { "in": "path", - "name": "outOfBandId", + "name": "orgId", "required": true, "schema": { - "$ref": "#/components/schemas/RecordId" + "type": "string" } } ], @@ -7864,158 +8992,88 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AcceptInvitationConfig" + "$ref": "#/components/schemas/OrgTokenRequest" } } } } } }, - "/didcomm/connections": { + "/agent": { "get": { - "operationId": "GetAllConnections", + "operationId": "GetAgentInfo", "responses": { "200": { - "description": "ConnectionRecord[]", + "description": "Ok", "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" - } - ] - } + "$ref": "#/components/schemas/AgentInfo" } } } } }, - "description": "Retrieve all connections records", + "description": "Retrieve basic agent information", "tags": [ - "DIDComm - Connections" + "Agent" ], "security": [ { "jwt": [ "tenant", - "dedicated" + "dedicated", + "Basewallet" ] } ], - "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/DidCommDidExchangeState" - } - }, - { - "description": "My DID", - "in": "query", - "name": "myDid", - "required": false, - "schema": { - "type": "string" - } - }, - { - "description": "Their DID", - "in": "query", - "name": "theirDid", - "required": false, - "schema": { - "type": "string" + "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": [ { - "description": "Their label", - "in": "query", - "name": "theirLabel", - "required": false, - "schema": { - "type": "string" - } + "apiKey": [] } - ] + ], + "parameters": [] } }, - "/didcomm/connections/{connectionId}": { - "get": { - "operationId": "GetConnectionById", + "/agent/credential/verify": { + "post": { + "operationId": "VerifyCredential", "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" - } - } + "$ref": "#/components/schemas/W3cVerifyCredentialResult" } } } } }, - "description": "Retrieve connection record by connection id", "tags": [ - "DIDComm - Connections" + "Agent" ], "security": [ { @@ -8025,28 +9083,56 @@ ] } ], - "parameters": [ - { - "description": "Connection identifier", - "in": "path", - "name": "connectionId", - "required": true, - "schema": { - "$ref": "#/components/schemas/RecordId" + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "$ref": "#/components/schemas/SafeW3cJsonLdVerifyCredentialOptions" + }, + {} + ] + } } } - ] - }, - "delete": { - "operationId": "DeleteConnection", + } + } + }, + "/anoncreds/schemas/{schemaId}": { + "get": { + "operationId": "GetSchemaById", "responses": { - "204": { - "description": "No content" + "200": { + "description": "get schema by Id", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SchemaResponseDTO" + }, + "examples": { + "Example 1": { + "value": { + "ver": "1.0", + "id": "WgWxqztrNooG92RXvxSTWv:2:schema_name:1.0", + "name": "schema", + "version": "1.0", + "attrNames": [ + "string" + ], + "seqNo": 351936 + } + } + } + } + } } }, - "description": "Deletes a connection record from the connection repository.", + "description": "Get schema by schemaId", "tags": [ - "DIDComm - Connections" + "Anoncreds - Schemas" ], "security": [ { @@ -8058,44 +9144,48 @@ ], "parameters": [ { - "description": "Connection identifier", "in": "path", - "name": "connectionId", + "name": "schemaId", "required": true, "schema": { - "$ref": "#/components/schemas/RecordId" + "$ref": "#/components/schemas/SchemaId" } } ] } }, - "/didcomm/connections/{connectionId}/accept-request": { + "/anoncreds/schemas": { "post": { - "operationId": "AcceptRequest", + "operationId": "CreateSchema", "responses": { "200": { - "description": "ConnectionRecord", + "description": "get schema", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Record_string.unknown_" + "anyOf": [ + { + "$ref": "#/components/schemas/RegisterSchemaReturn" + }, + { + "$ref": "#/components/schemas/RegisterSchemaReturnStateFinished" + } + ] }, "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" + "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" } } } @@ -8103,9 +9193,9 @@ } } }, - "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.", + "description": "Create schema", "tags": [ - "DIDComm - Connections" + "Anoncreds - Schemas" ], "security": [ { @@ -8115,46 +9205,63 @@ ] } ], - "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/CreateSchemaInput" + } } } - ] + } } }, - "/didcomm/connections/{connectionId}/accept-response": { - "post": { - "operationId": "AcceptResponse", + "/anoncreds/credential-definitions/{credentialDefinitionId}": { + "get": { + "operationId": "GetCredentialDefinitionById", "responses": { "200": { - "description": "ConnectionRecord", + "description": "CredDef", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Record_string.unknown_" + "$ref": "#/components/schemas/GetCredentialDefinitionReturn" }, "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" + "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" + } + } } } } @@ -8162,9 +9269,9 @@ } } }, - "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.", + "description": "Retrieve credential definition by credential definition id", "tags": [ - "DIDComm - Connections" + "Anoncreds - Credential Definitions" ], "security": [ { @@ -8176,192 +9283,171 @@ ], "parameters": [ { - "description": "Connection identifier", "in": "path", - "name": "connectionId", + "name": "credentialDefinitionId", "required": true, "schema": { - "$ref": "#/components/schemas/RecordId" + "$ref": "#/components/schemas/CredentialDefinitionId" } } ] } }, - "/didcomm/url/{invitationId}": { - "get": { - "operationId": "GetInvitation", + "/anoncreds/credential-definitions": { + "post": { + "operationId": "CreateCredentialDefinition", "responses": { "200": { - "description": "Ok", + "description": "CredDef", "content": { "application/json": { "schema": { - "items": { - "$ref": "#/components/schemas/DidCommConnectionRecord" - }, - "type": "array" + "anyOf": [ + { + "$ref": "#/components/schemas/RegisterCredentialDefinitionReturn" + }, + { + "$ref": "#/components/schemas/CredentialDefinitionStates" + } + ] + }, + "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": [ - "DIDComm - Connections" + "Anoncreds - Credential Definitions" ], - "security": [], - "parameters": [ + "security": [ { - "in": "path", - "name": "invitationId", - "required": true, - "schema": { - "type": "string" - } + "jwt": [ + "tenant", + "dedicated" + ] } - ] - } - }, - "/dids/{did}": { - "get": { - "operationId": "GetDidRecordByDid", - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": { - "properties": { - "didDocumentMetadata": { - "$ref": "#/components/schemas/DIDDocumentMetadata" - }, - "didResolutionMetadata": { - "$ref": "#/components/schemas/DidResolutionMetadata" - }, - "didDocument": { - "$ref": "#/components/schemas/Record_string.any_" - } + ], + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "properties": { + "endorserDid": { + "type": "string" }, - "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" - } - } + "endorse": { + "type": "boolean" + }, + "tag": { + "type": "string" + }, + "schemaId": { + "$ref": "#/components/schemas/SchemaId" + }, + "issuerId": { + "type": "string" } - } + }, + "required": [ + "tag", + "schemaId", + "issuerId" + ], + "type": "object" } } } - }, - "tags": [ - "Dids" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [ - { - "in": "path", - "name": "did", - "required": true, - "schema": { - "$ref": "#/components/schemas/Did" - } - } - ] + } } }, - "/dids/write": { - "post": { - "operationId": "WriteDid", + "/didcomm/credentials": { + "get": { + "operationId": "GetAllCredentials", "responses": { "200": { - "description": "DidResolutionResult", + "description": "CredentialExchangeRecord[]", "content": { "application/json": { - "schema": {}, + "schema": { + "items": { + "$ref": "#/components/schemas/Record_string.unknown_" + }, + "type": "array" + }, "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" + "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" } - ], - "authentication": [ - "did:indy:bcovrin:testnet:LRCUFcizUL74AGgLqdJHK7#verkey" - ] + }, + "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": "Did nym registration", + "description": "Retrieve all credential exchange records", "tags": [ - "Dids" + "DIDComm - Credentials" ], "security": [ { @@ -8371,22 +9457,53 @@ ] } ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DidCreate" - } + "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/DidCommCredentialState" + } + }, + { + "in": "query", + "name": "role", + "required": false, + "schema": { + "$ref": "#/components/schemas/DidCommCredentialRole" } } - } + ] } }, - "/dids": { + "/didcomm/credentials/w3c": { "get": { - "operationId": "GetDids", + "operationId": "GetAllW3c", "responses": { "200": { "description": "Ok", @@ -8394,7 +9511,7 @@ "application/json": { "schema": { "items": { - "$ref": "#/components/schemas/DidRecord" + "$ref": "#/components/schemas/W3cCredentialRecord" }, "type": "array" } @@ -8403,7 +9520,7 @@ } }, "tags": [ - "Dids" + "DIDComm - Credentials" ], "security": [ { @@ -8416,123 +9533,213 @@ "parameters": [] } }, - "/v1/orgs/{orgId}/token": { - "post": { - "operationId": "GetOrgToken", + "/didcomm/credentials/w3c/{id}": { + "get": { + "operationId": "GetW3cById", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/OrgTokenResponse" + "$ref": "#/components/schemas/W3cCredentialRecord" } } } } }, - "description": "Generate an organization token by forwarding credentials to the platform", "tags": [ - "Auth" + "DIDComm - Credentials" + ], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } ], - "security": [], "parameters": [ { "in": "path", - "name": "orgId", + "name": "id", "required": true, "schema": { "type": "string" } } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OrgTokenRequest" - } - } - } - } + ] } }, - "/agent": { + "/didcomm/credentials/{credentialRecordId}": { "get": { - "operationId": "GetAgentInfo", + "operationId": "GetCredentialById", "responses": { "200": { - "description": "Ok", + "description": "CredentialExchangeRecord", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AgentInfo" + "$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 basic agent information", + "description": "Retrieve credential exchange record by credential record id", "tags": [ - "Agent" + "DIDComm - Credentials" ], "security": [ { "jwt": [ "tenant", - "dedicated", - "Basewallet" + "dedicated" ] } ], - "parameters": [] + "parameters": [ + { + "in": "path", + "name": "credentialRecordId", + "required": true, + "schema": { + "$ref": "#/components/schemas/RecordId" + } + } + ] } }, - "/agent/token": { + "/didcomm/credentials/propose-credential": { "post": { - "operationId": "GetAgentToken", + "operationId": "ProposeCredential", "responses": { "200": { - "description": "Ok", + "description": "CredentialExchangeRecord", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AgentToken" + "$ref": "#/components/schemas/DidCommCredentialExchangeRecord" + }, + "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 agent token", + "description": "Initiate a new credential exchange as holder by sending a propose credential message\nto the connection with a specified connection id.", "tags": [ - "Agent" + "DIDComm - Credentials" ], "security": [ { - "apiKey": [] + "jwt": [ + "tenant", + "dedicated" + ] } ], - "parameters": [] + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProposeCredentialOptions" + } + } + } + } } }, - "/agent/credential/verify": { + "/didcomm/credentials/accept-proposal": { "post": { - "operationId": "VerifyCredential", + "operationId": "AcceptProposal", "responses": { "200": { - "description": "Ok", + "description": "CredentialExchangeRecord", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/W3cVerifyCredentialResult" + "$ref": "#/components/schemas/DidCommCredentialExchangeRecord" + }, + "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": [ - "Agent" + "DIDComm - Credentials" ], "security": [ { @@ -8548,40 +9755,45 @@ "content": { "application/json": { "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/SafeW3cJsonLdVerifyCredentialOptions" - }, - {} - ] + "$ref": "#/components/schemas/AcceptCredentialProposalOptions" } } } } } }, - "/anoncreds/schemas/{schemaId}": { - "get": { - "operationId": "GetSchemaById", + "/didcomm/credentials/create-offer": { + "post": { + "operationId": "CreateOffer", "responses": { "200": { - "description": "get schema by Id", + "description": "AgentMessage, CredentialExchangeRecord", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SchemaResponseDTO" + "$ref": "#/components/schemas/DidCommCredentialExchangeRecord" }, "examples": { "Example 1": { "value": { - "ver": "1.0", - "id": "WgWxqztrNooG92RXvxSTWv:2:schema_name:1.0", - "name": "schema", - "version": "1.0", - "attrNames": [ - "string" - ], - "seqNo": 351936 + "_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" } } } @@ -8589,9 +9801,9 @@ } } }, - "description": "Get schema by schemaId", + "description": "Initiate a new credential exchange as issuer by creating a credential offer\nwithout specifying a connection id", "tags": [ - "Anoncreds - Schemas" + "DIDComm - Credentials" ], "security": [ { @@ -8601,60 +9813,64 @@ ] } ], - "parameters": [ - { - "in": "path", - "name": "schemaId", - "required": true, - "schema": { - "$ref": "#/components/schemas/SchemaId" + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateOfferOptions" + } } } - ] + } } }, - "/anoncreds/schemas": { + "/didcomm/credentials/create-offer-oob": { "post": { - "operationId": "CreateSchema", + "operationId": "CreateOfferOob", "responses": { "200": { - "description": "get schema", + "description": "Ok", "content": { "application/json": { "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/RegisterSchemaReturn" + "properties": { + "invitationDid": { + "type": "string" }, - { - "$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" + "credentialRequestThId": { + "type": "string" + }, + "outOfBandRecordId": { + "type": "string" + }, + "outOfBandRecord": { + "$ref": "#/components/schemas/Record_string.unknown_" + }, + "invitation": { + "$ref": "#/components/schemas/DidCommPlaintextMessage" + }, + "invitationUrl": { + "type": "string" } - } + }, + "required": [ + "invitationDid", + "credentialRequestThId", + "outOfBandRecordId", + "outOfBandRecord", + "invitation", + "invitationUrl" + ], + "type": "object" } } } } }, - "description": "Create schema", "tags": [ - "Anoncreds - Schemas" + "DIDComm - Credentials" ], "security": [ { @@ -8670,57 +9886,45 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateSchemaInput" + "$ref": "#/components/schemas/CreateOfferOobOptions" } } } } } }, - "/anoncreds/credential-definitions/{credentialDefinitionId}": { - "get": { - "operationId": "GetCredentialDefinitionById", + "/didcomm/credentials/accept-offer": { + "post": { + "operationId": "AcceptOffer", "responses": { "200": { - "description": "CredDef", + "description": "CredentialExchangeRecord", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GetCredentialDefinitionReturn" + "$ref": "#/components/schemas/DidCommCredentialExchangeRecord" }, "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" + "_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" } } } @@ -8728,9 +9932,9 @@ } } }, - "description": "Retrieve credential definition by credential definition id", + "description": "Accept a credential offer as holder by sending an accept offer message\nto the connection associated with the credential exchange record.", "tags": [ - "Anoncreds - Credential Definitions" + "DIDComm - Credentials" ], "security": [ { @@ -8738,84 +9942,63 @@ "tenant", "dedicated" ] - } - ], - "parameters": [ - { - "in": "path", - "name": "credentialDefinitionId", - "required": true, - "schema": { - "$ref": "#/components/schemas/CredentialDefinitionId" + } + ], + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CredentialOfferOptions" + } } } - ] + } } }, - "/anoncreds/credential-definitions": { + "/didcomm/credentials/accept-request": { "post": { - "operationId": "CreateCredentialDefinition", + "operationId": "AcceptRequest", "responses": { "200": { - "description": "CredDef", + "description": "CredentialExchangeRecord", "content": { "application/json": { "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/RegisterCredentialDefinitionReturn" - }, - { - "$ref": "#/components/schemas/CredentialDefinitionStates" - } - ] + "$ref": "#/components/schemas/DidCommCredentialExchangeRecord" }, "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" + "_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" } } } } } - }, - "202": { - "description": "Wait for action to complete" } }, - "description": "Creates a new credential definition.", + "description": "Accept a credential request as issuer by sending an accept request message\nto the connection associated with the credential exchange record.", "tags": [ - "Anoncreds - Credential Definitions" + "DIDComm - Credentials" ], "security": [ { @@ -8831,80 +10014,53 @@ "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" + "$ref": "#/components/schemas/AcceptCredentialRequestOptions" } } } } } }, - "/didcomm/credentials": { - "get": { - "operationId": "GetAllCredentials", + "/didcomm/credentials/accept-credential": { + "post": { + "operationId": "AcceptCredential", "responses": { "200": { - "description": "CredentialExchangeRecord[]", + "description": "CredentialExchangeRecord", "content": { "application/json": { "schema": { - "items": { - "$ref": "#/components/schemas/Record_string.unknown_" - }, - "type": "array" + "$ref": "#/components/schemas/DidCommCredentialExchangeRecord" }, "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", + "value": { + "_tags": { + "state": "offer-sent", "threadId": "82701488-b43c-4d7b-9244-4bb204a7ae26", - "credentialAttributes": [], - "protocolVersion": "v1" - } - ] + "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", + "description": "Accept a credential as holder by sending an accept credential message\nto the connection associated with the credential exchange record.", "tags": [ "DIDComm - Credentials" ], @@ -8916,68 +10072,35 @@ ] } ], - "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/DidCommCredentialState" - } - }, - { - "in": "query", - "name": "role", - "required": false, - "schema": { - "$ref": "#/components/schemas/DidCommCredentialRole" + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AcceptCredential" + } } } - ] + } } }, - "/didcomm/credentials/w3c": { + "/didcomm/credentials/{credentialRecordId}/form-data": { "get": { - "operationId": "GetAllW3c", + "operationId": "CredentialFormData", "responses": { "200": { - "description": "Ok", + "description": "credentialRecord", "content": { "application/json": { "schema": { - "items": { - "$ref": "#/components/schemas/W3cCredentialRecord" - }, - "type": "array" + "$ref": "#/components/schemas/GetCredentialFormatDataReturn__40_LegacyIndyCredentialFormat-or-DidCommJsonLdCredentialFormat-or-AnonCredsDidCommCredentialFormat_41_-Array_" } } } } }, + "description": "Return credentialRecord", "tags": [ "DIDComm - Credentials" ], @@ -8989,26 +10112,53 @@ ] } ], - "parameters": [] + "parameters": [ + { + "in": "path", + "name": "credentialRecordId", + "required": true, + "schema": { + "type": "string" + } + } + ] } }, - "/didcomm/credentials/w3c/{id}": { + "/didcomm/proofs": { "get": { - "operationId": "GetW3cById", + "operationId": "GetAllProofs", "responses": { "200": { - "description": "Ok", + "description": "ProofRecord[]", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/W3cCredentialRecord" + "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 - Credentials" + "DIDComm - Proofs" ], "security": [ { @@ -9020,9 +10170,9 @@ ], "parameters": [ { - "in": "path", - "name": "id", - "required": true, + "in": "query", + "name": "threadId", + "required": false, "schema": { "type": "string" } @@ -9030,12 +10180,12 @@ ] } }, - "/didcomm/credentials/{credentialRecordId}": { + "/didcomm/proofs/{proofRecordId}": { "get": { - "operationId": "GetCredentialById", + "operationId": "GetProofById", "responses": { "200": { - "description": "CredentialExchangeRecord", + "description": "ProofRecord", "content": { "application/json": { "schema": { @@ -9044,23 +10194,11 @@ "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": [], + "metadata": {}, "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": [], + "connectionId": "2aecf74c-3073-4f98-9acb-92415d096834", + "threadId": "0019d466-5eea-4269-8c40-031b4896c5b7", "protocolVersion": "v1" } } @@ -9069,9 +10207,9 @@ } } }, - "description": "Retrieve credential exchange record by credential record id", + "description": "Retrieve proof record by proof record id", "tags": [ - "DIDComm - Credentials" + "DIDComm - Proofs" ], "security": [ { @@ -9084,7 +10222,7 @@ "parameters": [ { "in": "path", - "name": "credentialRecordId", + "name": "proofRecordId", "required": true, "schema": { "$ref": "#/components/schemas/RecordId" @@ -9093,37 +10231,25 @@ ] } }, - "/didcomm/credentials/propose-credential": { + "/didcomm/proofs/propose-proof": { "post": { - "operationId": "ProposeCredential", + "operationId": "ProposeProof", "responses": { "200": { - "description": "CredentialExchangeRecord", + "description": "ProofRecord", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DidCommCredentialExchangeRecord" + "$ref": "#/components/schemas/DidCommProofExchangeRecord" }, "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": [], + "metadata": {}, "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": [], + "connectionId": "2aecf74c-3073-4f98-9acb-92415d096834", + "threadId": "0019d466-5eea-4269-8c40-031b4896c5b7", "protocolVersion": "v1" } } @@ -9132,9 +10258,9 @@ } } }, - "description": "Initiate a new credential exchange as holder by sending a propose credential message\nto the connection with a specified connection id.", + "description": "Initiate a new presentation exchange as prover by sending a presentation proposal request\nto the connection with the specified connection id.", "tags": [ - "DIDComm - Credentials" + "DIDComm - Proofs" ], "security": [ { @@ -9150,44 +10276,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProposeCredentialOptions" + "$ref": "#/components/schemas/RequestProofProposalOptions" } } } } } }, - "/didcomm/credentials/accept-proposal": { + "/didcomm/proofs/accept-proposal": { "post": { "operationId": "AcceptProposal", "responses": { "200": { - "description": "CredentialExchangeRecord", + "description": "ProofRecord", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DidCommCredentialExchangeRecord" + "$ref": "#/components/schemas/DidCommProofExchangeRecord" }, "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": [], + "metadata": {}, "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": [], + "connectionId": "2aecf74c-3073-4f98-9acb-92415d096834", + "threadId": "0019d466-5eea-4269-8c40-031b4896c5b7", "protocolVersion": "v1" } } @@ -9196,9 +10310,9 @@ } } }, - "description": "Accept a credential proposal as issuer by sending an accept proposal message\nto the connection associated with the credential exchange record.", + "description": "Accept a presentation proposal as verifier by sending an accept proposal message\nto the connection associated with the proof record.", "tags": [ - "DIDComm - Credentials" + "DIDComm - Proofs" ], "security": [ { @@ -9214,44 +10328,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AcceptCredentialProposalOptions" + "$ref": "#/components/schemas/AcceptProofProposal" } } } } } }, - "/didcomm/credentials/create-offer": { + "/didcomm/proofs/request-proof": { "post": { - "operationId": "CreateOffer", + "operationId": "RequestProof", "responses": { "200": { - "description": "AgentMessage, CredentialExchangeRecord", + "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DidCommCredentialExchangeRecord" + "$ref": "#/components/schemas/DidCommProofExchangeRecord" }, "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": [], + "metadata": {}, "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": [], + "connectionId": "2aecf74c-3073-4f98-9acb-92415d096834", + "threadId": "0019d466-5eea-4269-8c40-031b4896c5b7", "protocolVersion": "v1" } } @@ -9260,9 +10362,9 @@ } } }, - "description": "Initiate a new credential exchange as issuer by creating a credential offer\nwithout specifying a connection id", + "description": "Creates a presentation request bound to existing connection", "tags": [ - "DIDComm - Credentials" + "DIDComm - Proofs" ], "security": [ { @@ -9278,16 +10380,16 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateOfferOptions" + "$ref": "#/components/schemas/RequestProofOptions" } } } } } }, - "/didcomm/credentials/create-offer-oob": { + "/didcomm/proofs/create-request-oob": { "post": { - "operationId": "CreateOfferOob", + "operationId": "CreateRequest", "responses": { "200": { "description": "Ok", @@ -9295,13 +10397,13 @@ "application/json": { "schema": { "properties": { - "invitationDid": { + "proofMessageId": { "type": "string" }, - "credentialRequestThId": { + "proofRecordThId": { "type": "string" }, - "outOfBandRecordId": { + "invitationDid": { "type": "string" }, "outOfBandRecord": { @@ -9315,74 +10417,23 @@ } }, "required": [ + "proofMessageId", + "proofRecordThId", "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/DidCommCredentialExchangeRecord" }, "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": [], + "metadata": {}, "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": [], + "connectionId": "2aecf74c-3073-4f98-9acb-92415d096834", + "threadId": "0019d466-5eea-4269-8c40-031b4896c5b7", "protocolVersion": "v1" } } @@ -9391,9 +10442,9 @@ } } }, - "description": "Accept a credential offer as holder by sending an accept offer message\nto the connection associated with the credential exchange record.", + "description": "Creates a presentation request not bound to any proposal or existing connection", "tags": [ - "DIDComm - Credentials" + "DIDComm - Proofs" ], "security": [ { @@ -9409,44 +10460,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CredentialOfferOptions" + "$ref": "#/components/schemas/CreateProofRequestOobOptions" } } } } } }, - "/didcomm/credentials/accept-request": { + "/didcomm/proofs/{proofRecordId}/accept-request": { "post": { "operationId": "AcceptRequest", "responses": { "200": { - "description": "CredentialExchangeRecord", + "description": "ProofRecord", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DidCommCredentialExchangeRecord" + "$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": [], + "metadata": {}, "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": [], + "connectionId": "2aecf74c-3073-4f98-9acb-92415d096834", + "threadId": "0019d466-5eea-4269-8c40-031b4896c5b7", "protocolVersion": "v1" } } @@ -9455,9 +10494,9 @@ } } }, - "description": "Accept a credential request as issuer by sending an accept request message\nto the connection associated with the credential exchange record.", + "description": "Accept a presentation request as prover by sending an accept request message\nto the connection associated with the proof record.", "tags": [ - "DIDComm - Credentials" + "DIDComm - Proofs" ], "security": [ { @@ -9467,50 +10506,58 @@ ] } ], - "parameters": [], + "parameters": [ + { + "in": "path", + "name": "proofRecordId", + "required": true, + "schema": { + "type": "string" + } + } + ], "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AcceptCredentialRequestOptions" + "properties": { + "comment": { + "type": "string" + }, + "filterByNonRevocationRequirements": { + "type": "boolean" + }, + "filterByPresentationPreview": { + "type": "boolean" + } + }, + "type": "object" } } } } } }, - "/didcomm/credentials/accept-credential": { + "/didcomm/proofs/{proofRecordId}/accept-presentation": { "post": { - "operationId": "AcceptCredential", + "operationId": "AcceptPresentation", "responses": { "200": { - "description": "CredentialExchangeRecord", + "description": "ProofRecord", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DidCommCredentialExchangeRecord" + "$ref": "#/components/schemas/DidCommProofExchangeRecord" }, "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": [], + "metadata": {}, "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": [], + "connectionId": "2aecf74c-3073-4f98-9acb-92415d096834", + "threadId": "0019d466-5eea-4269-8c40-031b4896c5b7", "protocolVersion": "v1" } } @@ -9519,9 +10566,9 @@ } } }, - "description": "Accept a credential as holder by sending an accept credential message\nto the connection associated with the credential exchange record.", + "description": "Accept a presentation as prover by sending an accept presentation message\nto the connection associated with the proof record.", "tags": [ - "DIDComm - Credentials" + "DIDComm - Proofs" ], "security": [ { @@ -9531,37 +10578,48 @@ ] } ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AcceptCredential" - } + "parameters": [ + { + "in": "path", + "name": "proofRecordId", + "required": true, + "schema": { + "type": "string" } } - } + ] } }, - "/didcomm/credentials/{credentialRecordId}/form-data": { + "/didcomm/proofs/{proofRecordId}/form-data": { "get": { - "operationId": "CredentialFormData", + "operationId": "ProofFormData", "responses": { "200": { - "description": "credentialRecord", + "description": "ProofRecord", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GetCredentialFormatDataReturn__40_LegacyIndyCredentialFormat-or-DidCommJsonLdCredentialFormat-or-AnonCredsDidCommCredentialFormat_41_-Array_" + "$ref": "#/components/schemas/GetProofFormatDataReturn__40_LegacyIndyDidCommProofFormat-or-AnonCredsDidCommProofFormat-or-DidCommDifPresentationExchangeProofFormat_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 credentialRecord", + "description": "Return proofRecord", "tags": [ - "DIDComm - Credentials" + "DIDComm - Proofs" ], "security": [ { @@ -9574,7 +10632,7 @@ "parameters": [ { "in": "path", - "name": "credentialRecordId", + "name": "proofRecordId", "required": true, "schema": { "type": "string" From db87d1a41903771a164e6c16fe5ac2f9c6c3c87d Mon Sep 17 00:00:00 2001 From: Tipu_Singh Date: Fri, 3 Apr 2026 18:52:49 +0530 Subject: [PATCH 117/152] feat: added DisclosureFrameForOffer array in sdjwt flow Signed-off-by: Tipu_Singh --- src/controllers/openid4vc/types/issuer.types.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/controllers/openid4vc/types/issuer.types.ts b/src/controllers/openid4vc/types/issuer.types.ts index 987a0543..7da2c857 100644 --- a/src/controllers/openid4vc/types/issuer.types.ts +++ b/src/controllers/openid4vc/types/issuer.types.ts @@ -24,7 +24,7 @@ export interface OpenId4VciOfferCredentials { export interface DisclosureFrameForOffer { _sd?: string[] - [claim: string]: DisclosureFrameForOffer | string[] | undefined + [claim: string]: DisclosureFrameForOffer | DisclosureFrameForOffer[] | string[] | undefined } export interface OpenId4VciOfferSdJwtCredential extends OpenId4VciOfferCredentials { From e7711261fea1607f9cca39f16a54bb35b61fa9ee Mon Sep 17 00:00:00 2001 From: Tipu_Singh Date: Fri, 3 Apr 2026 18:57:50 +0530 Subject: [PATCH 118/152] feat: added DisclosureFrame array support Signed-off-by: Tipu_Singh --- src/routes/routes.ts | 2 +- src/routes/swagger.json | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/routes/routes.ts b/src/routes/routes.ts index e1bb1f99..7c1d7e96 100644 --- a/src/routes/routes.ts +++ b/src/routes/routes.ts @@ -801,7 +801,7 @@ const models: TsoaRoute.Models = { "properties": { "_sd": {"dataType":"array","array":{"dataType":"string"}}, }, - "additionalProperties": {"dataType":"union","subSchemas":[{"ref":"DisclosureFrameForOffer"},{"dataType":"array","array":{"dataType":"string"}},{"dataType":"undefined"}]}, + "additionalProperties": {"dataType":"union","subSchemas":[{"ref":"DisclosureFrameForOffer"},{"dataType":"array","array":{"dataType":"refObject","ref":"DisclosureFrameForOffer"}},{"dataType":"array","array":{"dataType":"string"}},{"dataType":"undefined"}]}, }, // WARNING: This 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": { diff --git a/src/routes/swagger.json b/src/routes/swagger.json index 1e988b5f..92368c70 100644 --- a/src/routes/swagger.json +++ b/src/routes/swagger.json @@ -1662,6 +1662,12 @@ { "$ref": "#/components/schemas/DisclosureFrameForOffer" }, + { + "items": { + "$ref": "#/components/schemas/DisclosureFrameForOffer" + }, + "type": "array" + }, { "items": { "type": "string" From f68e72e137954ac58b8a01794be0fe9255959ab5 Mon Sep 17 00:00:00 2001 From: Tipu_Singh Date: Mon, 6 Apr 2026 13:20:33 +0530 Subject: [PATCH 119/152] fix: package.json docker issue Signed-off-by: Tipu_Singh --- package.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/package.json b/package.json index ee77db50..f8d83c81 100644 --- a/package.json +++ b/package.json @@ -68,7 +68,7 @@ "@types/ref-struct-di": "^1.1.12", "@types/uuid": "^10.0.0", "@types/ws": "^8.18.1", - "axios": "^1.13.5", + "axios": "1.13.5", "body-parser": "^2.2.0", "cors": "^2.8.5", "dotenv": "^16.5.0", @@ -120,7 +120,6 @@ "resolutions": { "@credo-ts/core": "0.6.2", "@credo-ts/askar": "0.6.2", - "axios": "1.13.5", "flatted": "3.4.0", "undici": "6.24.0" } From 07f74a25dadc3e49659459cf64083fcb434e0ff8 Mon Sep 17 00:00:00 2001 From: Sagar Khole Date: Thu, 26 Mar 2026 16:20:16 +0530 Subject: [PATCH 120/152] feat: Add status list management and revocation for OpenID4VC issuance sessions and integrate SdJwtVcModule. Signed-off-by: Sagar Khole --- samples/cliConfig.json | 7 ++- .../issuance-sessions.service.ts | 5 +- src/utils/statusListService.ts | 60 ++++++++++++------- 3 files changed, 48 insertions(+), 24 deletions(-) diff --git a/samples/cliConfig.json b/samples/cliConfig.json index b924aa21..092c3d79 100644 --- a/samples/cliConfig.json +++ b/samples/cliConfig.json @@ -42,5 +42,10 @@ "schemaManagerContractAddress": "0x4742d43C2dFCa5a1d4238240Afa8547Daf87Ee7a", "rpcUrl": "https://rpc-amoy.polygon.technology", "fileServerUrl": "https://schema.credebl.id", - "fileServerToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJBeWFuV29ya3MiLCJpZCI6ImNhZDI3ZjhjLTMyNWYtNDRmZC04ZmZkLWExNGNhZTY3NTMyMSJ9.I3IR7abjWbfStnxzn1BhxhV0OEzt1x3mULjDdUcgWHk" + "fileServerToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJBeWFuV29ya3MiLCJpZCI6ImNhZDI3ZjhjLTMyNWYtNDRmZC04ZmZkLWExNGNhZTY3NTMyMSJ9.I3IR7abjWbfStnxzn1BhxhV0OEzt1x3mULjDdUcgWHk", + "apiKey": "supersecret-that-too-16chars", + "updateJwtSecret": false, + "statusListServerUrl": "http://localhost:3000", + "statusListApiKey": "test_key", + "statusListDefaultSize": 131072 } diff --git a/src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts b/src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts index 278896ae..74ffbd6f 100644 --- a/src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts +++ b/src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts @@ -9,7 +9,6 @@ import { BadRequestError, NotFoundError } from '../../../errors/errors' import { checkAndCreateStatusList, getServerUrl, revokeCredentialInStatusList } from '../../../utils/statusListService' import { STATUS_LISTS_PATH } from '../../../utils/constant' - class IssuanceSessionsService { public async createCredentialOffer(options: OpenId4VcIssuanceSessionsCreateOffer, agentReq: Req) { const { credentials, publicIssuerId } = options @@ -98,6 +97,10 @@ class IssuanceSessionsService { options.issuanceMetadata.StatusListInfo = offerStatusInfo } + if (offerStatusInfo.length > 0) { + options.issuanceMetadata.StatusListInfo = offerStatusInfo + } + const issuerModule = agentReq.agent.modules.openid4vc.issuer if (!issuerModule) { diff --git a/src/utils/statusListService.ts b/src/utils/statusListService.ts index 105a7d17..ec183643 100644 --- a/src/utils/statusListService.ts +++ b/src/utils/statusListService.ts @@ -1,6 +1,7 @@ -import { Agent, JwsProtectedHeaderOptions, JwsService, JwtPayload } from '@credo-ts/core'; +import { Agent, JwsProtectedHeaderOptions, JwsService, JwtPayload, VerificationMethod } from '@credo-ts/core'; import { StatusList, getListFromStatusListJWT } from '@sd-jwt/jwt-status-list'; import { STATUS_LISTS_PATH } from './constant'; +import { getAlgFromVerificationMethod, getVerificationMethod, fetchWithTimeout } from './helpers'; const statusListLocks = new Map>(); @@ -36,7 +37,7 @@ async function getKmsKeyIdForDid(agent: Agent, did: string, verificationMethodId return verificationMethodId; } -async function signStatusList(agent: Agent, verificationMethodId: string, statusList: StatusList, listId: string, issuerDid: string): Promise { +async function signStatusList(agent: Agent, verificationMethod: VerificationMethod, statusList: StatusList, listId: string, issuerDid: string): Promise { const payload = new JwtPayload({ iss: issuerDid, sub: `${getServerUrl()}/${STATUS_LISTS_PATH}/${listId}`, @@ -49,14 +50,16 @@ async function signStatusList(agent: Agent, verificationMethodId: string, status } }); + const alg = getAlgFromVerificationMethod(verificationMethod); + const jwsService = agent.dependencyManager.resolve(JwsService); + const kmsKeyId = await getKmsKeyIdForDid(agent, issuerDid, verificationMethod.id); + const header: JwsProtectedHeaderOptions = { - alg: 'EdDSA', + alg: alg as any, typ: 'statuslist+jwt', + kid: verificationMethod.id, }; - const jwsService = agent.dependencyManager.resolve(JwsService); - const kmsKeyId = await getKmsKeyIdForDid(agent, issuerDid, verificationMethodId); - return jwsService.createJwsCompact(agent.context, { keyId: kmsKeyId, payload, @@ -65,10 +68,21 @@ async function signStatusList(agent: Agent, verificationMethodId: string, status } export async function checkAndCreateStatusList(agent: Agent, listId: string, issuerDid: string, listSize?: number) { - const uri = `${getServerUrl()}/${STATUS_LISTS_PATH}/${listId}`; + const previousLock = statusListLocks.get(listId) || Promise.resolve(); + + let releaseLock: () => void; + const currentLock = new Promise((resolve) => { + releaseLock = resolve; + }); + + statusListLocks.set(listId, currentLock); try { - const res = await fetch(uri, { + await previousLock; + + const uri = `${getServerUrl()}/${STATUS_LISTS_PATH}/${listId}`; + + const res = await fetchWithTimeout(uri, { headers: getApiKeyHeaders() }); @@ -78,22 +92,20 @@ export async function checkAndCreateStatusList(agent: Agent, listId: string, iss const statusList = new StatusList(new Array(size).fill(0), 1); const didDocument = await agent.dids.resolve(issuerDid); - const verificationMethod = didDocument.didDocument?.verificationMethod?.[0]; + const verificationMethod = didDocument.didDocument ? getVerificationMethod(didDocument.didDocument) : undefined; if (!verificationMethod) { - throw new Error(`Could not find verification method for DID ${issuerDid}`); + throw new Error(`Could not find suitable verification method (assertionMethod) for DID ${issuerDid}`); } - const keyId = verificationMethod.id; - - const jwt = await signStatusList(agent, keyId, statusList, listId, issuerDid); - const postRes = await fetch(`${getServerUrl()}/${STATUS_LISTS_PATH}`, { + const jwt = await signStatusList(agent, verificationMethod, statusList, listId, issuerDid); + const postRes = await fetchWithTimeout(`${getServerUrl()}/${STATUS_LISTS_PATH}`, { method: 'POST', headers: getApiKeyHeaders(), body: JSON.stringify({ id: listId, jwt }), }); - if (!postRes.ok) { + if (!postRes.ok && postRes.status !== 409) { const errBody = await postRes.text(); throw new Error(`Failed to create list on server: ${postRes.status} ${errBody}`); } @@ -106,6 +118,11 @@ export async function checkAndCreateStatusList(agent: Agent, listId: string, iss } catch (error) { console.error(`Error in checkAndCreateStatusList:`, error); throw error; + } finally { + releaseLock!(); + if (statusListLocks.get(listId) === currentLock) { + statusListLocks.delete(listId); + } } } @@ -124,7 +141,7 @@ export async function revokeCredentialInStatusList(agent: Agent, listId: string, const uri = `${getServerUrl()}/${STATUS_LISTS_PATH}/${listId}`; - const res = await fetch(uri, { + const res = await fetchWithTimeout(uri, { headers: getApiKeyHeaders(), }); if (!res.ok) { @@ -138,13 +155,12 @@ export async function revokeCredentialInStatusList(agent: Agent, listId: string, statusList.setStatus(index, 1); const didDocument = await agent.dids.resolve(issuerDid); - const verificationMethod = didDocument.didDocument?.verificationMethod?.[0]; - if (!verificationMethod) throw new Error(`Could not find verification method for DID ${issuerDid}`); - const keyId = verificationMethod.id; + const verificationMethod = didDocument.didDocument ? getVerificationMethod(didDocument.didDocument) : undefined; + if (!verificationMethod) throw new Error(`Could not find suitable verification method (assertionMethod) for DID ${issuerDid}`); - const newJwt = await signStatusList(agent, keyId, statusList, listId, issuerDid); + const newJwt = await signStatusList(agent, verificationMethod, statusList, listId, issuerDid); - const patchRes = await fetch(`${getServerUrl()}/${STATUS_LISTS_PATH}/${listId}`, { + const patchRes = await fetchWithTimeout(`${getServerUrl()}/${STATUS_LISTS_PATH}/${listId}`, { method: 'PATCH', headers: getApiKeyHeaders(), body: JSON.stringify({ jwt: newJwt }), @@ -160,4 +176,4 @@ export async function revokeCredentialInStatusList(agent: Agent, listId: string, statusListLocks.delete(listId); } } -} +} \ No newline at end of file From f000699898bd9f72d7695a4e34c65c9706dec8ef Mon Sep 17 00:00:00 2001 From: Sagar Khole Date: Thu, 26 Mar 2026 18:15:42 +0530 Subject: [PATCH 121/152] feat: Add property to credential offer types and issuance logic Signed-off-by: Sagar Khole --- .../openid4vc/issuance-sessions/issuance-sessions.service.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts b/src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts index 74ffbd6f..356132f3 100644 --- a/src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts +++ b/src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts @@ -97,10 +97,6 @@ class IssuanceSessionsService { options.issuanceMetadata.StatusListInfo = offerStatusInfo } - if (offerStatusInfo.length > 0) { - options.issuanceMetadata.StatusListInfo = offerStatusInfo - } - const issuerModule = agentReq.agent.modules.openid4vc.issuer if (!issuerModule) { From 311fe25a600c8fd84ba7689523767a1eba2f607e Mon Sep 17 00:00:00 2001 From: Sagar Khole Date: Mon, 30 Mar 2026 12:07:16 +0530 Subject: [PATCH 122/152] feat: concurrency handled in the status list service. Signed-off-by: Sagar Khole --- samples/cliConfig.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/samples/cliConfig.json b/samples/cliConfig.json index 092c3d79..17001d25 100644 --- a/samples/cliConfig.json +++ b/samples/cliConfig.json @@ -1,6 +1,6 @@ { - "label": "AFJ Rest Agent 1", - "walletId": "sample", + "label": "platform-admin-agent", + "walletId": "platform_admin_agent", "walletKey": "sample", "walletType": "postgres", "walletUrl": "localhost:5432", @@ -23,7 +23,7 @@ "indyNamespace": "bcovrin:testnet" } ], - "endpoint": ["http://localhost:4002"], + "endpoint": ["https://e70b-122-170-198-40.ngrok-free.app"], "autoAcceptConnections": true, "autoAcceptCredentials": "always", "autoAcceptProofs": "contentApproved", @@ -45,7 +45,7 @@ "fileServerToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJBeWFuV29ya3MiLCJpZCI6ImNhZDI3ZjhjLTMyNWYtNDRmZC04ZmZkLWExNGNhZTY3NTMyMSJ9.I3IR7abjWbfStnxzn1BhxhV0OEzt1x3mULjDdUcgWHk", "apiKey": "supersecret-that-too-16chars", "updateJwtSecret": false, - "statusListServerUrl": "http://localhost:3000", + "statusListServerUrl": "https://dev-status-list.sovio.id/", "statusListApiKey": "test_key", "statusListDefaultSize": 131072 } From c2a976d75aaefa41afcc440f83b5e7f71154cc39 Mon Sep 17 00:00:00 2001 From: Sagar Khole Date: Mon, 30 Mar 2026 12:56:28 +0530 Subject: [PATCH 123/152] feat: update CLI configuration and refine status list service logic Signed-off-by: Sagar Khole --- samples/cliConfig.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/cliConfig.json b/samples/cliConfig.json index 17001d25..f4d2a2d1 100644 --- a/samples/cliConfig.json +++ b/samples/cliConfig.json @@ -1,6 +1,6 @@ { - "label": "platform-admin-agent", - "walletId": "platform_admin_agent", + "label": "AFJ Rest Agent 1", + "walletId": "sample", "walletKey": "sample", "walletType": "postgres", "walletUrl": "localhost:5432", @@ -23,7 +23,7 @@ "indyNamespace": "bcovrin:testnet" } ], - "endpoint": ["https://e70b-122-170-198-40.ngrok-free.app"], + "endpoint": ["http://localhost:4002"], "autoAcceptConnections": true, "autoAcceptCredentials": "always", "autoAcceptProofs": "contentApproved", From a4e56fd109973d316b36389c2f50ad3ee2f73ac5 Mon Sep 17 00:00:00 2001 From: Sagar Khole Date: Tue, 7 Apr 2026 19:09:05 +0530 Subject: [PATCH 124/152] refactor:code review changes Signed-off-by: Sagar Khole --- .env.demo | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.env.demo b/.env.demo index 7829a476..10242742 100644 --- a/.env.demo +++ b/.env.demo @@ -84,4 +84,13 @@ OID4VCI_CNONCE_EXPIRY=3600 OID4VP_AUTH_REQUEST_PROOF_REQUEST_EXPIRY=3600 APP_JSON_BODY_SIZE=5mb -APP_URL_ENCODED_BODY_SIZE=5mb \ No newline at end of file +APP_URL_ENCODED_BODY_SIZE=5mb + + +API_KEY=supersecret-that-too-16chars +UPDATE_JWT_SECRET=false + + +STATUS_LIST_SERVER_URL=https://dev-status-list.sovio.id/ +STATUS_LIST_API_KEY=test_key +STATUS_LIST_DEFAULT_SIZE=131072 \ No newline at end of file From 40fd337efdef4e46683bcd18f28a4d3590805754 Mon Sep 17 00:00:00 2001 From: Sagar Khole Date: Mon, 13 Apr 2026 18:55:14 +0530 Subject: [PATCH 125/152] feat: implement per-list concurrency locking and dynamic algorithm selection for status list operations Signed-off-by: Sagar Khole --- .../issuance-sessions.service.ts | 2 +- src/enums/enum.ts | 8 +++ src/utils/helpers.ts | 56 ++++++++++++++++++- tsconfig.build.json | 2 +- 4 files changed, 65 insertions(+), 3 deletions(-) diff --git a/src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts b/src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts index 356132f3..874f9a71 100644 --- a/src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts +++ b/src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts @@ -4,7 +4,7 @@ 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 { CredentialFormat, SignerMethod } from '../../../enums/enum' import { BadRequestError, NotFoundError } from '../../../errors/errors' import { checkAndCreateStatusList, getServerUrl, revokeCredentialInStatusList } from '../../../utils/statusListService' diff --git a/src/enums/enum.ts b/src/enums/enum.ts index ed45ac7b..8eb51544 100644 --- a/src/enums/enum.ts +++ b/src/enums/enum.ts @@ -111,3 +111,11 @@ export enum KeyAlgorithmCurve { secp256k1 = 'secp256k1', Bls12381G2 = 'bls12381g2', } + +export enum CredentialFormat { + VcSdJwt = 'vc+sd-jwt', + DcSdJwt = 'dc+sd-jwt', + JwtVcJson = 'jwt_vc_json', + JwtVcJsonLd = 'jwt_vc_json-ld', + LdpVc = 'ldp_vc', +} diff --git a/src/utils/helpers.ts b/src/utils/helpers.ts index fc2eff3f..d05fdf1b 100644 --- a/src/utils/helpers.ts +++ b/src/utils/helpers.ts @@ -1,7 +1,7 @@ import type { Curve, EcCurve, EcType, OkpCurve, OkpType } from '../controllers/types' import type { KeyAlgorithm } from '@openwallet-foundation/askar-nodejs' -import { JsonEncoder, JsonTransformer } from '@credo-ts/core' +import { JsonEncoder, JsonTransformer, DidDocument, VerificationMethod } from '@credo-ts/core' import axios from 'axios' import { randomBytes } from 'crypto' @@ -116,6 +116,60 @@ export function getTypeFromCurve(key: Curve | KeyAlgorithm): OkpType | EcType { return keyTypeInfo } +export function getVerificationMethod(didDocument: DidDocument): VerificationMethod | undefined { + // Try assertionMethod first + const assertionMethod = didDocument.assertionMethod?.[0] + if (assertionMethod) { + if (typeof assertionMethod === 'string') { + return didDocument.dereferenceVerificationMethod(assertionMethod) + } + return assertionMethod as VerificationMethod + } + // Fallback to verificationMethod[0] + return didDocument.verificationMethod?.[0] +} + +export function getAlgFromVerificationMethod(vm: VerificationMethod): string { + if (vm.type === 'Ed25519VerificationKey2018' || vm.type === 'Ed25519VerificationKey2020') { + return 'EdDSA' + } + + if (vm.type === 'JsonWebKey2020' || vm.type === 'JsonWebKey2024') { + const jwk = vm.publicKeyJwk as any + if (jwk?.crv === 'P-256') return 'ES256' + if (jwk?.crv === 'P-384') return 'ES384' + if (jwk?.crv === 'P-521') return 'ES512' + if (jwk?.crv === 'secp256k1') return 'ES256K' + } + + if (vm.type === 'EcdsaSecp256k1VerificationKey2019') { + return 'ES256K' + } + + return 'EdDSA' +} + +export async function fetchWithTimeout(resource: string, options: any = {}) { + const { timeout = 10000, ...fetchOptions } = options + const controller = new AbortController() + const id = setTimeout(() => controller.abort(), timeout) + + try { + const response = await fetch(resource, { + ...fetchOptions, + signal: controller.signal, + }) + return response + } catch (error: any) { + if (error.name === 'AbortError') { + throw new Error(`Request timed out after ${timeout}ms`) + } + throw error + } finally { + clearTimeout(id) + } +} + type Namespaces = Record export function processIsoImages(namespaces: Namespaces): Namespaces { diff --git a/tsconfig.build.json b/tsconfig.build.json index f64e3ff5..d8e50b2d 100644 --- a/tsconfig.build.json +++ b/tsconfig.build.json @@ -35,4 +35,4 @@ "**/*.d.ts", "scripts" ] -} \ No newline at end of file +} From e5271e1f5c1c1ae0011e2bbfc0a091be4bc5aa5f Mon Sep 17 00:00:00 2001 From: Sagar Khole Date: Tue, 14 Apr 2026 11:43:35 +0530 Subject: [PATCH 126/152] update:Removed file server token from cli config for security Signed-off-by: Sagar Khole --- samples/cliConfig.json | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/samples/cliConfig.json b/samples/cliConfig.json index f4d2a2d1..a8ca612a 100644 --- a/samples/cliConfig.json +++ b/samples/cliConfig.json @@ -1,7 +1,7 @@ { "label": "AFJ Rest Agent 1", - "walletId": "sample", - "walletKey": "sample", + "walletId": "sample10", + "walletKey": "sample10", "walletType": "postgres", "walletUrl": "localhost:5432", "walletAccount": "postgres", @@ -23,7 +23,9 @@ "indyNamespace": "bcovrin:testnet" } ], - "endpoint": ["http://localhost:4002"], + "endpoint": [ + "http://localhost:4002" + ], "autoAcceptConnections": true, "autoAcceptCredentials": "always", "autoAcceptProofs": "contentApproved", @@ -34,7 +36,9 @@ "port": 4002 } ], - "outboundTransport": ["http"], + "outboundTransport": [ + "http" + ], "adminPort": 4001, "tenancy": true, "schemaFileServerURL": "https://schema.credebl.id/schemas/", @@ -42,10 +46,5 @@ "schemaManagerContractAddress": "0x4742d43C2dFCa5a1d4238240Afa8547Daf87Ee7a", "rpcUrl": "https://rpc-amoy.polygon.technology", "fileServerUrl": "https://schema.credebl.id", - "fileServerToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJBeWFuV29ya3MiLCJpZCI6ImNhZDI3ZjhjLTMyNWYtNDRmZC04ZmZkLWExNGNhZTY3NTMyMSJ9.I3IR7abjWbfStnxzn1BhxhV0OEzt1x3mULjDdUcgWHk", - "apiKey": "supersecret-that-too-16chars", - "updateJwtSecret": false, - "statusListServerUrl": "https://dev-status-list.sovio.id/", - "statusListApiKey": "test_key", - "statusListDefaultSize": 131072 + "fileServerToken": "" } From 947ccac1e136c3884de9af994ec053f1425eb1c9 Mon Sep 17 00:00:00 2001 From: Sagar Khole Date: Tue, 21 Apr 2026 15:16:35 +0530 Subject: [PATCH 127/152] refactor: reduce cognitive complexity of createCredentialOffer flow Signed-off-by: Sagar Khole --- .../issuance-sessions.service.ts | 208 ++++++++++++------ 1 file changed, 139 insertions(+), 69 deletions(-) diff --git a/src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts b/src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts index 874f9a71..9b7a0aa2 100644 --- a/src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts +++ b/src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts @@ -9,6 +9,7 @@ import { BadRequestError, NotFoundError } from '../../../errors/errors' import { checkAndCreateStatusList, getServerUrl, revokeCredentialInStatusList } from '../../../utils/statusListService' import { STATUS_LISTS_PATH } from '../../../utils/constant' + class IssuanceSessionsService { public async createCredentialOffer(options: OpenId4VcIssuanceSessionsCreateOffer, agentReq: Req) { const { credentials, publicIssuerId } = options @@ -20,74 +21,25 @@ class IssuanceSessionsService { const offerStatusInfo: any[] = [] - const mappedCredentials = await Promise.all(credentials.map(async (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 effectiveIssuerDid = cred.signerOptions?.method === SignerMethod.Did ? cred.signerOptions.did : undefined - const effectiveStatusList = cred.statusListDetails || options.statusListDetails - - let statusBlock = undefined - if (options.isRevocable && effectiveIssuerDid && effectiveStatusList) { - await checkAndCreateStatusList( - agentReq.agent as any, - effectiveStatusList.listId, - effectiveIssuerDid, - effectiveStatusList.listSize, - ) - const listUri = `${getServerUrl()}/${STATUS_LISTS_PATH}/${effectiveStatusList.listId}` - - statusBlock = { - status_list: { - uri: listUri, - idx: effectiveStatusList.index - } - } + const mappedCredentials = await Promise.all( + credentials.map(async (cred) => { + const supported = issuer.credentialConfigurationsSupported[cred.credentialSupportedId] - offerStatusInfo.push({ - credentialSupportedId: cred.credentialSupportedId, - listId: effectiveStatusList.listId, - index: effectiveStatusList.index, - issuerDid: effectiveIssuerDid - }) - } - - const currentVct = cred.payload && 'vct' in cred.payload ? (cred.payload as any).vct : undefined - return { - ...cred, - payload: { - ...cred.payload, - vct: currentVct ?? (typeof supported.vct === 'string' ? supported.vct : undefined), - ...(statusBlock ? { status: statusBlock } : {}) - }, - } - })) + this.validateCredentialConfig(cred, supported) + + const statusBlock = await this.processStatusList(cred, options, agentReq, offerStatusInfo) + + 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), + ...(statusBlock ? { status: statusBlock } : {}), + }, + } + }), + ) options.issuanceMetadata ||= {} options.issuanceMetadata.credentials = mappedCredentials @@ -102,17 +54,131 @@ class IssuanceSessionsService { if (!issuerModule) { throw new Error('OID4VC issuer module not initialized') } + const preAuthorizedCodeFlowConfig = this.resolvePreAuthorizedCodeFlowConfig(options.preAuthorizedCodeFlowConfig) + const { credentialOffer, issuanceSession } = await issuerModule.createCredentialOffer({ issuerId: publicIssuerId, issuanceMetadata: options.issuanceMetadata, credentialConfigurationIds: credentials.map((c) => c.credentialSupportedId), - preAuthorizedCodeFlowConfig: options.preAuthorizedCodeFlowConfig, + preAuthorizedCodeFlowConfig, authorizationCodeFlowConfig: options.authorizationCodeFlowConfig, }) return { credentialOffer, issuanceSession } } + private resolvePreAuthorizedCodeFlowConfig( + config: OpenId4VcIssuanceSessionsCreateOffer['preAuthorizedCodeFlowConfig'], + ) { + if (!config) return undefined + + const hasTxCode = config.txCode != null + const hasAuthServerUrl = config.authorizationServerUrl != null + + if (hasTxCode !== hasAuthServerUrl) { + throw new BadRequestError( + 'Both txCode and authorizationServerUrl must be provided together for normal flow, or both must be omitted for no-auth flow', + ) + } + + if (!hasTxCode) return {} + + if (Object.keys(config.txCode!).length === 0) { + throw new BadRequestError('txCode must not be an empty object when provided') + } + + if (config.authorizationServerUrl!.trim() === '') { + throw new BadRequestError('authorizationServerUrl must not be an empty string when provided') + } + + return { txCode: config.txCode, authorizationServerUrl: config.authorizationServerUrl } + } + + private validateCredentialConfig(cred: any, supported: any) { + 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}'`, + ) + } + + 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' `, + ) + } + } + + private async processStatusList( + cred: any, + options: OpenId4VcIssuanceSessionsCreateOffer, + agentReq: Req, + offerStatusInfo: any[], + ) { + if (!options.isRevocable) { + return undefined + } + + const effectiveIssuerDid = cred.signerOptions?.method === SignerMethod.Did ? cred.signerOptions.did : undefined + const effectiveStatusList = cred.statusListDetails || options.statusListDetails + + if (![CredentialFormat.VcSdJwt, CredentialFormat.DcSdJwt].includes(cred.format as unknown as CredentialFormat)) { + throw new BadRequestError( + `Revocation is only supported for SD-JWT formats (vc+sd-jwt, dc+sd-jwt), got '${cred.format}'`, + ) + } + + if (!process.env.STATUS_LIST_SERVER_URL) { + throw new BadRequestError('Cannot create revocable credentials: STATUS_LIST_SERVER_URL is not configured') + } + + if (cred.signerOptions.method !== SignerMethod.Did || !effectiveIssuerDid) { + throw new BadRequestError(`Revocation is not supported without a DID signer (found ${cred.signerOptions.method})`) + } + + if (!effectiveStatusList) { + throw new BadRequestError('Status list details must be provided for revocable credentials') + } + + await checkAndCreateStatusList( + agentReq.agent as any, + effectiveStatusList.listId, + effectiveIssuerDid, + effectiveStatusList.listSize, + ) + + const listUri = `${getServerUrl()}/${STATUS_LISTS_PATH}/${effectiveStatusList.listId}` + + offerStatusInfo.push({ + credentialSupportedId: cred.credentialSupportedId, + listId: effectiveStatusList.listId, + index: effectiveStatusList.index, + issuerDid: effectiveIssuerDid, + }) + + return { + status_list: { + uri: listUri, + idx: effectiveStatusList.index, + }, + } + } + + public async getIssuanceSessionsById(agentReq: Req, sessionId: string) { const issuer = agentReq.agent.modules.openid4vc.issuer if (!issuer) { @@ -196,6 +262,10 @@ class IssuanceSessionsService { throw new Error(`No status list information found for session ${sessionId}`) } + if (!process.env.STATUS_LIST_SERVER_URL) { + throw new BadRequestError('Cannot execute revocation: STATUS_LIST_SERVER_URL is not configured') + } + for (const info of statusInfo) { await revokeCredentialInStatusList(agentReq.agent as any, info.listId, info.index, info.issuerDid) } @@ -204,4 +274,4 @@ class IssuanceSessionsService { } } -export const issuanceSessionService = new IssuanceSessionsService() +export const issuanceSessionService = new IssuanceSessionsService() \ No newline at end of file From 49581a08d3e642033a63ee7148a3fcc114bf1d89 Mon Sep 17 00:00:00 2001 From: Sagar Khole Date: Tue, 21 Apr 2026 15:44:17 +0530 Subject: [PATCH 128/152] refactor: address code quality issues and cleanup x509 enums Signed-off-by: Sagar Khole --- src/controllers/x509/x509.types.ts | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) diff --git a/src/controllers/x509/x509.types.ts b/src/controllers/x509/x509.types.ts index 274db1c4..11417255 100644 --- a/src/controllers/x509/x509.types.ts +++ b/src/controllers/x509/x509.types.ts @@ -1,26 +1,5 @@ -import type { Curve } from '../types' - -export enum X509KeyUsage { - DigitalSignature = 1, - NonRepudiation = 2, - KeyEncipherment = 4, - DataEncipherment = 8, - KeyAgreement = 16, - KeyCertSign = 32, - CrlSign = 64, - EncipherOnly = 128, - DecipherOnly = 256, -} - -export enum X509ExtendedKeyUsage { - ServerAuth = '1.3.6.1.5.5.7.3.1', - ClientAuth = '1.3.6.1.5.5.7.3.2', - CodeSigning = '1.3.6.1.5.5.7.3.3', - EmailProtection = '1.3.6.1.5.5.7.3.4', - TimeStamping = '1.3.6.1.5.5.7.3.8', - OcspSigning = '1.3.6.1.5.5.7.3.9', - MdlDs = '1.0.18013.5.1.2', -} +import type { X509ExtendedKeyUsage, X509KeyUsage } from '@credo-ts/core' +import { Curve } from '../types' // Enum remains the same export enum GeneralNameType { From c221f12bc4e02c666ff2048b0b10b6421ed3519b Mon Sep 17 00:00:00 2001 From: KambleSahil3 Date: Tue, 14 Apr 2026 15:02:39 +0530 Subject: [PATCH 129/152] chore: update .env.demo and add trusted-certs.json file Signed-off-by: KambleSahil3 --- .env.demo | 2 +- .env.sample | 2 +- trusted-certs.json | 0 3 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 trusted-certs.json diff --git a/.env.demo b/.env.demo index 10242742..19ff4c20 100644 --- a/.env.demo +++ b/.env.demo @@ -93,4 +93,4 @@ UPDATE_JWT_SECRET=false STATUS_LIST_SERVER_URL=https://dev-status-list.sovio.id/ STATUS_LIST_API_KEY=test_key -STATUS_LIST_DEFAULT_SIZE=131072 \ No newline at end of file +STATUS_LIST_DEFAULT_SIZE=131072 diff --git a/.env.sample b/.env.sample index f89e4b19..6aadaa82 100644 --- a/.env.sample +++ b/.env.sample @@ -91,4 +91,4 @@ UPDATE_JWT_SECRET=false # Status List STATUS_LIST_SERVER_URL=https://dev-status-list.sovio.id/ STATUS_LIST_API_KEY=test_key -STATUS_LIST_DEFAULT_SIZE=131072 \ No newline at end of file +STATUS_LIST_DEFAULT_SIZE=131072 diff --git a/trusted-certs.json b/trusted-certs.json new file mode 100644 index 00000000..e69de29b From d41677b43519c30fe986ef972e4ab82617c735e2 Mon Sep 17 00:00:00 2001 From: Krishna Waske Date: Thu, 16 Apr 2026 16:26:37 +0530 Subject: [PATCH 130/152] fix: events typings (#362) * fix: events typings Signed-off-by: Krishna Waske * fix: remove unnecessary comments Signed-off-by: Krishna Waske * fix: add non-throwing method Signed-off-by: Krishna Waske * fix: edge case handling Signed-off-by: Krishna Waske * fix: formatting Signed-off-by: Krishna Waske --------- Signed-off-by: Krishna Waske --- src/cliAgent.ts | 3 +++ src/events/CredentialEvents.ts | 29 ++++++++++++++++++++++++++--- src/events/ProofEvents.ts | 8 ++++---- 3 files changed, 33 insertions(+), 7 deletions(-) diff --git a/src/cliAgent.ts b/src/cliAgent.ts index beaca1cd..0f354e63 100644 --- a/src/cliAgent.ts +++ b/src/cliAgent.ts @@ -32,6 +32,7 @@ import { JwkDidRegistrar, JwkDidResolver, SdJwtVcModule, + PeerDidNumAlgo, } from '@credo-ts/core' import { DidCommHttpOutboundTransport, @@ -215,6 +216,8 @@ const getModules = ( basicMessages: true, connections: { autoAcceptConnections: autoAcceptConnections || true, + peerNumAlgoForDidExchangeRequests: PeerDidNumAlgo.GenesisDoc, + peerNumAlgoForDidRotation: PeerDidNumAlgo.ShortFormAndLongForm, }, proofs: { autoAcceptProofs: autoAcceptProofs || DidCommAutoAcceptProof.ContentApproved, diff --git a/src/events/CredentialEvents.ts b/src/events/CredentialEvents.ts index 080ecf6d..244b6980 100644 --- a/src/events/CredentialEvents.ts +++ b/src/events/CredentialEvents.ts @@ -12,21 +12,44 @@ export const credentialEvents = async (agent: Agent, config: ServerConfig) => { DidCommCredentialEventTypes.DidCommCredentialStateChanged, async (event: DidCommCredentialStateChangedEvent) => { const record = event.payload.credentialExchangeRecord + const tenantId = (!event.metadata.contextCorrelationId || event.metadata.contextCorrelationId === 'default') ? event.metadata.contextCorrelationId : event.metadata.contextCorrelationId.split('tenant-')[1] const body: Record = { ...record.toJSON(), ...event.metadata, + contextCorrelationId: tenantId, outOfBandId: null, credentialData: null, } if (record?.connectionId) { - const connectionRecord = await agent.modules.connections.findById(record.connectionId!) + let connectionRecord + if (tenantId && tenantId !== 'default') { + await (agent as Agent).modules.tenants.withTenantAgent( + { tenantId: body.contextCorrelationId as string }, + async (tenantAgent) => { + connectionRecord = await tenantAgent.modules.didcomm.connections.findById(record.connectionId ? record.connectionId : '') + }, + ) + } else { + connectionRecord = await agent.modules.didcomm.connections.findById(record.connectionId) + } body.outOfBandId = connectionRecord?.outOfBandId } - const data = await agent.modules.credentials.getFormatData(record.id) - body.credentialData = data + let formatData = null + if (tenantId && tenantId !== 'default') { + await (agent as Agent).modules.tenants.withTenantAgent( + { tenantId: body.contextCorrelationId as string }, + async (tenantAgent) => { + formatData = await tenantAgent.modules.didcomm.credentials.getFormatData(record.id) + }, + ) + } else { + formatData = await agent.modules.didcomm.credentials.getFormatData(record.id) + } + + body.credentialData = formatData if (config.webhookUrl) { await sendWebhookEvent(config.webhookUrl + '/credentials', body, agent.config.logger) diff --git a/src/events/ProofEvents.ts b/src/events/ProofEvents.ts index 44166f62..1dac15db 100644 --- a/src/events/ProofEvents.ts +++ b/src/events/ProofEvents.ts @@ -9,17 +9,17 @@ export const proofEvents = async (agent: Agent, config: ServerConfig) => { agent.events.on(DidCommProofEventTypes.ProofStateChanged, async (event: DidCommProofStateChangedEvent) => { const record = event.payload.proofRecord const body = { ...record.toJSON(), ...event.metadata } as { proofData?: any } - if (event.metadata.contextCorrelationId !== 'default') { + if (event.metadata.contextCorrelationId && event.metadata.contextCorrelationId !== 'default') { const tenantAgent = await agent.modules.tenants.getTenantAgent({ - tenantId: event.metadata.contextCorrelationId, + tenantId: event.metadata.contextCorrelationId.split('tenant-')[1], }) - const data = await tenantAgent.proofs.getFormatData(record.id) + const data = await tenantAgent.modules.didcomm.proofs.getFormatData(record.id) body.proofData = data } //Emit webhook for dedicated agent if (event.metadata.contextCorrelationId === 'default') { - const data = await agent.modules.proofs.getFormatData(record.id) + const data = await agent.modules.didcomm.proofs.getFormatData(record.id) body.proofData = data } From f69e0af2056706f6f59575dd81f714f4e7719ebf Mon Sep 17 00:00:00 2001 From: Tipu_Singh Date: Fri, 24 Apr 2026 17:15:31 +0530 Subject: [PATCH 131/152] feat: added noAuth support Signed-off-by: Tipu_Singh --- src/controllers/openid4vc/types/issuer.types.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/controllers/openid4vc/types/issuer.types.ts b/src/controllers/openid4vc/types/issuer.types.ts index 7da2c857..38c7a853 100644 --- a/src/controllers/openid4vc/types/issuer.types.ts +++ b/src/controllers/openid4vc/types/issuer.types.ts @@ -65,13 +65,12 @@ export interface OpenId4VcIssuanceSessionsCreateOffer { issuerState?: string } preAuthorizedCodeFlowConfig?: { - preAuthorizedCode?: string txCode?: { description?: string length?: number input_mode?: 'numeric' | 'text' } - authorizationServerUrl: string + authorizationServerUrl?: string } issuanceMetadata?: Record statusListDetails?: { From 023d4bebc4f21c090ffedd18f980ca0f4055521b Mon Sep 17 00:00:00 2001 From: Tipu_Singh Date: Fri, 17 Apr 2026 14:58:15 +0530 Subject: [PATCH 132/152] added nats and cron Signed-off-by: Tipu_Singh --- package.json | 3 + src/cli.ts | 3 + src/cliAgent.ts | 23 +- src/server.ts | 8 +- src/services/RetentionCronService.ts | 223 ++++++++++++++++++ src/services/deletion/BaseRetentionWorker.ts | 162 +++++++++++++ .../deletion/DidCommCredentialWorker.ts | 15 ++ src/services/deletion/DidCommProofWorker.ts | 15 ++ src/services/deletion/Oid4VcIssuanceWorker.ts | 29 +++ .../deletion/Oid4VcVerificationWorker.ts | 18 ++ src/tracer.ts | 9 +- src/types/RetentionTypes.ts | 137 +++++++++++ src/utils/NatsClient.ts | 164 +++++++++++++ src/utils/NatsConstants.ts | 120 ++++++++++ src/utils/ServerConfig.ts | 2 + yarn.lock | 29 +++ 16 files changed, 955 insertions(+), 5 deletions(-) create mode 100644 src/services/RetentionCronService.ts create mode 100644 src/services/deletion/BaseRetentionWorker.ts create mode 100644 src/services/deletion/DidCommCredentialWorker.ts create mode 100644 src/services/deletion/DidCommProofWorker.ts create mode 100644 src/services/deletion/Oid4VcIssuanceWorker.ts create mode 100644 src/services/deletion/Oid4VcVerificationWorker.ts create mode 100644 src/types/RetentionTypes.ts create mode 100644 src/utils/NatsClient.ts create mode 100644 src/utils/NatsConstants.ts diff --git a/package.json b/package.json index f8d83c81..a7c26005 100644 --- a/package.json +++ b/package.json @@ -76,6 +76,8 @@ "express-rate-limit": "^7.5.0", "joi": "^17.13.3", "jsonwebtoken": "^9.0.2", + "nats": "^2.29.3", + "node-cron": "^4.2.1", "node-fetch": "2", "patch-package": "^8.0.0", "reflect-metadata": "^0.2.2", @@ -97,6 +99,7 @@ "@types/jsonwebtoken": "^9.0.9", "@types/multer": "^1.4.12", "@types/node": "^20.17.0", + "@types/node-cron": "^3.0.11", "@types/ref-array-di": "^1.2.8", "@types/ref-struct-di": "^1.1.12", "@types/supertest": "^6.0.3", diff --git a/src/cli.ts b/src/cli.ts index 4454cb4d..860fd009 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -1,4 +1,5 @@ import type { AriesRestConfig } from './cliAgent.js' +import type { RetentionConfig } from './types/RetentionTypes.js' import yargs from 'yargs' import { hideBin } from 'yargs/helpers' @@ -51,6 +52,7 @@ interface Parsed { 'status-list-server-url'?: string 'status-list-api-key'?: string 'status-list-default-size'?: number + retention?: RetentionConfig } interface InboundTransport { @@ -225,5 +227,6 @@ export async function runCliServer() { statusListServerUrl: parsed['status-list-server-url'], statusListApiKey: parsed['status-list-api-key'], statusListDefaultSize: parsed['status-list-default-size'], + retention: parsed.retention, } as AriesRestConfig) } diff --git a/src/cliAgent.ts b/src/cliAgent.ts index 0f354e63..ae89353e 100644 --- a/src/cliAgent.ts +++ b/src/cliAgent.ts @@ -66,8 +66,9 @@ import { readFile } from 'fs/promises' import { IndicioAcceptanceMechanism, IndicioTransactionAuthorAgreement, Network, NetworkName } from './enums' import { setupServer } from './server' -import { isCustomDocumentLoaderEnabled } from './utils/config' -import { CustomDocumentLoader } from './utils/customDocumentLoader' +import { retentionCronService } from './services/RetentionCronService' +import { buildRetentionConfig } from './types/RetentionTypes' +import type { RetentionConfig } from './types/RetentionTypes' import { generateSecretKey } from './utils/helpers' import { TsLogger } from './utils/logger' import { @@ -127,6 +128,7 @@ export interface AriesRestConfig { statusListServerUrl?: string statusListApiKey?: string statusListDefaultSize?: number + retention?: RetentionConfig } export async function readRestConfig(path: string) { @@ -366,6 +368,7 @@ const getWithTenantModules = ( // return secretKey // } + export async function runRestAgent(restConfig: AriesRestConfig) { const { endpoints, @@ -579,4 +582,20 @@ export async function runRestAgent(restConfig: AriesRestConfig) { app.listen(adminPort, () => { logger.info(`Successfully started server on port ${adminPort}`) }) + + // Start retention cron service if enabled + const retentionConfig = buildRetentionConfig(restConfig.retention) + if (retentionConfig) { + await retentionCronService.start(agent, retentionConfig, webhookUrl) + } + + // Graceful shutdown — stop retention service before exit + const shutdown = async () => { + agent.config.logger.info('[Retention] Shutting down retention cron service...') + await retentionCronService.stop() + process.exit(0) + } + + process.on('SIGTERM', shutdown) + process.on('SIGINT', shutdown) } diff --git a/src/server.ts b/src/server.ts index 75c315f6..31042563 100644 --- a/src/server.ts +++ b/src/server.ts @@ -40,8 +40,12 @@ export const setupServer = async ( config: ServerConfig, apiKey?: string, ) => { - await otelSDK.start() - agent.config.logger.info('OpenTelemetry SDK started') + if (process.env.OTEL_ENABLED === 'true') { + await otelSDK.start() + agent.config.logger.info('OpenTelemetry SDK started') + } else { + agent.config.logger.info('OpenTelemetry SDK disabled (set OTEL_ENABLED=true to enable)') + } validateAuthConfig() container.registerInstance(Agent, agent as Agent) fs.writeFileSync('config.json', JSON.stringify(config, null, 2)) diff --git a/src/services/RetentionCronService.ts b/src/services/RetentionCronService.ts new file mode 100644 index 00000000..240d53f8 --- /dev/null +++ b/src/services/RetentionCronService.ts @@ -0,0 +1,223 @@ +import type { Agent } from '@credo-ts/core' +import type { ScheduledTask } from 'node-cron' + +import { OpenId4VcIssuanceSessionRepository, OpenId4VcVerificationSessionRepository } from '@credo-ts/openid4vc' +import cron from 'node-cron' + +import type { DeletionJob, RetentionConfig } from '../types/RetentionTypes' +import { NATS_SUBJECTS, RecordType, TERMINAL_STATES } from '../types/RetentionTypes' +import { natsClient } from '../utils/NatsClient' + +import { didCommCredentialWorker } from './deletion/DidCommCredentialWorker' +import { didCommProofWorker } from './deletion/DidCommProofWorker' +import { oid4VcIssuanceWorker } from './deletion/Oid4VcIssuanceWorker' +import { oid4VcVerificationWorker } from './deletion/Oid4VcVerificationWorker' + +class RetentionCronService { + private job: ScheduledTask | null = null + private _webhookUrl: string | undefined + + get webhookUrl(): string | undefined { + return this._webhookUrl + } + + async start(agent: Agent, config: RetentionConfig, webhookUrl: string | undefined): Promise { + this._webhookUrl = webhookUrl + + await natsClient.connect(config.nats) + await natsClient.provisionStreams() + await natsClient.provisionConsumers() + + const enabledTypes = new Set(config.recordTypes) + + if (enabledTypes.has(RecordType.DIDCOMM_CREDENTIAL)) { + didCommCredentialWorker + .start(agent, this._webhookUrl) + .catch((err: Error) => + agent.config.logger.error('[Retention] DidCommCredentialWorker crashed', { error: err?.message }), + ) + } + + if (enabledTypes.has(RecordType.DIDCOMM_PROOF)) { + didCommProofWorker + .start(agent, this._webhookUrl) + .catch((err: Error) => + agent.config.logger.error('[Retention] DidCommProofWorker crashed', { error: err?.message }), + ) + } + + if (enabledTypes.has(RecordType.OID4VC_ISSUANCE)) { + oid4VcIssuanceWorker + .start(agent, this._webhookUrl) + .catch((err: Error) => + agent.config.logger.error('[Retention] Oid4VcIssuanceWorker crashed', { error: err?.message }), + ) + } + + if (enabledTypes.has(RecordType.OID4VC_VERIFICATION)) { + oid4VcVerificationWorker + .start(agent, this._webhookUrl) + .catch((err: Error) => + agent.config.logger.error('[Retention] Oid4VcVerificationWorker crashed', { error: err?.message }), + ) + } + + agent.config.logger.info('[Retention] Deletion workers started', { enabledTypes: config.recordTypes }) + + this.job = cron.schedule(config.cronSchedule, () => { + this.runScan(agent, config).catch((err: Error) => + agent.config.logger.error('[Retention] Unhandled scan error', { error: err?.message }), + ) + }) + + agent.config.logger.info('[Retention] Cron service started', { + cronSchedule: config.cronSchedule, + ttlSeconds: config.ttlSeconds, + recordTypes: config.recordTypes, + }) + } + + async stop(): Promise { + this.job?.stop() + this.job = null + await natsClient.disconnect() + } + + private async runScan(agent: Agent, config: RetentionConfig): Promise { + const logger = agent.config.logger + let totalPublished = 0 + + try { + const isShared = typeof (agent as any).modules?.tenants?.getAllTenants === 'function' + + logger.info('[Retention] Scan started', { agentMode: isShared ? 'shared' : 'dedicated' }) + + if (isShared) { + const tenants: Array<{ id: string }> = await (agent as any).modules.tenants.getAllTenants() + + for (const tenant of tenants) { + try { + await (agent as any).modules.tenants.withTenantAgent( + { tenantId: tenant.id }, + async (tenantAgent: Agent) => { + const count = await this.scanTenant(tenantAgent, tenant.id, config) + totalPublished += count + }, + ) + } catch (err: any) { + logger.error('[Retention] Failed to scan tenant', { tenantId: tenant.id, error: err?.message }) + } + } + } else { + totalPublished = await this.scanTenant(agent, '', config) + } + + logger.info('[Retention] Scan completed', { jobsPublished: totalPublished }) + } catch (err: any) { + logger.error('[Retention] Scan error', { error: err?.message }) + } + } + + private async scanTenant(tenantAgent: Agent, tenantId: string, config: RetentionConfig): Promise { + let published = 0 + const agentMode: 'shared' | 'dedicated' = tenantId === '' ? 'dedicated' : 'shared' + + for (const recordType of config.recordTypes) { + try { + const recordIds = await this.queryExpiredRecords(tenantAgent, recordType, config.ttlSeconds) + + if (recordIds.length === 0) continue + + for (const recordId of recordIds) { + await this.publishJob(recordId, recordType, tenantId, agentMode) + published++ + } + } catch (err: any) { + tenantAgent.config.logger.error('[Retention] Error scanning record type', { + tenantId, + recordType, + error: err?.message, + }) + } + } + + return published + } + + private async queryExpiredRecords(agent: Agent, recordType: RecordType, ttlSeconds: number): Promise { + const terminalStates = TERMINAL_STATES[recordType] + const cutoffMs = Date.now() - ttlSeconds * 1000 + const expiredIds: string[] = [] + + switch (recordType) { + case RecordType.DIDCOMM_CREDENTIAL: { + const records = await (agent as any).modules.didcomm.credentials.findAllByQuery({ + state: terminalStates, + }) + for (const record of records) { + if (record.updatedAt && new Date(record.updatedAt).getTime() < cutoffMs) { + expiredIds.push(record.id) + } + } + break + } + + case RecordType.DIDCOMM_PROOF: { + const records = await (agent as any).modules.didcomm.proofs.findAllByQuery({ + state: terminalStates, + }) + for (const record of records) { + if (record.updatedAt && new Date(record.updatedAt).getTime() < cutoffMs) { + expiredIds.push(record.id) + } + } + break + } + + case RecordType.OID4VC_ISSUANCE: { + const repo = agent.dependencyManager.resolve(OpenId4VcIssuanceSessionRepository) + const records = await repo.findByQuery(agent.context, {}) + for (const record of records) { + const inTerminalState = terminalStates.includes(record.state as string) + if (inTerminalState && record.updatedAt && new Date(record.updatedAt).getTime() < cutoffMs) { + expiredIds.push(record.id) + } + } + break + } + + case RecordType.OID4VC_VERIFICATION: { + const repo = agent.dependencyManager.resolve(OpenId4VcVerificationSessionRepository) + const records = await repo.findByQuery(agent.context, {}) + for (const record of records) { + const inTerminalState = terminalStates.includes(record.state as string) + if (inTerminalState && record.updatedAt && new Date(record.updatedAt).getTime() < cutoffMs) { + expiredIds.push(record.id) + } + } + break + } + } + + return expiredIds + } + + private async publishJob( + recordId: string, + recordType: RecordType, + tenantId: string, + agentMode: 'shared' | 'dedicated', + ): Promise { + const job: DeletionJob = { + recordId, + recordType, + tenantId, + agentMode, + enqueuedAt: new Date().toISOString(), + } + + await natsClient.publish(NATS_SUBJECTS[recordType], job) + } +} + +export const retentionCronService = new RetentionCronService() diff --git a/src/services/deletion/BaseRetentionWorker.ts b/src/services/deletion/BaseRetentionWorker.ts new file mode 100644 index 00000000..511c3a69 --- /dev/null +++ b/src/services/deletion/BaseRetentionWorker.ts @@ -0,0 +1,162 @@ +import type { Agent, Logger } from '@credo-ts/core' +import type { JsMsg } from 'nats' + +import { RecordNotFoundError } from '@credo-ts/core' +import { StringCodec } from 'nats' + +import type { DeletionJob } from '../../types/RetentionTypes' +import { DLQ_SUBJECTS, WEBHOOK_PATHS, RecordType, DeletionStatus } from '../../types/RetentionTypes' +import { natsClient } from '../../utils/NatsClient' +import { CONSUMER_MAX_DELIVER, WEBHOOK_RETRY_DELAYS_MS } from '../../utils/NatsConstants' +import { sleep } from '../../utils/webhook' + +const sc = StringCodec() + +export abstract class BaseRetentionWorker { + protected abstract recordType: RecordType + protected abstract consumerName: string + + protected abstract deleteRecord(agent: Agent, recordId: string): Promise + + async start(agent: Agent, webhookUrl: string | undefined): Promise { + try { + const consumer = await natsClient.getPullConsumer(this.consumerName) + agent.config.logger.info(`[Retention] Worker started`, { consumer: this.consumerName }) + + while (true) { + const messages = await consumer.consume() + for await (const msg of messages) { + await this.processMessage(msg, agent, webhookUrl) + } + agent.config.logger.warn(`[Retention] Consume loop ended — restarting`, { consumer: this.consumerName }) + } + } catch (err: any) { + agent.config.logger.error(`[Retention] Worker loop exited`, { + consumer: this.consumerName, + error: err?.message, + stack: err?.stack, + }) + } + } + + private async processMessage(msg: JsMsg, agent: Agent, webhookUrl: string | undefined): Promise { + let job: DeletionJob | undefined + + try { + job = JSON.parse(sc.decode(msg.data)) as DeletionJob + } catch { + agent.config.logger.error('[Retention] Failed to parse job message — discarding', { + consumer: this.consumerName, + }) + msg.ack() + return + } + + const { recordId, recordType, tenantId, agentMode } = job + const logger = agent.config.logger + const deliveryCount = msg.info.deliveryCount + + logger.debug('[Retention] Job received', { recordId, recordType, tenantId, deliveryCount }) + + try { + if (agentMode === 'shared') { + await (agent as any).modules.tenants.withTenantAgent({ tenantId }, async (tenantAgent: Agent) => { + await this.deleteRecord(tenantAgent, recordId) + }) + } else { + await this.deleteRecord(agent, recordId) + } + + logger.info('[Retention] Record deleted', { recordId, recordType, tenantId }) + + msg.ack() + if (webhookUrl) { + await this.sendWebhookWithRetry( + `${webhookUrl}${WEBHOOK_PATHS[this.recordType]}`, + this.buildWebhookBody(job, DeletionStatus.DELETED), + logger, + ) + } + } catch (err: any) { + if (err instanceof RecordNotFoundError) { + logger.warn('[Retention] Record already absent — treating as success', { recordId, recordType }) + + msg.ack() + if (webhookUrl) { + await this.sendWebhookWithRetry( + `${webhookUrl}${WEBHOOK_PATHS[this.recordType]}`, + this.buildWebhookBody(job, DeletionStatus.ALREADY_ABSENT), + logger, + ) + } + return + } + + logger.warn('[Retention] Job failed', { recordId, recordType, deliveryCount, error: err?.message }) + + if (deliveryCount >= CONSUMER_MAX_DELIVER) { + try { + await natsClient.publishToDlq(DLQ_SUBJECTS[this.recordType], job, err?.message ?? 'unknown error') + } catch (dlqErr: any) { + logger.error('[Retention] Failed to publish to DLQ', { recordId, error: dlqErr?.message }) + } + + logger.error('[Retention] Job moved to DLQ after max retries', { + recordId, + recordType, + tenantId, + deliveryCount, + }) + + msg.ack() + } else { + logger.warn('[Retention] Job failed — retrying', { recordId, deliveryCount }) + msg.nak() + } + } + } + + private async sendWebhookWithRetry( + url: string, + body: Record, + logger: Logger, + ): Promise { + const delays = WEBHOOK_RETRY_DELAYS_MS + const maxAttempts = delays.length + 1 + + for (let attempt = 0; attempt < maxAttempts; attempt++) { + try { + await fetch(url, { + method: 'POST', + body: JSON.stringify(body), + headers: { 'Content-Type': 'application/json' }, + signal: AbortSignal.timeout(10000), + }) + logger.debug('[Retention] Webhook sent', { url, recordId: (body.deletion as any)?.recordId }) + return + } catch (err: any) { + const isLastAttempt = attempt === maxAttempts - 1 + if (isLastAttempt) { + logger.warn('[Retention] Webhook delivery failed after all retries', { url, error: err?.message }) + } else { + logger.debug(`[Retention] Webhook attempt ${attempt + 1} failed — retrying in ${delays[attempt]}ms`) + await sleep(delays[attempt]) + } + } + } + } + + private buildWebhookBody(job: DeletionJob, status: DeletionStatus): Record { + return { + eventType: 'retention.deletion.complete', + occurredAt: new Date().toISOString(), + tenantId: job.tenantId, + deletion: { + recordId: job.recordId, + recordType: job.recordType, + status, + deletedAt: new Date().toISOString(), + }, + } + } +} diff --git a/src/services/deletion/DidCommCredentialWorker.ts b/src/services/deletion/DidCommCredentialWorker.ts new file mode 100644 index 00000000..fa269e35 --- /dev/null +++ b/src/services/deletion/DidCommCredentialWorker.ts @@ -0,0 +1,15 @@ +import type { Agent } from '@credo-ts/core' + +import { RecordType } from '../../types/RetentionTypes' +import { BaseRetentionWorker } from './BaseRetentionWorker' + +export class DidCommCredentialWorker extends BaseRetentionWorker { + protected recordType = RecordType.DIDCOMM_CREDENTIAL + protected consumerName = 'retention-worker-didcomm-credential' + + protected async deleteRecord(agent: Agent, recordId: string): Promise { + await (agent as any).modules.didcomm.credentials.deleteById(recordId) + } +} + +export const didCommCredentialWorker = new DidCommCredentialWorker() diff --git a/src/services/deletion/DidCommProofWorker.ts b/src/services/deletion/DidCommProofWorker.ts new file mode 100644 index 00000000..f8cc5ecd --- /dev/null +++ b/src/services/deletion/DidCommProofWorker.ts @@ -0,0 +1,15 @@ +import type { Agent } from '@credo-ts/core' + +import { RecordType } from '../../types/RetentionTypes' +import { BaseRetentionWorker } from './BaseRetentionWorker' + +export class DidCommProofWorker extends BaseRetentionWorker { + protected recordType = RecordType.DIDCOMM_PROOF + protected consumerName = 'retention-worker-didcomm-proof' + + protected async deleteRecord(agent: Agent, recordId: string): Promise { + await (agent as any).modules.didcomm.proofs.deleteById(recordId) + } +} + +export const didCommProofWorker = new DidCommProofWorker() diff --git a/src/services/deletion/Oid4VcIssuanceWorker.ts b/src/services/deletion/Oid4VcIssuanceWorker.ts new file mode 100644 index 00000000..7e0685d1 --- /dev/null +++ b/src/services/deletion/Oid4VcIssuanceWorker.ts @@ -0,0 +1,29 @@ +import type { Agent } from '@credo-ts/core' + +import { OpenId4VcIssuanceSessionRepository } from '@credo-ts/openid4vc' + +import { RecordType } from '../../types/RetentionTypes' +import { BaseRetentionWorker } from './BaseRetentionWorker' + +export class Oid4VcIssuanceWorker extends BaseRetentionWorker { + protected recordType = RecordType.OID4VC_ISSUANCE + protected consumerName = 'retention-worker-oid4vc-issuance' + + protected async deleteRecord(agent: Agent, recordId: string): Promise { + agent.config.logger.info(`[Retention] Attempting to delete OID4VC issuance session`, { recordId }) + try { + const repository = agent.dependencyManager.resolve(OpenId4VcIssuanceSessionRepository) + await repository.deleteById(agent.context, recordId) + agent.config.logger.info(`[Retention] Successfully deleted OID4VC issuance session`, { recordId }) + } catch (err: any) { + agent.config.logger.error(`[Retention] Failed to delete OID4VC issuance session`, { + recordId, + error: err?.message, + errorType: err?.constructor?.name, + }) + throw err // re-throw so BaseRetentionWorker can handle retry/DLQ + } + } +} + +export const oid4VcIssuanceWorker = new Oid4VcIssuanceWorker() diff --git a/src/services/deletion/Oid4VcVerificationWorker.ts b/src/services/deletion/Oid4VcVerificationWorker.ts new file mode 100644 index 00000000..64787b47 --- /dev/null +++ b/src/services/deletion/Oid4VcVerificationWorker.ts @@ -0,0 +1,18 @@ +import type { Agent } from '@credo-ts/core' + +import { OpenId4VcVerificationSessionRepository } from '@credo-ts/openid4vc' + +import { RecordType } from '../../types/RetentionTypes' +import { BaseRetentionWorker } from './BaseRetentionWorker' + +export class Oid4VcVerificationWorker extends BaseRetentionWorker { + protected recordType = RecordType.OID4VC_VERIFICATION + protected consumerName = 'retention-worker-oid4vc-verification' + + protected async deleteRecord(agent: Agent, recordId: string): Promise { + const repository = agent.dependencyManager.resolve(OpenId4VcVerificationSessionRepository) + await repository.deleteById(agent.context, recordId) + } +} + +export const oid4VcVerificationWorker = new Oid4VcVerificationWorker() diff --git a/src/tracer.ts b/src/tracer.ts index ed0ecbe1..3c7048fc 100644 --- a/src/tracer.ts +++ b/src/tracer.ts @@ -27,6 +27,8 @@ const resource = new resourceFromAttributes({ [SemanticResourceAttributes.SERVICE_INSTANCE_ID]: process.env.HOSTNAME, }) +const otelEnabled = process.env.OTEL_ENABLED === 'true' + const traceExporter = new OTLPTraceExporter({ url: process.env.OTEL_TRACES_OTLP_ENDPOINT, headers: { @@ -40,8 +42,13 @@ const logExporter = new OTLPLogExporter({ Authorization: `Api-Key ${process.env.OTEL_HEADERS_KEY}`, }, }) + const logProvider = new LoggerProvider({ resource }) -logProvider.addLogRecordProcessor(new BatchLogRecordProcessor(logExporter)) +// Only add the BatchLogRecordProcessor when OTEL is enabled — otherwise it +// tries to connect to localhost:4318 on every flush even if SDK never started. +if (otelEnabled) { + logProvider.addLogRecordProcessor(new BatchLogRecordProcessor(logExporter)) +} export const otelLogger: Logger = logProvider.getLogger('credo-controller-logger') export const otelLoggerProviderInstance = logProvider diff --git a/src/types/RetentionTypes.ts b/src/types/RetentionTypes.ts new file mode 100644 index 00000000..0ad38fff --- /dev/null +++ b/src/types/RetentionTypes.ts @@ -0,0 +1,137 @@ +export enum RecordType { + DIDCOMM_CREDENTIAL = 'didcomm_credential', + DIDCOMM_PROOF = 'didcomm_proof', + OID4VC_ISSUANCE = 'oid4vc_issuance', + OID4VC_VERIFICATION = 'oid4vc_verification', +} + +// Terminal states that make a record eligible for deletion +export const TERMINAL_STATES: Record = { + [RecordType.DIDCOMM_CREDENTIAL]: ['done', 'abandoned'], + [RecordType.DIDCOMM_PROOF]: ['done', 'abandoned'], + + // All states from OpenId4VcIssuanceSessionState enum + [RecordType.OID4VC_ISSUANCE]: [ + 'OfferCreated', + 'OfferUriRetrieved', + 'AuthorizationInitiated', + 'AuthorizationGranted', + 'AccessTokenRequested', + 'AccessTokenCreated', + 'CredentialRequestReceived', + 'CredentialsPartiallyIssued', + 'Completed', + 'Error', + ], + + // All states from OpenId4VcVerificationSessionState enum + [RecordType.OID4VC_VERIFICATION]: [ + 'RequestCreated', + 'RequestUriRetrieved', + 'ResponseVerified', + 'Error', + ], +} + +// Maps RecordType to the NATS subject it should be published on +export const NATS_SUBJECTS: Record = { + [RecordType.DIDCOMM_CREDENTIAL]: 'retention.delete.didcomm.credential', + [RecordType.DIDCOMM_PROOF]: 'retention.delete.didcomm.proof', + [RecordType.OID4VC_ISSUANCE]: 'retention.delete.oid4vc.issuance', + [RecordType.OID4VC_VERIFICATION]: 'retention.delete.oid4vc.verification', +} + +// Maps RecordType to its webhook path (appended to webhookUrl) +// Need to add delete in the route +export const WEBHOOK_PATHS: Record = { + [RecordType.DIDCOMM_CREDENTIAL]: '/wh/didcomm-issuance', + [RecordType.DIDCOMM_PROOF]: '/wh/didcomm-verification', + [RecordType.OID4VC_ISSUANCE]: '/wh/delete/oid4vc-issuance', + [RecordType.OID4VC_VERIFICATION]: '/wh/delete/oid4vc-verification', +} + +// Maps RecordType to its DLQ subject +export const DLQ_SUBJECTS: Record = { + [RecordType.DIDCOMM_CREDENTIAL]: 'retention.dlq.didcomm.credential', + [RecordType.DIDCOMM_PROOF]: 'retention.dlq.didcomm.proof', + [RecordType.OID4VC_ISSUANCE]: 'retention.dlq.oid4vc.issuance', + [RecordType.OID4VC_VERIFICATION]: 'retention.dlq.oid4vc.verification', +} + +export interface NatsConfig { + servers: string[] + credentialsFile?: string +} + +export interface RetentionConfig { + enabled: boolean + cronSchedule: string // cron syntax e.g. "0 */2 * * *" + ttlSeconds: number // TTL in seconds after terminal state reached + recordTypes: RecordType[] + nats: NatsConfig +} + +// ─── Config builders ───────────────────────────────────────────────────────── +// Resolves the final RetentionConfig from env vars + cliConfig.json. +// Priority: env vars > cliConfig.json > defaults. +// Returns undefined if retention is not enabled from either source. +export function buildRetentionConfig(configRetention?: Partial): RetentionConfig | undefined { + const enabled = process.env.RETENTION_ENABLED === 'true' || configRetention?.enabled === true + if (!enabled) return undefined + + return { + enabled: true, + cronSchedule: process.env.RETENTION_CRON_SCHEDULE || configRetention?.cronSchedule || '0 */2 * * *', + ttlSeconds: Number(process.env.RETENTION_TTL_SECONDS) || configRetention?.ttlSeconds || 2592000, + recordTypes: buildRetentionRecordTypes(configRetention?.recordTypes), + nats: { + servers: ( + process.env.NATS_SERVERS || + configRetention?.nats?.servers?.join(',') || + 'nats://localhost:4222' + ).split(','), + credentialsFile: process.env.NATS_CREDENTIALS_FILE || configRetention?.nats?.credentialsFile, + }, + } +} + +// Builds the list of record types from per-type env flags, falling back to +// cliConfig.json recordTypes array, then all four types as default. +function buildRetentionRecordTypes(configRecordTypes?: RecordType[]): RecordType[] { + const envFlags: Record = { + RETENTION_DIDCOMM_CREDENTIAL: RecordType.DIDCOMM_CREDENTIAL, + RETENTION_DIDCOMM_PROOF: RecordType.DIDCOMM_PROOF, + RETENTION_OID4VC_ISSUANCE: RecordType.OID4VC_ISSUANCE, + RETENTION_OID4VC_VERIFICATION: RecordType.OID4VC_VERIFICATION, + } + + const anyEnvSet = Object.keys(envFlags).some((key) => process.env[key] !== undefined) + + if (anyEnvSet) { + return Object.entries(envFlags) + .filter(([key]) => process.env[key] === 'true') + .map(([, type]) => type) + } + + return configRecordTypes ?? [ + RecordType.DIDCOMM_CREDENTIAL, + RecordType.DIDCOMM_PROOF, + RecordType.OID4VC_ISSUANCE, + RecordType.OID4VC_VERIFICATION, + ] +} + +// Status values reported in the webhook payload after a deletion attempt +export enum DeletionStatus { + DELETED = 'deleted', // record was successfully deleted + ALREADY_ABSENT = 'already-absent', // record was not found — treated as success (idempotent) +} + +// Payload published to NATS for each eligible record +export interface DeletionJob { + recordId: string + recordType: RecordType + tenantId: string // empty string for dedicated agents + agentMode: 'shared' | 'dedicated' + enqueuedAt: string // ISO-8601 +} diff --git a/src/utils/NatsClient.ts b/src/utils/NatsClient.ts new file mode 100644 index 00000000..ba2b365b --- /dev/null +++ b/src/utils/NatsClient.ts @@ -0,0 +1,164 @@ +import { + AckPolicy, + DiscardPolicy, + RetentionPolicy, + StorageType, + StringCodec, + connect, + headers, +} from 'nats' +import type { Consumer, JetStreamClient, JetStreamManager, NatsConnection, StreamConfig } from 'nats' + +import type { DeletionJob, NatsConfig } from '../types/RetentionTypes' +import { RecordType } from '../types/RetentionTypes' +import { + CONSUMERS, + CONSUMER_ACK_WAIT_NS, + CONSUMER_BACKOFF_NS, + CONSUMER_MAX_DELIVER, + DELETION_STREAM_DEDUP_WINDOW_NS, + DELETION_STREAM_MAX_AGE_NS, + DELETION_STREAM_MAX_MSGS, + DELETION_SUBJECTS, + DLQ_STREAM_MAX_AGE_NS, + DLQ_STREAM_MAX_MSGS, + NATS_ERR_CONSUMER_ALREADY_EXISTS, + NATS_ERR_STREAM_ALREADY_EXISTS, + NATS_MAX_RECONNECT_ATTEMPTS, + NATS_RECONNECT_TIME_WAIT_MS, + RETENTION_DELETION_STREAM, + RETENTION_DLQ_STREAM, +} from './NatsConstants' + +const sc = StringCodec() + +class NatsClient { + private nc: NatsConnection | null = null + private js: JetStreamClient | null = null + private jsm: JetStreamManager | null = null + + async connect(config: NatsConfig): Promise { + this.nc = await connect({ + servers: config.servers, + ...(config.credentialsFile ? { credentialsFile: config.credentialsFile } : {}), + maxReconnectAttempts: NATS_MAX_RECONNECT_ATTEMPTS, + reconnectTimeWait: NATS_RECONNECT_TIME_WAIT_MS, + }) + this.js = this.nc.jetstream() + this.jsm = await this.nc.jetstreamManager() + } + + async provisionStreams(): Promise { + if (!this.jsm) throw new Error('[NatsClient] Not connected — call connect() first') + + const deletionStreamConfig = { + name: RETENTION_DELETION_STREAM, + subjects: DELETION_SUBJECTS, + retention: RetentionPolicy.Workqueue, + storage: StorageType.File, + max_age: DELETION_STREAM_MAX_AGE_NS, + max_msgs: DELETION_STREAM_MAX_MSGS, + discard: DiscardPolicy.Old, + duplicate_window: DELETION_STREAM_DEDUP_WINDOW_NS, + } + + const dlqStreamConfig = { + name: RETENTION_DLQ_STREAM, + subjects: ['retention.dlq.>'], + retention: RetentionPolicy.Limits, + storage: StorageType.File, + max_age: DLQ_STREAM_MAX_AGE_NS, + max_msgs: DLQ_STREAM_MAX_MSGS, + } + + // Use update-or-create so config changes (e.g. new subjects) always take effect + await this.addOrUpdateStream(deletionStreamConfig) + await this.addOrUpdateStream(dlqStreamConfig) + } + + private async addOrUpdateStream(config: Partial & { name: string }): Promise { + if (!this.jsm) throw new Error('[NatsClient] Not connected — call connect() first') + try { + await this.jsm.streams.add(config) + } catch (err: any) { + if (this.isAlreadyExistsError(err)) { + // Stream exists — update it so any config changes (subjects, retention, etc.) take effect + await this.jsm.streams.update(config.name, config) + } else { + throw err + } + } + } + + async provisionConsumers(): Promise { + if (!this.jsm) throw new Error('[NatsClient] Not connected — call connect() first') + + for (const consumer of CONSUMERS) { + try { + await this.jsm.consumers.add(RETENTION_DELETION_STREAM, { + durable_name: consumer.name, + ack_policy: AckPolicy.Explicit, + ack_wait: CONSUMER_ACK_WAIT_NS, + max_deliver: CONSUMER_MAX_DELIVER, + backoff: CONSUMER_BACKOFF_NS, + filter_subject: consumer.filterSubject, + }) + } catch (err: any) { + if (!this.isAlreadyExistsError(err)) throw err + } + } + } + + async publish(subject: string, payload: DeletionJob): Promise { + if (!this.js) throw new Error('[NatsClient] Not connected — call connect() first') + + const h = headers() + // Msg-Id combines recordId + enqueuedAt so the same record can be re-queued + // in a later cron run (different timestamp) while still deduplicating within + // a single cron run (same timestamp for all jobs published together). + h.set('Nats-Msg-Id', `${payload.recordId}-${payload.enqueuedAt}`) + + await this.js.publish(subject, sc.encode(JSON.stringify(payload)), { headers: h }) + } + + async publishToDlq(dlqSubject: string, payload: DeletionJob, errorReason: string): Promise { + if (!this.js) throw new Error('[NatsClient] Not connected — call connect() first') + + const h = headers() + h.set('X-Retention-Error', errorReason) + h.set('X-Retention-Record-Type', payload.recordType) + + await this.js.publish(dlqSubject, sc.encode(JSON.stringify(payload)), { headers: h }) + } + + async getPullConsumer(consumerName: string): Promise { + if (!this.js) throw new Error('[NatsClient] Not connected — call connect() first') + return this.js.consumers.get(RETENTION_DELETION_STREAM, consumerName) + } + + async disconnect(): Promise { + if (this.nc) { + await this.nc.drain() + this.nc = null + this.js = null + this.jsm = null + } + } + + decode(data: Uint8Array): DeletionJob { + return JSON.parse(sc.decode(data)) as DeletionJob + } + + private isAlreadyExistsError(err: any): boolean { + const msg: string = err?.message ?? '' + return ( + msg.includes('stream name already in use') || + msg.includes('consumer name already in use') || + err?.api_error?.err_code === NATS_ERR_STREAM_ALREADY_EXISTS || + err?.api_error?.err_code === NATS_ERR_CONSUMER_ALREADY_EXISTS + ) + } +} + +export const natsClient = new NatsClient() +export { RecordType } diff --git a/src/utils/NatsConstants.ts b/src/utils/NatsConstants.ts new file mode 100644 index 00000000..2162d137 --- /dev/null +++ b/src/utils/NatsConstants.ts @@ -0,0 +1,120 @@ +// ─── NATS Stream Names ──────────────────────────────────────────────────────── + +// Main work queue — holds all pending deletion jobs. +// WorkQueue retention: message is permanently removed after it is ack'd. +export const RETENTION_DELETION_STREAM = 'RETENTION_DELETION' + +// Dead-letter queue — holds jobs that failed after all retry attempts. +// Limits retention: messages are kept for manual investigation, not auto-deleted on ack. +export const RETENTION_DLQ_STREAM = 'RETENTION_DLQ' + +// ─── NATS Subject Patterns ──────────────────────────────────────────────────── + +// All subjects that the RETENTION_DELETION stream must capture. +// Must stay in sync with NATS_SUBJECTS in RetentionTypes.ts. +export const DELETION_SUBJECTS = [ + 'retention.delete.didcomm.credential', + 'retention.delete.didcomm.proof', + 'retention.delete.oid4vc.issuance', + 'retention.delete.oid4vc.verification', +] + +// ─── NATS Consumer Definitions ─────────────────────────────────────────────── + +// One pull consumer per record type. +// Each consumer filters to its own subject so workers only receive their own messages. +// Consumer names must stay in sync with the consumerName in each *Worker.ts file. +export const CONSUMERS: Array<{ name: string; filterSubject: string }> = [ + { + name: 'retention-worker-didcomm-credential', + filterSubject: 'retention.delete.didcomm.credential', + }, + { + name: 'retention-worker-didcomm-proof', + filterSubject: 'retention.delete.didcomm.proof', + }, + { + name: 'retention-worker-oid4vc-issuance', + filterSubject: 'retention.delete.oid4vc.issuance', + }, + { + name: 'retention-worker-oid4vc-verification', + filterSubject: 'retention.delete.oid4vc.verification', + }, +] + +// ─── NATS Connection ────────────────────────────────────────────────────────── + +// -1 means retry forever — the agent should not stop trying to reconnect. +export const NATS_MAX_RECONNECT_ATTEMPTS = -1 + +// How long (ms) to wait between reconnect attempts. +export const NATS_RECONNECT_TIME_WAIT_MS = 2000 + +// ─── NATS Stream Limits ─────────────────────────────────────────────────────── + +// NATS time values are in nanoseconds (1 second = 1_000_000_000 ns). + +// How long to keep a message in the RETENTION_DELETION stream before discarding. +// Prevents unbounded growth if workers fall behind. +// 7 days in nanoseconds. +export const DELETION_STREAM_MAX_AGE_NS = 7 * 24 * 60 * 60 * 1_000_000_000 + +// Maximum number of messages to keep in the RETENTION_DELETION stream. +export const DELETION_STREAM_MAX_MSGS = 1_000_000 + +// Deduplication window: NATS will reject a message with the same Nats-Msg-Id +// if it was already published within this window. +// Our Msg-Id = recordId + enqueuedAt, so this prevents double-publishing +// from the same cron run while allowing re-publishing in later cron runs. +// 24 hours in nanoseconds. +export const DELETION_STREAM_DEDUP_WINDOW_NS = 24 * 60 * 60 * 1_000_000_000 + +// How long to keep failed jobs in the DLQ for manual investigation. +// 30 days in nanoseconds. +export const DLQ_STREAM_MAX_AGE_NS = 30 * 24 * 60 * 60 * 1_000_000_000 + +// Maximum number of messages to keep in the DLQ stream. +export const DLQ_STREAM_MAX_MSGS = 100_000 + +// ─── NATS Consumer Delivery Config ─────────────────────────────────────────── + +// How long NATS waits for a worker to ack a message before redelivering it. +// Must be long enough to cover the full deletion + webhook retry time. +// Worst case: webhook retries = 1s + 5s + 30s = 36s → 60s gives comfortable headroom. +// 60 seconds in nanoseconds. +export const CONSUMER_ACK_WAIT_NS = 60 * 1_000_000_000 + +// Maximum number of delivery attempts before a job is considered permanently failed. +// After this many attempts, the worker routes the job to the DLQ. +// Must stay in sync with MAX_DELIVER in BaseRetentionWorker.ts. +export const CONSUMER_MAX_DELIVER = 5 + +// Backoff delays between redelivery attempts (nanoseconds). +// NATS uses these to space out retries after a nak(). +// Attempt 1 → 2: wait 1s +// Attempt 2 → 3: wait 5s +// Attempt 3 → 4: wait 30s +// Attempt 4 → 5: wait 2 min +// Attempt 5 : move to DLQ (no more redelivery) +export const CONSUMER_BACKOFF_NS = [ + 1_000_000_000, // 1 second + 5_000_000_000, // 5 seconds + 30_000_000_000, // 30 seconds + 120_000_000_000, // 2 minutes + 300_000_000_000, // 5 minutes +] + +// ─── NATS Error Codes ───────────────────────────────────────────────────────── + +// JetStream API error codes returned when a stream or consumer already exists. +// Used in addOrUpdateStream() to detect and handle existing resources. +export const NATS_ERR_STREAM_ALREADY_EXISTS = 10058 +export const NATS_ERR_CONSUMER_ALREADY_EXISTS = 10148 + +// ─── Webhook Retry Delays ───────────────────────────────────────────────────── + +// Delays in milliseconds between webhook delivery attempts. +// Total attempts = delays.length + 1 (1 initial + N retries). +// [1s, 5s, 30s] → 3 retries → 4 total attempts. +export const WEBHOOK_RETRY_DELAYS_MS = [1000, 5000, 30000] diff --git a/src/utils/ServerConfig.ts b/src/utils/ServerConfig.ts index 4f66c053..e2734b83 100644 --- a/src/utils/ServerConfig.ts +++ b/src/utils/ServerConfig.ts @@ -1,5 +1,6 @@ import type { Express } from 'express' import type { Server } from 'ws' +import type { RetentionConfig } from '../types/RetentionTypes' export interface ServerConfig { port: number @@ -9,4 +10,5 @@ export interface ServerConfig { /* Socket server is used for sending events over websocket to clients */ socketServer?: Server schemaFileServerURL?: string + retention?: RetentionConfig } diff --git a/yarn.lock b/yarn.lock index 1f60614e..095114a6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2754,6 +2754,11 @@ dependencies: "@types/express" "*" +"@types/node-cron@^3.0.11": + version "3.0.11" + resolved "https://registry.yarnpkg.com/@types/node-cron/-/node-cron-3.0.11.tgz#70b7131f65038ae63cfe841354c8aba363632344" + integrity sha512-0ikrnug3/IyneSHqCBeslAhlK2aBfYek1fGo4bP4QnZPmiqSGRK+Oy7ZMisLWkesffJvQ1cqAcBnJC+8+nxIAg== + "@types/node-fetch@^2.6.4": version "2.6.13" resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.13.tgz#e0c9b7b5edbdb1b50ce32c127e85e880872d56ee" @@ -6470,6 +6475,13 @@ napi-postinstall@^0.3.0: resolved "https://registry.yarnpkg.com/napi-postinstall/-/napi-postinstall-0.3.4.tgz#7af256d6588b5f8e952b9190965d6b019653bbb9" integrity sha512-PHI5f1O0EP5xJ9gQmFGMS6IZcrVvTjpXjz7Na41gTE7eE2hK11lg04CECCYEEjdc17EV4DO+fkGEtt7TpTaTiQ== +nats@^2.29.3: + version "2.29.3" + resolved "https://registry.yarnpkg.com/nats/-/nats-2.29.3.tgz#86099c9bc193464d4f8cbb1d3504335bd2719ec6" + integrity sha512-tOQCRCwC74DgBTk4pWZ9V45sk4d7peoE2njVprMRCBXrhJ5q5cYM7i6W+Uvw2qUrcfOSnuisrX7bEx3b3Wx4QA== + dependencies: + nkeys.js "1.1.0" + natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" @@ -6509,6 +6521,13 @@ ngrok@^4.3.3: optionalDependencies: hpagent "^0.1.2" +nkeys.js@1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/nkeys.js/-/nkeys.js-1.1.0.tgz#de83a9a13f396c5b6d7c412788f4b9f7f35d4c18" + integrity sha512-tB/a0shZL5UZWSwsoeyqfTszONTt4k2YS0tuQioMOD180+MbombYVgzDUYHlx+gejYK6rgf08n/2Df99WY0Sxg== + dependencies: + tweetnacl "1.0.3" + node-addon-api@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-2.0.2.tgz#432cfa82962ce494b132e9d72a15b29f71ff5d32" @@ -6519,6 +6538,11 @@ node-addon-api@^3.0.0: resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-3.2.1.tgz#81325e0a2117789c0128dab65e7e38f07ceba161" integrity sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A== +node-cron@^4.2.1: + version "4.2.1" + resolved "https://registry.yarnpkg.com/node-cron/-/node-cron-4.2.1.tgz#6979be4aee4702f06322d21220df8de252c8e265" + integrity sha512-lgimEHPE/QDgFlywTd8yTR61ptugX3Qer29efeyWw2rv259HtGBNn1vZVmp8lB9uo9wC0t/AT4iGqXxia+CJFg== + node-fetch@2, node-fetch@^2.7.0: version "2.7.0" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d" @@ -7839,6 +7863,11 @@ tsyringe@^4.10.0, tsyringe@^4.6.0: dependencies: tslib "^1.9.3" +tweetnacl@1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-1.0.3.tgz#ac0af71680458d8a6378d0d0d050ab1407d35596" + integrity sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw== + type-check@^0.4.0, type-check@~0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1" From 6b59d1fba9a70c5747b6f47b5d15754d5e3ffbce Mon Sep 17 00:00:00 2001 From: Tipu_Singh Date: Tue, 21 Apr 2026 21:48:06 +0530 Subject: [PATCH 133/152] feat: added nats scheduler Signed-off-by: Tipu_Singh --- .env.sample | 42 ++++ src/cli.ts | 1 - src/cliAgent.ts | 29 ++- .../credentials/CredentialController.ts | 5 + .../didcomm/proofs/ProofController.ts | 5 + .../issuance-sessions.Controller.ts | 3 + .../verification-sessions.Controller.ts | 3 + src/purge/PurgeConfigValidator.ts | 47 ++++ src/purge/PurgeConstants.ts | 68 ++++++ src/purge/PurgeDeleteRecord.ts | 29 +++ src/purge/PurgeSchedulerFactory.ts | 23 ++ src/purge/PurgeTypes.ts | 89 +++++++ src/purge/PurgeWebhook.ts | 55 +++++ src/purge/PurgeWorker.ts | 92 ++++++++ src/purge/decorators/SchedulePurge.ts | 49 ++++ src/purge/schedulers/CronPurgeScheduler.ts | 175 ++++++++++++++ src/purge/schedulers/NatsPurgeScheduler.ts | 192 +++++++++++++++ src/routes/swagger.json | 8 + src/services/RetentionCronService.ts | 223 ------------------ src/services/deletion/BaseRetentionWorker.ts | 162 ------------- .../deletion/DidCommCredentialWorker.ts | 15 -- src/services/deletion/DidCommProofWorker.ts | 15 -- src/services/deletion/Oid4VcIssuanceWorker.ts | 29 --- .../deletion/Oid4VcVerificationWorker.ts | 18 -- src/types/RetentionTypes.ts | 137 ----------- src/utils/NatsClient.ts | 164 ------------- src/utils/NatsConstants.ts | 111 --------- src/utils/ServerConfig.ts | 2 - 28 files changed, 904 insertions(+), 887 deletions(-) create mode 100644 src/purge/PurgeConfigValidator.ts create mode 100644 src/purge/PurgeConstants.ts create mode 100644 src/purge/PurgeDeleteRecord.ts create mode 100644 src/purge/PurgeSchedulerFactory.ts create mode 100644 src/purge/PurgeTypes.ts create mode 100644 src/purge/PurgeWebhook.ts create mode 100644 src/purge/PurgeWorker.ts create mode 100644 src/purge/decorators/SchedulePurge.ts create mode 100644 src/purge/schedulers/CronPurgeScheduler.ts create mode 100644 src/purge/schedulers/NatsPurgeScheduler.ts delete mode 100644 src/services/RetentionCronService.ts delete mode 100644 src/services/deletion/BaseRetentionWorker.ts delete mode 100644 src/services/deletion/DidCommCredentialWorker.ts delete mode 100644 src/services/deletion/DidCommProofWorker.ts delete mode 100644 src/services/deletion/Oid4VcIssuanceWorker.ts delete mode 100644 src/services/deletion/Oid4VcVerificationWorker.ts delete mode 100644 src/types/RetentionTypes.ts delete mode 100644 src/utils/NatsClient.ts diff --git a/.env.sample b/.env.sample index 6aadaa82..7b336ad8 100644 --- a/.env.sample +++ b/.env.sample @@ -92,3 +92,45 @@ UPDATE_JWT_SECRET=false STATUS_LIST_SERVER_URL=https://dev-status-list.sovio.id/ STATUS_LIST_API_KEY=test_key STATUS_LIST_DEFAULT_SIZE=131072 +# Specify Bcovrin test genesis +BCOVRIN_TEST_GENESIS=`{"reqSignature":{},"txn":{"data":{"data":{"alias":"Node1","blskey":"4N8aUNHSgjQVgkpm8nhNEfDf6txHznoYREg9kirmJrkivgL4oSEimFF6nsQ6M41QvhM2Z33nves5vfSn9n1UwNFJBYtWVnHYMATn76vLuL3zU88KyeAYcHfsih3He6UHcXDxcaecHVz6jhCYz1P2UZn2bDVruL5wXpehgBfBaLKm3Ba","blskey_pop":"RahHYiCvoNCtPTrVtP7nMC5eTYrsUA8WjXbdhNc8debh1agE9bGiJxWBXYNFbnJXoXhWFMvyqhqhRoq737YQemH5ik9oL7R4NTTCz2LEZhkgLJzB3QRQqJyBNyv7acbdHrAT8nQ9UkLbaVL9NBpnWXBTw4LEMePaSHEw66RzPNdAX1","client_ip":"138.197.138.255","client_port":9702,"node_ip":"138.197.138.255","node_port":9701,"services":["VALIDATOR"]},"dest":"Gw6pDLhcBcoQesN72qfotTgFa7cbuqZpkX3Xo6pLhPhv"},"metadata":{"from":"Th7MpTaRZVRYnPiabds81Y"},"type":"0"},"txnMetadata":{"seqNo":1,"txnId":"fea82e10e894419fe2bea7d96296a6d46f50f93f9eeda954ec461b2ed2950b62"},"ver":"1"} +{"reqSignature":{},"txn":{"data":{"data":{"alias":"Node2","blskey":"37rAPpXVoxzKhz7d9gkUe52XuXryuLXoM6P6LbWDB7LSbG62Lsb33sfG7zqS8TK1MXwuCHj1FKNzVpsnafmqLG1vXN88rt38mNFs9TENzm4QHdBzsvCuoBnPH7rpYYDo9DZNJePaDvRvqJKByCabubJz3XXKbEeshzpz4Ma5QYpJqjk","blskey_pop":"Qr658mWZ2YC8JXGXwMDQTzuZCWF7NK9EwxphGmcBvCh6ybUuLxbG65nsX4JvD4SPNtkJ2w9ug1yLTj6fgmuDg41TgECXjLCij3RMsV8CwewBVgVN67wsA45DFWvqvLtu4rjNnE9JbdFTc1Z4WCPA3Xan44K1HoHAq9EVeaRYs8zoF5","client_ip":"138.197.138.255","client_port":9704,"node_ip":"138.197.138.255","node_port":9703,"services":["VALIDATOR"]},"dest":"8ECVSk179mjsjKRLWiQtssMLgp6EPhWXtaYyStWPSGAb"},"metadata":{"from":"EbP4aYNeTHL6q385GuVpRV"},"type":"0"},"txnMetadata":{"seqNo":2,"txnId":"1ac8aece2a18ced660fef8694b61aac3af08ba875ce3026a160acbc3a3af35fc"},"ver":"1"} +{"reqSignature":{},"txn":{"data":{"data":{"alias":"Node3","blskey":"3WFpdbg7C5cnLYZwFZevJqhubkFALBfCBBok15GdrKMUhUjGsk3jV6QKj6MZgEubF7oqCafxNdkm7eswgA4sdKTRc82tLGzZBd6vNqU8dupzup6uYUf32KTHTPQbuUM8Yk4QFXjEf2Usu2TJcNkdgpyeUSX42u5LqdDDpNSWUK5deC5","blskey_pop":"QwDeb2CkNSx6r8QC8vGQK3GRv7Yndn84TGNijX8YXHPiagXajyfTjoR87rXUu4G4QLk2cF8NNyqWiYMus1623dELWwx57rLCFqGh7N4ZRbGDRP4fnVcaKg1BcUxQ866Ven4gw8y4N56S5HzxXNBZtLYmhGHvDtk6PFkFwCvxYrNYjh","client_ip":"138.197.138.255","client_port":9706,"node_ip":"138.197.138.255","node_port":9705,"services":["VALIDATOR"]},"dest":"DKVxG2fXXTU8yT5N7hGEbXB3dfdAnYv1JczDUHpmDxya"},"metadata":{"from":"4cU41vWW82ArfxJxHkzXPG"},"type":"0"},"txnMetadata":{"seqNo":3,"txnId":"7e9f355dffa78ed24668f0e0e369fd8c224076571c51e2ea8be5f26479edebe4"},"ver":"1"} +{"reqSignature":{},"txn":{"data":{"data":{"alias":"Node4","blskey":"2zN3bHM1m4rLz54MJHYSwvqzPchYp8jkHswveCLAEJVcX6Mm1wHQD1SkPYMzUDTZvWvhuE6VNAkK3KxVeEmsanSmvjVkReDeBEMxeDaayjcZjFGPydyey1qxBHmTvAnBKoPydvuTAqx5f7YNNRAdeLmUi99gERUU7TD8KfAa6MpQ9bw","blskey_pop":"RPLagxaR5xdimFzwmzYnz4ZhWtYQEj8iR5ZU53T2gitPCyCHQneUn2Huc4oeLd2B2HzkGnjAff4hWTJT6C7qHYB1Mv2wU5iHHGFWkhnTX9WsEAbunJCV2qcaXScKj4tTfvdDKfLiVuU2av6hbsMztirRze7LvYBkRHV3tGwyCptsrP","client_ip":"138.197.138.255","client_port":9708,"node_ip":"138.197.138.255","node_port":9707,"services":["VALIDATOR"]},"dest":"4PS3EDQ3dW1tci1Bp6543CfuuebjFrg36kLAUcskGfaA"},"metadata":{"from":"TWwCRQRZ2ZHMJFn9TzLp7W"},"type":"0"},"txnMetadata":{"seqNo":4,"txnId":"aa5e817d7cc626170eca175822029339a444eb0ee8f0bd20d3b0b76e566fb008"},"ver":"1"}` + +# Specify Indicio test genesis +INDICIO_TEST_GENESIS=`{"reqSignature":{},"txn":{"data":{"data":{"alias":"OpsNode","blskey":"4i39oJqm7fVX33gnYEbFdGurMtwYQJgDEYfXdYykpbJMWogByocaXxKbuXdrg3k9LP33Tamq64gUwnm4oA7FkxqJ5h4WfKH6qyVLvmBu5HgeV8Rm1GJ33mKX6LWPbm1XE9TfzpQXJegKyxHQN9ABquyBVAsfC6NSM4J5t1QGraJBfZi","blskey_pop":"Qq3CzhSfugsCJotxSCRAnPjmNDJidDz7Ra8e4xvLTEzQ5w3ppGray9KynbGPH8T7XnUTU1ioZadTbjXaRY26xd4hQ3DxAyR4GqBymBn3UBomLRJHmj7ukcdJf9WE6tu1Fp1EhxmyaMqHv13KkDrDfCthgd2JjAWvSgMGWwAAzXEow5","client_ip":"13.58.197.208","client_port":"9702","node_ip":"3.135.134.42","node_port":"9701","services":["VALIDATOR"]},"dest":"EVwxHoKXUy2rnRzVdVKnJGWFviamxMwLvUso7KMjjQNH"},"metadata":{"from":"Pms5AZzgPWHSj6nNmJDfmo"},"type":"0"},"txnMetadata":{"seqNo":1,"txnId":"77ad6682f320be9969f70a37d712344afed8e3fba8d43fa5602c81b578d26088"},"ver":"1"} +{"reqSignature":{},"txn":{"data":{"data":{"alias":"cynjanode","blskey":"32DLSweyJRxVMcVKGjUeNkVF1fwyFfRcFqGU9x7qL2ox2STpF6VxZkbxoLkGMPnt3gywRaY6jAjqgC8XMkf3webMJ4SEViPtBKZJjCCFTf4tGXfEsMwinummaPja85GgTALf7DddCNyCojmkXWHpgjrLx3626Z2MiNxVbaMapG2taFX","blskey_pop":"RQRU8GVYSYZeu9dfH6myhzZ2qfxeVpCL3bTzgto1bRbx3QCt3mFFQQBVbgrqui2JpXhcWXxoDzp1WyYbSZwYqYQbRmvK7PPG82VAvVagv1n83Qa3cdyGwCevZdEzxuETiiXBRWSPfb4JibAXPKkLZHyQHWCEHcAEVeXtx7FRS1wjTd","client_ip":"3.17.103.221","client_port":"9702","node_ip":"3.17.215.226","node_port":"9701","services":["VALIDATOR"]},"dest":"iTq944JTtwHnst7rucfsRA4m26x9i6zCKKohETBCiWu"},"metadata":{"from":"QC174PGaL4zA9YHYqofPH2"},"type":"0"},"txnMetadata":{"seqNo":2,"txnId":"ce7361e44ec10a275899ece1574f6e38f2f3c7530c179fa07a2924e55775759b"},"ver":"1"} +{"reqSignature":{},"txn":{"data":{"data":{"alias":"GlobaliD","blskey":"4Behdr1KJfLTAPNospghtL7iWdCHca6MZDxAtzYNXq35QCUr4aqpLu6p4Sgu9wNbTACB3DbwmVgE2L7hX6UsasuvZautqUpf4nC5viFpH7X6mHyqLreBJTBH52tSwifQhRjuFAySbbfyRK3wb6R2Emxun9GY7MFNuy792LXYg4C6sRJ","blskey_pop":"RKYDRy8oTxKnyAV3HocapavH2jkw3PVe54JcEekxXz813DFbEy87N3i3BNqwHB7MH93qhtTRb7EZMaEiYhm92uaLKyubUMo5Rqjve2jbEdYEYVRmgNJWpxFKCmUBa5JwBWYuGunLMZZUTU3qjbdDXkJ9UNMQxDULCPU5gzLTy1B5kb","client_ip":"13.56.175.126","client_port":"9702","node_ip":"50.18.84.131","node_port":"9701","services":["VALIDATOR"]},"dest":"2ErWxamsNGBfhkFnwYgs4UW4aApct1kHUvu7jbkA1xX4"},"metadata":{"from":"4H8us7B1paLW9teANv8nam"},"type":"0"},"txnMetadata":{"seqNo":3,"txnId":"0c3b33b77e0419d6883be35d14b389c3936712c38a469ac5320a3cae68be1293"},"ver":"1"} +{"reqSignature":{},"txn":{"data":{"data":{"alias":"IdRamp","blskey":"LoYzqUMPDZEfRshwGSzkgATxcM5FAS1LYx896zHnMfXP7duDsCQ6CBG2akBkZzgH3tBMvnjhs2z7PFc2gFeaKUF9fKDHhtbVqPofxH3ebcRfA959qU9mgvmkUwMUgwd21puRU6BebUwBiYxMxcE5ChReBnAkdAv19gVorm3prBMk94","blskey_pop":"R1DjpsG7UxgwstuF7WDUL17a9Qq64vCozwJZ88bTrSDPwC1cdRn3WmhqJw5LpEhFQJosDSVVT6tS8dAZrrssRv2YsELbfGEJ7ZGjhNjZHwhqg4qeustZ7PZZE3Vr1ALSHY4Aa6KpNzGodxu1XymYZWXAFokPAs3Kho8mKcJwLCHn3h","client_ip":"207.126.128.12","client_port":"9702","node_ip":"207.126.129.12","node_port":"9701","services":["VALIDATOR"]},"dest":"5Zj5Aec6Kt9ki1runrXu87wZ522mnm3zwmaoHLUcHLx9"},"metadata":{"from":"AFLDFPoJuDQUHqnfmg8U7i"},"type":"0"},"txnMetadata":{"seqNo":4,"txnId":"c9df105558333ac8016610d9da5aad1e9a5dd50b9d9cc5684e94f439fa10f836"},"ver":"1"} +{"reqSignature":{},"txn":{"data":{"data":{"alias":"idlab-node01","blskey":"2fjJVi33U1tCTjW77cJaf1NLz7EzWkVNzR9BEQpVVK64MJpRKNUzt6k7Td2U8yqU5hGyAFH5N7ZymSB55TnpC3rJYLVTcGXZeXpmrQx3mwnXNyfTDnxfTpdQ1KMoFeZoDPZ8acfaH8GWeW2jL1qREE52tetBf4tXTeshmWzGkEN7r4y","blskey_pop":"RSjiM6dYUmN2rv2ca7dUCmEKrivq12rhxhXUKHdmSwUxbCmcijsgoERjYG7MqxhKLjSAJ5715K23fVEc6uK1kTenKmYCcCts8MLMAQG8Upb22nfgHJ3py8RwRoACeAjFF3myAMNRJJPhUdv96drJdwkGRv7f6JjvoB5KWVQYTNgheP","client_ip":"205.159.92.17","client_port":"9702","node_ip":"205.159.92.16","node_port":"9701","services":["VALIDATOR"]},"dest":"8czYgwmLDazVrBHuo53Tyx7Tw8ZhvnoC2BfhQGir4r8F"},"metadata":{"from":"PN8wFxLKjdkwyxoEEXwyz2"},"type":"0"},"txnMetadata":{"seqNo":5,"txnId":"9237eca7d2a203f6e1779f63064d2f22cf28e1bcd4e6fe5d791b15e82969acdc"},"ver":"1"} +{"reqSignature":{},"txn":{"data":{"data":{"alias":"lorica-identity-node1","blskey":"wUh24sVCQ8PHDgSb343g2eLxjD5vwxsrETfuV2sbwMNnYon9nhbaK5jcWTekvXtyiwxHxuiCCoZwKS97MQEAeC2oLbbMeKjYm212QwSnm7aKLEqTStXht35VqZvZLT7Q3mPQRYLjMGixdn4ocNHrBTMwPUQYycEqwaHWgE1ncDueXY","blskey_pop":"R2sMwF7UW6AaD4ALa1uB1YVPuP6JsdJ7LsUoViM9oySFqFt34C1x1tdHDysS9wwruzaaEFui6xNPqJ8eu3UBqcFKkoWhdsMqCALwe63ytxPwvtLtCffJLhHAcgrPC7DorXYdqhdG2cevdqc5oqFEAaKoFDBf12p5SsbbM4PYWCmVCb","client_ip":"35.225.220.151","client_port":"9702","node_ip":"35.224.26.110","node_port":"9701","services":["VALIDATOR"]},"dest":"k74ZsZuUaJEcB8RRxMwkCwdE5g1r9yzA3nx41qvYqYf"},"metadata":{"from":"Ex6hzsJFYzNJ7kzbfncNeU"},"type":"0"},"txnMetadata":{"seqNo":6,"txnId":"6880673ce4ae4a2352f103d2a6ae20469dd070f2027283a1da5e62a64a59d688"},"ver":"1"} +{"reqSignature":{},"txn":{"data":{"data":{"alias":"cysecure-itn","blskey":"GdCvMLkkBYevRFi93b6qaj9G2u1W6Vnbg8QhRD1chhrWR8vRE8x9x7KXVeUBPFf6yW5qq2JCfA2frc8SGni2RwjtTagezfwAwnorLhVJqS5ZxTi4pgcw6smebnt4zWVhTkh6ugDHEypHwNQBcw5WhBZcEJKgNbyVLnHok9ob6cfr3u","blskey_pop":"RbH9mY7M5p3UB3oj4sT1skYwMkxjoUnja8eTYfcm83VcNbxC9zR9pCiRhk4q1dJT3wkDBPGNKnk2p83vaJYLcgMuJtzoWoJAWAxjb3Mcq8Agf6cgQpBuzBq2uCzFPuQCAhDS4Kv9iwA6FsRnfvoeFTs1hhgSJVxQzDWMVTVAD9uCqu","client_ip":"35.169.19.171","client_port":"9702","node_ip":"54.225.56.21","node_port":"9701","services":["VALIDATOR"]},"dest":"4ETBDmHzx8iDQB6Xygmo9nNXtMgq9f6hxGArNhQ6Hh3u"},"metadata":{"from":"uSXXXEdBicPHMMhr3ddNF"},"type":"0"},"txnMetadata":{"seqNo":7,"txnId":"3c21718b07806b2f193b35953dda5b68b288efd551dce4467ce890703d5ba549"},"ver":"1"}` +# ─── Data Purge ─────────────────────────────────────────────────────────────── +# Automatically deletes records after a configurable TTL. +# Two independent flows — enable one or both: +# Flow A (NATS): schedules deletion at offer-creation time via NATS JetStream +# Flow B (Cron): periodically scans DB and deletes records older than TTL + +# Master switch — set to true to activate purge system +PURGE_ENABLED= + +# ── Flow A: NATS (requires NATS_SERVERS below) ──────────────────────────────── +PURGE_NATS_ENABLED= +PURGE_NATS_TTL_SECONDS= # seconds from offer creation to deletion (e.g. 2592000 = 30 days) + +# ── Flow B: Cron (DB scan, no NATS required) ────────────────────────────────── +PURGE_CRON_ENABLED= +PURGE_CRON_TTL_SECONDS= # records older than this (createdAt) are deleted (e.g. 2592000 = 30 days) +PURGE_CRON_SCHEDULE= # cron expression for scan frequency (e.g. 0 * * * * = hourly) + +# ── Optional: per-type record filtering ─────────────────────────────────────── +# Uncomment to restrict purge to specific record types (default: all types enabled) +# PURGE_DIDCOMM_CREDENTIAL=true +# PURGE_DIDCOMM_PROOF=true +# PURGE_OID4VC_ISSUANCE=true +# PURGE_OID4VC_VERIFICATION=true + +# ─── NATS Connection (required for Flow A) ──────────────────────────────────── +NATS_SERVERS= +NATS_CREDENTIALS_FILE= diff --git a/src/cli.ts b/src/cli.ts index 860fd009..9e5c13e3 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -1,5 +1,4 @@ import type { AriesRestConfig } from './cliAgent.js' -import type { RetentionConfig } from './types/RetentionTypes.js' import yargs from 'yargs' import { hideBin } from 'yargs/helpers' diff --git a/src/cliAgent.ts b/src/cliAgent.ts index ae89353e..59916bc8 100644 --- a/src/cliAgent.ts +++ b/src/cliAgent.ts @@ -66,9 +66,9 @@ import { readFile } from 'fs/promises' import { IndicioAcceptanceMechanism, IndicioTransactionAuthorAgreement, Network, NetworkName } from './enums' import { setupServer } from './server' -import { retentionCronService } from './services/RetentionCronService' -import { buildRetentionConfig } from './types/RetentionTypes' -import type { RetentionConfig } from './types/RetentionTypes' +import { buildPurgeConfig } from './purge/PurgeTypes' +import { validatePurgeConfig } from './purge/PurgeConfigValidator' +import { initPurgeSchedulers, stopPurgeSchedulers, getNatsPurgeScheduler, getCronPurgeScheduler } from './purge/PurgeSchedulerFactory' import { generateSecretKey } from './utils/helpers' import { TsLogger } from './utils/logger' import { @@ -583,16 +583,25 @@ export async function runRestAgent(restConfig: AriesRestConfig) { logger.info(`Successfully started server on port ${adminPort}`) }) - // Start retention cron service if enabled - const retentionConfig = buildRetentionConfig(restConfig.retention) - if (retentionConfig) { - await retentionCronService.start(agent, retentionConfig, webhookUrl) + // Start purge schedulers if enabled (NATS and Cron are independent) + const purgeConfig = buildPurgeConfig() + if (purgeConfig) { + await validatePurgeConfig(purgeConfig) + initPurgeSchedulers(purgeConfig.natsConfig.enabled, purgeConfig.cronConfig.enabled) + + if (purgeConfig.natsConfig.enabled) { + await getNatsPurgeScheduler()!.start(agent, purgeConfig, webhookUrl) + } + + if (purgeConfig.cronConfig.enabled) { + await getCronPurgeScheduler()!.start(agent, purgeConfig, webhookUrl) + } } - // Graceful shutdown — stop retention service before exit + // Graceful shutdown const shutdown = async () => { - agent.config.logger.info('[Retention] Shutting down retention cron service...') - await retentionCronService.stop() + agent.config.logger.info('[Shutdown] Stopping services...') + await stopPurgeSchedulers() process.exit(0) } diff --git a/src/controllers/didcomm/credentials/CredentialController.ts b/src/controllers/didcomm/credentials/CredentialController.ts index 315a2c0e..0da39061 100644 --- a/src/controllers/didcomm/credentials/CredentialController.ts +++ b/src/controllers/didcomm/credentials/CredentialController.ts @@ -14,6 +14,8 @@ import { injectable } from 'tsyringe' import { SCOPES } from '../../../enums' import ErrorHandlingService from '../../../errorHandlingService' +import { SchedulePurge } from '../../../purge/decorators/SchedulePurge' +import { PurgeRecordType } from '../../../purge/PurgeTypes' import { AgentType } from '../../../types' import { CredentialExchangeRecordExample, RecordId } from '../../examples' import { @@ -163,6 +165,7 @@ export class CredentialController extends Controller { */ @Example(CredentialExchangeRecordExample) @Post('/create-offer') + @SchedulePurge(PurgeRecordType.DIDCOMM_CREDENTIAL, (r) => (r as any)?.id) public async createOffer(@Request() request: Req, @Body() createOfferOptions: CreateOfferOptions) { try { const offer = await request.agent.modules.didcomm.credentials.offerCredential(createOfferOptions) @@ -173,6 +176,7 @@ export class CredentialController extends Controller { } @Post('/create-offer-oob') + @SchedulePurge(PurgeRecordType.DIDCOMM_CREDENTIAL, (r) => (r as any)?.credentialExchangeRecordId) public async createOfferOob(@Request() request: Req, @Body() outOfBandOption: CreateOfferOobOptions) { try { let invitationDid: string | undefined @@ -230,6 +234,7 @@ export class CredentialController extends Controller { }), outOfBandRecord: outOfBandRecord.toJSON(), outOfBandRecordId: outOfBandRecord.id, + credentialExchangeRecordId: offerOob.credentialExchangeRecord.id, credentialRequestThId: offerOob.credentialExchangeRecord.threadId, invitationDid, } diff --git a/src/controllers/didcomm/proofs/ProofController.ts b/src/controllers/didcomm/proofs/ProofController.ts index 01832fb2..f971497d 100644 --- a/src/controllers/didcomm/proofs/ProofController.ts +++ b/src/controllers/didcomm/proofs/ProofController.ts @@ -16,6 +16,8 @@ import { injectable } from 'tsyringe' import { SCOPES } from '../../../enums' import ErrorHandlingService from '../../../errorHandlingService' +import { SchedulePurge } from '../../../purge/decorators/SchedulePurge' +import { PurgeRecordType } from '../../../purge/PurgeTypes' import { ProofRecordExample, RecordId } from '../../examples' import { AcceptProofProposal, @@ -118,6 +120,7 @@ export class ProofController extends Controller { */ @Post('/request-proof') @Example(ProofRecordExample) + @SchedulePurge(PurgeRecordType.DIDCOMM_PROOF, (r) => (r as any)?.id) public async requestProof(@Request() request: Req, @Body() requestProofOptions: RequestProofOptions) { try { const requestProofPayload = { @@ -143,6 +146,7 @@ export class ProofController extends Controller { */ @Post('create-request-oob') @Example(ProofRecordExample) + @SchedulePurge(PurgeRecordType.DIDCOMM_PROOF, (r) => (r as any)?.proofRecordId) public async createRequest(@Request() request: Req, @Body() createRequestOptions: CreateProofRequestOobOptions) { try { let routing: DidCommRouting @@ -200,6 +204,7 @@ export class ProofController extends Controller { }), outOfBandRecord: outOfBandRecord.toJSON(), invitationDid, + proofRecordId: proof.proofRecord.id, proofRecordThId: proof.proofRecord.threadId, proofMessageId: proof.message.thread?.threadId || proof.message.threadId || proof.message.id, } diff --git a/src/controllers/openid4vc/issuance-sessions/issuance-sessions.Controller.ts b/src/controllers/openid4vc/issuance-sessions/issuance-sessions.Controller.ts index 01b1df1d..d575e226 100644 --- a/src/controllers/openid4vc/issuance-sessions/issuance-sessions.Controller.ts +++ b/src/controllers/openid4vc/issuance-sessions/issuance-sessions.Controller.ts @@ -6,6 +6,8 @@ import { injectable } from 'tsyringe' import { SCOPES } from '../../../enums' // eslint-disable-next-line import/order import ErrorHandlingService from '../../../errorHandlingService' +import { SchedulePurge } from '../../../purge/decorators/SchedulePurge' +import { PurgeRecordType } from '../../../purge/PurgeTypes' // import { AgentWithRootOrTenant } from '../../types/agent' import { OpenId4VcIssuanceSessionsCreateOffer } from '../types/issuer.types' @@ -26,6 +28,7 @@ export class IssuanceSessionsController extends Controller { * Creates a credential offer with the specified credential configurations and authorization type. */ @Post('/create-credential-offer') + @SchedulePurge(PurgeRecordType.OID4VC_ISSUANCE, (r) => (r as any)?.issuanceSession?.id) public async createCredentialOffer(@Request() request: Req, @Body() options: OpenId4VcIssuanceSessionsCreateOffer) { try { return await issuanceSessionService.createCredentialOffer(options, request) diff --git a/src/controllers/openid4vc/verifier-sessions/verification-sessions.Controller.ts b/src/controllers/openid4vc/verifier-sessions/verification-sessions.Controller.ts index 7e6385b1..b6d945cd 100644 --- a/src/controllers/openid4vc/verifier-sessions/verification-sessions.Controller.ts +++ b/src/controllers/openid4vc/verifier-sessions/verification-sessions.Controller.ts @@ -5,6 +5,8 @@ import { injectable } from 'tsyringe' import { SCOPES } from '../../../enums' import ErrorHandlingService from '../../../errorHandlingService' +import { SchedulePurge } from '../../../purge/decorators/SchedulePurge' +import { PurgeRecordType } from '../../../purge/PurgeTypes' import { CreateAuthorizationRequest, OpenId4VCDCQLVerificationSessionRecord } from '../types/verifier.types' import { VerificationSessionsService } from './verification-sessions.service' @@ -21,6 +23,7 @@ export class VerificationSessionsController extends Controller { * Create an authorization request, acting as a Relying Party (RP) */ @Post('/create-presentation-request') + @SchedulePurge(PurgeRecordType.OID4VC_VERIFICATION, (r) => (r as any)?.verificationSession?.id) public async createProofRequest( @Request() request: Req, @Body() createAuthorizationRequest: CreateAuthorizationRequest, diff --git a/src/purge/PurgeConfigValidator.ts b/src/purge/PurgeConfigValidator.ts new file mode 100644 index 00000000..7235acf4 --- /dev/null +++ b/src/purge/PurgeConfigValidator.ts @@ -0,0 +1,47 @@ +import { connect } from 'nats' + +import type { PurgeConfig } from './PurgeTypes' + +export async function validatePurgeConfig(config: PurgeConfig): Promise { + const { natsConfig, cronConfig } = config + + // At least one mode must be enabled when PURGE_ENABLED=true + if (!natsConfig.enabled && !cronConfig.enabled) { + throw new Error( + '[Purge] PURGE_ENABLED=true but neither PURGE_NATS_ENABLED nor PURGE_CRON_ENABLED is set to true. ' + + 'Enable at least one mode.', + ) + } + + // If NATS mode is enabled, verify the server is reachable and JetStream is on + if (natsConfig.enabled) { + await verifyNatsJetStream(natsConfig.nats.servers, natsConfig.nats.credentialsFile) + } +} + +async function verifyNatsJetStream(servers: string[], credentialsFile?: string): Promise { + let nc: Awaited> | null = null + + try { + nc = await connect({ + servers, + ...(credentialsFile ? { credentialsFile } : {}), + timeout: 5000, + maxReconnectAttempts: 0, + }) + } catch (err: any) { + throw new Error( + `[Purge] PURGE_NATS_ENABLED=true but cannot connect to NATS at ${servers.join(', ')}: ${err?.message}`, + ) + } + + try { + await nc.jetstreamManager() + } catch (err: any) { + throw new Error( + `[Purge] Connected to NATS but JetStream is not enabled. Start NATS with the -js flag. Error: ${err?.message}`, + ) + } finally { + await nc.close() + } +} diff --git a/src/purge/PurgeConstants.ts b/src/purge/PurgeConstants.ts new file mode 100644 index 00000000..a9be3ec1 --- /dev/null +++ b/src/purge/PurgeConstants.ts @@ -0,0 +1,68 @@ +import { PurgeRecordType } from './PurgeTypes' + +// ─── NATS Stream Name ───────────────────────────────────────────────────────── +// Single combined stream — schedule and execution subjects must be in the same +// stream for Nats-Schedule-Target to be valid. + +export const PURGE_STREAM = 'PURGE' + +// ─── NATS Subjects ──────────────────────────────────────────────────────────── + +// Scheduled messages are published here. NATS holds them until Nats-Schedule +// time, then re-publishes to the corresponding execution subject (same stream). +export const PURGE_SCHEDULER_SUBJECTS: Record = { + [PurgeRecordType.DIDCOMM_CREDENTIAL]: 'purge.schedule.didcomm.credential', + [PurgeRecordType.DIDCOMM_PROOF]: 'purge.schedule.didcomm.proof', + [PurgeRecordType.OID4VC_ISSUANCE]: 'purge.schedule.oid4vc.issuance', + [PurgeRecordType.OID4VC_VERIFICATION]: 'purge.schedule.oid4vc.verification', +} + +// Workers consume from these subjects. Consumers filter on these so schedule +// messages are ignored. +export const PURGE_EXECUTION_SUBJECTS: Record = { + [PurgeRecordType.DIDCOMM_CREDENTIAL]: 'purge.execute.didcomm.credential', + [PurgeRecordType.DIDCOMM_PROOF]: 'purge.execute.didcomm.proof', + [PurgeRecordType.OID4VC_ISSUANCE]: 'purge.execute.oid4vc.issuance', + [PurgeRecordType.OID4VC_VERIFICATION]: 'purge.execute.oid4vc.verification', +} + +// ─── NATS Consumer Definitions ─────────────────────────────────────────────── + +export const PURGE_CONSUMER_NAMES: Record = { + [PurgeRecordType.DIDCOMM_CREDENTIAL]: 'purge-worker-didcomm-credential', + [PurgeRecordType.DIDCOMM_PROOF]: 'purge-worker-didcomm-proof', + [PurgeRecordType.OID4VC_ISSUANCE]: 'purge-worker-oid4vc-issuance', + [PurgeRecordType.OID4VC_VERIFICATION]: 'purge-worker-oid4vc-verification', +} + +// ─── NATS Stream Limits ─────────────────────────────────────────────────────── + +// 35 days — covers max schedule TTL + buffer for unprocessed execute messages +export const PURGE_STREAM_MAX_AGE_NS = 35 * 24 * 60 * 60 * 1_000_000_000 + +// ─── Consumer Delivery Config ───────────────────────────────────────────────── + +// 30 seconds in nanoseconds +export const PURGE_CONSUMER_ACK_WAIT_NS = 30 * 1_000_000_000 + +export const PURGE_CONSUMER_MAX_DELIVER = 3 + +export const PURGE_CONSUMER_BACKOFF_NS = [ + 5_000_000_000, // 5 seconds + 30_000_000_000, // 30 seconds +] + +// ─── Webhook Paths ──────────────────────────────────────────────────────────── + +// Appended to webhookUrl after every deletion. +// Full URL = webhookUrl + PURGE_WEBHOOK_PATHS[recordType] +// e.g. http://host/wh/agentId/purge/oid4vc-issuance +export const PURGE_WEBHOOK_PATHS: Record = { + [PurgeRecordType.DIDCOMM_CREDENTIAL]: '/purge/didcomm-credential', + [PurgeRecordType.DIDCOMM_PROOF]: '/purge/didcomm-proof', + [PurgeRecordType.OID4VC_ISSUANCE]: '/purge/oid4vc-issuance', + [PurgeRecordType.OID4VC_VERIFICATION]: '/purge/oid4vc-verification', +} + +// Retry delays for webhook delivery attempts (ms): 1s → 5s → 30s +export const PURGE_WEBHOOK_RETRY_DELAYS_MS = [1000, 5000, 30000] diff --git a/src/purge/PurgeDeleteRecord.ts b/src/purge/PurgeDeleteRecord.ts new file mode 100644 index 00000000..86b5245f --- /dev/null +++ b/src/purge/PurgeDeleteRecord.ts @@ -0,0 +1,29 @@ +import type { Agent } from '@credo-ts/core' + +import { OpenId4VcIssuanceSessionRepository, OpenId4VcVerificationSessionRepository } from '@credo-ts/openid4vc' + +import { PurgeRecordType } from './PurgeTypes' + +export async function deletePurgeRecord(agent: Agent, recordType: PurgeRecordType, recordId: string): Promise { + switch (recordType) { + case PurgeRecordType.DIDCOMM_CREDENTIAL: + await (agent as any).modules.didcomm.credentials.deleteById(recordId) + break + + case PurgeRecordType.DIDCOMM_PROOF: + await (agent as any).modules.didcomm.proofs.deleteById(recordId) + break + + case PurgeRecordType.OID4VC_ISSUANCE: { + const repo = agent.dependencyManager.resolve(OpenId4VcIssuanceSessionRepository) + await repo.deleteById(agent.context, recordId) + break + } + + case PurgeRecordType.OID4VC_VERIFICATION: { + const repo = agent.dependencyManager.resolve(OpenId4VcVerificationSessionRepository) + await repo.deleteById(agent.context, recordId) + break + } + } +} diff --git a/src/purge/PurgeSchedulerFactory.ts b/src/purge/PurgeSchedulerFactory.ts new file mode 100644 index 00000000..22454280 --- /dev/null +++ b/src/purge/PurgeSchedulerFactory.ts @@ -0,0 +1,23 @@ +import { CronPurgeScheduler } from './schedulers/CronPurgeScheduler' +import { NatsPurgeScheduler } from './schedulers/NatsPurgeScheduler' + +let _natsScheduler: NatsPurgeScheduler | null = null +let _cronScheduler: CronPurgeScheduler | null = null + +export function getNatsPurgeScheduler(): NatsPurgeScheduler | null { + return _natsScheduler +} + +export function getCronPurgeScheduler(): CronPurgeScheduler | null { + return _cronScheduler +} + +export function initPurgeSchedulers(natsEnabled: boolean, cronEnabled: boolean): void { + if (natsEnabled) _natsScheduler = new NatsPurgeScheduler() + if (cronEnabled) _cronScheduler = new CronPurgeScheduler() +} + +export async function stopPurgeSchedulers(): Promise { + await _natsScheduler?.stop() + await _cronScheduler?.stop() +} diff --git a/src/purge/PurgeTypes.ts b/src/purge/PurgeTypes.ts new file mode 100644 index 00000000..f9368159 --- /dev/null +++ b/src/purge/PurgeTypes.ts @@ -0,0 +1,89 @@ +export interface NatsConfig { + servers: string[] + credentialsFile?: string +} + +export enum PurgeRecordType { + DIDCOMM_CREDENTIAL = 'didcomm_credential', + DIDCOMM_PROOF = 'didcomm_proof', + OID4VC_ISSUANCE = 'oid4vc_issuance', + OID4VC_VERIFICATION = 'oid4vc_verification', +} + +export interface PurgeJob { + recordId: string + recordType: PurgeRecordType + tenantId: string // empty string for dedicated agents + agentMode: 'shared' | 'dedicated' + scheduledAt: string // ISO-8601 +} + +export interface PurgeNatsConfig { + enabled: boolean + ttlSeconds: number + nats: NatsConfig + recordTypes: PurgeRecordType[] +} + +export interface PurgeCronConfig { + enabled: boolean + ttlSeconds: number + cronSchedule: string + recordTypes: PurgeRecordType[] +} + +export interface PurgeConfig { + natsConfig: PurgeNatsConfig + cronConfig: PurgeCronConfig +} + +export function buildPurgeConfig(): PurgeConfig | undefined { + if (process.env.PURGE_ENABLED !== 'true') return undefined + + const natsEnabled = process.env.PURGE_NATS_ENABLED === 'true' + const cronEnabled = process.env.PURGE_CRON_ENABLED === 'true' + + if (!natsEnabled && !cronEnabled) return undefined + + return { + natsConfig: { + enabled: natsEnabled, + ttlSeconds: Number(process.env.PURGE_NATS_TTL_SECONDS) || 2592000, + nats: { + servers: (process.env.NATS_SERVERS || 'nats://localhost:4222').split(','), + credentialsFile: process.env.NATS_CREDENTIALS_FILE, + }, + recordTypes: buildPurgeRecordTypes(), + }, + cronConfig: { + enabled: cronEnabled, + ttlSeconds: Number(process.env.PURGE_CRON_TTL_SECONDS) || 2592000, + cronSchedule: process.env.PURGE_CRON_SCHEDULE || '0 * * * *', + recordTypes: buildPurgeRecordTypes(), + }, + } +} + +function buildPurgeRecordTypes(): PurgeRecordType[] { + const envFlags: Record = { + PURGE_DIDCOMM_CREDENTIAL: PurgeRecordType.DIDCOMM_CREDENTIAL, + PURGE_DIDCOMM_PROOF: PurgeRecordType.DIDCOMM_PROOF, + PURGE_OID4VC_ISSUANCE: PurgeRecordType.OID4VC_ISSUANCE, + PURGE_OID4VC_VERIFICATION: PurgeRecordType.OID4VC_VERIFICATION, + } + + const anyEnvSet = Object.keys(envFlags).some((key) => process.env[key] !== undefined) + + if (anyEnvSet) { + return Object.entries(envFlags) + .filter(([key]) => process.env[key] === 'true') + .map(([, type]) => type) + } + + return [ + PurgeRecordType.DIDCOMM_CREDENTIAL, + PurgeRecordType.DIDCOMM_PROOF, + PurgeRecordType.OID4VC_ISSUANCE, + PurgeRecordType.OID4VC_VERIFICATION, + ] +} diff --git a/src/purge/PurgeWebhook.ts b/src/purge/PurgeWebhook.ts new file mode 100644 index 00000000..4ee6fd0b --- /dev/null +++ b/src/purge/PurgeWebhook.ts @@ -0,0 +1,55 @@ +import type { Logger } from '@credo-ts/core' + +import { sleep } from '../utils/webhook' +import { PURGE_WEBHOOK_PATHS, PURGE_WEBHOOK_RETRY_DELAYS_MS } from './PurgeConstants' +import type { PurgeRecordType } from './PurgeTypes' + +export enum PurgeDeletionStatus { + DELETED = 'deleted', + ALREADY_ABSENT = 'already-absent', +} + +export async function sendPurgeWebhook( + webhookUrl: string, + recordId: string, + recordType: PurgeRecordType, + tenantId: string, + status: PurgeDeletionStatus, + logger: Logger, +): Promise { + const url = `${webhookUrl}${PURGE_WEBHOOK_PATHS[recordType]}` + const body = { + eventType: 'purge.deletion.complete', + occurredAt: new Date().toISOString(), + tenantId, + deletion: { + recordId, + recordType, + status, + deletedAt: new Date().toISOString(), + }, + } + + const delays = PURGE_WEBHOOK_RETRY_DELAYS_MS + const maxAttempts = delays.length + 1 + + for (let attempt = 0; attempt < maxAttempts; attempt++) { + try { + await fetch(url, { + method: 'POST', + body: JSON.stringify(body), + headers: { 'Content-Type': 'application/json' }, + signal: AbortSignal.timeout(10000), + }) + logger.debug('[Purge] Webhook delivered', { url, recordId }) + return + } catch (err: any) { + if (attempt === maxAttempts - 1) { + logger.warn('[Purge] Webhook failed after all retries', { url, recordId, error: err?.message }) + } else { + logger.debug(`[Purge] Webhook attempt ${attempt + 1} failed — retrying in ${delays[attempt]}ms`) + await sleep(delays[attempt]) + } + } + } +} diff --git a/src/purge/PurgeWorker.ts b/src/purge/PurgeWorker.ts new file mode 100644 index 00000000..45da0d2a --- /dev/null +++ b/src/purge/PurgeWorker.ts @@ -0,0 +1,92 @@ +import type { Agent } from '@credo-ts/core' +import type { Consumer } from 'nats' + +import { RecordNotFoundError } from '@credo-ts/core' +import { StringCodec } from 'nats' + +import { PURGE_CONSUMER_MAX_DELIVER } from './PurgeConstants' +import { deletePurgeRecord } from './PurgeDeleteRecord' +import { sendPurgeWebhook, PurgeDeletionStatus } from './PurgeWebhook' +import type { PurgeJob } from './PurgeTypes' +import { PurgeRecordType } from './PurgeTypes' + +const sc = StringCodec() + +export class PurgeWorker { + private recordType: PurgeRecordType + private consumerName: string + private webhookUrl: string | undefined + + constructor(recordType: PurgeRecordType, consumerName: string, webhookUrl?: string) { + this.recordType = recordType + this.consumerName = consumerName + this.webhookUrl = webhookUrl + } + + async start(agent: Agent, consumer: Consumer): Promise { + agent.config.logger.info('[Purge] Worker started', { consumer: this.consumerName }) + + while (true) { + const messages = await consumer.consume() + for await (const msg of messages) { + await this.processMessage(msg, agent) + } + agent.config.logger.warn('[Purge] Consume loop ended — restarting', { consumer: this.consumerName }) + } + } + + private async processMessage(msg: any, agent: Agent): Promise { + let job: PurgeJob | undefined + + try { + job = JSON.parse(sc.decode(msg.data)) as PurgeJob + } catch { + agent.config.logger.error('[Purge] Failed to parse job — discarding', { consumer: this.consumerName }) + msg.ack() + return + } + + const { recordId, recordType, tenantId, agentMode } = job + const logger = agent.config.logger + const deliveryCount: number = msg.info.deliveryCount + + logger.info('[Purge] Job received', { recordId, recordType, tenantId, deliveryCount }) + + try { + if (agentMode === 'shared') { + await (agent as any).modules.tenants.withTenantAgent({ tenantId }, async (tenantAgent: Agent) => { + await deletePurgeRecord(tenantAgent, this.recordType, recordId) + }) + } else { + await deletePurgeRecord(agent, this.recordType, recordId) + } + + logger.info('[Purge] Record deleted', { recordId, recordType, tenantId }) + msg.ack() + + if (this.webhookUrl) { + await sendPurgeWebhook(this.webhookUrl, recordId, this.recordType, tenantId, PurgeDeletionStatus.DELETED, logger) + } + } catch (err: any) { + if (err instanceof RecordNotFoundError) { + logger.warn('[Purge] Record already absent — treating as success', { recordId, recordType }) + msg.ack() + + if (this.webhookUrl) { + await sendPurgeWebhook(this.webhookUrl, recordId, this.recordType, tenantId, PurgeDeletionStatus.ALREADY_ABSENT, logger) + } + return + } + + logger.warn('[Purge] Job failed', { recordId, recordType, deliveryCount, error: err?.message }) + + if (deliveryCount >= PURGE_CONSUMER_MAX_DELIVER) { + logger.error('[Purge] Job dropped after max retries', { recordId, recordType, tenantId, deliveryCount }) + msg.ack() + } else { + msg.nak() + } + } + } + +} diff --git a/src/purge/decorators/SchedulePurge.ts b/src/purge/decorators/SchedulePurge.ts new file mode 100644 index 00000000..b1dc3c1c --- /dev/null +++ b/src/purge/decorators/SchedulePurge.ts @@ -0,0 +1,49 @@ +import type { PurgeRecordType } from '../PurgeTypes' + +import { getNatsPurgeScheduler } from '../PurgeSchedulerFactory' + +export function SchedulePurge( + recordType: PurgeRecordType, + idExtractor: (result: unknown) => string | undefined, +) { + return function (_target: object, _key: string, descriptor: PropertyDescriptor) { + const original = descriptor.value as (...args: unknown[]) => Promise + + descriptor.value = async function (...args: unknown[]) { + const result = await original.apply(this, args) + + const scheduler = getNatsPurgeScheduler() + + if (!scheduler) { + console.warn(`[Purge] @SchedulePurge(${recordType}): NATS scheduler not initialized — skipping`) + return result + } + + const recordId = idExtractor(result) + + if (!recordId) { + console.warn(`[Purge] @SchedulePurge(${recordType}): could not extract recordId from result`, result) + return result + } + + const request = args[0] as any + // TenantAgent sets context.contextCorrelationId = `tenant-${tenantId}` (Credo internals). + // Auth middleware sets request.agent to TenantAgent directly — query param is not reliable. + const contextCorrelationId: string = (request?.agent as any)?.context?.contextCorrelationId ?? '' + const tenantId: string = contextCorrelationId.startsWith('tenant-') + ? contextCorrelationId.slice('tenant-'.length) + : '' + const agentMode: 'shared' | 'dedicated' = tenantId ? 'shared' : 'dedicated' + + console.info(`[Purge] Scheduling purge: ${recordType} recordId=${recordId} tenantId="${tenantId}" agentMode=${agentMode}`) + + scheduler.schedulePurge(recordType, recordId, tenantId, agentMode).catch((err: Error) => { + console.error(`[Purge] Failed to schedule purge for ${recordType}:${recordId}`, err?.message) + }) + + return result + } + + return descriptor + } +} diff --git a/src/purge/schedulers/CronPurgeScheduler.ts b/src/purge/schedulers/CronPurgeScheduler.ts new file mode 100644 index 00000000..fe5a802e --- /dev/null +++ b/src/purge/schedulers/CronPurgeScheduler.ts @@ -0,0 +1,175 @@ +import type { Agent } from '@credo-ts/core' +import type { ScheduledTask } from 'node-cron' + +import { RecordNotFoundError } from '@credo-ts/core' +import { OpenId4VcIssuanceSessionRepository, OpenId4VcVerificationSessionRepository } from '@credo-ts/openid4vc' +import cron from 'node-cron' + +import { deletePurgeRecord } from '../PurgeDeleteRecord' +import { sendPurgeWebhook, PurgeDeletionStatus } from '../PurgeWebhook' +import type { PurgeConfig } from '../PurgeTypes' +import { PurgeRecordType } from '../PurgeTypes' + +export class CronPurgeScheduler { + private job: ScheduledTask | null = null + + async start(agent: Agent, config: PurgeConfig, webhookUrl: string | undefined): Promise { + const { cronConfig } = config + + this.job = cron.schedule(cronConfig.cronSchedule, () => { + this.runScan(agent, config, webhookUrl).catch((err: Error) => + agent.config.logger.error('[Purge] Cron scan error', { error: err?.message }), + ) + }) + + agent.config.logger.info('[Purge] CronPurgeScheduler started', { + cronSchedule: cronConfig.cronSchedule, + ttlSeconds: cronConfig.ttlSeconds, + recordTypes: cronConfig.recordTypes, + }) + } + + async stop(): Promise { + this.job?.stop() + this.job = null + } + + private async runScan(agent: Agent, config: PurgeConfig, webhookUrl: string | undefined): Promise { + const logger = agent.config.logger + const isShared = typeof (agent as any).modules?.tenants?.getAllTenants === 'function' + + logger.info('[Purge] Cron scan started', { agentMode: isShared ? 'shared' : 'dedicated' }) + + let totalDeleted = 0 + + if (isShared) { + const tenants: Array<{ id: string }> = await (agent as any).modules.tenants.getAllTenants() + + for (const tenant of tenants) { + try { + await (agent as any).modules.tenants.withTenantAgent( + { tenantId: tenant.id }, + async (tenantAgent: Agent) => { + const count = await this.scanTenant(tenantAgent, tenant.id, config, webhookUrl) + totalDeleted += count + }, + ) + } catch (err: any) { + logger.error('[Purge] Failed to scan tenant', { tenantId: tenant.id, error: err?.message }) + } + } + } else { + totalDeleted = await this.scanTenant(agent, '', config, webhookUrl) + } + + logger.info('[Purge] Cron scan completed', { totalDeleted }) + } + + private async scanTenant( + tenantAgent: Agent, + tenantId: string, + config: PurgeConfig, + webhookUrl: string | undefined, + ): Promise { + let deleted = 0 + const { cronConfig } = config + + for (const recordType of cronConfig.recordTypes) { + try { + const expiredIds = await this.queryExpiredRecords(tenantAgent, recordType, cronConfig.ttlSeconds) + + for (const recordId of expiredIds) { + if (await this.deleteAndNotify(tenantAgent, recordId, recordType, tenantId, webhookUrl)) { + deleted++ + } + } + } catch (err: any) { + tenantAgent.config.logger.error('[Purge] Error scanning record type', { + tenantId, + recordType, + error: err?.message, + }) + } + } + + return deleted + } + + private async queryExpiredRecords( + agent: Agent, + recordType: PurgeRecordType, + ttlSeconds: number, + ): Promise { + const cutoffMs = Date.now() - ttlSeconds * 1000 + const ids: string[] = [] + + switch (recordType) { + case PurgeRecordType.DIDCOMM_CREDENTIAL: { + const records = await (agent as any).modules.didcomm.credentials.findAllByQuery({}) + for (const r of records) { + if (r.createdAt && new Date(r.createdAt).getTime() < cutoffMs) ids.push(r.id) + } + break + } + + case PurgeRecordType.DIDCOMM_PROOF: { + const records = await (agent as any).modules.didcomm.proofs.findAllByQuery({}) + for (const r of records) { + if (r.createdAt && new Date(r.createdAt).getTime() < cutoffMs) ids.push(r.id) + } + break + } + + case PurgeRecordType.OID4VC_ISSUANCE: { + const repo = agent.dependencyManager.resolve(OpenId4VcIssuanceSessionRepository) + const records = await repo.findByQuery(agent.context, {}) + for (const r of records) { + if (r.createdAt && new Date(r.createdAt).getTime() < cutoffMs) ids.push(r.id) + } + break + } + + case PurgeRecordType.OID4VC_VERIFICATION: { + const repo = agent.dependencyManager.resolve(OpenId4VcVerificationSessionRepository) + const records = await repo.findByQuery(agent.context, {}) + for (const r of records) { + if (r.createdAt && new Date(r.createdAt).getTime() < cutoffMs) ids.push(r.id) + } + break + } + } + + return ids + } + + private async deleteAndNotify( + agent: Agent, + recordId: string, + recordType: PurgeRecordType, + tenantId: string, + webhookUrl: string | undefined, + ): Promise { + const logger = agent.config.logger + let status: PurgeDeletionStatus + + try { + await deletePurgeRecord(agent, recordType, recordId) + logger.info('[Purge] Record deleted by cron', { recordId, recordType, tenantId }) + status = PurgeDeletionStatus.DELETED + } catch (err: any) { + if (err instanceof RecordNotFoundError) { + logger.warn('[Purge] Record already absent — skipping', { recordId, recordType }) + status = PurgeDeletionStatus.ALREADY_ABSENT + } else { + logger.error('[Purge] Failed to delete record', { recordId, recordType, error: err?.message }) + return false + } + } + + if (webhookUrl) { + await sendPurgeWebhook(webhookUrl, recordId, recordType, tenantId, status, logger) + } + + return true + } +} diff --git a/src/purge/schedulers/NatsPurgeScheduler.ts b/src/purge/schedulers/NatsPurgeScheduler.ts new file mode 100644 index 00000000..20165eaa --- /dev/null +++ b/src/purge/schedulers/NatsPurgeScheduler.ts @@ -0,0 +1,192 @@ +import type { Agent } from '@credo-ts/core' +import type { JetStreamClient, JetStreamManager, NatsConnection } from 'nats' + +import { AckPolicy, DiscardPolicy, RetentionPolicy, StorageType, StringCodec, connect, headers } from 'nats' + +import { + NATS_ERR_CONSUMER_ALREADY_EXISTS, + NATS_ERR_STREAM_ALREADY_EXISTS, + NATS_MAX_RECONNECT_ATTEMPTS, + NATS_RECONNECT_TIME_WAIT_MS, +} from '../../utils/NatsConstants' +import { + PURGE_CONSUMER_ACK_WAIT_NS, + PURGE_CONSUMER_BACKOFF_NS, + PURGE_CONSUMER_MAX_DELIVER, + PURGE_CONSUMER_NAMES, + PURGE_EXECUTION_SUBJECTS, + PURGE_SCHEDULER_SUBJECTS, + PURGE_STREAM, + PURGE_STREAM_MAX_AGE_NS, +} from '../PurgeConstants' +import type { PurgeConfig, PurgeJob } from '../PurgeTypes' +import { PurgeRecordType } from '../PurgeTypes' +import { PurgeWorker } from '../PurgeWorker' + +const sc = StringCodec() + +export class NatsPurgeScheduler { + private nc: NatsConnection | null = null + private js: JetStreamClient | null = null + private jsm: JetStreamManager | null = null + private ttlSeconds = 0 + private recordTypes: PurgeRecordType[] = [] + + async start(agent: Agent, config: PurgeConfig, webhookUrl: string | undefined): Promise { + const { natsConfig } = config + this.ttlSeconds = natsConfig.ttlSeconds + this.recordTypes = natsConfig.recordTypes + + this.nc = await connect({ + servers: natsConfig.nats.servers, + ...(natsConfig.nats.credentialsFile ? { credentialsFile: natsConfig.nats.credentialsFile } : {}), + maxReconnectAttempts: NATS_MAX_RECONNECT_ATTEMPTS, + reconnectTimeWait: NATS_RECONNECT_TIME_WAIT_MS, + }) + this.js = this.nc.jetstream() + this.jsm = await this.nc.jetstreamManager() + + agent.config.logger.info('[Purge] Provisioning NATS streams...') + await this.provisionStreams() + agent.config.logger.info('[Purge] NATS streams ready') + + agent.config.logger.info('[Purge] Provisioning NATS consumers...') + await this.provisionConsumers() + agent.config.logger.info('[Purge] NATS consumers ready') + + await this.startWorkers(agent, webhookUrl) + + agent.config.logger.info('[Purge] NatsPurgeScheduler started', { ttlSeconds: this.ttlSeconds }) + } + + async schedulePurge( + recordType: PurgeRecordType, + recordId: string, + tenantId: string, + agentMode: 'shared' | 'dedicated', + ): Promise { + if (!this.js) throw new Error('[Purge] NatsPurgeScheduler not started') + + const fireAt = new Date(Date.now() + this.ttlSeconds * 1000).toISOString() + const job: PurgeJob = { recordId, recordType, tenantId, agentMode, scheduledAt: fireAt } + + // Subject is unique per record — prevents later offers overwriting earlier ones + // (NATS: only one active schedule per subject) + const scheduleSubject = `${PURGE_SCHEDULER_SUBJECTS[recordType]}.${recordId}` + + const h = headers() + h.set('Nats-Schedule', `@at ${fireAt}`) + h.set('Nats-Schedule-Target', PURGE_EXECUTION_SUBJECTS[recordType]) + h.set('Nats-Msg-Id', `purge-${recordType}-${recordId}`) + + await this.js.publish(scheduleSubject, sc.encode(JSON.stringify(job)), { headers: h }) + + console.info(`[Purge] Scheduled: ${recordType} recordId=${recordId} fireAt=${fireAt}`) + } + + async stop(): Promise { + if (this.nc) { + await this.nc.drain() + this.nc = null + this.js = null + this.jsm = null + } + } + + private async provisionStreams(): Promise { + if (!this.jsm) throw new Error('[Purge] Not connected') + + // Single combined stream: schedule subjects AND execution subjects must live + // in the same stream — NATS validates Nats-Schedule-Target against the same stream. + // Limits retention so schedule messages are not blocked waiting for a consumer ack. + await this.addOrUpdateStream({ + name: PURGE_STREAM, + // Wildcards required — schedule subjects include a per-record ID suffix + // e.g. purge.schedule.oid4vc.issuance. + subjects: ['purge.schedule.>', 'purge.execute.>'], + retention: RetentionPolicy.Limits, + storage: StorageType.File, + max_age: PURGE_STREAM_MAX_AGE_NS, + discard: DiscardPolicy.Old, + allow_msg_schedules: true, + }) + } + + private async addOrUpdateStream(config: any): Promise { + if (!this.jsm) throw new Error('[Purge] Not connected') + try { + await this.jsm.streams.add(config) + } catch (err: any) { + if (this.isAlreadyExistsError(err)) { + await this.jsm.streams.update(config.name, config) + } else if (err?.message?.includes('subjects overlap')) { + // Old streams from a previous code version have conflicting subjects. + // Delete them and retry — safe because these are transient job streams. + console.warn('[Purge] Subject overlap detected — purging stale streams and retrying') + await this.deleteStaleStreams(config.subjects) + await this.jsm.streams.add(config) + } else { + throw err + } + } + } + + private async deleteStaleStreams(subjects: string[]): Promise { + if (!this.jsm) return + const list = await this.jsm.streams.list().next() + for (const stream of list) { + const hasOverlap = stream.config.subjects?.some((s: string) => + subjects.some((newS) => s === newS || s.endsWith('>') || newS.endsWith('>')), + ) + if (hasOverlap && stream.config.name !== PURGE_STREAM) { + console.warn(`[Purge] Deleting stale stream: ${stream.config.name}`) + await this.jsm.streams.delete(stream.config.name) + } + } + } + + private async provisionConsumers(): Promise { + if (!this.jsm) throw new Error('[Purge] Not connected') + + for (const recordType of this.recordTypes) { + try { + await this.jsm.consumers.add(PURGE_STREAM, { + durable_name: PURGE_CONSUMER_NAMES[recordType], + ack_policy: AckPolicy.Explicit, + ack_wait: PURGE_CONSUMER_ACK_WAIT_NS, + max_deliver: PURGE_CONSUMER_MAX_DELIVER, + backoff: PURGE_CONSUMER_BACKOFF_NS, + filter_subject: PURGE_EXECUTION_SUBJECTS[recordType], + }) + } catch (err: any) { + if (!this.isAlreadyExistsError(err)) throw err + } + } + } + + private async startWorkers(agent: Agent, webhookUrl: string | undefined): Promise { + if (!this.js) throw new Error('[Purge] Not connected') + + for (const recordType of this.recordTypes) { + const consumerName = PURGE_CONSUMER_NAMES[recordType] + const consumer = await this.js.consumers.get(PURGE_STREAM, consumerName) + const worker = new PurgeWorker(recordType, consumerName, webhookUrl) + + agent.config.logger.info('[Purge] Starting worker', { recordType, consumerName }) + + worker.start(agent, consumer).catch((err: Error) => + agent.config.logger.error('[Purge] Worker crashed', { consumerName, error: err?.message }), + ) + } + } + + private isAlreadyExistsError(err: any): boolean { + const msg: string = err?.message ?? '' + return ( + msg.includes('stream name already in use') || + msg.includes('consumer name already in use') || + err?.api_error?.err_code === NATS_ERR_STREAM_ALREADY_EXISTS || + err?.api_error?.err_code === NATS_ERR_CONSUMER_ALREADY_EXISTS + ) + } +} diff --git a/src/routes/swagger.json b/src/routes/swagger.json index 92368c70..cd877124 100644 --- a/src/routes/swagger.json +++ b/src/routes/swagger.json @@ -9848,6 +9848,9 @@ "credentialRequestThId": { "type": "string" }, + "credentialExchangeRecordId": { + "type": "string" + }, "outOfBandRecordId": { "type": "string" }, @@ -9864,6 +9867,7 @@ "required": [ "invitationDid", "credentialRequestThId", + "credentialExchangeRecordId", "outOfBandRecordId", "outOfBandRecord", "invitation", @@ -10409,6 +10413,9 @@ "proofRecordThId": { "type": "string" }, + "proofRecordId": { + "type": "string" + }, "invitationDid": { "type": "string" }, @@ -10425,6 +10432,7 @@ "required": [ "proofMessageId", "proofRecordThId", + "proofRecordId", "invitationDid", "outOfBandRecord", "invitation", diff --git a/src/services/RetentionCronService.ts b/src/services/RetentionCronService.ts deleted file mode 100644 index 240d53f8..00000000 --- a/src/services/RetentionCronService.ts +++ /dev/null @@ -1,223 +0,0 @@ -import type { Agent } from '@credo-ts/core' -import type { ScheduledTask } from 'node-cron' - -import { OpenId4VcIssuanceSessionRepository, OpenId4VcVerificationSessionRepository } from '@credo-ts/openid4vc' -import cron from 'node-cron' - -import type { DeletionJob, RetentionConfig } from '../types/RetentionTypes' -import { NATS_SUBJECTS, RecordType, TERMINAL_STATES } from '../types/RetentionTypes' -import { natsClient } from '../utils/NatsClient' - -import { didCommCredentialWorker } from './deletion/DidCommCredentialWorker' -import { didCommProofWorker } from './deletion/DidCommProofWorker' -import { oid4VcIssuanceWorker } from './deletion/Oid4VcIssuanceWorker' -import { oid4VcVerificationWorker } from './deletion/Oid4VcVerificationWorker' - -class RetentionCronService { - private job: ScheduledTask | null = null - private _webhookUrl: string | undefined - - get webhookUrl(): string | undefined { - return this._webhookUrl - } - - async start(agent: Agent, config: RetentionConfig, webhookUrl: string | undefined): Promise { - this._webhookUrl = webhookUrl - - await natsClient.connect(config.nats) - await natsClient.provisionStreams() - await natsClient.provisionConsumers() - - const enabledTypes = new Set(config.recordTypes) - - if (enabledTypes.has(RecordType.DIDCOMM_CREDENTIAL)) { - didCommCredentialWorker - .start(agent, this._webhookUrl) - .catch((err: Error) => - agent.config.logger.error('[Retention] DidCommCredentialWorker crashed', { error: err?.message }), - ) - } - - if (enabledTypes.has(RecordType.DIDCOMM_PROOF)) { - didCommProofWorker - .start(agent, this._webhookUrl) - .catch((err: Error) => - agent.config.logger.error('[Retention] DidCommProofWorker crashed', { error: err?.message }), - ) - } - - if (enabledTypes.has(RecordType.OID4VC_ISSUANCE)) { - oid4VcIssuanceWorker - .start(agent, this._webhookUrl) - .catch((err: Error) => - agent.config.logger.error('[Retention] Oid4VcIssuanceWorker crashed', { error: err?.message }), - ) - } - - if (enabledTypes.has(RecordType.OID4VC_VERIFICATION)) { - oid4VcVerificationWorker - .start(agent, this._webhookUrl) - .catch((err: Error) => - agent.config.logger.error('[Retention] Oid4VcVerificationWorker crashed', { error: err?.message }), - ) - } - - agent.config.logger.info('[Retention] Deletion workers started', { enabledTypes: config.recordTypes }) - - this.job = cron.schedule(config.cronSchedule, () => { - this.runScan(agent, config).catch((err: Error) => - agent.config.logger.error('[Retention] Unhandled scan error', { error: err?.message }), - ) - }) - - agent.config.logger.info('[Retention] Cron service started', { - cronSchedule: config.cronSchedule, - ttlSeconds: config.ttlSeconds, - recordTypes: config.recordTypes, - }) - } - - async stop(): Promise { - this.job?.stop() - this.job = null - await natsClient.disconnect() - } - - private async runScan(agent: Agent, config: RetentionConfig): Promise { - const logger = agent.config.logger - let totalPublished = 0 - - try { - const isShared = typeof (agent as any).modules?.tenants?.getAllTenants === 'function' - - logger.info('[Retention] Scan started', { agentMode: isShared ? 'shared' : 'dedicated' }) - - if (isShared) { - const tenants: Array<{ id: string }> = await (agent as any).modules.tenants.getAllTenants() - - for (const tenant of tenants) { - try { - await (agent as any).modules.tenants.withTenantAgent( - { tenantId: tenant.id }, - async (tenantAgent: Agent) => { - const count = await this.scanTenant(tenantAgent, tenant.id, config) - totalPublished += count - }, - ) - } catch (err: any) { - logger.error('[Retention] Failed to scan tenant', { tenantId: tenant.id, error: err?.message }) - } - } - } else { - totalPublished = await this.scanTenant(agent, '', config) - } - - logger.info('[Retention] Scan completed', { jobsPublished: totalPublished }) - } catch (err: any) { - logger.error('[Retention] Scan error', { error: err?.message }) - } - } - - private async scanTenant(tenantAgent: Agent, tenantId: string, config: RetentionConfig): Promise { - let published = 0 - const agentMode: 'shared' | 'dedicated' = tenantId === '' ? 'dedicated' : 'shared' - - for (const recordType of config.recordTypes) { - try { - const recordIds = await this.queryExpiredRecords(tenantAgent, recordType, config.ttlSeconds) - - if (recordIds.length === 0) continue - - for (const recordId of recordIds) { - await this.publishJob(recordId, recordType, tenantId, agentMode) - published++ - } - } catch (err: any) { - tenantAgent.config.logger.error('[Retention] Error scanning record type', { - tenantId, - recordType, - error: err?.message, - }) - } - } - - return published - } - - private async queryExpiredRecords(agent: Agent, recordType: RecordType, ttlSeconds: number): Promise { - const terminalStates = TERMINAL_STATES[recordType] - const cutoffMs = Date.now() - ttlSeconds * 1000 - const expiredIds: string[] = [] - - switch (recordType) { - case RecordType.DIDCOMM_CREDENTIAL: { - const records = await (agent as any).modules.didcomm.credentials.findAllByQuery({ - state: terminalStates, - }) - for (const record of records) { - if (record.updatedAt && new Date(record.updatedAt).getTime() < cutoffMs) { - expiredIds.push(record.id) - } - } - break - } - - case RecordType.DIDCOMM_PROOF: { - const records = await (agent as any).modules.didcomm.proofs.findAllByQuery({ - state: terminalStates, - }) - for (const record of records) { - if (record.updatedAt && new Date(record.updatedAt).getTime() < cutoffMs) { - expiredIds.push(record.id) - } - } - break - } - - case RecordType.OID4VC_ISSUANCE: { - const repo = agent.dependencyManager.resolve(OpenId4VcIssuanceSessionRepository) - const records = await repo.findByQuery(agent.context, {}) - for (const record of records) { - const inTerminalState = terminalStates.includes(record.state as string) - if (inTerminalState && record.updatedAt && new Date(record.updatedAt).getTime() < cutoffMs) { - expiredIds.push(record.id) - } - } - break - } - - case RecordType.OID4VC_VERIFICATION: { - const repo = agent.dependencyManager.resolve(OpenId4VcVerificationSessionRepository) - const records = await repo.findByQuery(agent.context, {}) - for (const record of records) { - const inTerminalState = terminalStates.includes(record.state as string) - if (inTerminalState && record.updatedAt && new Date(record.updatedAt).getTime() < cutoffMs) { - expiredIds.push(record.id) - } - } - break - } - } - - return expiredIds - } - - private async publishJob( - recordId: string, - recordType: RecordType, - tenantId: string, - agentMode: 'shared' | 'dedicated', - ): Promise { - const job: DeletionJob = { - recordId, - recordType, - tenantId, - agentMode, - enqueuedAt: new Date().toISOString(), - } - - await natsClient.publish(NATS_SUBJECTS[recordType], job) - } -} - -export const retentionCronService = new RetentionCronService() diff --git a/src/services/deletion/BaseRetentionWorker.ts b/src/services/deletion/BaseRetentionWorker.ts deleted file mode 100644 index 511c3a69..00000000 --- a/src/services/deletion/BaseRetentionWorker.ts +++ /dev/null @@ -1,162 +0,0 @@ -import type { Agent, Logger } from '@credo-ts/core' -import type { JsMsg } from 'nats' - -import { RecordNotFoundError } from '@credo-ts/core' -import { StringCodec } from 'nats' - -import type { DeletionJob } from '../../types/RetentionTypes' -import { DLQ_SUBJECTS, WEBHOOK_PATHS, RecordType, DeletionStatus } from '../../types/RetentionTypes' -import { natsClient } from '../../utils/NatsClient' -import { CONSUMER_MAX_DELIVER, WEBHOOK_RETRY_DELAYS_MS } from '../../utils/NatsConstants' -import { sleep } from '../../utils/webhook' - -const sc = StringCodec() - -export abstract class BaseRetentionWorker { - protected abstract recordType: RecordType - protected abstract consumerName: string - - protected abstract deleteRecord(agent: Agent, recordId: string): Promise - - async start(agent: Agent, webhookUrl: string | undefined): Promise { - try { - const consumer = await natsClient.getPullConsumer(this.consumerName) - agent.config.logger.info(`[Retention] Worker started`, { consumer: this.consumerName }) - - while (true) { - const messages = await consumer.consume() - for await (const msg of messages) { - await this.processMessage(msg, agent, webhookUrl) - } - agent.config.logger.warn(`[Retention] Consume loop ended — restarting`, { consumer: this.consumerName }) - } - } catch (err: any) { - agent.config.logger.error(`[Retention] Worker loop exited`, { - consumer: this.consumerName, - error: err?.message, - stack: err?.stack, - }) - } - } - - private async processMessage(msg: JsMsg, agent: Agent, webhookUrl: string | undefined): Promise { - let job: DeletionJob | undefined - - try { - job = JSON.parse(sc.decode(msg.data)) as DeletionJob - } catch { - agent.config.logger.error('[Retention] Failed to parse job message — discarding', { - consumer: this.consumerName, - }) - msg.ack() - return - } - - const { recordId, recordType, tenantId, agentMode } = job - const logger = agent.config.logger - const deliveryCount = msg.info.deliveryCount - - logger.debug('[Retention] Job received', { recordId, recordType, tenantId, deliveryCount }) - - try { - if (agentMode === 'shared') { - await (agent as any).modules.tenants.withTenantAgent({ tenantId }, async (tenantAgent: Agent) => { - await this.deleteRecord(tenantAgent, recordId) - }) - } else { - await this.deleteRecord(agent, recordId) - } - - logger.info('[Retention] Record deleted', { recordId, recordType, tenantId }) - - msg.ack() - if (webhookUrl) { - await this.sendWebhookWithRetry( - `${webhookUrl}${WEBHOOK_PATHS[this.recordType]}`, - this.buildWebhookBody(job, DeletionStatus.DELETED), - logger, - ) - } - } catch (err: any) { - if (err instanceof RecordNotFoundError) { - logger.warn('[Retention] Record already absent — treating as success', { recordId, recordType }) - - msg.ack() - if (webhookUrl) { - await this.sendWebhookWithRetry( - `${webhookUrl}${WEBHOOK_PATHS[this.recordType]}`, - this.buildWebhookBody(job, DeletionStatus.ALREADY_ABSENT), - logger, - ) - } - return - } - - logger.warn('[Retention] Job failed', { recordId, recordType, deliveryCount, error: err?.message }) - - if (deliveryCount >= CONSUMER_MAX_DELIVER) { - try { - await natsClient.publishToDlq(DLQ_SUBJECTS[this.recordType], job, err?.message ?? 'unknown error') - } catch (dlqErr: any) { - logger.error('[Retention] Failed to publish to DLQ', { recordId, error: dlqErr?.message }) - } - - logger.error('[Retention] Job moved to DLQ after max retries', { - recordId, - recordType, - tenantId, - deliveryCount, - }) - - msg.ack() - } else { - logger.warn('[Retention] Job failed — retrying', { recordId, deliveryCount }) - msg.nak() - } - } - } - - private async sendWebhookWithRetry( - url: string, - body: Record, - logger: Logger, - ): Promise { - const delays = WEBHOOK_RETRY_DELAYS_MS - const maxAttempts = delays.length + 1 - - for (let attempt = 0; attempt < maxAttempts; attempt++) { - try { - await fetch(url, { - method: 'POST', - body: JSON.stringify(body), - headers: { 'Content-Type': 'application/json' }, - signal: AbortSignal.timeout(10000), - }) - logger.debug('[Retention] Webhook sent', { url, recordId: (body.deletion as any)?.recordId }) - return - } catch (err: any) { - const isLastAttempt = attempt === maxAttempts - 1 - if (isLastAttempt) { - logger.warn('[Retention] Webhook delivery failed after all retries', { url, error: err?.message }) - } else { - logger.debug(`[Retention] Webhook attempt ${attempt + 1} failed — retrying in ${delays[attempt]}ms`) - await sleep(delays[attempt]) - } - } - } - } - - private buildWebhookBody(job: DeletionJob, status: DeletionStatus): Record { - return { - eventType: 'retention.deletion.complete', - occurredAt: new Date().toISOString(), - tenantId: job.tenantId, - deletion: { - recordId: job.recordId, - recordType: job.recordType, - status, - deletedAt: new Date().toISOString(), - }, - } - } -} diff --git a/src/services/deletion/DidCommCredentialWorker.ts b/src/services/deletion/DidCommCredentialWorker.ts deleted file mode 100644 index fa269e35..00000000 --- a/src/services/deletion/DidCommCredentialWorker.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { Agent } from '@credo-ts/core' - -import { RecordType } from '../../types/RetentionTypes' -import { BaseRetentionWorker } from './BaseRetentionWorker' - -export class DidCommCredentialWorker extends BaseRetentionWorker { - protected recordType = RecordType.DIDCOMM_CREDENTIAL - protected consumerName = 'retention-worker-didcomm-credential' - - protected async deleteRecord(agent: Agent, recordId: string): Promise { - await (agent as any).modules.didcomm.credentials.deleteById(recordId) - } -} - -export const didCommCredentialWorker = new DidCommCredentialWorker() diff --git a/src/services/deletion/DidCommProofWorker.ts b/src/services/deletion/DidCommProofWorker.ts deleted file mode 100644 index f8cc5ecd..00000000 --- a/src/services/deletion/DidCommProofWorker.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { Agent } from '@credo-ts/core' - -import { RecordType } from '../../types/RetentionTypes' -import { BaseRetentionWorker } from './BaseRetentionWorker' - -export class DidCommProofWorker extends BaseRetentionWorker { - protected recordType = RecordType.DIDCOMM_PROOF - protected consumerName = 'retention-worker-didcomm-proof' - - protected async deleteRecord(agent: Agent, recordId: string): Promise { - await (agent as any).modules.didcomm.proofs.deleteById(recordId) - } -} - -export const didCommProofWorker = new DidCommProofWorker() diff --git a/src/services/deletion/Oid4VcIssuanceWorker.ts b/src/services/deletion/Oid4VcIssuanceWorker.ts deleted file mode 100644 index 7e0685d1..00000000 --- a/src/services/deletion/Oid4VcIssuanceWorker.ts +++ /dev/null @@ -1,29 +0,0 @@ -import type { Agent } from '@credo-ts/core' - -import { OpenId4VcIssuanceSessionRepository } from '@credo-ts/openid4vc' - -import { RecordType } from '../../types/RetentionTypes' -import { BaseRetentionWorker } from './BaseRetentionWorker' - -export class Oid4VcIssuanceWorker extends BaseRetentionWorker { - protected recordType = RecordType.OID4VC_ISSUANCE - protected consumerName = 'retention-worker-oid4vc-issuance' - - protected async deleteRecord(agent: Agent, recordId: string): Promise { - agent.config.logger.info(`[Retention] Attempting to delete OID4VC issuance session`, { recordId }) - try { - const repository = agent.dependencyManager.resolve(OpenId4VcIssuanceSessionRepository) - await repository.deleteById(agent.context, recordId) - agent.config.logger.info(`[Retention] Successfully deleted OID4VC issuance session`, { recordId }) - } catch (err: any) { - agent.config.logger.error(`[Retention] Failed to delete OID4VC issuance session`, { - recordId, - error: err?.message, - errorType: err?.constructor?.name, - }) - throw err // re-throw so BaseRetentionWorker can handle retry/DLQ - } - } -} - -export const oid4VcIssuanceWorker = new Oid4VcIssuanceWorker() diff --git a/src/services/deletion/Oid4VcVerificationWorker.ts b/src/services/deletion/Oid4VcVerificationWorker.ts deleted file mode 100644 index 64787b47..00000000 --- a/src/services/deletion/Oid4VcVerificationWorker.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { Agent } from '@credo-ts/core' - -import { OpenId4VcVerificationSessionRepository } from '@credo-ts/openid4vc' - -import { RecordType } from '../../types/RetentionTypes' -import { BaseRetentionWorker } from './BaseRetentionWorker' - -export class Oid4VcVerificationWorker extends BaseRetentionWorker { - protected recordType = RecordType.OID4VC_VERIFICATION - protected consumerName = 'retention-worker-oid4vc-verification' - - protected async deleteRecord(agent: Agent, recordId: string): Promise { - const repository = agent.dependencyManager.resolve(OpenId4VcVerificationSessionRepository) - await repository.deleteById(agent.context, recordId) - } -} - -export const oid4VcVerificationWorker = new Oid4VcVerificationWorker() diff --git a/src/types/RetentionTypes.ts b/src/types/RetentionTypes.ts deleted file mode 100644 index 0ad38fff..00000000 --- a/src/types/RetentionTypes.ts +++ /dev/null @@ -1,137 +0,0 @@ -export enum RecordType { - DIDCOMM_CREDENTIAL = 'didcomm_credential', - DIDCOMM_PROOF = 'didcomm_proof', - OID4VC_ISSUANCE = 'oid4vc_issuance', - OID4VC_VERIFICATION = 'oid4vc_verification', -} - -// Terminal states that make a record eligible for deletion -export const TERMINAL_STATES: Record = { - [RecordType.DIDCOMM_CREDENTIAL]: ['done', 'abandoned'], - [RecordType.DIDCOMM_PROOF]: ['done', 'abandoned'], - - // All states from OpenId4VcIssuanceSessionState enum - [RecordType.OID4VC_ISSUANCE]: [ - 'OfferCreated', - 'OfferUriRetrieved', - 'AuthorizationInitiated', - 'AuthorizationGranted', - 'AccessTokenRequested', - 'AccessTokenCreated', - 'CredentialRequestReceived', - 'CredentialsPartiallyIssued', - 'Completed', - 'Error', - ], - - // All states from OpenId4VcVerificationSessionState enum - [RecordType.OID4VC_VERIFICATION]: [ - 'RequestCreated', - 'RequestUriRetrieved', - 'ResponseVerified', - 'Error', - ], -} - -// Maps RecordType to the NATS subject it should be published on -export const NATS_SUBJECTS: Record = { - [RecordType.DIDCOMM_CREDENTIAL]: 'retention.delete.didcomm.credential', - [RecordType.DIDCOMM_PROOF]: 'retention.delete.didcomm.proof', - [RecordType.OID4VC_ISSUANCE]: 'retention.delete.oid4vc.issuance', - [RecordType.OID4VC_VERIFICATION]: 'retention.delete.oid4vc.verification', -} - -// Maps RecordType to its webhook path (appended to webhookUrl) -// Need to add delete in the route -export const WEBHOOK_PATHS: Record = { - [RecordType.DIDCOMM_CREDENTIAL]: '/wh/didcomm-issuance', - [RecordType.DIDCOMM_PROOF]: '/wh/didcomm-verification', - [RecordType.OID4VC_ISSUANCE]: '/wh/delete/oid4vc-issuance', - [RecordType.OID4VC_VERIFICATION]: '/wh/delete/oid4vc-verification', -} - -// Maps RecordType to its DLQ subject -export const DLQ_SUBJECTS: Record = { - [RecordType.DIDCOMM_CREDENTIAL]: 'retention.dlq.didcomm.credential', - [RecordType.DIDCOMM_PROOF]: 'retention.dlq.didcomm.proof', - [RecordType.OID4VC_ISSUANCE]: 'retention.dlq.oid4vc.issuance', - [RecordType.OID4VC_VERIFICATION]: 'retention.dlq.oid4vc.verification', -} - -export interface NatsConfig { - servers: string[] - credentialsFile?: string -} - -export interface RetentionConfig { - enabled: boolean - cronSchedule: string // cron syntax e.g. "0 */2 * * *" - ttlSeconds: number // TTL in seconds after terminal state reached - recordTypes: RecordType[] - nats: NatsConfig -} - -// ─── Config builders ───────────────────────────────────────────────────────── -// Resolves the final RetentionConfig from env vars + cliConfig.json. -// Priority: env vars > cliConfig.json > defaults. -// Returns undefined if retention is not enabled from either source. -export function buildRetentionConfig(configRetention?: Partial): RetentionConfig | undefined { - const enabled = process.env.RETENTION_ENABLED === 'true' || configRetention?.enabled === true - if (!enabled) return undefined - - return { - enabled: true, - cronSchedule: process.env.RETENTION_CRON_SCHEDULE || configRetention?.cronSchedule || '0 */2 * * *', - ttlSeconds: Number(process.env.RETENTION_TTL_SECONDS) || configRetention?.ttlSeconds || 2592000, - recordTypes: buildRetentionRecordTypes(configRetention?.recordTypes), - nats: { - servers: ( - process.env.NATS_SERVERS || - configRetention?.nats?.servers?.join(',') || - 'nats://localhost:4222' - ).split(','), - credentialsFile: process.env.NATS_CREDENTIALS_FILE || configRetention?.nats?.credentialsFile, - }, - } -} - -// Builds the list of record types from per-type env flags, falling back to -// cliConfig.json recordTypes array, then all four types as default. -function buildRetentionRecordTypes(configRecordTypes?: RecordType[]): RecordType[] { - const envFlags: Record = { - RETENTION_DIDCOMM_CREDENTIAL: RecordType.DIDCOMM_CREDENTIAL, - RETENTION_DIDCOMM_PROOF: RecordType.DIDCOMM_PROOF, - RETENTION_OID4VC_ISSUANCE: RecordType.OID4VC_ISSUANCE, - RETENTION_OID4VC_VERIFICATION: RecordType.OID4VC_VERIFICATION, - } - - const anyEnvSet = Object.keys(envFlags).some((key) => process.env[key] !== undefined) - - if (anyEnvSet) { - return Object.entries(envFlags) - .filter(([key]) => process.env[key] === 'true') - .map(([, type]) => type) - } - - return configRecordTypes ?? [ - RecordType.DIDCOMM_CREDENTIAL, - RecordType.DIDCOMM_PROOF, - RecordType.OID4VC_ISSUANCE, - RecordType.OID4VC_VERIFICATION, - ] -} - -// Status values reported in the webhook payload after a deletion attempt -export enum DeletionStatus { - DELETED = 'deleted', // record was successfully deleted - ALREADY_ABSENT = 'already-absent', // record was not found — treated as success (idempotent) -} - -// Payload published to NATS for each eligible record -export interface DeletionJob { - recordId: string - recordType: RecordType - tenantId: string // empty string for dedicated agents - agentMode: 'shared' | 'dedicated' - enqueuedAt: string // ISO-8601 -} diff --git a/src/utils/NatsClient.ts b/src/utils/NatsClient.ts deleted file mode 100644 index ba2b365b..00000000 --- a/src/utils/NatsClient.ts +++ /dev/null @@ -1,164 +0,0 @@ -import { - AckPolicy, - DiscardPolicy, - RetentionPolicy, - StorageType, - StringCodec, - connect, - headers, -} from 'nats' -import type { Consumer, JetStreamClient, JetStreamManager, NatsConnection, StreamConfig } from 'nats' - -import type { DeletionJob, NatsConfig } from '../types/RetentionTypes' -import { RecordType } from '../types/RetentionTypes' -import { - CONSUMERS, - CONSUMER_ACK_WAIT_NS, - CONSUMER_BACKOFF_NS, - CONSUMER_MAX_DELIVER, - DELETION_STREAM_DEDUP_WINDOW_NS, - DELETION_STREAM_MAX_AGE_NS, - DELETION_STREAM_MAX_MSGS, - DELETION_SUBJECTS, - DLQ_STREAM_MAX_AGE_NS, - DLQ_STREAM_MAX_MSGS, - NATS_ERR_CONSUMER_ALREADY_EXISTS, - NATS_ERR_STREAM_ALREADY_EXISTS, - NATS_MAX_RECONNECT_ATTEMPTS, - NATS_RECONNECT_TIME_WAIT_MS, - RETENTION_DELETION_STREAM, - RETENTION_DLQ_STREAM, -} from './NatsConstants' - -const sc = StringCodec() - -class NatsClient { - private nc: NatsConnection | null = null - private js: JetStreamClient | null = null - private jsm: JetStreamManager | null = null - - async connect(config: NatsConfig): Promise { - this.nc = await connect({ - servers: config.servers, - ...(config.credentialsFile ? { credentialsFile: config.credentialsFile } : {}), - maxReconnectAttempts: NATS_MAX_RECONNECT_ATTEMPTS, - reconnectTimeWait: NATS_RECONNECT_TIME_WAIT_MS, - }) - this.js = this.nc.jetstream() - this.jsm = await this.nc.jetstreamManager() - } - - async provisionStreams(): Promise { - if (!this.jsm) throw new Error('[NatsClient] Not connected — call connect() first') - - const deletionStreamConfig = { - name: RETENTION_DELETION_STREAM, - subjects: DELETION_SUBJECTS, - retention: RetentionPolicy.Workqueue, - storage: StorageType.File, - max_age: DELETION_STREAM_MAX_AGE_NS, - max_msgs: DELETION_STREAM_MAX_MSGS, - discard: DiscardPolicy.Old, - duplicate_window: DELETION_STREAM_DEDUP_WINDOW_NS, - } - - const dlqStreamConfig = { - name: RETENTION_DLQ_STREAM, - subjects: ['retention.dlq.>'], - retention: RetentionPolicy.Limits, - storage: StorageType.File, - max_age: DLQ_STREAM_MAX_AGE_NS, - max_msgs: DLQ_STREAM_MAX_MSGS, - } - - // Use update-or-create so config changes (e.g. new subjects) always take effect - await this.addOrUpdateStream(deletionStreamConfig) - await this.addOrUpdateStream(dlqStreamConfig) - } - - private async addOrUpdateStream(config: Partial & { name: string }): Promise { - if (!this.jsm) throw new Error('[NatsClient] Not connected — call connect() first') - try { - await this.jsm.streams.add(config) - } catch (err: any) { - if (this.isAlreadyExistsError(err)) { - // Stream exists — update it so any config changes (subjects, retention, etc.) take effect - await this.jsm.streams.update(config.name, config) - } else { - throw err - } - } - } - - async provisionConsumers(): Promise { - if (!this.jsm) throw new Error('[NatsClient] Not connected — call connect() first') - - for (const consumer of CONSUMERS) { - try { - await this.jsm.consumers.add(RETENTION_DELETION_STREAM, { - durable_name: consumer.name, - ack_policy: AckPolicy.Explicit, - ack_wait: CONSUMER_ACK_WAIT_NS, - max_deliver: CONSUMER_MAX_DELIVER, - backoff: CONSUMER_BACKOFF_NS, - filter_subject: consumer.filterSubject, - }) - } catch (err: any) { - if (!this.isAlreadyExistsError(err)) throw err - } - } - } - - async publish(subject: string, payload: DeletionJob): Promise { - if (!this.js) throw new Error('[NatsClient] Not connected — call connect() first') - - const h = headers() - // Msg-Id combines recordId + enqueuedAt so the same record can be re-queued - // in a later cron run (different timestamp) while still deduplicating within - // a single cron run (same timestamp for all jobs published together). - h.set('Nats-Msg-Id', `${payload.recordId}-${payload.enqueuedAt}`) - - await this.js.publish(subject, sc.encode(JSON.stringify(payload)), { headers: h }) - } - - async publishToDlq(dlqSubject: string, payload: DeletionJob, errorReason: string): Promise { - if (!this.js) throw new Error('[NatsClient] Not connected — call connect() first') - - const h = headers() - h.set('X-Retention-Error', errorReason) - h.set('X-Retention-Record-Type', payload.recordType) - - await this.js.publish(dlqSubject, sc.encode(JSON.stringify(payload)), { headers: h }) - } - - async getPullConsumer(consumerName: string): Promise { - if (!this.js) throw new Error('[NatsClient] Not connected — call connect() first') - return this.js.consumers.get(RETENTION_DELETION_STREAM, consumerName) - } - - async disconnect(): Promise { - if (this.nc) { - await this.nc.drain() - this.nc = null - this.js = null - this.jsm = null - } - } - - decode(data: Uint8Array): DeletionJob { - return JSON.parse(sc.decode(data)) as DeletionJob - } - - private isAlreadyExistsError(err: any): boolean { - const msg: string = err?.message ?? '' - return ( - msg.includes('stream name already in use') || - msg.includes('consumer name already in use') || - err?.api_error?.err_code === NATS_ERR_STREAM_ALREADY_EXISTS || - err?.api_error?.err_code === NATS_ERR_CONSUMER_ALREADY_EXISTS - ) - } -} - -export const natsClient = new NatsClient() -export { RecordType } diff --git a/src/utils/NatsConstants.ts b/src/utils/NatsConstants.ts index 2162d137..43d85f9f 100644 --- a/src/utils/NatsConstants.ts +++ b/src/utils/NatsConstants.ts @@ -1,120 +1,9 @@ -// ─── NATS Stream Names ──────────────────────────────────────────────────────── - -// Main work queue — holds all pending deletion jobs. -// WorkQueue retention: message is permanently removed after it is ack'd. -export const RETENTION_DELETION_STREAM = 'RETENTION_DELETION' - -// Dead-letter queue — holds jobs that failed after all retry attempts. -// Limits retention: messages are kept for manual investigation, not auto-deleted on ack. -export const RETENTION_DLQ_STREAM = 'RETENTION_DLQ' - -// ─── NATS Subject Patterns ──────────────────────────────────────────────────── - -// All subjects that the RETENTION_DELETION stream must capture. -// Must stay in sync with NATS_SUBJECTS in RetentionTypes.ts. -export const DELETION_SUBJECTS = [ - 'retention.delete.didcomm.credential', - 'retention.delete.didcomm.proof', - 'retention.delete.oid4vc.issuance', - 'retention.delete.oid4vc.verification', -] - -// ─── NATS Consumer Definitions ─────────────────────────────────────────────── - -// One pull consumer per record type. -// Each consumer filters to its own subject so workers only receive their own messages. -// Consumer names must stay in sync with the consumerName in each *Worker.ts file. -export const CONSUMERS: Array<{ name: string; filterSubject: string }> = [ - { - name: 'retention-worker-didcomm-credential', - filterSubject: 'retention.delete.didcomm.credential', - }, - { - name: 'retention-worker-didcomm-proof', - filterSubject: 'retention.delete.didcomm.proof', - }, - { - name: 'retention-worker-oid4vc-issuance', - filterSubject: 'retention.delete.oid4vc.issuance', - }, - { - name: 'retention-worker-oid4vc-verification', - filterSubject: 'retention.delete.oid4vc.verification', - }, -] - -// ─── NATS Connection ────────────────────────────────────────────────────────── - // -1 means retry forever — the agent should not stop trying to reconnect. export const NATS_MAX_RECONNECT_ATTEMPTS = -1 // How long (ms) to wait between reconnect attempts. export const NATS_RECONNECT_TIME_WAIT_MS = 2000 -// ─── NATS Stream Limits ─────────────────────────────────────────────────────── - -// NATS time values are in nanoseconds (1 second = 1_000_000_000 ns). - -// How long to keep a message in the RETENTION_DELETION stream before discarding. -// Prevents unbounded growth if workers fall behind. -// 7 days in nanoseconds. -export const DELETION_STREAM_MAX_AGE_NS = 7 * 24 * 60 * 60 * 1_000_000_000 - -// Maximum number of messages to keep in the RETENTION_DELETION stream. -export const DELETION_STREAM_MAX_MSGS = 1_000_000 - -// Deduplication window: NATS will reject a message with the same Nats-Msg-Id -// if it was already published within this window. -// Our Msg-Id = recordId + enqueuedAt, so this prevents double-publishing -// from the same cron run while allowing re-publishing in later cron runs. -// 24 hours in nanoseconds. -export const DELETION_STREAM_DEDUP_WINDOW_NS = 24 * 60 * 60 * 1_000_000_000 - -// How long to keep failed jobs in the DLQ for manual investigation. -// 30 days in nanoseconds. -export const DLQ_STREAM_MAX_AGE_NS = 30 * 24 * 60 * 60 * 1_000_000_000 - -// Maximum number of messages to keep in the DLQ stream. -export const DLQ_STREAM_MAX_MSGS = 100_000 - -// ─── NATS Consumer Delivery Config ─────────────────────────────────────────── - -// How long NATS waits for a worker to ack a message before redelivering it. -// Must be long enough to cover the full deletion + webhook retry time. -// Worst case: webhook retries = 1s + 5s + 30s = 36s → 60s gives comfortable headroom. -// 60 seconds in nanoseconds. -export const CONSUMER_ACK_WAIT_NS = 60 * 1_000_000_000 - -// Maximum number of delivery attempts before a job is considered permanently failed. -// After this many attempts, the worker routes the job to the DLQ. -// Must stay in sync with MAX_DELIVER in BaseRetentionWorker.ts. -export const CONSUMER_MAX_DELIVER = 5 - -// Backoff delays between redelivery attempts (nanoseconds). -// NATS uses these to space out retries after a nak(). -// Attempt 1 → 2: wait 1s -// Attempt 2 → 3: wait 5s -// Attempt 3 → 4: wait 30s -// Attempt 4 → 5: wait 2 min -// Attempt 5 : move to DLQ (no more redelivery) -export const CONSUMER_BACKOFF_NS = [ - 1_000_000_000, // 1 second - 5_000_000_000, // 5 seconds - 30_000_000_000, // 30 seconds - 120_000_000_000, // 2 minutes - 300_000_000_000, // 5 minutes -] - -// ─── NATS Error Codes ───────────────────────────────────────────────────────── - // JetStream API error codes returned when a stream or consumer already exists. -// Used in addOrUpdateStream() to detect and handle existing resources. export const NATS_ERR_STREAM_ALREADY_EXISTS = 10058 export const NATS_ERR_CONSUMER_ALREADY_EXISTS = 10148 - -// ─── Webhook Retry Delays ───────────────────────────────────────────────────── - -// Delays in milliseconds between webhook delivery attempts. -// Total attempts = delays.length + 1 (1 initial + N retries). -// [1s, 5s, 30s] → 3 retries → 4 total attempts. -export const WEBHOOK_RETRY_DELAYS_MS = [1000, 5000, 30000] diff --git a/src/utils/ServerConfig.ts b/src/utils/ServerConfig.ts index e2734b83..4f66c053 100644 --- a/src/utils/ServerConfig.ts +++ b/src/utils/ServerConfig.ts @@ -1,6 +1,5 @@ import type { Express } from 'express' import type { Server } from 'ws' -import type { RetentionConfig } from '../types/RetentionTypes' export interface ServerConfig { port: number @@ -10,5 +9,4 @@ export interface ServerConfig { /* Socket server is used for sending events over websocket to clients */ socketServer?: Server schemaFileServerURL?: string - retention?: RetentionConfig } From ed51190a7eaca03f8e0ac244cb9b269428dae68b Mon Sep 17 00:00:00 2001 From: Tipu_Singh Date: Thu, 23 Apr 2026 14:56:57 +0530 Subject: [PATCH 134/152] refactored: code rabbit comments Signed-off-by: Tipu_Singh --- .env.sample | 2 + src/cliAgent.ts | 14 ++-- src/purge/PurgeConfigValidator.ts | 2 - src/purge/PurgeConstants.ts | 32 ++------- src/purge/PurgeDeleteRecord.ts | 5 ++ src/purge/PurgeTypes.ts | 36 ++++++++-- src/purge/PurgeWebhook.ts | 3 +- src/purge/PurgeWorker.ts | 10 +++ src/purge/decorators/SchedulePurge.ts | 20 ++++-- src/purge/schedulers/CronPurgeScheduler.ts | 12 +++- src/purge/schedulers/NatsPurgeScheduler.ts | 77 ++++++++++++++-------- 11 files changed, 131 insertions(+), 82 deletions(-) diff --git a/.env.sample b/.env.sample index 7b336ad8..8a348cdd 100644 --- a/.env.sample +++ b/.env.sample @@ -114,6 +114,8 @@ INDICIO_TEST_GENESIS=`{"reqSignature":{},"txn":{"data":{"data":{"alias":"OpsNode # Master switch — set to true to activate purge system PURGE_ENABLED= +# Set to false to skip webhook calls after deletion (default: true) +PURGE_WEBHOOK_ENABLED= # ── Flow A: NATS (requires NATS_SERVERS below) ──────────────────────────────── PURGE_NATS_ENABLED= diff --git a/src/cliAgent.ts b/src/cliAgent.ts index 59916bc8..f06237e9 100644 --- a/src/cliAgent.ts +++ b/src/cliAgent.ts @@ -579,25 +579,27 @@ export async function runRestAgent(restConfig: AriesRestConfig) { logger.info(`*** API Key: ${apiKey}`) - app.listen(adminPort, () => { - logger.info(`Successfully started server on port ${adminPort}`) - }) - // Start purge schedulers if enabled (NATS and Cron are independent) const purgeConfig = buildPurgeConfig() if (purgeConfig) { await validatePurgeConfig(purgeConfig) initPurgeSchedulers(purgeConfig.natsConfig.enabled, purgeConfig.cronConfig.enabled) + const purgeWebhookUrl = purgeConfig.webhookEnabled ? webhookUrl : undefined + if (purgeConfig.natsConfig.enabled) { - await getNatsPurgeScheduler()!.start(agent, purgeConfig, webhookUrl) + await getNatsPurgeScheduler()!.start(agent, purgeConfig, purgeWebhookUrl) } if (purgeConfig.cronConfig.enabled) { - await getCronPurgeScheduler()!.start(agent, purgeConfig, webhookUrl) + await getCronPurgeScheduler()!.start(agent, purgeConfig, purgeWebhookUrl) } } + app.listen(adminPort, () => { + logger.info(`Successfully started server on port ${adminPort}`) + }) + // Graceful shutdown const shutdown = async () => { agent.config.logger.info('[Shutdown] Stopping services...') diff --git a/src/purge/PurgeConfigValidator.ts b/src/purge/PurgeConfigValidator.ts index 7235acf4..347cca06 100644 --- a/src/purge/PurgeConfigValidator.ts +++ b/src/purge/PurgeConfigValidator.ts @@ -5,7 +5,6 @@ import type { PurgeConfig } from './PurgeTypes' export async function validatePurgeConfig(config: PurgeConfig): Promise { const { natsConfig, cronConfig } = config - // At least one mode must be enabled when PURGE_ENABLED=true if (!natsConfig.enabled && !cronConfig.enabled) { throw new Error( '[Purge] PURGE_ENABLED=true but neither PURGE_NATS_ENABLED nor PURGE_CRON_ENABLED is set to true. ' + @@ -13,7 +12,6 @@ export async function validatePurgeConfig(config: PurgeConfig): Promise { ) } - // If NATS mode is enabled, verify the server is reachable and JetStream is on if (natsConfig.enabled) { await verifyNatsJetStream(natsConfig.nats.servers, natsConfig.nats.credentialsFile) } diff --git a/src/purge/PurgeConstants.ts b/src/purge/PurgeConstants.ts index a9be3ec1..245386ca 100644 --- a/src/purge/PurgeConstants.ts +++ b/src/purge/PurgeConstants.ts @@ -1,15 +1,8 @@ import { PurgeRecordType } from './PurgeTypes' -// ─── NATS Stream Name ───────────────────────────────────────────────────────── -// Single combined stream — schedule and execution subjects must be in the same -// stream for Nats-Schedule-Target to be valid. - export const PURGE_STREAM = 'PURGE' -// ─── NATS Subjects ──────────────────────────────────────────────────────────── - -// Scheduled messages are published here. NATS holds them until Nats-Schedule -// time, then re-publishes to the corresponding execution subject (same stream). +// Schedule and execution subjects must be in the same stream for Nats-Schedule-Target to work export const PURGE_SCHEDULER_SUBJECTS: Record = { [PurgeRecordType.DIDCOMM_CREDENTIAL]: 'purge.schedule.didcomm.credential', [PurgeRecordType.DIDCOMM_PROOF]: 'purge.schedule.didcomm.proof', @@ -17,8 +10,6 @@ export const PURGE_SCHEDULER_SUBJECTS: Record = { [PurgeRecordType.OID4VC_VERIFICATION]: 'purge.schedule.oid4vc.verification', } -// Workers consume from these subjects. Consumers filter on these so schedule -// messages are ignored. export const PURGE_EXECUTION_SUBJECTS: Record = { [PurgeRecordType.DIDCOMM_CREDENTIAL]: 'purge.execute.didcomm.credential', [PurgeRecordType.DIDCOMM_PROOF]: 'purge.execute.didcomm.proof', @@ -26,8 +17,6 @@ export const PURGE_EXECUTION_SUBJECTS: Record = { [PurgeRecordType.OID4VC_VERIFICATION]: 'purge.execute.oid4vc.verification', } -// ─── NATS Consumer Definitions ─────────────────────────────────────────────── - export const PURGE_CONSUMER_NAMES: Record = { [PurgeRecordType.DIDCOMM_CREDENTIAL]: 'purge-worker-didcomm-credential', [PurgeRecordType.DIDCOMM_PROOF]: 'purge-worker-didcomm-proof', @@ -35,28 +24,18 @@ export const PURGE_CONSUMER_NAMES: Record = { [PurgeRecordType.OID4VC_VERIFICATION]: 'purge-worker-oid4vc-verification', } -// ─── NATS Stream Limits ─────────────────────────────────────────────────────── +// Added to ttlSeconds when computing stream max_age — covers worker processing time after fire +export const PURGE_STREAM_BUFFER_NS = 7 * 24 * 60 * 60 * 1_000_000_000 -// 35 days — covers max schedule TTL + buffer for unprocessed execute messages -export const PURGE_STREAM_MAX_AGE_NS = 35 * 24 * 60 * 60 * 1_000_000_000 - -// ─── Consumer Delivery Config ───────────────────────────────────────────────── - -// 30 seconds in nanoseconds export const PURGE_CONSUMER_ACK_WAIT_NS = 30 * 1_000_000_000 export const PURGE_CONSUMER_MAX_DELIVER = 3 export const PURGE_CONSUMER_BACKOFF_NS = [ - 5_000_000_000, // 5 seconds - 30_000_000_000, // 30 seconds + 5_000_000_000, // 5s + 30_000_000_000, // 30s ] -// ─── Webhook Paths ──────────────────────────────────────────────────────────── - -// Appended to webhookUrl after every deletion. -// Full URL = webhookUrl + PURGE_WEBHOOK_PATHS[recordType] -// e.g. http://host/wh/agentId/purge/oid4vc-issuance export const PURGE_WEBHOOK_PATHS: Record = { [PurgeRecordType.DIDCOMM_CREDENTIAL]: '/purge/didcomm-credential', [PurgeRecordType.DIDCOMM_PROOF]: '/purge/didcomm-proof', @@ -64,5 +43,4 @@ export const PURGE_WEBHOOK_PATHS: Record = { [PurgeRecordType.OID4VC_VERIFICATION]: '/purge/oid4vc-verification', } -// Retry delays for webhook delivery attempts (ms): 1s → 5s → 30s export const PURGE_WEBHOOK_RETRY_DELAYS_MS = [1000, 5000, 30000] diff --git a/src/purge/PurgeDeleteRecord.ts b/src/purge/PurgeDeleteRecord.ts index 86b5245f..6de526e4 100644 --- a/src/purge/PurgeDeleteRecord.ts +++ b/src/purge/PurgeDeleteRecord.ts @@ -25,5 +25,10 @@ export async function deletePurgeRecord(agent: Agent, recordType: PurgeRecordTyp await repo.deleteById(agent.context, recordId) break } + + default: { + const _exhaustive: never = recordType + throw new Error(`[Purge] Unhandled record type: ${_exhaustive}`) + } } } diff --git a/src/purge/PurgeTypes.ts b/src/purge/PurgeTypes.ts index f9368159..60c3a9e9 100644 --- a/src/purge/PurgeTypes.ts +++ b/src/purge/PurgeTypes.ts @@ -3,6 +3,8 @@ export interface NatsConfig { credentialsFile?: string } +export type AgentMode = 'shared' | 'dedicated' + export enum PurgeRecordType { DIDCOMM_CREDENTIAL = 'didcomm_credential', DIDCOMM_PROOF = 'didcomm_proof', @@ -13,9 +15,9 @@ export enum PurgeRecordType { export interface PurgeJob { recordId: string recordType: PurgeRecordType - tenantId: string // empty string for dedicated agents - agentMode: 'shared' | 'dedicated' - scheduledAt: string // ISO-8601 + tenantId: string + agentMode: AgentMode + scheduledAt: string } export interface PurgeNatsConfig { @@ -35,6 +37,7 @@ export interface PurgeCronConfig { export interface PurgeConfig { natsConfig: PurgeNatsConfig cronConfig: PurgeCronConfig + webhookEnabled: boolean } export function buildPurgeConfig(): PurgeConfig | undefined { @@ -48,20 +51,30 @@ export function buildPurgeConfig(): PurgeConfig | undefined { return { natsConfig: { enabled: natsEnabled, - ttlSeconds: Number(process.env.PURGE_NATS_TTL_SECONDS) || 2592000, + ttlSeconds: parseTtlSeconds(process.env.PURGE_NATS_TTL_SECONDS, 'PURGE_NATS_TTL_SECONDS'), nats: { - servers: (process.env.NATS_SERVERS || 'nats://localhost:4222').split(','), + servers: (process.env.NATS_SERVERS || 'nats://localhost:4222').split(',').map((s) => s.trim()).filter(Boolean), credentialsFile: process.env.NATS_CREDENTIALS_FILE, }, recordTypes: buildPurgeRecordTypes(), }, cronConfig: { enabled: cronEnabled, - ttlSeconds: Number(process.env.PURGE_CRON_TTL_SECONDS) || 2592000, + ttlSeconds: parseTtlSeconds(process.env.PURGE_CRON_TTL_SECONDS, 'PURGE_CRON_TTL_SECONDS'), cronSchedule: process.env.PURGE_CRON_SCHEDULE || '0 * * * *', recordTypes: buildPurgeRecordTypes(), }, + webhookEnabled: process.env.PURGE_WEBHOOK_ENABLED !== 'false', + } +} + +function parseTtlSeconds(value: string | undefined, envKey: string, defaultSeconds = 2592000): number { + if (value === undefined || value === '') return defaultSeconds + const parsed = Number(value) + if (!Number.isInteger(parsed) || parsed <= 0) { + throw new Error(`[Purge] ${envKey} must be a positive integer, got: "${value}"`) } + return parsed } function buildPurgeRecordTypes(): PurgeRecordType[] { @@ -75,9 +88,18 @@ function buildPurgeRecordTypes(): PurgeRecordType[] { const anyEnvSet = Object.keys(envFlags).some((key) => process.env[key] !== undefined) if (anyEnvSet) { - return Object.entries(envFlags) + const selected = Object.entries(envFlags) .filter(([key]) => process.env[key] === 'true') .map(([, type]) => type) + + if (selected.length === 0) { + throw new Error( + '[Purge] At least one PURGE_* record type flag must be set to "true" when any flag is present. ' + + 'Set PURGE_ENABLED=false to disable purge entirely.', + ) + } + + return selected } return [ diff --git a/src/purge/PurgeWebhook.ts b/src/purge/PurgeWebhook.ts index 4ee6fd0b..fa1dbf55 100644 --- a/src/purge/PurgeWebhook.ts +++ b/src/purge/PurgeWebhook.ts @@ -35,12 +35,13 @@ export async function sendPurgeWebhook( for (let attempt = 0; attempt < maxAttempts; attempt++) { try { - await fetch(url, { + const res = await fetch(url, { method: 'POST', body: JSON.stringify(body), headers: { 'Content-Type': 'application/json' }, signal: AbortSignal.timeout(10000), }) + if (!res.ok) throw new Error(`HTTP ${res.status}`) logger.debug('[Purge] Webhook delivered', { url, recordId }) return } catch (err: any) { diff --git a/src/purge/PurgeWorker.ts b/src/purge/PurgeWorker.ts index 45da0d2a..90cee770 100644 --- a/src/purge/PurgeWorker.ts +++ b/src/purge/PurgeWorker.ts @@ -50,6 +50,16 @@ export class PurgeWorker { const logger = agent.config.logger const deliveryCount: number = msg.info.deliveryCount + if (recordType !== this.recordType) { + logger.error('[Purge] Job record type mismatch — discarding', { + expected: this.recordType, + received: recordType, + recordId, + }) + msg.ack() + return + } + logger.info('[Purge] Job received', { recordId, recordType, tenantId, deliveryCount }) try { diff --git a/src/purge/decorators/SchedulePurge.ts b/src/purge/decorators/SchedulePurge.ts index b1dc3c1c..cb7a316e 100644 --- a/src/purge/decorators/SchedulePurge.ts +++ b/src/purge/decorators/SchedulePurge.ts @@ -1,6 +1,6 @@ -import type { PurgeRecordType } from '../PurgeTypes' +import type { AgentMode, PurgeRecordType } from '../PurgeTypes' -import { getNatsPurgeScheduler } from '../PurgeSchedulerFactory' +import { getCronPurgeScheduler, getNatsPurgeScheduler } from '../PurgeSchedulerFactory' export function SchedulePurge( recordType: PurgeRecordType, @@ -22,23 +22,29 @@ export function SchedulePurge( const recordId = idExtractor(result) if (!recordId) { - console.warn(`[Purge] @SchedulePurge(${recordType}): could not extract recordId from result`, result) + const resultKeys = result && typeof result === 'object' ? Object.keys(result) : typeof result + console.warn(`[Purge] @SchedulePurge(${recordType}): could not extract recordId — result shape: ${JSON.stringify(resultKeys)}`) return result } const request = args[0] as any - // TenantAgent sets context.contextCorrelationId = `tenant-${tenantId}` (Credo internals). - // Auth middleware sets request.agent to TenantAgent directly — query param is not reliable. + // TenantAgent.context.contextCorrelationId = `tenant-${tenantId}` (Credo internals) const contextCorrelationId: string = (request?.agent as any)?.context?.contextCorrelationId ?? '' const tenantId: string = contextCorrelationId.startsWith('tenant-') ? contextCorrelationId.slice('tenant-'.length) : '' - const agentMode: 'shared' | 'dedicated' = tenantId ? 'shared' : 'dedicated' + const agentMode: AgentMode = tenantId ? 'shared' : 'dedicated' console.info(`[Purge] Scheduling purge: ${recordType} recordId=${recordId} tenantId="${tenantId}" agentMode=${agentMode}`) + // Fire-and-forget: purge scheduling must not block record creation. + // If NATS publish fails and cron is disabled, this record will not be purged. scheduler.schedulePurge(recordType, recordId, tenantId, agentMode).catch((err: Error) => { - console.error(`[Purge] Failed to schedule purge for ${recordType}:${recordId}`, err?.message) + const hasCronFallback = getCronPurgeScheduler() !== null + const level = hasCronFallback ? 'warn' : 'error' + console[level]( + `[Purge] Failed to schedule NATS purge for ${recordType}:${recordId} — ${hasCronFallback ? 'cron fallback active' : 'NO cron fallback, record may leak'}: ${err?.message}`, + ) }) return result diff --git a/src/purge/schedulers/CronPurgeScheduler.ts b/src/purge/schedulers/CronPurgeScheduler.ts index fe5a802e..9ae7319a 100644 --- a/src/purge/schedulers/CronPurgeScheduler.ts +++ b/src/purge/schedulers/CronPurgeScheduler.ts @@ -12,14 +12,20 @@ import { PurgeRecordType } from '../PurgeTypes' export class CronPurgeScheduler { private job: ScheduledTask | null = null + private isRunning = false async start(agent: Agent, config: PurgeConfig, webhookUrl: string | undefined): Promise { const { cronConfig } = config this.job = cron.schedule(cronConfig.cronSchedule, () => { - this.runScan(agent, config, webhookUrl).catch((err: Error) => - agent.config.logger.error('[Purge] Cron scan error', { error: err?.message }), - ) + if (this.isRunning) { + agent.config.logger.warn('[Purge] Cron scan still running — skipping this tick') + return + } + this.isRunning = true + this.runScan(agent, config, webhookUrl) + .catch((err: Error) => agent.config.logger.error('[Purge] Cron scan error', { error: err?.message })) + .finally(() => { this.isRunning = false }) }) agent.config.logger.info('[Purge] CronPurgeScheduler started', { diff --git a/src/purge/schedulers/NatsPurgeScheduler.ts b/src/purge/schedulers/NatsPurgeScheduler.ts index 20165eaa..bf632ddc 100644 --- a/src/purge/schedulers/NatsPurgeScheduler.ts +++ b/src/purge/schedulers/NatsPurgeScheduler.ts @@ -1,7 +1,9 @@ import type { Agent } from '@credo-ts/core' import type { JetStreamClient, JetStreamManager, NatsConnection } from 'nats' -import { AckPolicy, DiscardPolicy, RetentionPolicy, StorageType, StringCodec, connect, headers } from 'nats' +import { readFileSync } from 'node:fs' + +import { AckPolicy, DiscardPolicy, RetentionPolicy, StorageType, StringCodec, connect, credsAuthenticator, headers } from 'nats' import { NATS_ERR_CONSUMER_ALREADY_EXISTS, @@ -17,9 +19,9 @@ import { PURGE_EXECUTION_SUBJECTS, PURGE_SCHEDULER_SUBJECTS, PURGE_STREAM, - PURGE_STREAM_MAX_AGE_NS, + PURGE_STREAM_BUFFER_NS, } from '../PurgeConstants' -import type { PurgeConfig, PurgeJob } from '../PurgeTypes' +import type { AgentMode, PurgeConfig, PurgeJob } from '../PurgeTypes' import { PurgeRecordType } from '../PurgeTypes' import { PurgeWorker } from '../PurgeWorker' @@ -39,7 +41,9 @@ export class NatsPurgeScheduler { this.nc = await connect({ servers: natsConfig.nats.servers, - ...(natsConfig.nats.credentialsFile ? { credentialsFile: natsConfig.nats.credentialsFile } : {}), + ...(natsConfig.nats.credentialsFile + ? { authenticator: credsAuthenticator(readFileSync(natsConfig.nats.credentialsFile)) } + : {}), maxReconnectAttempts: NATS_MAX_RECONNECT_ATTEMPTS, reconnectTimeWait: NATS_RECONNECT_TIME_WAIT_MS, }) @@ -63,25 +67,26 @@ export class NatsPurgeScheduler { recordType: PurgeRecordType, recordId: string, tenantId: string, - agentMode: 'shared' | 'dedicated', + agentMode: AgentMode, ): Promise { if (!this.js) throw new Error('[Purge] NatsPurgeScheduler not started') const fireAt = new Date(Date.now() + this.ttlSeconds * 1000).toISOString() const job: PurgeJob = { recordId, recordType, tenantId, agentMode, scheduledAt: fireAt } - // Subject is unique per record — prevents later offers overwriting earlier ones - // (NATS: only one active schedule per subject) - const scheduleSubject = `${PURGE_SCHEDULER_SUBJECTS[recordType]}.${recordId}` + // tenantScope ensures subjects and dedup IDs are unique across tenants in shared mode + const tenantScope = agentMode === 'shared' ? tenantId : 'dedicated' + // Subject is unique per tenant+record — NATS allows only one active schedule per subject + const scheduleSubject = `${PURGE_SCHEDULER_SUBJECTS[recordType]}.${tenantScope}.${recordId}` const h = headers() h.set('Nats-Schedule', `@at ${fireAt}`) h.set('Nats-Schedule-Target', PURGE_EXECUTION_SUBJECTS[recordType]) - h.set('Nats-Msg-Id', `purge-${recordType}-${recordId}`) + h.set('Nats-Msg-Id', `purge-${recordType}-${tenantScope}-${recordId}`) await this.js.publish(scheduleSubject, sc.encode(JSON.stringify(job)), { headers: h }) - console.info(`[Purge] Scheduled: ${recordType} recordId=${recordId} fireAt=${fireAt}`) + console.info(`[Purge] Scheduled: ${recordType} recordId=${recordId} tenantId="${tenantId}" agentMode=${agentMode} fireAt=${fireAt}`) } async stop(): Promise { @@ -96,17 +101,12 @@ export class NatsPurgeScheduler { private async provisionStreams(): Promise { if (!this.jsm) throw new Error('[Purge] Not connected') - // Single combined stream: schedule subjects AND execution subjects must live - // in the same stream — NATS validates Nats-Schedule-Target against the same stream. - // Limits retention so schedule messages are not blocked waiting for a consumer ack. await this.addOrUpdateStream({ name: PURGE_STREAM, - // Wildcards required — schedule subjects include a per-record ID suffix - // e.g. purge.schedule.oid4vc.issuance. subjects: ['purge.schedule.>', 'purge.execute.>'], retention: RetentionPolicy.Limits, storage: StorageType.File, - max_age: PURGE_STREAM_MAX_AGE_NS, + max_age: this.ttlSeconds * 1_000_000_000 + PURGE_STREAM_BUFFER_NS, discard: DiscardPolicy.Old, allow_msg_schedules: true, }) @@ -120,8 +120,7 @@ export class NatsPurgeScheduler { if (this.isAlreadyExistsError(err)) { await this.jsm.streams.update(config.name, config) } else if (err?.message?.includes('subjects overlap')) { - // Old streams from a previous code version have conflicting subjects. - // Delete them and retry — safe because these are transient job streams. + // Stale streams from a previous version — delete and retry console.warn('[Purge] Subject overlap detected — purging stale streams and retrying') await this.deleteStaleStreams(config.subjects) await this.jsm.streams.add(config) @@ -131,15 +130,17 @@ export class NatsPurgeScheduler { } } - private async deleteStaleStreams(subjects: string[]): Promise { + private async deleteStaleStreams(_subjects: string[]): Promise { if (!this.jsm) return const list = await this.jsm.streams.list().next() for (const stream of list) { - const hasOverlap = stream.config.subjects?.some((s: string) => - subjects.some((newS) => s === newS || s.endsWith('>') || newS.endsWith('>')), + if (stream.config.name === PURGE_STREAM) continue + // Only delete streams that explicitly claim purge.* subjects — never touch unrelated streams + const isPurgeStream = stream.config.subjects?.some( + (s: string) => s.startsWith('purge.schedule.') || s.startsWith('purge.execute.'), ) - if (hasOverlap && stream.config.name !== PURGE_STREAM) { - console.warn(`[Purge] Deleting stale stream: ${stream.config.name}`) + if (isPurgeStream) { + console.warn(`[Purge] Deleting stale purge stream: ${stream.config.name}`) await this.jsm.streams.delete(stream.config.name) } } @@ -169,15 +170,33 @@ export class NatsPurgeScheduler { for (const recordType of this.recordTypes) { const consumerName = PURGE_CONSUMER_NAMES[recordType] - const consumer = await this.js.consumers.get(PURGE_STREAM, consumerName) - const worker = new PurgeWorker(recordType, consumerName, webhookUrl) - agent.config.logger.info('[Purge] Starting worker', { recordType, consumerName }) + this.runWorkerWithRestart(agent, recordType, consumerName, webhookUrl) + } + } - worker.start(agent, consumer).catch((err: Error) => - agent.config.logger.error('[Purge] Worker crashed', { consumerName, error: err?.message }), - ) + private runWorkerWithRestart( + agent: Agent, + recordType: PurgeRecordType, + consumerName: string, + webhookUrl: string | undefined, + attempt = 0, + ): void { + if (!this.js) return + + const delayMs = Math.min(1000 * 2 ** attempt, 60_000) + + const launch = async () => { + const consumer = await this.js!.consumers.get(PURGE_STREAM, consumerName) + const worker = new PurgeWorker(recordType, consumerName, webhookUrl) + await worker.start(agent, consumer) } + + launch().catch((err: Error) => { + if (!this.nc) return // scheduler stopped — do not restart + agent.config.logger.error('[Purge] Worker crashed — restarting', { consumerName, attempt, delayMs, error: err?.message }) + setTimeout(() => this.runWorkerWithRestart(agent, recordType, consumerName, webhookUrl, attempt + 1), delayMs) + }) } private isAlreadyExistsError(err: any): boolean { From 49f8673144e6320bba8b1a34b554d7e60f8d74a1 Mon Sep 17 00:00:00 2001 From: Tipu_Singh Date: Mon, 27 Apr 2026 12:49:55 +0530 Subject: [PATCH 135/152] refactore: added logs for testing Signed-off-by: Tipu_Singh --- src/purge/PurgeWorker.ts | 9 +++++++++ src/purge/schedulers/CronPurgeScheduler.ts | 20 ++++++++++++++++++-- src/purge/schedulers/NatsPurgeScheduler.ts | 20 +++++++++++++++----- 3 files changed, 42 insertions(+), 7 deletions(-) diff --git a/src/purge/PurgeWorker.ts b/src/purge/PurgeWorker.ts index 90cee770..6ce2bcce 100644 --- a/src/purge/PurgeWorker.ts +++ b/src/purge/PurgeWorker.ts @@ -24,13 +24,16 @@ export class PurgeWorker { } async start(agent: Agent, consumer: Consumer): Promise { + console.log(`[Purge][Worker] Started — consumer=${this.consumerName} recordType=${this.recordType}`) agent.config.logger.info('[Purge] Worker started', { consumer: this.consumerName }) while (true) { const messages = await consumer.consume() + console.log(`[Purge][Worker] Consuming messages — consumer=${this.consumerName}`) for await (const msg of messages) { await this.processMessage(msg, agent) } + console.warn(`[Purge][Worker] Consume loop ended — restarting consumer=${this.consumerName}`) agent.config.logger.warn('[Purge] Consume loop ended — restarting', { consumer: this.consumerName }) } } @@ -60,6 +63,7 @@ export class PurgeWorker { return } + console.log(`[Purge][Worker] Job received — recordType=${recordType} recordId=${recordId} tenantId="${tenantId}" deliveryCount=${deliveryCount}`) logger.info('[Purge] Job received', { recordId, recordType, tenantId, deliveryCount }) try { @@ -71,6 +75,7 @@ export class PurgeWorker { await deletePurgeRecord(agent, this.recordType, recordId) } + console.log(`[Purge][Worker] Record deleted — recordType=${recordType} recordId=${recordId} tenantId="${tenantId}"`) logger.info('[Purge] Record deleted', { recordId, recordType, tenantId }) msg.ack() @@ -79,6 +84,7 @@ export class PurgeWorker { } } catch (err: any) { if (err instanceof RecordNotFoundError) { + console.warn(`[Purge][Worker] Record already absent — recordType=${recordType} recordId=${recordId}`) logger.warn('[Purge] Record already absent — treating as success', { recordId, recordType }) msg.ack() @@ -88,12 +94,15 @@ export class PurgeWorker { return } + console.warn(`[Purge][Worker] Job failed — recordType=${recordType} recordId=${recordId} deliveryCount=${deliveryCount}`, err?.message) logger.warn('[Purge] Job failed', { recordId, recordType, deliveryCount, error: err?.message }) if (deliveryCount >= PURGE_CONSUMER_MAX_DELIVER) { + console.error(`[Purge][Worker] Job dropped after max retries — recordType=${recordType} recordId=${recordId} tenantId="${tenantId}"`) logger.error('[Purge] Job dropped after max retries', { recordId, recordType, tenantId, deliveryCount }) msg.ack() } else { + console.log(`[Purge][Worker] Nacking job for retry — recordType=${recordType} recordId=${recordId} deliveryCount=${deliveryCount}`) msg.nak() } } diff --git a/src/purge/schedulers/CronPurgeScheduler.ts b/src/purge/schedulers/CronPurgeScheduler.ts index 9ae7319a..cd781116 100644 --- a/src/purge/schedulers/CronPurgeScheduler.ts +++ b/src/purge/schedulers/CronPurgeScheduler.ts @@ -18,16 +18,22 @@ export class CronPurgeScheduler { const { cronConfig } = config this.job = cron.schedule(cronConfig.cronSchedule, () => { + console.log(`[Purge][Cron] Tick fired — schedule="${cronConfig.cronSchedule}"`) if (this.isRunning) { + console.warn('[Purge][Cron] Scan still running — skipping this tick') agent.config.logger.warn('[Purge] Cron scan still running — skipping this tick') return } this.isRunning = true this.runScan(agent, config, webhookUrl) - .catch((err: Error) => agent.config.logger.error('[Purge] Cron scan error', { error: err?.message })) + .catch((err: Error) => { + console.error('[Purge][Cron] Scan error', err?.message) + agent.config.logger.error('[Purge] Cron scan error', { error: err?.message }) + }) .finally(() => { this.isRunning = false }) }) + console.log(`[Purge][Cron] Scheduler started — schedule="${cronConfig.cronSchedule}" ttlSeconds=${cronConfig.ttlSeconds} recordTypes=${cronConfig.recordTypes.join(', ')}`) agent.config.logger.info('[Purge] CronPurgeScheduler started', { cronSchedule: cronConfig.cronSchedule, ttlSeconds: cronConfig.ttlSeconds, @@ -44,6 +50,7 @@ export class CronPurgeScheduler { const logger = agent.config.logger const isShared = typeof (agent as any).modules?.tenants?.getAllTenants === 'function' + console.log(`[Purge][Cron] Scan started — agentMode=${isShared ? 'shared' : 'dedicated'}`) logger.info('[Purge] Cron scan started', { agentMode: isShared ? 'shared' : 'dedicated' }) let totalDeleted = 0 @@ -61,6 +68,7 @@ export class CronPurgeScheduler { }, ) } catch (err: any) { + console.error(`[Purge][Cron] Failed to scan tenant tenantId=${tenant.id}`, err?.message) logger.error('[Purge] Failed to scan tenant', { tenantId: tenant.id, error: err?.message }) } } @@ -68,6 +76,7 @@ export class CronPurgeScheduler { totalDeleted = await this.scanTenant(agent, '', config, webhookUrl) } + console.log(`[Purge][Cron] Scan completed — totalDeleted=${totalDeleted}`) logger.info('[Purge] Cron scan completed', { totalDeleted }) } @@ -83,13 +92,16 @@ export class CronPurgeScheduler { for (const recordType of cronConfig.recordTypes) { try { const expiredIds = await this.queryExpiredRecords(tenantAgent, recordType, cronConfig.ttlSeconds) + console.log(`[Purge][Cron] Queried expired records — recordType=${recordType} tenantId="${tenantId}" found=${expiredIds.length}`) for (const recordId of expiredIds) { + console.log(`[Purge][Cron] Deleting record — recordType=${recordType} recordId=${recordId} tenantId="${tenantId}"`) if (await this.deleteAndNotify(tenantAgent, recordId, recordType, tenantId, webhookUrl)) { deleted++ } } } catch (err: any) { + console.error(`[Purge][Cron] Error scanning recordType=${recordType} tenantId="${tenantId}"`, err?.message) tenantAgent.config.logger.error('[Purge] Error scanning record type', { tenantId, recordType, @@ -160,13 +172,16 @@ export class CronPurgeScheduler { try { await deletePurgeRecord(agent, recordType, recordId) + console.log(`[Purge][Cron] Record deleted — recordType=${recordType} recordId=${recordId} tenantId="${tenantId}"`) logger.info('[Purge] Record deleted by cron', { recordId, recordType, tenantId }) status = PurgeDeletionStatus.DELETED } catch (err: any) { if (err instanceof RecordNotFoundError) { + console.warn(`[Purge][Cron] Record already absent — recordType=${recordType} recordId=${recordId}`) logger.warn('[Purge] Record already absent — skipping', { recordId, recordType }) status = PurgeDeletionStatus.ALREADY_ABSENT } else { + console.error(`[Purge][Cron] Failed to delete record — recordType=${recordType} recordId=${recordId}`, err?.message) logger.error('[Purge] Failed to delete record', { recordId, recordType, error: err?.message }) return false } @@ -174,7 +189,8 @@ export class CronPurgeScheduler { if (webhookUrl) { await sendPurgeWebhook(webhookUrl, recordId, recordType, tenantId, status, logger) - } + + } return true } diff --git a/src/purge/schedulers/NatsPurgeScheduler.ts b/src/purge/schedulers/NatsPurgeScheduler.ts index bf632ddc..8e49c7ae 100644 --- a/src/purge/schedulers/NatsPurgeScheduler.ts +++ b/src/purge/schedulers/NatsPurgeScheduler.ts @@ -50,16 +50,22 @@ export class NatsPurgeScheduler { this.js = this.nc.jetstream() this.jsm = await this.nc.jetstreamManager() + console.log(`[Purge][NATS] Connected to NATS server(s): ${natsConfig.nats.servers}`) + console.log('[Purge][NATS] Provisioning streams...') agent.config.logger.info('[Purge] Provisioning NATS streams...') await this.provisionStreams() + console.log('[Purge][NATS] Streams ready') agent.config.logger.info('[Purge] NATS streams ready') + console.log('[Purge][NATS] Provisioning consumers...') agent.config.logger.info('[Purge] Provisioning NATS consumers...') await this.provisionConsumers() + console.log(`[Purge][NATS] Consumers ready — recordTypes=${this.recordTypes.join(', ')}`) agent.config.logger.info('[Purge] NATS consumers ready') await this.startWorkers(agent, webhookUrl) + console.log(`[Purge][NATS] Scheduler started — ttlSeconds=${this.ttlSeconds} recordTypes=${this.recordTypes.join(', ')}`) agent.config.logger.info('[Purge] NatsPurgeScheduler started', { ttlSeconds: this.ttlSeconds }) } @@ -170,6 +176,7 @@ export class NatsPurgeScheduler { for (const recordType of this.recordTypes) { const consumerName = PURGE_CONSUMER_NAMES[recordType] + console.log(`[Purge][NATS] Starting worker — recordType=${recordType} consumer=${consumerName}`) agent.config.logger.info('[Purge] Starting worker', { recordType, consumerName }) this.runWorkerWithRestart(agent, recordType, consumerName, webhookUrl) } @@ -192,11 +199,14 @@ export class NatsPurgeScheduler { await worker.start(agent, consumer) } - launch().catch((err: Error) => { - if (!this.nc) return // scheduler stopped — do not restart - agent.config.logger.error('[Purge] Worker crashed — restarting', { consumerName, attempt, delayMs, error: err?.message }) - setTimeout(() => this.runWorkerWithRestart(agent, recordType, consumerName, webhookUrl, attempt + 1), delayMs) - }) + launch() + .then(() => console.log(`[Purge][NATS] Worker launched — consumer=${consumerName}`)) + .catch((err: Error) => { + if (!this.nc) return // scheduler stopped — do not restart + console.error(`[Purge][NATS] Worker crashed — consumer=${consumerName} attempt=${attempt} retryIn=${delayMs}ms`, err?.message) + agent.config.logger.error('[Purge] Worker crashed — restarting', { consumerName, attempt, delayMs, error: err?.message }) + setTimeout(() => this.runWorkerWithRestart(agent, recordType, consumerName, webhookUrl, attempt + 1), delayMs) + }) } private isAlreadyExistsError(err: any): boolean { From b341168ee50c5db1595b2ff2f4d188e18699391a Mon Sep 17 00:00:00 2001 From: Tipu_Singh Date: Tue, 28 Apr 2026 13:18:20 +0530 Subject: [PATCH 136/152] feat: added NATS authentication Signed-off-by: Tipu_Singh --- src/purge/PurgeConfigValidator.ts | 13 ++++----- src/purge/PurgeTypes.ts | 6 +++++ src/purge/schedulers/NatsPurgeScheduler.ts | 9 +++---- src/utils/NatsAuthenticator.ts | 31 ++++++++++++++++++++++ 4 files changed, 48 insertions(+), 11 deletions(-) create mode 100644 src/utils/NatsAuthenticator.ts diff --git a/src/purge/PurgeConfigValidator.ts b/src/purge/PurgeConfigValidator.ts index 347cca06..b2f316bf 100644 --- a/src/purge/PurgeConfigValidator.ts +++ b/src/purge/PurgeConfigValidator.ts @@ -1,6 +1,7 @@ import { connect } from 'nats' -import type { PurgeConfig } from './PurgeTypes' +import { buildNatsAuthenticator } from '../utils/NatsAuthenticator' +import type { NatsConfig, PurgeConfig } from './PurgeTypes' export async function validatePurgeConfig(config: PurgeConfig): Promise { const { natsConfig, cronConfig } = config @@ -13,23 +14,23 @@ export async function validatePurgeConfig(config: PurgeConfig): Promise { } if (natsConfig.enabled) { - await verifyNatsJetStream(natsConfig.nats.servers, natsConfig.nats.credentialsFile) + await verifyNatsJetStream(natsConfig.nats) } } -async function verifyNatsJetStream(servers: string[], credentialsFile?: string): Promise { +async function verifyNatsJetStream(nats: NatsConfig): Promise { let nc: Awaited> | null = null try { nc = await connect({ - servers, - ...(credentialsFile ? { credentialsFile } : {}), + servers: nats.servers, + ...buildNatsAuthenticator(nats), timeout: 5000, maxReconnectAttempts: 0, }) } catch (err: any) { throw new Error( - `[Purge] PURGE_NATS_ENABLED=true but cannot connect to NATS at ${servers.join(', ')}: ${err?.message}`, + `[Purge] PURGE_NATS_ENABLED=true but cannot connect to NATS at ${nats.servers.join(', ')}: ${err?.message}`, ) } diff --git a/src/purge/PurgeTypes.ts b/src/purge/PurgeTypes.ts index 60c3a9e9..ee9c5a92 100644 --- a/src/purge/PurgeTypes.ts +++ b/src/purge/PurgeTypes.ts @@ -1,6 +1,9 @@ export interface NatsConfig { servers: string[] + nkeySeed?: string credentialsFile?: string + username?: string + password?: string } export type AgentMode = 'shared' | 'dedicated' @@ -54,7 +57,10 @@ export function buildPurgeConfig(): PurgeConfig | undefined { ttlSeconds: parseTtlSeconds(process.env.PURGE_NATS_TTL_SECONDS, 'PURGE_NATS_TTL_SECONDS'), nats: { servers: (process.env.NATS_SERVERS || 'nats://localhost:4222').split(',').map((s) => s.trim()).filter(Boolean), + nkeySeed: process.env.NATS_NKEY_SEED, credentialsFile: process.env.NATS_CREDENTIALS_FILE, + username: process.env.NATS_USER, + password: process.env.NATS_PASSWORD, }, recordTypes: buildPurgeRecordTypes(), }, diff --git a/src/purge/schedulers/NatsPurgeScheduler.ts b/src/purge/schedulers/NatsPurgeScheduler.ts index 8e49c7ae..609bd4bd 100644 --- a/src/purge/schedulers/NatsPurgeScheduler.ts +++ b/src/purge/schedulers/NatsPurgeScheduler.ts @@ -1,9 +1,9 @@ import type { Agent } from '@credo-ts/core' import type { JetStreamClient, JetStreamManager, NatsConnection } from 'nats' -import { readFileSync } from 'node:fs' +import { AckPolicy, DiscardPolicy, RetentionPolicy, StorageType, StringCodec, connect, headers } from 'nats' -import { AckPolicy, DiscardPolicy, RetentionPolicy, StorageType, StringCodec, connect, credsAuthenticator, headers } from 'nats' +import { buildNatsAuthenticator } from '../../utils/NatsAuthenticator' import { NATS_ERR_CONSUMER_ALREADY_EXISTS, @@ -41,9 +41,7 @@ export class NatsPurgeScheduler { this.nc = await connect({ servers: natsConfig.nats.servers, - ...(natsConfig.nats.credentialsFile - ? { authenticator: credsAuthenticator(readFileSync(natsConfig.nats.credentialsFile)) } - : {}), + ...buildNatsAuthenticator(natsConfig.nats), maxReconnectAttempts: NATS_MAX_RECONNECT_ATTEMPTS, reconnectTimeWait: NATS_RECONNECT_TIME_WAIT_MS, }) @@ -219,3 +217,4 @@ export class NatsPurgeScheduler { ) } } + diff --git a/src/utils/NatsAuthenticator.ts b/src/utils/NatsAuthenticator.ts new file mode 100644 index 00000000..a3420589 --- /dev/null +++ b/src/utils/NatsAuthenticator.ts @@ -0,0 +1,31 @@ +import { readFileSync } from 'node:fs' + +import type { Authenticator } from 'nats' +import { credsAuthenticator, nkeyAuthenticator, usernamePasswordAuthenticator } from 'nats' + +import type { NatsConfig } from '../purge/PurgeTypes' + +export type NatsAuthType = 'nkey' | 'creds' | 'usernamePassword' | 'none' + +export function buildNatsAuthenticator(nats: NatsConfig): { authenticator?: Authenticator } { + const authType = (process.env.NATS_AUTH_TYPE as NatsAuthType) || 'none' + + switch (authType) { + case 'nkey': + if (!nats.nkeySeed) throw new Error('[NATS] NATS_AUTH_TYPE=nkey but NATS_NKEY_SEED is not set') + return { authenticator: nkeyAuthenticator(new TextEncoder().encode(nats.nkeySeed)) } + + case 'creds': + if (!nats.credentialsFile) throw new Error('[NATS] NATS_AUTH_TYPE=creds but NATS_CREDENTIALS_FILE is not set') + return { authenticator: credsAuthenticator(readFileSync(nats.credentialsFile)) } + + case 'usernamePassword': + if (!nats.username || !nats.password) + throw new Error('[NATS] NATS_AUTH_TYPE=usernamePassword but NATS_USER or NATS_PASSWORD is not set') + return { authenticator: usernamePasswordAuthenticator(nats.username, nats.password) } + + case 'none': + default: + return {} + } +} From c8dab5536553a1a86f75e13ba0f050be55fdd944 Mon Sep 17 00:00:00 2001 From: Tipu_Singh Date: Tue, 28 Apr 2026 14:57:09 +0530 Subject: [PATCH 137/152] feat: updated demo and sample Signed-off-by: Tipu_Singh --- .env.demo | 29 +++++++++++++++++++++++++++++ .env.sample | 4 +++- 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/.env.demo b/.env.demo index 19ff4c20..2ca700db 100644 --- a/.env.demo +++ b/.env.demo @@ -94,3 +94,32 @@ UPDATE_JWT_SECRET=false STATUS_LIST_SERVER_URL=https://dev-status-list.sovio.id/ STATUS_LIST_API_KEY=test_key STATUS_LIST_DEFAULT_SIZE=131072 +# ─── Data Purge — Record Deletion ──────────────────────────────────────────── +# Automatically deletes credential/proof/session records after a configurable TTL. +# Two independent flows — enable one or both: +# Flow A (NATS): schedules deletion at offer-creation time via NATS JetStream +# Flow B (Cron): periodically scans DB and deletes records older than TTL + +PURGE_ENABLED=false +PURGE_WEBHOOK_ENABLED=false + +# ── Flow A: NATS (event-driven, requires NATS connection below) ─────────────── +PURGE_NATS_ENABLED=false +PURGE_NATS_TTL_SECONDS=2592000 + +# ── Flow B: Cron (DB scan, no NATS required) ────────────────────────────────── +PURGE_CRON_ENABLED=false +PURGE_CRON_TTL_SECONDS=2592000 +PURGE_CRON_SCHEDULE=0 * * * * + +# ── Optional: per-type record filtering (default: all 4 types) ──────────────── +# PURGE_DIDCOMM_CREDENTIAL=true +# PURGE_DIDCOMM_PROOF=true +# PURGE_OID4VC_ISSUANCE=true +# PURGE_OID4VC_VERIFICATION=true + +# ─── NATS Connection (required for Flow A) ──────────────────────────────────── +NATS_SERVERS=nats://localhost:4223 +# Auth type — one of: nkey | creds | usernamePassword | none +NATS_AUTH_TYPE=nkey +NATS_NKEY_SEED= diff --git a/.env.sample b/.env.sample index 8a348cdd..58389460 100644 --- a/.env.sample +++ b/.env.sample @@ -135,4 +135,6 @@ PURGE_CRON_SCHEDULE= # cron expression for scan frequency (e.g. 0 * # ─── NATS Connection (required for Flow A) ──────────────────────────────────── NATS_SERVERS= -NATS_CREDENTIALS_FILE= +# Auth type — one of: nkey | creds | usernamePassword | none +NATS_AUTH_TYPE= +NATS_NKEY_SEED= # required when NATS_AUTH_TYPE=nkey # required when NATS_AUTH_TYPE=usernamePassword From afb03c8e78396b29d0d83ba4cd48e15e61225af9 Mon Sep 17 00:00:00 2001 From: Krishna Waske Date: Thu, 16 Oct 2025 19:22:47 +0530 Subject: [PATCH 138/152] feat: add agent custom document loader (#321) * feat: add agent custom document loader Signed-off-by: Krishna Waske * fix: formatting Signed-off-by: Krishna Waske * fix: formatting Signed-off-by: Krishna Waske * feat: add appropriate warning for incorrect custom document loader initiation Signed-off-by: Krishna Waske * fix: formatting Signed-off-by: Krishna Waske * fix: formatting Signed-off-by: Krishna Waske * fix: error handling Signed-off-by: Krishna Waske * fix: formatting Signed-off-by: Krishna Waske * fix: formatting Signed-off-by: Krishna Waske * fix: coderabbit suggestions Signed-off-by: Krishna Waske * fix: reviewer suggestions Signed-off-by: Krishna Waske --------- Signed-off-by: Krishna Waske --- .env.demo | 17 +++++++++++++++++ .env.sample | 5 +++++ src/cliAgent.ts | 8 +++++++- 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/.env.demo b/.env.demo index 2ca700db..f33959ca 100644 --- a/.env.demo +++ b/.env.demo @@ -94,6 +94,23 @@ UPDATE_JWT_SECRET=false STATUS_LIST_SERVER_URL=https://dev-status-list.sovio.id/ STATUS_LIST_API_KEY=test_key STATUS_LIST_DEFAULT_SIZE=131072 +ENABLE_CUSTOM_DOCUMENT_LOADER=false +DEPRECATED_DOMAIN=https://schema.credebl.id +CURRENT_DOMAIN=https://schema.new-credebl.id + +BCOVRIN_TEST_GENESIS='{"reqSignature":{},"txn":{"data":{"data":{"alias":"Node1","blskey":"4N8aUNHSgjQVgkpm8nhNEfDf6txHznoYREg9kirmJrkivgL4oSEimFF6nsQ6M41QvhM2Z33nves5vfSn9n1UwNFJBYtWVnHYMATn76vLuL3zU88KyeAYcHfsih3He6UHcXDxcaecHVz6jhCYz1P2UZn2bDVruL5wXpehgBfBaLKm3Ba","blskey_pop":"RahHYiCvoNCtPTrVtP7nMC5eTYrsUA8WjXbdhNc8debh1agE9bGiJxWBXYNFbnJXoXhWFMvyqhqhRoq737YQemH5ik9oL7R4NTTCz2LEZhkgLJzB3QRQqJyBNyv7acbdHrAT8nQ9UkLbaVL9NBpnWXBTw4LEMePaSHEw66RzPNdAX1","client_ip":"138.197.138.255","client_port":9702,"node_ip":"138.197.138.255","node_port":9701,"services":["VALIDATOR"]},"dest":"Gw6pDLhcBcoQesN72qfotTgFa7cbuqZpkX3Xo6pLhPhv"},"metadata":{"from":"Th7MpTaRZVRYnPiabds81Y"},"type":"0"},"txnMetadata":{"seqNo":1,"txnId":"fea82e10e894419fe2bea7d96296a6d46f50f93f9eeda954ec461b2ed2950b62"},"ver":"1"} +{"reqSignature":{},"txn":{"data":{"data":{"alias":"Node2","blskey":"37rAPpXVoxzKhz7d9gkUe52XuXryuLXoM6P6LbWDB7LSbG62Lsb33sfG7zqS8TK1MXwuCHj1FKNzVpsnafmqLG1vXN88rt38mNFs9TENzm4QHdBzsvCuoBnPH7rpYYDo9DZNJePaDvRvqJKByCabubJz3XXKbEeshzpz4Ma5QYpJqjk","blskey_pop":"Qr658mWZ2YC8JXGXwMDQTzuZCWF7NK9EwxphGmcBvCh6ybUuLxbG65nsX4JvD4SPNtkJ2w9ug1yLTj6fgmuDg41TgECXjLCij3RMsV8CwewBVgVN67wsA45DFWvqvLtu4rjNnE9JbdFTc1Z4WCPA3Xan44K1HoHAq9EVeaRYs8zoF5","client_ip":"138.197.138.255","client_port":9704,"node_ip":"138.197.138.255","node_port":9703,"services":["VALIDATOR"]},"dest":"8ECVSk179mjsjKRLWiQtssMLgp6EPhWXtaYyStWPSGAb"},"metadata":{"from":"EbP4aYNeTHL6q385GuVpRV"},"type":"0"},"txnMetadata":{"seqNo":2,"txnId":"1ac8aece2a18ced660fef8694b61aac3af08ba875ce3026a160acbc3a3af35fc"},"ver":"1"} +{"reqSignature":{},"txn":{"data":{"data":{"alias":"Node3","blskey":"3WFpdbg7C5cnLYZwFZevJqhubkFALBfCBBok15GdrKMUhUjGsk3jV6QKj6MZgEubF7oqCafxNdkm7eswgA4sdKTRc82tLGzZBd6vNqU8dupzup6uYUf32KTHTPQbuUM8Yk4QFXjEf2Usu2TJcNkdgpyeUSX42u5LqdDDpNSWUK5deC5","blskey_pop":"QwDeb2CkNSx6r8QC8vGQK3GRv7Yndn84TGNijX8YXHPiagXajyfTjoR87rXUu4G4QLk2cF8NNyqWiYMus1623dELWwx57rLCFqGh7N4ZRbGDRP4fnVcaKg1BcUxQ866Ven4gw8y4N56S5HzxXNBZtLYmhGHvDtk6PFkFwCvxYrNYjh","client_ip":"138.197.138.255","client_port":9706,"node_ip":"138.197.138.255","node_port":9705,"services":["VALIDATOR"]},"dest":"DKVxG2fXXTU8yT5N7hGEbXB3dfdAnYv1JczDUHpmDxya"},"metadata":{"from":"4cU41vWW82ArfxJxHkzXPG"},"type":"0"},"txnMetadata":{"seqNo":3,"txnId":"7e9f355dffa78ed24668f0e0e369fd8c224076571c51e2ea8be5f26479edebe4"},"ver":"1"} +{"reqSignature":{},"txn":{"data":{"data":{"alias":"Node4","blskey":"2zN3bHM1m4rLz54MJHYSwvqzPchYp8jkHswveCLAEJVcX6Mm1wHQD1SkPYMzUDTZvWvhuE6VNAkK3KxVeEmsanSmvjVkReDeBEMxeDaayjcZjFGPydyey1qxBHmTvAnBKoPydvuTAqx5f7YNNRAdeLmUi99gERUU7TD8KfAa6MpQ9bw","blskey_pop":"RPLagxaR5xdimFzwmzYnz4ZhWtYQEj8iR5ZU53T2gitPCyCHQneUn2Huc4oeLd2B2HzkGnjAff4hWTJT6C7qHYB1Mv2wU5iHHGFWkhnTX9WsEAbunJCV2qcaXScKj4tTfvdDKfLiVuU2av6hbsMztirRze7LvYBkRHV3tGwyCptsrP","client_ip":"138.197.138.255","client_port":9708,"node_ip":"138.197.138.255","node_port":9707,"services":["VALIDATOR"]},"dest":"4PS3EDQ3dW1tci1Bp6543CfuuebjFrg36kLAUcskGfaA"},"metadata":{"from":"TWwCRQRZ2ZHMJFn9TzLp7W"},"type":"0"},"txnMetadata":{"seqNo":4,"txnId":"aa5e817d7cc626170eca175822029339a444eb0ee8f0bd20d3b0b76e566fb008"},"ver":"1"}' + +INDICIO_TEST_GENESIS='{"reqSignature":{},"txn":{"data":{"data":{"alias":"OpsNode","blskey":"4i39oJqm7fVX33gnYEbFdGurMtwYQJgDEYfXdYykpbJMWogByocaXxKbuXdrg3k9LP33Tamq64gUwnm4oA7FkxqJ5h4WfKH6qyVLvmBu5HgeV8Rm1GJ33mKX6LWPbm1XE9TfzpQXJegKyxHQN9ABquyBVAsfC6NSM4J5t1QGraJBfZi","blskey_pop":"Qq3CzhSfugsCJotxSCRAnPjmNDJidDz7Ra8e4xvLTEzQ5w3ppGray9KynbGPH8T7XnUTU1ioZadTbjXaRY26xd4hQ3DxAyR4GqBymBn3UBomLRJHmj7ukcdJf9WE6tu1Fp1EhxmyaMqHv13KkDrDfCthgd2JjAWvSgMGWwAAzXEow5","client_ip":"13.58.197.208","client_port":"9702","node_ip":"3.135.134.42","node_port":"9701","services":["VALIDATOR"]},"dest":"EVwxHoKXUy2rnRzVdVKnJGWFviamxMwLvUso7KMjjQNH"},"metadata":{"from":"Pms5AZzgPWHSj6nNmJDfmo"},"type":"0"},"txnMetadata":{"seqNo":1,"txnId":"77ad6682f320be9969f70a37d712344afed8e3fba8d43fa5602c81b578d26088"},"ver":"1"} +{"reqSignature":{},"txn":{"data":{"data":{"alias":"cynjanode","blskey":"32DLSweyJRxVMcVKGjUeNkVF1fwyFfRcFqGU9x7qL2ox2STpF6VxZkbxoLkGMPnt3gywRaY6jAjqgC8XMkf3webMJ4SEViPtBKZJjCCFTf4tGXfEsMwinummaPja85GgTALf7DddCNyCojmkXWHpgjrLx3626Z2MiNxVbaMapG2taFX","blskey_pop":"RQRU8GVYSYZeu9dfH6myhzZ2qfxeVpCL3bTzgto1bRbx3QCt3mFFQQBVbgrqui2JpXhcWXxoDzp1WyYbSZwYqYQbRmvK7PPG82VAvVagv1n83Qa3cdyGwCevZdEzxuETiiXBRWSPfb4JibAXPKkLZHyQHWCEHcAEVeXtx7FRS1wjTd","client_ip":"3.17.103.221","client_port":"9702","node_ip":"3.17.215.226","node_port":"9701","services":["VALIDATOR"]},"dest":"iTq944JTtwHnst7rucfsRA4m26x9i6zCKKohETBCiWu"},"metadata":{"from":"QC174PGaL4zA9YHYqofPH2"},"type":"0"},"txnMetadata":{"seqNo":2,"txnId":"ce7361e44ec10a275899ece1574f6e38f2f3c7530c179fa07a2924e55775759b"},"ver":"1"} +{"reqSignature":{},"txn":{"data":{"data":{"alias":"GlobaliD","blskey":"4Behdr1KJfLTAPNospghtL7iWdCHca6MZDxAtzYNXq35QCUr4aqpLu6p4Sgu9wNbTACB3DbwmVgE2L7hX6UsasuvZautqUpf4nC5viFpH7X6mHyqLreBJTBH52tSwifQhRjuFAySbbfyRK3wb6R2Emxun9GY7MFNuy792LXYg4C6sRJ","blskey_pop":"RKYDRy8oTxKnyAV3HocapavH2jkw3PVe54JcEekxXz813DFbEy87N3i3BNqwHB7MH93qhtTRb7EZMaEiYhm92uaLKyubUMo5Rqjve2jbEdYEYVRmgNJWpxFKCmUBa5JwBWYuGunLMZZUTU3qjbdDXkJ9UNMQxDULCPU5gzLTy1B5kb","client_ip":"13.56.175.126","client_port":"9702","node_ip":"50.18.84.131","node_port":"9701","services":["VALIDATOR"]},"dest":"2ErWxamsNGBfhkFnwYgs4UW4aApct1kHUvu7jbkA1xX4"},"metadata":{"from":"4H8us7B1paLW9teANv8nam"},"type":"0"},"txnMetadata":{"seqNo":3,"txnId":"0c3b33b77e0419d6883be35d14b389c3936712c38a469ac5320a3cae68be1293"},"ver":"1"} +{"reqSignature":{},"txn":{"data":{"data":{"alias":"IdRamp","blskey":"LoYzqUMPDZEfRshwGSzkgATxcM5FAS1LYx896zHnMfXP7duDsCQ6CBG2akBkZzgH3tBMvnjhs2z7PFc2gFeaKUF9fKDHhtbVqPofxH3ebcRfA959qU9mgvmkUwMUgwd21puRU6BebUwBiYxMxcE5ChReBnAkdAv19gVorm3prBMk94","blskey_pop":"R1DjpsG7UxgwstuF7WDUL17a9Qq64vCozwJZ88bTrSDPwC1cdRn3WmhqJw5LpEhFQJosDSVVT6tS8dAZrrssRv2YsELbfGEJ7ZGjhNjZHwhqg4qeustZ7PZZE3Vr1ALSHY4Aa6KpNzGodxu1XymYZWXAFokPAs3Kho8mKcJwLCHn3h","client_ip":"207.126.128.12","client_port":"9702","node_ip":"207.126.129.12","node_port":"9701","services":["VALIDATOR"]},"dest":"5Zj5Aec6Kt9ki1runrXu87wZ522mnm3zwmaoHLUcHLx9"},"metadata":{"from":"AFLDFPoJuDQUHqnfmg8U7i"},"type":"0"},"txnMetadata":{"seqNo":4,"txnId":"c9df105558333ac8016610d9da5aad1e9a5dd50b9d9cc5684e94f439fa10f836"},"ver":"1"} +{"reqSignature":{},"txn":{"data":{"data":{"alias":"idlab-node01","blskey":"2fjJVi33U1tCTjW77cJaf1NLz7EzWkVNzR9BEQpVVK64MJpRKNUzt6k7Td2U8yqU5hGyAFH5N7ZymSB55TnpC3rJYLVTcGXZeXpmrQx3mwnXNyfTDnxfTpdQ1KMoFeZoDPZ8acfaH8GWeW2jL1qREE52tetBf4tXTeshmWzGkEN7r4y","blskey_pop":"RSjiM6dYUmN2rv2ca7dUCmEKrivq12rhxhXUKHdmSwUxbCmcijsgoERjYG7MqxhKLjSAJ5715K23fVEc6uK1kTenKmYCcCts8MLMAQG8Upb22nfgHJ3py8RwRoACeAjFF3myAMNRJJPhUdv96drJdwkGRv7f6JjvoB5KWVQYTNgheP","client_ip":"205.159.92.17","client_port":"9702","node_ip":"205.159.92.16","node_port":"9701","services":["VALIDATOR"]},"dest":"8czYgwmLDazVrBHuo53Tyx7Tw8ZhvnoC2BfhQGir4r8F"},"metadata":{"from":"PN8wFxLKjdkwyxoEEXwyz2"},"type":"0"},"txnMetadata":{"seqNo":5,"txnId":"9237eca7d2a203f6e1779f63064d2f22cf28e1bcd4e6fe5d791b15e82969acdc"},"ver":"1"} +{"reqSignature":{},"txn":{"data":{"data":{"alias":"lorica-identity-node1","blskey":"wUh24sVCQ8PHDgSb343g2eLxjD5vwxsrETfuV2sbwMNnYon9nhbaK5jcWTekvXtyiwxHxuiCCoZwKS97MQEAeC2oLbbMeKjYm212QwSnm7aKLEqTStXht35VqZvZLT7Q3mPQRYLjMGixdn4ocNHrBTMwPUQYycEqwaHWgE1ncDueXY","blskey_pop":"R2sMwF7UW6AaD4ALa1uB1YVPuP6JsdJ7LsUoViM9oySFqFt34C1x1tdHDysS9wwruzaaEFui6xNPqJ8eu3UBqcFKkoWhdsMqCALwe63ytxPwvtLtCffJLhHAcgrPC7DorXYdqhdG2cevdqc5oqFEAaKoFDBf12p5SsbbM4PYWCmVCb","client_ip":"35.225.220.151","client_port":"9702","node_ip":"35.224.26.110","node_port":"9701","services":["VALIDATOR"]},"dest":"k74ZsZuUaJEcB8RRxMwkCwdE5g1r9yzA3nx41qvYqYf"},"metadata":{"from":"Ex6hzsJFYzNJ7kzbfncNeU"},"type":"0"},"txnMetadata":{"seqNo":6,"txnId":"6880673ce4ae4a2352f103d2a6ae20469dd070f2027283a1da5e62a64a59d688"},"ver":"1"} +{"reqSignature":{},"txn":{"data":{"data":{"alias":"cysecure-itn","blskey":"GdCvMLkkBYevRFi93b6qaj9G2u1W6Vnbg8QhRD1chhrWR8vRE8x9x7KXVeUBPFf6yW5qq2JCfA2frc8SGni2RwjtTagezfwAwnorLhVJqS5ZxTi4pgcw6smebnt4zWVhTkh6ugDHEypHwNQBcw5WhBZcEJKgNbyVLnHok9ob6cfr3u","blskey_pop":"RbH9mY7M5p3UB3oj4sT1skYwMkxjoUnja8eTYfcm83VcNbxC9zR9pCiRhk4q1dJT3wkDBPGNKnk2p83vaJYLcgMuJtzoWoJAWAxjb3Mcq8Agf6cgQpBuzBq2uCzFPuQCAhDS4Kv9iwA6FsRnfvoeFTs1hhgSJVxQzDWMVTVAD9uCqu","client_ip":"35.169.19.171","client_port":"9702","node_ip":"54.225.56.21","node_port":"9701","services":["VALIDATOR"]},"dest":"4ETBDmHzx8iDQB6Xygmo9nNXtMgq9f6hxGArNhQ6Hh3u"},"metadata":{"from":"uSXXXEdBicPHMMhr3ddNF"},"type":"0"},"txnMetadata":{"seqNo":7,"txnId":"3c21718b07806b2f193b35953dda5b68b288efd551dce4467ce890703d5ba549"},"ver":"1"}' + # ─── Data Purge — Record Deletion ──────────────────────────────────────────── # Automatically deletes credential/proof/session records after a configurable TTL. # Two independent flows — enable one or both: diff --git a/.env.sample b/.env.sample index 58389460..c79ee8ed 100644 --- a/.env.sample +++ b/.env.sample @@ -92,6 +92,11 @@ UPDATE_JWT_SECRET=false STATUS_LIST_SERVER_URL=https://dev-status-list.sovio.id/ STATUS_LIST_API_KEY=test_key STATUS_LIST_DEFAULT_SIZE=131072 +# Boolean: If we want to enable custom document loader +ENABLE_CUSTOM_DOCUMENT_LOADER=false +# If custom document loader is enabled, add the deprecated domain-url and the current/latest domain url +DEPRECATED_DOMAIN= +CURRENT_DOMAIN= # Specify Bcovrin test genesis BCOVRIN_TEST_GENESIS=`{"reqSignature":{},"txn":{"data":{"data":{"alias":"Node1","blskey":"4N8aUNHSgjQVgkpm8nhNEfDf6txHznoYREg9kirmJrkivgL4oSEimFF6nsQ6M41QvhM2Z33nves5vfSn9n1UwNFJBYtWVnHYMATn76vLuL3zU88KyeAYcHfsih3He6UHcXDxcaecHVz6jhCYz1P2UZn2bDVruL5wXpehgBfBaLKm3Ba","blskey_pop":"RahHYiCvoNCtPTrVtP7nMC5eTYrsUA8WjXbdhNc8debh1agE9bGiJxWBXYNFbnJXoXhWFMvyqhqhRoq737YQemH5ik9oL7R4NTTCz2LEZhkgLJzB3QRQqJyBNyv7acbdHrAT8nQ9UkLbaVL9NBpnWXBTw4LEMePaSHEw66RzPNdAX1","client_ip":"138.197.138.255","client_port":9702,"node_ip":"138.197.138.255","node_port":9701,"services":["VALIDATOR"]},"dest":"Gw6pDLhcBcoQesN72qfotTgFa7cbuqZpkX3Xo6pLhPhv"},"metadata":{"from":"Th7MpTaRZVRYnPiabds81Y"},"type":"0"},"txnMetadata":{"seqNo":1,"txnId":"fea82e10e894419fe2bea7d96296a6d46f50f93f9eeda954ec461b2ed2950b62"},"ver":"1"} {"reqSignature":{},"txn":{"data":{"data":{"alias":"Node2","blskey":"37rAPpXVoxzKhz7d9gkUe52XuXryuLXoM6P6LbWDB7LSbG62Lsb33sfG7zqS8TK1MXwuCHj1FKNzVpsnafmqLG1vXN88rt38mNFs9TENzm4QHdBzsvCuoBnPH7rpYYDo9DZNJePaDvRvqJKByCabubJz3XXKbEeshzpz4Ma5QYpJqjk","blskey_pop":"Qr658mWZ2YC8JXGXwMDQTzuZCWF7NK9EwxphGmcBvCh6ybUuLxbG65nsX4JvD4SPNtkJ2w9ug1yLTj6fgmuDg41TgECXjLCij3RMsV8CwewBVgVN67wsA45DFWvqvLtu4rjNnE9JbdFTc1Z4WCPA3Xan44K1HoHAq9EVeaRYs8zoF5","client_ip":"138.197.138.255","client_port":9704,"node_ip":"138.197.138.255","node_port":9703,"services":["VALIDATOR"]},"dest":"8ECVSk179mjsjKRLWiQtssMLgp6EPhWXtaYyStWPSGAb"},"metadata":{"from":"EbP4aYNeTHL6q385GuVpRV"},"type":"0"},"txnMetadata":{"seqNo":2,"txnId":"1ac8aece2a18ced660fef8694b61aac3af08ba875ce3026a160acbc3a3af35fc"},"ver":"1"} diff --git a/src/cliAgent.ts b/src/cliAgent.ts index f06237e9..9910a3cc 100644 --- a/src/cliAgent.ts +++ b/src/cliAgent.ts @@ -69,6 +69,8 @@ import { setupServer } from './server' import { buildPurgeConfig } from './purge/PurgeTypes' import { validatePurgeConfig } from './purge/PurgeConfigValidator' import { initPurgeSchedulers, stopPurgeSchedulers, getNatsPurgeScheduler, getCronPurgeScheduler } from './purge/PurgeSchedulerFactory' +import { isCustomDocumentLoaderEnabled } from './utils/config' +import { CustomDocumentLoader } from './utils/customDocumentLoader' import { generateSecretKey } from './utils/helpers' import { TsLogger } from './utils/logger' import { @@ -207,7 +209,11 @@ const getModules = ( registries: [new IndyVdrAnonCredsRegistry()], anoncreds, }), - w3cCredentials: new W3cCredentialsModule(), + w3cCredentials: isCustomDocumentLoaderEnabled() + ? new W3cCredentialsModule() + : new W3cCredentialsModule({ + documentLoader: CustomDocumentLoader, + }), didcomm: new DidCommModule({ processDidCommMessagesConcurrently: true, mediationRecipient: true, From ebaecb99f939d28aaa04fb7421a9eec8a831557c Mon Sep 17 00:00:00 2001 From: Tipu_Singh Date: Wed, 29 Apr 2026 16:17:13 +0530 Subject: [PATCH 139/152] refactor: docmentLoader changes Signed-off-by: Tipu_Singh --- ...sion string type-import esm-export interface.patch | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/patches/@credo-ts+core+0.6.2+001+fix: change version string type-import esm-export interface.patch b/patches/@credo-ts+core+0.6.2+001+fix: change version string type-import esm-export interface.patch index 276af6b3..43913eb7 100644 --- a/patches/@credo-ts+core+0.6.2+001+fix: change version string type-import esm-export interface.patch +++ b/patches/@credo-ts+core+0.6.2+001+fix: change version string type-import esm-export interface.patch @@ -11,6 +11,17 @@ index 5a311c1..4d640d0 100644 contextUrl?: string | null; documentUrl: string; document: Record; +diff --git a/node_modules/@credo-ts/core/build/modules/vc/data-integrity/libraries/documentLoader.d.mts b/node_modules/@credo-ts/core/build/modules/vc/data-integrity/libraries/documentLoader.d.mts +index 195af1d..30d1638 100644 +--- a/node_modules/@credo-ts/core/build/modules/vc/data-integrity/libraries/documentLoader.d.mts ++++ b/node_modules/@credo-ts/core/build/modules/vc/data-integrity/libraries/documentLoader.d.mts +@@ -5,4 +5,5 @@ import { AgentContext } from "../../../../agent/context/AgentContext.mjs"; + type DocumentLoaderWithContext = (agentContext: AgentContext) => DocumentLoader; + //#endregion + export { DocumentLoaderWithContext }; ++export declare function defaultDocumentLoader(agentContext: AgentContext): DocumentLoader; + //# sourceMappingURL=documentLoader.d.mts.map +\ No newline at end of file diff --git a/node_modules/@credo-ts/core/build/modules/vc/data-integrity/libraries/nativeDocumentLoader.mjs b/node_modules/@credo-ts/core/build/modules/vc/data-integrity/libraries/nativeDocumentLoader.mjs index 49ee03f..aa7e43a 100644 --- a/node_modules/@credo-ts/core/build/modules/vc/data-integrity/libraries/nativeDocumentLoader.mjs From 47f4840c4faa9237b32eaa455f0f82d73f5ace4b Mon Sep 17 00:00:00 2001 From: Tipu_Singh Date: Wed, 29 Apr 2026 16:18:17 +0530 Subject: [PATCH 140/152] refactor: commented the label Signed-off-by: Tipu_Singh --- src/utils/customDocumentLoader.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/utils/customDocumentLoader.ts b/src/utils/customDocumentLoader.ts index c31a15f9..9d0d4cef 100644 --- a/src/utils/customDocumentLoader.ts +++ b/src/utils/customDocumentLoader.ts @@ -1,16 +1,16 @@ import type { AgentContext, DocumentLoader } from '@credo-ts/core' -import type { DocumentLoaderResult } from '@credo-ts/core/build/modules/vc/data-integrity/jsonldUtil' +import type { DocumentLoaderResult } from '@credo-ts/core/build/modules/vc/data-integrity/jsonldUtil.mjs' import { CredoError } from '@credo-ts/core' -import { defaultDocumentLoader } from '@credo-ts/core/build/modules/vc/data-integrity/libraries/documentLoader' +import { defaultDocumentLoader } from '@credo-ts/core/build/modules/vc/data-integrity/libraries/documentLoader.mjs' /** * Check if URL belongs to CREDEBL schema domain */ function isW3CDeprecatedUrl(url: string, agentContext: AgentContext): boolean { - agentContext.config.logger.debug( - `Checking if w3c url(${url}) contains deprecated domain for agent: ${agentContext.config.label}`, - ) + // agentContext.config.logger.debug( + // `Checking if w3c url(${url}) contains deprecated domain for agent: ${agentContext.config.label}`, + // ) return url.startsWith(process.env.DEPRECATED_DOMAIN!) } @@ -32,9 +32,9 @@ export const CustomDocumentLoader = (agentContext: AgentContext): DocumentLoader try { // Intercept credebl schemas if (isW3CDeprecatedUrl(url, agentContext)) { - agentContext.config.logger.debug( - `Found w3c url(${url}) containing deprecated domain for agent: ${agentContext.config.label}`, - ) + // agentContext.config.logger.debug( + // `Found w3c url(${url}) containing deprecated domain for agent: ${agentContext.config.label}`, + // ) url = replaceUrl(url, agentContext) } From 4a5740a5f1a934781b2658a3014ce346a01fbf07 Mon Sep 17 00:00:00 2001 From: Tipu_Singh Date: Wed, 29 Apr 2026 17:19:49 +0530 Subject: [PATCH 141/152] fix: import issue for document loader Signed-off-by: Tipu_Singh --- ...string type-import esm-export interface.patch | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/patches/@credo-ts+core+0.6.2+001+fix: change version string type-import esm-export interface.patch b/patches/@credo-ts+core+0.6.2+001+fix: change version string type-import esm-export interface.patch index 43913eb7..b06a3e00 100644 --- a/patches/@credo-ts+core+0.6.2+001+fix: change version string type-import esm-export interface.patch +++ b/patches/@credo-ts+core+0.6.2+001+fix: change version string type-import esm-export interface.patch @@ -71,3 +71,19 @@ index 19457ed..5fb595f 100644 \ No newline at end of file +{"version":3,"file":"version.mjs","names":[],"sources":["../../src/utils/version.ts"],"sourcesContent":["export function parseVersionString(version: VersionString): Version {\n const [major, minor, patch] = version.split('.')\n\n return [Number(major), Number(minor), Number(patch ?? '0')]\n}\n\nexport function isFirstVersionHigherThanSecond(first: Version, second: Version) {\n return (\n first[0] > second[0] ||\n (first[0] === second[0] && first[1] > second[1]) ||\n (first[0] === second[0] && first[1] === second[1] && first[2] > second[2])\n )\n}\n\nexport function isFirstVersionEqualToSecond(first: Version, second: Version) {\n return first[0] === second[0] && first[1] === second[1] && first[2] === second[2]\n}\n\nexport type VersionString = string\nexport type MajorVersion = number\nexport type MinorVersion = number\nexport type PatchVersion = number\nexport type Version = [MajorVersion, MinorVersion, PatchVersion]\n"],"mappings":";;;AAAA,SAAgB,mBAAmB,SAAiC;CAClE,MAAM,CAAC,OAAO,OAAO,SAAS,QAAQ,MAAM,IAAI;AAEhD,QAAO;EAAC,OAAO,MAAM;EAAE,OAAO,MAAM;EAAE,OAAO,SAAS,IAAI;EAAC;;AAG7D,SAAgB,+BAA+B,OAAgB,QAAiB;AAC9E,QACE,MAAM,KAAK,OAAO,MACjB,MAAM,OAAO,OAAO,MAAM,MAAM,KAAK,OAAO,MAC5C,MAAM,OAAO,OAAO,MAAM,MAAM,OAAO,OAAO,MAAM,MAAM,KAAK,OAAO;;AAI3E,SAAgB,4BAA4B,OAAgB,QAAiB;AAC3E,QAAO,MAAM,OAAO,OAAO,MAAM,MAAM,OAAO,OAAO,MAAM,MAAM,OAAO,OAAO"} \ No newline at end of file +diff --git a/node_modules/@credo-ts/core/package.json b/node_modules/@credo-ts/core/package.json +index 8198ea2..5d23e62 100644 +--- a/node_modules/@credo-ts/core/package.json ++++ b/node_modules/@credo-ts/core/package.json +@@ -7,6 +7,11 @@ + "import": "./build/modules/kms/index.mjs", + "require": "./build/modules/kms/index.mjs", + "types": "./build/modules/kms/index.d.mts" ++ }, ++ "./build/modules/vc/data-integrity/libraries/documentLoader.mjs": { ++ "import": "./build/modules/vc/data-integrity/libraries/documentLoader.mjs", ++ "require": "./build/modules/vc/data-integrity/libraries/documentLoader.mjs", ++ "types": "./build/modules/vc/data-integrity/libraries/documentLoader.d.mts" + } + }, + "version": "0.6.2", From 597987b8327de358f73dd98b015a5302091751aa Mon Sep 17 00:00:00 2001 From: Tipu_Singh Date: Wed, 29 Apr 2026 18:51:43 +0530 Subject: [PATCH 142/152] refactor: resolved merge conflicts Signed-off-by: Tipu_Singh --- src/cli.ts | 13 +------------ src/cliAgent.ts | 21 +-------------------- src/routes/routes.ts | 2 +- src/routes/swagger.json | 8 +------- 4 files changed, 4 insertions(+), 40 deletions(-) diff --git a/src/cli.ts b/src/cli.ts index 9e5c13e3..e8285a55 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -48,10 +48,6 @@ interface Parsed { fileServerToken?: string apiKey?: string updateJwtSecret?: boolean - 'status-list-server-url'?: string - 'status-list-api-key'?: string - 'status-list-default-size'?: number - retention?: RetentionConfig } interface InboundTransport { @@ -172,9 +168,6 @@ async function parseArguments(): Promise { boolean: true, default: process.env.UPDATE_JWT_SECRET === 'true', }) - .option('status-list-server-url', { string: true, default: process.env.STATUS_LIST_SERVER_URL }) - .option('status-list-api-key', { string: true, default: process.env.STATUS_LIST_API_KEY }) - .option('status-list-default-size', { number: true, default: process.env.STATUS_LIST_DEFAULT_SIZE ? Number(process.env.STATUS_LIST_DEFAULT_SIZE) : undefined }) .config() .env('AFJ_REST') .parseAsync() as Promise @@ -223,9 +216,5 @@ export async function runCliServer() { fileServerToken: parsed.fileServerToken, apiKey: parsed['apiKey'], updateJwtSecret: parsed['updateJwtSecret'], - statusListServerUrl: parsed['status-list-server-url'], - statusListApiKey: parsed['status-list-api-key'], - statusListDefaultSize: parsed['status-list-default-size'], - retention: parsed.retention, } as AriesRestConfig) -} +} \ No newline at end of file diff --git a/src/cliAgent.ts b/src/cliAgent.ts index 9910a3cc..f6425d7c 100644 --- a/src/cliAgent.ts +++ b/src/cliAgent.ts @@ -127,10 +127,6 @@ export interface AriesRestConfig { schemaFileServerURL?: string apiKey: string updateJwtSecret?: boolean - statusListServerUrl?: string - statusListApiKey?: string - statusListDefaultSize?: number - retention?: RetentionConfig } export async function readRestConfig(path: string) { @@ -396,24 +392,9 @@ export async function runRestAgent(restConfig: AriesRestConfig) { walletScheme, apiKey, updateJwtSecret, - statusListServerUrl, - statusListApiKey, - statusListDefaultSize, ...afjConfig } = restConfig - if (statusListServerUrl) { - process.env.STATUS_LIST_SERVER_URL = statusListServerUrl - } else { - throw new Error('statusListServerUrl is required in the configuration') - } - if (statusListApiKey) { - process.env.STATUS_LIST_API_KEY = statusListApiKey - } - if (statusListDefaultSize) { - process.env.STATUS_LIST_DEFAULT_SIZE = String(statusListDefaultSize) - } - const logger = new TsLogger(logLevel ?? LogLevel.error) const agentConfig: InitConfig = { @@ -615,4 +596,4 @@ export async function runRestAgent(restConfig: AriesRestConfig) { process.on('SIGTERM', shutdown) process.on('SIGINT', shutdown) -} +} \ No newline at end of file diff --git a/src/routes/routes.ts b/src/routes/routes.ts index 7c1d7e96..3285a6ec 100644 --- a/src/routes/routes.ts +++ b/src/routes/routes.ts @@ -950,7 +950,7 @@ const models: TsoaRoute.Models = { "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"}}}, + "preAuthorizedCodeFlowConfig": {"dataType":"nestedObjectLiteral","nestedProperties":{"authorizationServerUrl":{"dataType":"string"},"txCode":{"dataType":"nestedObjectLiteral","nestedProperties":{"input_mode":{"dataType":"union","subSchemas":[{"dataType":"enum","enums":["numeric"]},{"dataType":"enum","enums":["text"]}]},"length":{"dataType":"double"},"description":{"dataType":"string"}}}}}, "issuanceMetadata": {"ref":"Record_string.unknown_"}, "statusListDetails": {"dataType":"nestedObjectLiteral","nestedProperties":{"listSize":{"dataType":"double"},"index":{"dataType":"double","required":true},"listId":{"dataType":"string","required":true}}}, "isRevocable": {"dataType":"boolean"}, diff --git a/src/routes/swagger.json b/src/routes/swagger.json index cd877124..4fceed67 100644 --- a/src/routes/swagger.json +++ b/src/routes/swagger.json @@ -2211,14 +2211,8 @@ } }, "type": "object" - }, - "preAuthorizedCode": { - "type": "string" } }, - "required": [ - "authorizationServerUrl" - ], "type": "object" }, "issuanceMetadata": { @@ -5264,7 +5258,7 @@ }, "info": { "title": "credo-controller", - "version": "2.0.0", + "version": "2.1.3", "description": "Rest endpoint wrapper for using your agent over HTTP", "license": { "name": "Apache-2.0" From 169a64f503fdeb3f8aea6d837dbf796e6dbb42a4 Mon Sep 17 00:00:00 2001 From: Tipu_Singh Date: Wed, 29 Apr 2026 18:57:53 +0530 Subject: [PATCH 143/152] fix: dco commit Signed-off-by: Tipu_Singh --- src/cliAgent.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/cliAgent.ts b/src/cliAgent.ts index f6425d7c..68ca7290 100644 --- a/src/cliAgent.ts +++ b/src/cliAgent.ts @@ -587,6 +587,7 @@ export async function runRestAgent(restConfig: AriesRestConfig) { logger.info(`Successfully started server on port ${adminPort}`) }) + // Graceful shutdown const shutdown = async () => { agent.config.logger.info('[Shutdown] Stopping services...') From 9655d5d55650b8705579843ded9d778851e79536 Mon Sep 17 00:00:00 2001 From: Tipu_Singh Date: Wed, 29 Apr 2026 19:03:23 +0530 Subject: [PATCH 144/152] Third-Party DCO Remediation Commit for Deepak Nemade On behalf of Deepak Nemade , I, Tipu_Singh , hereby add my Signed-off-by to this commit: bcbc82e79aee654e195465c84ea087f094c4a9dd Signed-off-by: Tipu_Singh --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index caf31b2d..39f43417 100644 --- a/README.md +++ b/README.md @@ -80,6 +80,7 @@ npx -p @aries-framework/rest afj-rest start \ --inbound-transport http 5000 ``` + **Configuration** To find out all available configuration options from the CLI, you can run the CLI command with `--help`. This will print a full list of all available options. From bd177e7297f9b03823d58b4f8880909c9c1d77a4 Mon Sep 17 00:00:00 2001 From: Tipu_Singh Date: Mon, 4 May 2026 11:50:57 +0530 Subject: [PATCH 145/152] fix: resolved code rabbit issue Signed-off-by: Tipu_Singh --- ...ing type-import esm-export interface.patch | 27 ------------------- ...02+fix: export defaultDocumentLoader.patch | 27 +++++++++++++++++++ src/cliAgent.ts | 2 -- src/controllers/x509/x509.service.ts | 6 ----- src/events/WebSocketEvents.ts | 2 +- src/utils/agent.ts | 5 ++-- 6 files changed, 30 insertions(+), 39 deletions(-) create mode 100644 patches/@credo-ts+core+0.6.2+002+fix: export defaultDocumentLoader.patch diff --git a/patches/@credo-ts+core+0.6.2+001+fix: change version string type-import esm-export interface.patch b/patches/@credo-ts+core+0.6.2+001+fix: change version string type-import esm-export interface.patch index b06a3e00..276af6b3 100644 --- a/patches/@credo-ts+core+0.6.2+001+fix: change version string type-import esm-export interface.patch +++ b/patches/@credo-ts+core+0.6.2+001+fix: change version string type-import esm-export interface.patch @@ -11,17 +11,6 @@ index 5a311c1..4d640d0 100644 contextUrl?: string | null; documentUrl: string; document: Record; -diff --git a/node_modules/@credo-ts/core/build/modules/vc/data-integrity/libraries/documentLoader.d.mts b/node_modules/@credo-ts/core/build/modules/vc/data-integrity/libraries/documentLoader.d.mts -index 195af1d..30d1638 100644 ---- a/node_modules/@credo-ts/core/build/modules/vc/data-integrity/libraries/documentLoader.d.mts -+++ b/node_modules/@credo-ts/core/build/modules/vc/data-integrity/libraries/documentLoader.d.mts -@@ -5,4 +5,5 @@ import { AgentContext } from "../../../../agent/context/AgentContext.mjs"; - type DocumentLoaderWithContext = (agentContext: AgentContext) => DocumentLoader; - //#endregion - export { DocumentLoaderWithContext }; -+export declare function defaultDocumentLoader(agentContext: AgentContext): DocumentLoader; - //# sourceMappingURL=documentLoader.d.mts.map -\ No newline at end of file diff --git a/node_modules/@credo-ts/core/build/modules/vc/data-integrity/libraries/nativeDocumentLoader.mjs b/node_modules/@credo-ts/core/build/modules/vc/data-integrity/libraries/nativeDocumentLoader.mjs index 49ee03f..aa7e43a 100644 --- a/node_modules/@credo-ts/core/build/modules/vc/data-integrity/libraries/nativeDocumentLoader.mjs @@ -71,19 +60,3 @@ index 19457ed..5fb595f 100644 \ No newline at end of file +{"version":3,"file":"version.mjs","names":[],"sources":["../../src/utils/version.ts"],"sourcesContent":["export function parseVersionString(version: VersionString): Version {\n const [major, minor, patch] = version.split('.')\n\n return [Number(major), Number(minor), Number(patch ?? '0')]\n}\n\nexport function isFirstVersionHigherThanSecond(first: Version, second: Version) {\n return (\n first[0] > second[0] ||\n (first[0] === second[0] && first[1] > second[1]) ||\n (first[0] === second[0] && first[1] === second[1] && first[2] > second[2])\n )\n}\n\nexport function isFirstVersionEqualToSecond(first: Version, second: Version) {\n return first[0] === second[0] && first[1] === second[1] && first[2] === second[2]\n}\n\nexport type VersionString = string\nexport type MajorVersion = number\nexport type MinorVersion = number\nexport type PatchVersion = number\nexport type Version = [MajorVersion, MinorVersion, PatchVersion]\n"],"mappings":";;;AAAA,SAAgB,mBAAmB,SAAiC;CAClE,MAAM,CAAC,OAAO,OAAO,SAAS,QAAQ,MAAM,IAAI;AAEhD,QAAO;EAAC,OAAO,MAAM;EAAE,OAAO,MAAM;EAAE,OAAO,SAAS,IAAI;EAAC;;AAG7D,SAAgB,+BAA+B,OAAgB,QAAiB;AAC9E,QACE,MAAM,KAAK,OAAO,MACjB,MAAM,OAAO,OAAO,MAAM,MAAM,KAAK,OAAO,MAC5C,MAAM,OAAO,OAAO,MAAM,MAAM,OAAO,OAAO,MAAM,MAAM,KAAK,OAAO;;AAI3E,SAAgB,4BAA4B,OAAgB,QAAiB;AAC3E,QAAO,MAAM,OAAO,OAAO,MAAM,MAAM,OAAO,OAAO,MAAM,MAAM,OAAO,OAAO"} \ No newline at end of file -diff --git a/node_modules/@credo-ts/core/package.json b/node_modules/@credo-ts/core/package.json -index 8198ea2..5d23e62 100644 ---- a/node_modules/@credo-ts/core/package.json -+++ b/node_modules/@credo-ts/core/package.json -@@ -7,6 +7,11 @@ - "import": "./build/modules/kms/index.mjs", - "require": "./build/modules/kms/index.mjs", - "types": "./build/modules/kms/index.d.mts" -+ }, -+ "./build/modules/vc/data-integrity/libraries/documentLoader.mjs": { -+ "import": "./build/modules/vc/data-integrity/libraries/documentLoader.mjs", -+ "require": "./build/modules/vc/data-integrity/libraries/documentLoader.mjs", -+ "types": "./build/modules/vc/data-integrity/libraries/documentLoader.d.mts" - } - }, - "version": "0.6.2", diff --git a/patches/@credo-ts+core+0.6.2+002+fix: export defaultDocumentLoader.patch b/patches/@credo-ts+core+0.6.2+002+fix: export defaultDocumentLoader.patch new file mode 100644 index 00000000..81c03cb3 --- /dev/null +++ b/patches/@credo-ts+core+0.6.2+002+fix: export defaultDocumentLoader.patch @@ -0,0 +1,27 @@ +diff --git a/node_modules/@credo-ts/core/build/modules/vc/data-integrity/libraries/documentLoader.d.mts b/node_modules/@credo-ts/core/build/modules/vc/data-integrity/libraries/documentLoader.d.mts +index 195af1d..30d1638 100644 +--- a/node_modules/@credo-ts/core/build/modules/vc/data-integrity/libraries/documentLoader.d.mts ++++ b/node_modules/@credo-ts/core/build/modules/vc/data-integrity/libraries/documentLoader.d.mts +@@ -5,4 +5,5 @@ import { AgentContext } from "../../../../agent/context/AgentContext.mjs"; + type DocumentLoaderWithContext = (agentContext: AgentContext) => DocumentLoader; + //#endregion + export { DocumentLoaderWithContext }; ++export declare function defaultDocumentLoader(agentContext: AgentContext): DocumentLoader; + //# sourceMappingURL=documentLoader.d.mts.map +\ No newline at end of file +diff --git a/node_modules/@credo-ts/core/package.json b/node_modules/@credo-ts/core/package.json +index 8198ea2..5d23e62 100644 +--- a/node_modules/@credo-ts/core/package.json ++++ b/node_modules/@credo-ts/core/package.json +@@ -7,6 +7,11 @@ + "import": "./build/modules/kms/index.mjs", + "require": "./build/modules/kms/index.mjs", + "types": "./build/modules/kms/index.d.mts" ++ }, ++ "./build/modules/vc/data-integrity/libraries/documentLoader.mjs": { ++ "import": "./build/modules/vc/data-integrity/libraries/documentLoader.mjs", ++ "require": "./build/modules/vc/data-integrity/libraries/documentLoader.mjs", ++ "types": "./build/modules/vc/data-integrity/libraries/documentLoader.d.mts" + } + }, + "version": "0.6.2", diff --git a/src/cliAgent.ts b/src/cliAgent.ts index 68ca7290..42c5a0ce 100644 --- a/src/cliAgent.ts +++ b/src/cliAgent.ts @@ -298,10 +298,8 @@ const getModules = ( ) => { //TODO: We need to trust the certificate tenant wise, for that we need to fetch those details from platform const tenantId = agentContext.contextCorrelationId - console.log('[getTrustedCertificatesForVerification] tenantId from agentContext:', tenantId) const authType = getAuthType() - console.log('[getTrustedCertificatesForVerification] authType:', authType) if (authType === AuthTypes.ClientAuth) { return await getX509CertsByClientToken(tenantId, certificateChain) diff --git a/src/controllers/x509/x509.service.ts b/src/controllers/x509/x509.service.ts index c8525d1c..bae36674 100644 --- a/src/controllers/x509/x509.service.ts +++ b/src/controllers/x509/x509.service.ts @@ -79,8 +79,6 @@ class x509Service { let authorityKeyID, subjectPublicKeyID, authorityKeyKmsId - agent.config.logger.debug(`createCertificate options:`, options) - if (options.authorityKey && options?.authorityKey?.seed) { const { privateJwk } = transformSeedToPrivateJwk({ type: getTypeFromCurve(options.authorityKey.keyType ?? 'P-256'), @@ -114,8 +112,6 @@ class x509Service { subjectPublicKeyID = publicJwk } } - agent.config.logger.info('This is subjectPublicKeyID', subjectPublicKeyID) - const certificate = await agent.x509.createCertificate({ authorityKey: Kms.PublicJwk.fromPublicJwk(authorityKeyID), serialNumber: options.serialNumber, @@ -220,8 +216,6 @@ export async function createKey(agent: Agent, keyType: KeyAlgorithm) { try { const seed = await generateSecretKey(keyType === KeyAlgorithm.EcSecp256r1 ? 64 : 32) - agent.config.logger.debug(`createKey: got seed ${seed}`) - const normalizedCurve = keyAlgorithmToCurve[keyType] if (!normalizedCurve) throw new Error('Unspported key type for method importKey') const importedKey = await agent.kms.importKey({ diff --git a/src/events/WebSocketEvents.ts b/src/events/WebSocketEvents.ts index e3f1b00f..a5193024 100644 --- a/src/events/WebSocketEvents.ts +++ b/src/events/WebSocketEvents.ts @@ -1,4 +1,4 @@ -import { Server } from 'ws' +import { WebSocket, type Server } from 'ws' export const sendWebSocketEvent = async (server: Server, data: unknown) => { server.clients.forEach((client) => { diff --git a/src/utils/agent.ts b/src/utils/agent.ts index aebf6c49..866fb63e 100644 --- a/src/utils/agent.ts +++ b/src/utils/agent.ts @@ -152,14 +152,13 @@ export const setupAgent = async ({ if (typeof req.query.d_m === 'string') { const invitation = await DidCommConnectionInvitationMessage.fromUrl(req.url.replace('d_m=', 'c_i=')) res.send(invitation.toJSON()) - } - if (typeof req.query.c_i === 'string') { + } else if (typeof req.query.c_i === 'string') { const invitation = await DidCommConnectionInvitationMessage.fromUrl(req.url) res.send(invitation.toJSON()) } else { const { outOfBandInvitation } = await agent.modules.didcomm.oob.createInvitation() - res.send(outOfBandInvitation.toUrl({ domain: endpoints + '/invitation' })) + res.send(outOfBandInvitation.toUrl({ domain: endpoints[0] + '/invitation' })) } }, ) From 0ff81313405f7175e1232432bc23ad01b86840cb Mon Sep 17 00:00:00 2001 From: Tipu_Singh Date: Mon, 4 May 2026 15:14:47 +0530 Subject: [PATCH 146/152] fix: resolved comments Signed-off-by: Tipu_Singh --- src/cliAgent.ts | 26 +++++++++++++------------- src/controllers/x509/crypto-util.ts | 2 +- src/controllers/x509/x509.service.ts | 8 +++++--- src/purge/PurgeWorker.ts | 12 ++++++++++-- src/utils/agent.ts | 6 +++++- src/utils/helpers.ts | 8 +------- 6 files changed, 35 insertions(+), 27 deletions(-) diff --git a/src/cliAgent.ts b/src/cliAgent.ts index 42c5a0ce..a5490acd 100644 --- a/src/cliAgent.ts +++ b/src/cliAgent.ts @@ -7,7 +7,7 @@ import type { AskarModuleConfigStoreOptions } from '@credo-ts/askar' import type { InitConfig } from '@credo-ts/core' 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 { AnonCredsDidCommCredentialFormatService, AnonCredsModule, @@ -65,10 +65,11 @@ import express from 'express' import { readFile } from 'fs/promises' import { IndicioAcceptanceMechanism, IndicioTransactionAuthorAgreement, Network, NetworkName } from './enums' -import { setupServer } from './server' -import { buildPurgeConfig } from './purge/PurgeTypes' import { validatePurgeConfig } from './purge/PurgeConfigValidator' import { initPurgeSchedulers, stopPurgeSchedulers, getNatsPurgeScheduler, getCronPurgeScheduler } from './purge/PurgeSchedulerFactory' +import { buildPurgeConfig } from './purge/PurgeTypes' +import { setupServer } from './server' +import { AuthTypes, getAuthType } from './utils/auth' import { isCustomDocumentLoaderEnabled } from './utils/config' import { CustomDocumentLoader } from './utils/customDocumentLoader' import { generateSecretKey } from './utils/helpers' @@ -78,8 +79,6 @@ import { getX509CertsByClientToken, getX509CertsByUrl, } from './utils/oid4vc-agent' -import { AuthTypes, getAuthType } from './utils/auth' -import { PolygonDidRegistrar, PolygonDidResolver, PolygonModule } from '@ayanworks/credo-polygon-w3c-module' export type Transports = 'ws' | 'http' export type InboundTransport = { @@ -206,10 +205,10 @@ const getModules = ( anoncreds, }), w3cCredentials: isCustomDocumentLoaderEnabled() - ? new W3cCredentialsModule() - : new W3cCredentialsModule({ + ? new W3cCredentialsModule({ documentLoader: CustomDocumentLoader, - }), + }) + : new W3cCredentialsModule(), didcomm: new DidCommModule({ processDidCommMessagesConcurrently: true, mediationRecipient: true, @@ -219,7 +218,7 @@ const getModules = ( basicMessages: true, connections: { - autoAcceptConnections: autoAcceptConnections || true, + autoAcceptConnections: autoAcceptConnections ?? true, peerNumAlgoForDidExchangeRequests: PeerDidNumAlgo.GenesisDoc, peerNumAlgoForDidRotation: PeerDidNumAlgo.ShortFormAndLongForm, }, @@ -469,7 +468,7 @@ export async function runRestAgent(restConfig: AriesRestConfig) { fileServerUrl || '', rpcUrl || '', schemaManagerContractAddress || '', - autoAcceptConnections || true, + autoAcceptConnections ?? true, autoAcceptCredentials || DidCommAutoAcceptCredential.Always, autoAcceptProofs || DidCommAutoAcceptProof.ContentApproved, walletScheme || AskarMultiWalletDatabaseScheme.ProfilePerWallet, @@ -484,7 +483,7 @@ export async function runRestAgent(restConfig: AriesRestConfig) { fileServerUrl || '', rpcUrl || '', schemaManagerContractAddress || '', - autoAcceptConnections || true, + autoAcceptConnections ?? true, autoAcceptCredentials || DidCommAutoAcceptCredential.Always, autoAcceptProofs || DidCommAutoAcceptProof.ContentApproved, walletScheme || AskarMultiWalletDatabaseScheme.ProfilePerWallet, @@ -581,15 +580,16 @@ export async function runRestAgent(restConfig: AriesRestConfig) { } } - app.listen(adminPort, () => { + const server = app.listen(adminPort, () => { logger.info(`Successfully started server on port ${adminPort}`) }) - // Graceful shutdown const shutdown = async () => { agent.config.logger.info('[Shutdown] Stopping services...') + server.close() await stopPurgeSchedulers() + await agent.shutdown() process.exit(0) } diff --git a/src/controllers/x509/crypto-util.ts b/src/controllers/x509/crypto-util.ts index ed675a0a..e864f9e4 100644 --- a/src/controllers/x509/crypto-util.ts +++ b/src/controllers/x509/crypto-util.ts @@ -34,7 +34,7 @@ export async function pemToRawEd25519PrivateKey(derKey: string | Buffer): Promis // Ed25519 JWK exports the *seed* (first 32 bytes of the private key) const jwk = keyObj.export({ format: 'jwk' }) - if (!jwk.d) throw new Error('Not an Ed25519 private key') + if (!jwk.d) throw new Error('Failed to extract private key material: missing d component in JWK') return Buffer.from(jwk.d, 'base64').toString('hex') } diff --git a/src/controllers/x509/x509.service.ts b/src/controllers/x509/x509.service.ts index bae36674..7970ff78 100644 --- a/src/controllers/x509/x509.service.ts +++ b/src/controllers/x509/x509.service.ts @@ -27,7 +27,7 @@ class x509Service { const authorityKey = await createKey(agent as Agent, createX509Options.keyType) const AGENT_HOST = createX509Options.issuerAlternativeNameURL - const AGENT_DNS = AGENT_HOST.replace('https://', '') + const AGENT_DNS = new URL(AGENT_HOST).hostname const selfSignedx509certificate = await X509Service.createCertificate(agent.context, { authorityKey: Kms.PublicJwk.fromPublicJwk(authorityKey.publicJwk), //createX509Options.subjectKey, issuer: { countryName: createX509Options.countryName, commonName: createX509Options.commonName }, @@ -106,7 +106,7 @@ class x509Service { subjectPublicKeyID = importedKey.publicJwk } else { - const { keyId, publicJwk } = await agent.kms.createKey({ + const { publicJwk } = await agent.kms.createKey({ type: getTypeFromCurve(options.subjectPublicKey?.keyType ?? 'P-256'), }) subjectPublicKeyID = publicJwk @@ -114,6 +114,7 @@ class x509Service { } const certificate = await agent.x509.createCertificate({ authorityKey: Kms.PublicJwk.fromPublicJwk(authorityKeyID), + subjectPublicKey: subjectPublicKeyID ? Kms.PublicJwk.fromPublicJwk(subjectPublicKeyID) : undefined, serialNumber: options.serialNumber, issuer: options.issuer, extensions: options.extensions, @@ -128,8 +129,9 @@ class x509Service { public async ImportX509Certificates(agentReq: Req, options: X509ImportCertificateOptionsDto) { const agent = agentReq.agent + if (!options.privateKey) throw new Error('[ImportX509Certificates] privateKey is required') agent.config.logger.debug(`Start validating keys`) - const secretHexKey = await pemToRawEd25519PrivateKey(options.privateKey ?? '') + const secretHexKey = await pemToRawEd25519PrivateKey(options.privateKey) const privateKey = TypedArrayEncoder.fromHex(secretHexKey) agent.config.logger.debug(`Decode certificate`) diff --git a/src/purge/PurgeWorker.ts b/src/purge/PurgeWorker.ts index 6ce2bcce..13dc068c 100644 --- a/src/purge/PurgeWorker.ts +++ b/src/purge/PurgeWorker.ts @@ -80,7 +80,11 @@ export class PurgeWorker { msg.ack() if (this.webhookUrl) { - await sendPurgeWebhook(this.webhookUrl, recordId, this.recordType, tenantId, PurgeDeletionStatus.DELETED, logger) + try { + await sendPurgeWebhook(this.webhookUrl, recordId, this.recordType, tenantId, PurgeDeletionStatus.DELETED, logger) + } catch (webhookErr: any) { + logger.warn('[Purge] Webhook delivery failed after deletion', { recordId, recordType, error: webhookErr?.message }) + } } } catch (err: any) { if (err instanceof RecordNotFoundError) { @@ -89,7 +93,11 @@ export class PurgeWorker { msg.ack() if (this.webhookUrl) { - await sendPurgeWebhook(this.webhookUrl, recordId, this.recordType, tenantId, PurgeDeletionStatus.ALREADY_ABSENT, logger) + try { + await sendPurgeWebhook(this.webhookUrl, recordId, this.recordType, tenantId, PurgeDeletionStatus.ALREADY_ABSENT, logger) + } catch (webhookErr: any) { + logger.warn('[Purge] Webhook delivery failed for already-absent record', { recordId, recordType, error: webhookErr?.message }) + } } return } diff --git a/src/utils/agent.ts b/src/utils/agent.ts index 866fb63e..b3cf150b 100644 --- a/src/utils/agent.ts +++ b/src/utils/agent.ts @@ -21,6 +21,7 @@ import { DidCommCredentialV2Protocol, DidCommModule, DidCommConnectionInvitationMessage, + parseInvitationUrl, } from '@credo-ts/didcomm' import { IndyVdrAnonCredsRegistry, IndyVdrModule } from '@credo-ts/indy-vdr' import { agentDependencies, DidCommHttpInboundTransport } from '@credo-ts/node' @@ -148,13 +149,16 @@ export const setupAgent = async ({ httpInbound.app.get( '/invitation', - async (req: { query: { d_m: any; c_i: any }; url: string }, res: { send: (arg0: any) => void }) => { + async (req: { query: { d_m: any; c_i: any; oob: any }; url: string }, res: { send: (arg0: any) => void }) => { if (typeof req.query.d_m === 'string') { const invitation = await DidCommConnectionInvitationMessage.fromUrl(req.url.replace('d_m=', 'c_i=')) res.send(invitation.toJSON()) } else if (typeof req.query.c_i === 'string') { const invitation = await DidCommConnectionInvitationMessage.fromUrl(req.url) res.send(invitation.toJSON()) + } else if (typeof req.query.oob === 'string') { + const invitation = parseInvitationUrl(req.url) + res.send(invitation.toJSON()) } else { const { outOfBandInvitation } = await agent.modules.didcomm.oob.createInvitation() diff --git a/src/utils/helpers.ts b/src/utils/helpers.ts index d05fdf1b..d95ac237 100644 --- a/src/utils/helpers.ts +++ b/src/utils/helpers.ts @@ -229,7 +229,6 @@ async function fetchPlatformToken( const cachedToken = getCachedToken(clientId) if (cachedToken) { - console.log(`[${label}] using cached token for clientId:`, clientId) return cachedToken } @@ -258,12 +257,8 @@ async function fetchPlatformToken( throw error } - console.log(`[${label}] token response status:`, tokenResponse.status) - console.log(`[${label}] token response data:`, JSON.stringify(tokenResponse.data, null, 2)) - const token: string = tokenResponse.data?.data?.access_token if (!token) { - console.error(`[${label}] unexpected token response shape:`, JSON.stringify(tokenResponse.data, null, 2)) throw new Error(`[${label}] access_token not found in platform response`) } @@ -350,10 +345,9 @@ export async function checkX509Certificates( if (!isDedicated) { resolvedTenantId = tenantId if (!resolvedTenantId) throw new Error(`[${label}] tenantId is required for shared agent but was not provided`) - console.log(`[${label}] using tenantId:`, resolvedTenantId) } - console.log(`[${label}] agent type: ${isDedicated ? 'dedicated' : 'shared'}, certificates:`, x509Certificates) + console.log(`[${label}] agent type: ${isDedicated ? 'dedicated' : 'shared'}, certificate count: ${x509Certificates.length}`) const token = await fetchPlatformToken(tokenUrl, clientId, clientSecret, label) From 8515bf78e21ba4ef4085e89d07fecd361aa72ed7 Mon Sep 17 00:00:00 2001 From: Tipu_Singh Date: Mon, 4 May 2026 17:37:44 +0530 Subject: [PATCH 147/152] fix: yarn format Signed-off-by: Tipu_Singh --- README.md | 1 - samples/cliConfig.json | 8 +- src/cli.ts | 2 +- src/cliAgent.ts | 12 +- .../didcomm/proofs/ProofController.ts | 30 +- .../issuance-sessions.Controller.ts | 5 +- .../issuance-sessions.service.ts | 3 +- src/controllers/types.ts | 6 +- src/controllers/x509/x509.service.ts | 11 +- src/events/CredentialEvents.ts | 9 +- src/purge/PurgeConstants.ts | 4 +- src/purge/PurgeTypes.ts | 5 +- src/purge/PurgeWorker.ts | 74 +++- src/purge/decorators/SchedulePurge.ts | 13 +- src/purge/schedulers/CronPurgeScheduler.ts | 41 ++- src/purge/schedulers/NatsPurgeScheduler.ts | 21 +- src/utils/agent.ts | 37 +- src/utils/auth.ts | 9 +- src/utils/helpers.ts | 4 +- src/utils/statusListService.ts | 326 +++++++++--------- tsconfig.build.json | 13 +- tsoa.json | 2 +- 22 files changed, 358 insertions(+), 278 deletions(-) diff --git a/README.md b/README.md index 39f43417..caf31b2d 100644 --- a/README.md +++ b/README.md @@ -80,7 +80,6 @@ npx -p @aries-framework/rest afj-rest start \ --inbound-transport http 5000 ``` - **Configuration** To find out all available configuration options from the CLI, you can run the CLI command with `--help`. This will print a full list of all available options. diff --git a/samples/cliConfig.json b/samples/cliConfig.json index a8ca612a..44c44c9c 100644 --- a/samples/cliConfig.json +++ b/samples/cliConfig.json @@ -23,9 +23,7 @@ "indyNamespace": "bcovrin:testnet" } ], - "endpoint": [ - "http://localhost:4002" - ], + "endpoint": ["http://localhost:4002"], "autoAcceptConnections": true, "autoAcceptCredentials": "always", "autoAcceptProofs": "contentApproved", @@ -36,9 +34,7 @@ "port": 4002 } ], - "outboundTransport": [ - "http" - ], + "outboundTransport": ["http"], "adminPort": 4001, "tenancy": true, "schemaFileServerURL": "https://schema.credebl.id/schemas/", diff --git a/src/cli.ts b/src/cli.ts index e8285a55..3ea425a1 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -217,4 +217,4 @@ export async function runCliServer() { apiKey: parsed['apiKey'], updateJwtSecret: parsed['updateJwtSecret'], } as AriesRestConfig) -} \ No newline at end of file +} diff --git a/src/cliAgent.ts b/src/cliAgent.ts index a5490acd..c2575ddd 100644 --- a/src/cliAgent.ts +++ b/src/cliAgent.ts @@ -66,7 +66,12 @@ import { readFile } from 'fs/promises' import { IndicioAcceptanceMechanism, IndicioTransactionAuthorAgreement, Network, NetworkName } from './enums' import { validatePurgeConfig } from './purge/PurgeConfigValidator' -import { initPurgeSchedulers, stopPurgeSchedulers, getNatsPurgeScheduler, getCronPurgeScheduler } from './purge/PurgeSchedulerFactory' +import { + initPurgeSchedulers, + stopPurgeSchedulers, + getNatsPurgeScheduler, + getCronPurgeScheduler, +} from './purge/PurgeSchedulerFactory' import { buildPurgeConfig } from './purge/PurgeTypes' import { setupServer } from './server' import { AuthTypes, getAuthType } from './utils/auth' @@ -367,7 +372,6 @@ const getWithTenantModules = ( // return secretKey // } - export async function runRestAgent(restConfig: AriesRestConfig) { const { endpoints, @@ -461,7 +465,7 @@ export async function runRestAgent(restConfig: AriesRestConfig) { let modules if (afjConfig.tenancy) { - modules = await getWithTenantModules( + modules = getWithTenantModules( networkConfig, didRegistryContractAddress || '', fileServerToken || '', @@ -595,4 +599,4 @@ export async function runRestAgent(restConfig: AriesRestConfig) { process.on('SIGTERM', shutdown) process.on('SIGINT', shutdown) -} \ No newline at end of file +} diff --git a/src/controllers/didcomm/proofs/ProofController.ts b/src/controllers/didcomm/proofs/ProofController.ts index f971497d..0f23eb6a 100644 --- a/src/controllers/didcomm/proofs/ProofController.ts +++ b/src/controllers/didcomm/proofs/ProofController.ts @@ -1,6 +1,4 @@ -import type { - PeerDidNumAlgo2CreateOptions, -} from '@credo-ts/core' +import type { PeerDidNumAlgo2CreateOptions } from '@credo-ts/core' import { AcceptProofRequestOptions, @@ -156,21 +154,23 @@ export class ProofController extends Controller { invitationDid = createRequestOptions?.invitationDid } else { routing = await request.agent.modules.didcomm.mediationRecipient.getRouting({}) - const {didDocument, keys} = createPeerDidDocumentFromServices([ - { - id: 'didcomm', - recipientKeys: [routing.recipientKey], - routingKeys: routing.routingKeys, - serviceEndpoint: routing.endpoints[0], - } - ], - true) + const { didDocument, keys } = createPeerDidDocumentFromServices( + [ + { + id: 'didcomm', + recipientKeys: [routing.recipientKey], + routingKeys: routing.routingKeys, + serviceEndpoint: routing.endpoints[0], + }, + ], + true, + ) const did = await request.agent.dids.create({ didDocument, method: 'peer', options: { numAlgo: PeerDidNumAlgo.MultipleInceptionKeyWithoutDoc, - keys + keys, }, }) invitationDid = did.didState.did @@ -264,7 +264,9 @@ export class ProofController extends Controller { @Example(ProofRecordExample) public async acceptPresentation(@Request() request: Req, @Path('proofRecordId') proofRecordId: string) { try { - const proof = await request.agent.modules.didcomm.proofs.acceptPresentation({ proofExchangeRecordId:proofRecordId }) + const proof = await request.agent.modules.didcomm.proofs.acceptPresentation({ + proofExchangeRecordId: proofRecordId, + }) return proof } catch (error) { throw ErrorHandlingService.handle(error) diff --git a/src/controllers/openid4vc/issuance-sessions/issuance-sessions.Controller.ts b/src/controllers/openid4vc/issuance-sessions/issuance-sessions.Controller.ts index d575e226..a12ed7d6 100644 --- a/src/controllers/openid4vc/issuance-sessions/issuance-sessions.Controller.ts +++ b/src/controllers/openid4vc/issuance-sessions/issuance-sessions.Controller.ts @@ -112,10 +112,7 @@ export class IssuanceSessionsController extends Controller { * Revoke credentials in an issuance session by session ID */ @Post('{issuanceSessionId}/revoke') - public async revokeSessionById( - @Request() request: Req, - @Path('issuanceSessionId') issuanceSessionId: string, - ) { + public async revokeSessionById(@Request() request: Req, @Path('issuanceSessionId') issuanceSessionId: string) { try { return await issuanceSessionService.revokeBySessionId(request, issuanceSessionId) } catch (error) { diff --git a/src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts b/src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts index 9b7a0aa2..588bec6f 100644 --- a/src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts +++ b/src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts @@ -178,7 +178,6 @@ class IssuanceSessionsService { } } - public async getIssuanceSessionsById(agentReq: Req, sessionId: string) { const issuer = agentReq.agent.modules.openid4vc.issuer if (!issuer) { @@ -274,4 +273,4 @@ class IssuanceSessionsService { } } -export const issuanceSessionService = new IssuanceSessionsService() \ No newline at end of file +export const issuanceSessionService = new IssuanceSessionsService() diff --git a/src/controllers/types.ts b/src/controllers/types.ts index a267b0ec..1c5ef7b3 100644 --- a/src/controllers/types.ts +++ b/src/controllers/types.ts @@ -105,7 +105,11 @@ export interface ProofRequestMessageResponse { // type CredentialFormats = [CredentialFormat] type CredentialFormats = [LegacyIndyCredentialFormat, AnonCredsDidCommCredentialFormat, DidCommJsonLdCredentialFormat] -type ProofFormats = [LegacyIndyDidCommProofFormat, AnonCredsDidCommProofFormat, DidCommDifPresentationExchangeProofFormat] +type ProofFormats = [ + LegacyIndyDidCommProofFormat, + AnonCredsDidCommProofFormat, + DidCommDifPresentationExchangeProofFormat, +] enum ProtocolVersion { v1 = 'v1', diff --git a/src/controllers/x509/x509.service.ts b/src/controllers/x509/x509.service.ts index 7970ff78..d3ae231d 100644 --- a/src/controllers/x509/x509.service.ts +++ b/src/controllers/x509/x509.service.ts @@ -158,14 +158,15 @@ class x509Service { } 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 Kms.KeyManagementKeyExistsError) { - // eslint-disable-next-line no-console - console.error('key already exists while importing certificate') + agent.config.logger.warn( + '[ImportX509Certificates] Key already exists — assuming certificate was already imported', + ) } else { - agent.config.logger.error(`${JSON.stringify(error)}`) + agent.config.logger.error('[ImportX509Certificates] Failed to import key', { + message: (error as Error)?.message, + }) throw error } } diff --git a/src/events/CredentialEvents.ts b/src/events/CredentialEvents.ts index 244b6980..e1b492fd 100644 --- a/src/events/CredentialEvents.ts +++ b/src/events/CredentialEvents.ts @@ -12,7 +12,10 @@ export const credentialEvents = async (agent: Agent, config: ServerConfig) => { DidCommCredentialEventTypes.DidCommCredentialStateChanged, async (event: DidCommCredentialStateChangedEvent) => { const record = event.payload.credentialExchangeRecord - const tenantId = (!event.metadata.contextCorrelationId || event.metadata.contextCorrelationId === 'default') ? event.metadata.contextCorrelationId : event.metadata.contextCorrelationId.split('tenant-')[1] + const tenantId = + !event.metadata.contextCorrelationId || event.metadata.contextCorrelationId === 'default' + ? event.metadata.contextCorrelationId + : event.metadata.contextCorrelationId.split('tenant-')[1] const body: Record = { ...record.toJSON(), @@ -28,7 +31,9 @@ export const credentialEvents = async (agent: Agent, config: ServerConfig) => { await (agent as Agent).modules.tenants.withTenantAgent( { tenantId: body.contextCorrelationId as string }, async (tenantAgent) => { - connectionRecord = await tenantAgent.modules.didcomm.connections.findById(record.connectionId ? record.connectionId : '') + connectionRecord = await tenantAgent.modules.didcomm.connections.findById( + record.connectionId ? record.connectionId : '', + ) }, ) } else { diff --git a/src/purge/PurgeConstants.ts b/src/purge/PurgeConstants.ts index 245386ca..b71117a5 100644 --- a/src/purge/PurgeConstants.ts +++ b/src/purge/PurgeConstants.ts @@ -32,7 +32,7 @@ export const PURGE_CONSUMER_ACK_WAIT_NS = 30 * 1_000_000_000 export const PURGE_CONSUMER_MAX_DELIVER = 3 export const PURGE_CONSUMER_BACKOFF_NS = [ - 5_000_000_000, // 5s + 5_000_000_000, // 5s 30_000_000_000, // 30s ] @@ -44,3 +44,5 @@ export const PURGE_WEBHOOK_PATHS: Record = { } export const PURGE_WEBHOOK_RETRY_DELAYS_MS = [1000, 5000, 30000] + +export const PURGE_WORKER_RESTART_DELAY_MS = 5_000 diff --git a/src/purge/PurgeTypes.ts b/src/purge/PurgeTypes.ts index ee9c5a92..ceebde02 100644 --- a/src/purge/PurgeTypes.ts +++ b/src/purge/PurgeTypes.ts @@ -56,7 +56,10 @@ export function buildPurgeConfig(): PurgeConfig | undefined { enabled: natsEnabled, ttlSeconds: parseTtlSeconds(process.env.PURGE_NATS_TTL_SECONDS, 'PURGE_NATS_TTL_SECONDS'), nats: { - servers: (process.env.NATS_SERVERS || 'nats://localhost:4222').split(',').map((s) => s.trim()).filter(Boolean), + servers: (process.env.NATS_SERVERS || 'nats://localhost:4222') + .split(',') + .map((s) => s.trim()) + .filter(Boolean), nkeySeed: process.env.NATS_NKEY_SEED, credentialsFile: process.env.NATS_CREDENTIALS_FILE, username: process.env.NATS_USER, diff --git a/src/purge/PurgeWorker.ts b/src/purge/PurgeWorker.ts index 13dc068c..85e69a65 100644 --- a/src/purge/PurgeWorker.ts +++ b/src/purge/PurgeWorker.ts @@ -4,7 +4,7 @@ import type { Consumer } from 'nats' import { RecordNotFoundError } from '@credo-ts/core' import { StringCodec } from 'nats' -import { PURGE_CONSUMER_MAX_DELIVER } from './PurgeConstants' +import { PURGE_CONSUMER_MAX_DELIVER, PURGE_WORKER_RESTART_DELAY_MS } from './PurgeConstants' import { deletePurgeRecord } from './PurgeDeleteRecord' import { sendPurgeWebhook, PurgeDeletionStatus } from './PurgeWebhook' import type { PurgeJob } from './PurgeTypes' @@ -28,13 +28,21 @@ export class PurgeWorker { agent.config.logger.info('[Purge] Worker started', { consumer: this.consumerName }) while (true) { - const messages = await consumer.consume() - console.log(`[Purge][Worker] Consuming messages — consumer=${this.consumerName}`) - for await (const msg of messages) { - await this.processMessage(msg, agent) + try { + const messages = await consumer.consume() + console.log(`[Purge][Worker] Consuming messages — consumer=${this.consumerName}`) + for await (const msg of messages) { + await this.processMessage(msg, agent) + } + console.warn(`[Purge][Worker] Consume loop ended — restarting consumer=${this.consumerName}`) + agent.config.logger.warn('[Purge] Consume loop ended — restarting', { consumer: this.consumerName }) + } catch (err: any) { + agent.config.logger.error('[Purge] Consume loop error — restarting after delay', { + consumer: this.consumerName, + error: err?.message, + }) + await new Promise((resolve) => setTimeout(resolve, PURGE_WORKER_RESTART_DELAY_MS)) } - console.warn(`[Purge][Worker] Consume loop ended — restarting consumer=${this.consumerName}`) - agent.config.logger.warn('[Purge] Consume loop ended — restarting', { consumer: this.consumerName }) } } @@ -63,7 +71,9 @@ export class PurgeWorker { return } - console.log(`[Purge][Worker] Job received — recordType=${recordType} recordId=${recordId} tenantId="${tenantId}" deliveryCount=${deliveryCount}`) + console.log( + `[Purge][Worker] Job received — recordType=${recordType} recordId=${recordId} tenantId="${tenantId}" deliveryCount=${deliveryCount}`, + ) logger.info('[Purge] Job received', { recordId, recordType, tenantId, deliveryCount }) try { @@ -75,15 +85,28 @@ export class PurgeWorker { await deletePurgeRecord(agent, this.recordType, recordId) } - console.log(`[Purge][Worker] Record deleted — recordType=${recordType} recordId=${recordId} tenantId="${tenantId}"`) + console.log( + `[Purge][Worker] Record deleted — recordType=${recordType} recordId=${recordId} tenantId="${tenantId}"`, + ) logger.info('[Purge] Record deleted', { recordId, recordType, tenantId }) msg.ack() if (this.webhookUrl) { try { - await sendPurgeWebhook(this.webhookUrl, recordId, this.recordType, tenantId, PurgeDeletionStatus.DELETED, logger) + await sendPurgeWebhook( + this.webhookUrl, + recordId, + this.recordType, + tenantId, + PurgeDeletionStatus.DELETED, + logger, + ) } catch (webhookErr: any) { - logger.warn('[Purge] Webhook delivery failed after deletion', { recordId, recordType, error: webhookErr?.message }) + logger.warn('[Purge] Webhook delivery failed after deletion', { + recordId, + recordType, + error: webhookErr?.message, + }) } } } catch (err: any) { @@ -94,26 +117,43 @@ export class PurgeWorker { if (this.webhookUrl) { try { - await sendPurgeWebhook(this.webhookUrl, recordId, this.recordType, tenantId, PurgeDeletionStatus.ALREADY_ABSENT, logger) + await sendPurgeWebhook( + this.webhookUrl, + recordId, + this.recordType, + tenantId, + PurgeDeletionStatus.ALREADY_ABSENT, + logger, + ) } catch (webhookErr: any) { - logger.warn('[Purge] Webhook delivery failed for already-absent record', { recordId, recordType, error: webhookErr?.message }) + logger.warn('[Purge] Webhook delivery failed for already-absent record', { + recordId, + recordType, + error: webhookErr?.message, + }) } } return } - console.warn(`[Purge][Worker] Job failed — recordType=${recordType} recordId=${recordId} deliveryCount=${deliveryCount}`, err?.message) + console.warn( + `[Purge][Worker] Job failed — recordType=${recordType} recordId=${recordId} deliveryCount=${deliveryCount}`, + err?.message, + ) logger.warn('[Purge] Job failed', { recordId, recordType, deliveryCount, error: err?.message }) if (deliveryCount >= PURGE_CONSUMER_MAX_DELIVER) { - console.error(`[Purge][Worker] Job dropped after max retries — recordType=${recordType} recordId=${recordId} tenantId="${tenantId}"`) + console.error( + `[Purge][Worker] Job dropped after max retries — recordType=${recordType} recordId=${recordId} tenantId="${tenantId}"`, + ) logger.error('[Purge] Job dropped after max retries', { recordId, recordType, tenantId, deliveryCount }) msg.ack() } else { - console.log(`[Purge][Worker] Nacking job for retry — recordType=${recordType} recordId=${recordId} deliveryCount=${deliveryCount}`) + console.log( + `[Purge][Worker] Nacking job for retry — recordType=${recordType} recordId=${recordId} deliveryCount=${deliveryCount}`, + ) msg.nak() } } } - } diff --git a/src/purge/decorators/SchedulePurge.ts b/src/purge/decorators/SchedulePurge.ts index cb7a316e..4aff2360 100644 --- a/src/purge/decorators/SchedulePurge.ts +++ b/src/purge/decorators/SchedulePurge.ts @@ -2,10 +2,7 @@ import type { AgentMode, PurgeRecordType } from '../PurgeTypes' import { getCronPurgeScheduler, getNatsPurgeScheduler } from '../PurgeSchedulerFactory' -export function SchedulePurge( - recordType: PurgeRecordType, - idExtractor: (result: unknown) => string | undefined, -) { +export function SchedulePurge(recordType: PurgeRecordType, idExtractor: (result: unknown) => string | undefined) { return function (_target: object, _key: string, descriptor: PropertyDescriptor) { const original = descriptor.value as (...args: unknown[]) => Promise @@ -23,7 +20,9 @@ export function SchedulePurge( if (!recordId) { const resultKeys = result && typeof result === 'object' ? Object.keys(result) : typeof result - console.warn(`[Purge] @SchedulePurge(${recordType}): could not extract recordId — result shape: ${JSON.stringify(resultKeys)}`) + console.warn( + `[Purge] @SchedulePurge(${recordType}): could not extract recordId — result shape: ${JSON.stringify(resultKeys)}`, + ) return result } @@ -35,7 +34,9 @@ export function SchedulePurge( : '' const agentMode: AgentMode = tenantId ? 'shared' : 'dedicated' - console.info(`[Purge] Scheduling purge: ${recordType} recordId=${recordId} tenantId="${tenantId}" agentMode=${agentMode}`) + console.info( + `[Purge] Scheduling purge: ${recordType} recordId=${recordId} tenantId="${tenantId}" agentMode=${agentMode}`, + ) // Fire-and-forget: purge scheduling must not block record creation. // If NATS publish fails and cron is disabled, this record will not be purged. diff --git a/src/purge/schedulers/CronPurgeScheduler.ts b/src/purge/schedulers/CronPurgeScheduler.ts index cd781116..2d47b1da 100644 --- a/src/purge/schedulers/CronPurgeScheduler.ts +++ b/src/purge/schedulers/CronPurgeScheduler.ts @@ -30,10 +30,14 @@ export class CronPurgeScheduler { console.error('[Purge][Cron] Scan error', err?.message) agent.config.logger.error('[Purge] Cron scan error', { error: err?.message }) }) - .finally(() => { this.isRunning = false }) + .finally(() => { + this.isRunning = false + }) }) - console.log(`[Purge][Cron] Scheduler started — schedule="${cronConfig.cronSchedule}" ttlSeconds=${cronConfig.ttlSeconds} recordTypes=${cronConfig.recordTypes.join(', ')}`) + console.log( + `[Purge][Cron] Scheduler started — schedule="${cronConfig.cronSchedule}" ttlSeconds=${cronConfig.ttlSeconds} recordTypes=${cronConfig.recordTypes.join(', ')}`, + ) agent.config.logger.info('[Purge] CronPurgeScheduler started', { cronSchedule: cronConfig.cronSchedule, ttlSeconds: cronConfig.ttlSeconds, @@ -60,13 +64,10 @@ export class CronPurgeScheduler { for (const tenant of tenants) { try { - await (agent as any).modules.tenants.withTenantAgent( - { tenantId: tenant.id }, - async (tenantAgent: Agent) => { - const count = await this.scanTenant(tenantAgent, tenant.id, config, webhookUrl) - totalDeleted += count - }, - ) + await (agent as any).modules.tenants.withTenantAgent({ tenantId: tenant.id }, async (tenantAgent: Agent) => { + const count = await this.scanTenant(tenantAgent, tenant.id, config, webhookUrl) + totalDeleted += count + }) } catch (err: any) { console.error(`[Purge][Cron] Failed to scan tenant tenantId=${tenant.id}`, err?.message) logger.error('[Purge] Failed to scan tenant', { tenantId: tenant.id, error: err?.message }) @@ -92,10 +93,14 @@ export class CronPurgeScheduler { for (const recordType of cronConfig.recordTypes) { try { const expiredIds = await this.queryExpiredRecords(tenantAgent, recordType, cronConfig.ttlSeconds) - console.log(`[Purge][Cron] Queried expired records — recordType=${recordType} tenantId="${tenantId}" found=${expiredIds.length}`) + console.log( + `[Purge][Cron] Queried expired records — recordType=${recordType} tenantId="${tenantId}" found=${expiredIds.length}`, + ) for (const recordId of expiredIds) { - console.log(`[Purge][Cron] Deleting record — recordType=${recordType} recordId=${recordId} tenantId="${tenantId}"`) + console.log( + `[Purge][Cron] Deleting record — recordType=${recordType} recordId=${recordId} tenantId="${tenantId}"`, + ) if (await this.deleteAndNotify(tenantAgent, recordId, recordType, tenantId, webhookUrl)) { deleted++ } @@ -113,11 +118,7 @@ export class CronPurgeScheduler { return deleted } - private async queryExpiredRecords( - agent: Agent, - recordType: PurgeRecordType, - ttlSeconds: number, - ): Promise { + private async queryExpiredRecords(agent: Agent, recordType: PurgeRecordType, ttlSeconds: number): Promise { const cutoffMs = Date.now() - ttlSeconds * 1000 const ids: string[] = [] @@ -181,7 +182,10 @@ export class CronPurgeScheduler { logger.warn('[Purge] Record already absent — skipping', { recordId, recordType }) status = PurgeDeletionStatus.ALREADY_ABSENT } else { - console.error(`[Purge][Cron] Failed to delete record — recordType=${recordType} recordId=${recordId}`, err?.message) + console.error( + `[Purge][Cron] Failed to delete record — recordType=${recordType} recordId=${recordId}`, + err?.message, + ) logger.error('[Purge] Failed to delete record', { recordId, recordType, error: err?.message }) return false } @@ -189,8 +193,7 @@ export class CronPurgeScheduler { if (webhookUrl) { await sendPurgeWebhook(webhookUrl, recordId, recordType, tenantId, status, logger) - - } + } return true } diff --git a/src/purge/schedulers/NatsPurgeScheduler.ts b/src/purge/schedulers/NatsPurgeScheduler.ts index 609bd4bd..31a43bca 100644 --- a/src/purge/schedulers/NatsPurgeScheduler.ts +++ b/src/purge/schedulers/NatsPurgeScheduler.ts @@ -63,7 +63,9 @@ export class NatsPurgeScheduler { await this.startWorkers(agent, webhookUrl) - console.log(`[Purge][NATS] Scheduler started — ttlSeconds=${this.ttlSeconds} recordTypes=${this.recordTypes.join(', ')}`) + console.log( + `[Purge][NATS] Scheduler started — ttlSeconds=${this.ttlSeconds} recordTypes=${this.recordTypes.join(', ')}`, + ) agent.config.logger.info('[Purge] NatsPurgeScheduler started', { ttlSeconds: this.ttlSeconds }) } @@ -90,7 +92,9 @@ export class NatsPurgeScheduler { await this.js.publish(scheduleSubject, sc.encode(JSON.stringify(job)), { headers: h }) - console.info(`[Purge] Scheduled: ${recordType} recordId=${recordId} tenantId="${tenantId}" agentMode=${agentMode} fireAt=${fireAt}`) + console.info( + `[Purge] Scheduled: ${recordType} recordId=${recordId} tenantId="${tenantId}" agentMode=${agentMode} fireAt=${fireAt}`, + ) } async stop(): Promise { @@ -201,8 +205,16 @@ export class NatsPurgeScheduler { .then(() => console.log(`[Purge][NATS] Worker launched — consumer=${consumerName}`)) .catch((err: Error) => { if (!this.nc) return // scheduler stopped — do not restart - console.error(`[Purge][NATS] Worker crashed — consumer=${consumerName} attempt=${attempt} retryIn=${delayMs}ms`, err?.message) - agent.config.logger.error('[Purge] Worker crashed — restarting', { consumerName, attempt, delayMs, error: err?.message }) + console.error( + `[Purge][NATS] Worker crashed — consumer=${consumerName} attempt=${attempt} retryIn=${delayMs}ms`, + err?.message, + ) + agent.config.logger.error('[Purge] Worker crashed — restarting', { + consumerName, + attempt, + delayMs, + error: err?.message, + }) setTimeout(() => this.runWorkerWithRestart(agent, recordType, consumerName, webhookUrl, attempt + 1), delayMs) }) } @@ -217,4 +229,3 @@ export class NatsPurgeScheduler { ) } } - diff --git a/src/utils/agent.ts b/src/utils/agent.ts index b3cf150b..b3316643 100644 --- a/src/utils/agent.ts +++ b/src/utils/agent.ts @@ -1,6 +1,6 @@ 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, LegacyIndyDidCommProofFormatService, @@ -31,7 +31,6 @@ import { indyVdr } from '@hyperledger/indy-vdr-nodejs' import { askar } from '@openwallet-foundation/askar-nodejs' import { TsLogger } from './logger' -import { PolygonModule } from '@ayanworks/credo-polygon-w3c-module' export const setupAgent = async ({ endpoints, @@ -149,20 +148,28 @@ export const setupAgent = async ({ httpInbound.app.get( '/invitation', - async (req: { query: { d_m: any; c_i: any; oob: any }; url: string }, res: { send: (arg0: any) => void }) => { - if (typeof req.query.d_m === 'string') { - const invitation = await DidCommConnectionInvitationMessage.fromUrl(req.url.replace('d_m=', 'c_i=')) - res.send(invitation.toJSON()) - } else if (typeof req.query.c_i === 'string') { - const invitation = await DidCommConnectionInvitationMessage.fromUrl(req.url) - res.send(invitation.toJSON()) - } else if (typeof req.query.oob === 'string') { - const invitation = parseInvitationUrl(req.url) - res.send(invitation.toJSON()) - } else { - const { outOfBandInvitation } = await agent.modules.didcomm.oob.createInvitation() + async ( + req: { query: { d_m: any; c_i: any; oob: any }; url: string }, + res: { send: (arg0: any) => void; status: (code: number) => { send: (arg0: any) => void } }, + ) => { + try { + if (typeof req.query.d_m === 'string') { + const invitation = DidCommConnectionInvitationMessage.fromUrl(req.url.replace('d_m=', 'c_i=')) + res.send(invitation.toJSON()) + } else if (typeof req.query.c_i === 'string') { + const invitation = DidCommConnectionInvitationMessage.fromUrl(req.url) + res.send(invitation.toJSON()) + } else if (typeof req.query.oob === 'string') { + const invitation = parseInvitationUrl(req.url) + res.send(invitation.toJSON()) + } else { + const { outOfBandInvitation } = await agent.modules.didcomm.oob.createInvitation() - res.send(outOfBandInvitation.toUrl({ domain: endpoints[0] + '/invitation' })) + res.send(outOfBandInvitation.toUrl({ domain: endpoints[0] + '/invitation' })) + } + } catch (err: any) { + logger.error('[/invitation] Failed to handle invitation request', { error: err?.message }) + res.status(500).send({ error: 'Failed to process invitation request' }) } }, ) diff --git a/src/utils/auth.ts b/src/utils/auth.ts index f3f677da..d5b50b96 100644 --- a/src/utils/auth.ts +++ b/src/utils/auth.ts @@ -45,10 +45,13 @@ export function validateAuthConfig(): void { if (!process.env.TRUST_LIST_URL) throw new Error('[validateAuthConfig] TRUST_LIST_URL is required for NoAuth') }, ClientAuth: () => { - if (!process.env.TRUST_SERVICE_TOKEN_URL) throw new Error('[validateAuthConfig] TRUST_SERVICE_TOKEN_URL is required for ClientAuth') + if (!process.env.TRUST_SERVICE_TOKEN_URL) + throw new Error('[validateAuthConfig] TRUST_SERVICE_TOKEN_URL is required for ClientAuth') if (!process.env.TRUST_LIST_URL) throw new Error('[validateAuthConfig] TRUST_LIST_URL is required for ClientAuth') - if (!process.env.TRUST_SERVICE_CLIENT_ID) throw new Error('[validateAuthConfig] TRUST_SERVICE_CLIENT_ID is required for ClientAuth') - if (!process.env.TRUST_SERVICE_CLIENT_SECRET) throw new Error('[validateAuthConfig] TRUST_SERVICE_CLIENT_SECRET is required for ClientAuth') + if (!process.env.TRUST_SERVICE_CLIENT_ID) + throw new Error('[validateAuthConfig] TRUST_SERVICE_CLIENT_ID is required for ClientAuth') + if (!process.env.TRUST_SERVICE_CLIENT_SECRET) + throw new Error('[validateAuthConfig] TRUST_SERVICE_CLIENT_SECRET is required for ClientAuth') }, } diff --git a/src/utils/helpers.ts b/src/utils/helpers.ts index d95ac237..6d0d24e5 100644 --- a/src/utils/helpers.ts +++ b/src/utils/helpers.ts @@ -347,7 +347,9 @@ export async function checkX509Certificates( if (!resolvedTenantId) throw new Error(`[${label}] tenantId is required for shared agent but was not provided`) } - console.log(`[${label}] agent type: ${isDedicated ? 'dedicated' : 'shared'}, certificate count: ${x509Certificates.length}`) + console.log( + `[${label}] agent type: ${isDedicated ? 'dedicated' : 'shared'}, certificate count: ${x509Certificates.length}`, + ) const token = await fetchPlatformToken(tokenUrl, clientId, clientSecret, label) diff --git a/src/utils/statusListService.ts b/src/utils/statusListService.ts index ec183643..4081f57d 100644 --- a/src/utils/statusListService.ts +++ b/src/utils/statusListService.ts @@ -1,179 +1,187 @@ -import { Agent, JwsProtectedHeaderOptions, JwsService, JwtPayload, VerificationMethod } from '@credo-ts/core'; -import { StatusList, getListFromStatusListJWT } from '@sd-jwt/jwt-status-list'; -import { STATUS_LISTS_PATH } from './constant'; -import { getAlgFromVerificationMethod, getVerificationMethod, fetchWithTimeout } from './helpers'; - -const statusListLocks = new Map>(); +import { Agent, JwsProtectedHeaderOptions, JwsService, JwtPayload, VerificationMethod } from '@credo-ts/core' +import { StatusList, getListFromStatusListJWT } from '@sd-jwt/jwt-status-list' +import { STATUS_LISTS_PATH } from './constant' +import { getAlgFromVerificationMethod, getVerificationMethod, fetchWithTimeout } from './helpers' +const statusListLocks = new Map>() export function getServerUrl() { - const url = process.env.STATUS_LIST_SERVER_URL; - if (!url) { - throw new Error('STATUS_LIST_SERVER_URL is not configured'); - } - return url.endsWith('/') ? url.slice(0, -1) : url; + const url = process.env.STATUS_LIST_SERVER_URL + if (!url) { + throw new Error('STATUS_LIST_SERVER_URL is not configured') + } + return url.endsWith('/') ? url.slice(0, -1) : url } function getApiKeyHeaders() { - const key = process.env.STATUS_LIST_API_KEY; - if (!key) { - throw new Error('STATUS_LIST_API_KEY is not configured'); - } - const headers: Record = { 'Content-Type': 'application/json' }; - headers['x-api-key'] = key; - return headers; + const key = process.env.STATUS_LIST_API_KEY + if (!key) { + throw new Error('STATUS_LIST_API_KEY is not configured') + } + const headers: Record = { 'Content-Type': 'application/json' } + headers['x-api-key'] = key + return headers } async function getKmsKeyIdForDid(agent: Agent, did: string, verificationMethodId: string) { - const didRecords = await agent.dids.getCreatedDids({ did }); - const didRecord = didRecords[0]; - if (didRecord && didRecord.keys) { - const relativeId = verificationMethodId.includes('#') ? verificationMethodId.split('#')[1] : verificationMethodId; - const keyMap = didRecord.keys.find((k: any) => k.didDocumentRelativeKeyId === `#${relativeId}` || k.didDocumentRelativeKeyId === relativeId); - if (keyMap) { - return keyMap.kmsKeyId; - } + const didRecords = await agent.dids.getCreatedDids({ did }) + const didRecord = didRecords[0] + if (didRecord && didRecord.keys) { + const relativeId = verificationMethodId.includes('#') ? verificationMethodId.split('#')[1] : verificationMethodId + const keyMap = didRecord.keys.find( + (k: any) => k.didDocumentRelativeKeyId === `#${relativeId}` || k.didDocumentRelativeKeyId === relativeId, + ) + if (keyMap) { + return keyMap.kmsKeyId } - return verificationMethodId; + } + return verificationMethodId } -async function signStatusList(agent: Agent, verificationMethod: VerificationMethod, statusList: StatusList, listId: string, issuerDid: string): Promise { - const payload = new JwtPayload({ - iss: issuerDid, - sub: `${getServerUrl()}/${STATUS_LISTS_PATH}/${listId}`, - iat: Math.floor(Date.now() / 1000), - additionalClaims: { - status_list: { - bits: statusList.getBitsPerStatus(), - lst: statusList.compressStatusList(), - } - } - }); - - const alg = getAlgFromVerificationMethod(verificationMethod); - const jwsService = agent.dependencyManager.resolve(JwsService); - const kmsKeyId = await getKmsKeyIdForDid(agent, issuerDid, verificationMethod.id); - - const header: JwsProtectedHeaderOptions = { - alg: alg as any, - typ: 'statuslist+jwt', - kid: verificationMethod.id, - }; - - return jwsService.createJwsCompact(agent.context, { - keyId: kmsKeyId, - payload, - protectedHeaderOptions: header, - }); +async function signStatusList( + agent: Agent, + verificationMethod: VerificationMethod, + statusList: StatusList, + listId: string, + issuerDid: string, +): Promise { + const payload = new JwtPayload({ + iss: issuerDid, + sub: `${getServerUrl()}/${STATUS_LISTS_PATH}/${listId}`, + iat: Math.floor(Date.now() / 1000), + additionalClaims: { + status_list: { + bits: statusList.getBitsPerStatus(), + lst: statusList.compressStatusList(), + }, + }, + }) + + const alg = getAlgFromVerificationMethod(verificationMethod) + const jwsService = agent.dependencyManager.resolve(JwsService) + const kmsKeyId = await getKmsKeyIdForDid(agent, issuerDid, verificationMethod.id) + + const header: JwsProtectedHeaderOptions = { + alg: alg as any, + typ: 'statuslist+jwt', + kid: verificationMethod.id, + } + + return jwsService.createJwsCompact(agent.context, { + keyId: kmsKeyId, + payload, + protectedHeaderOptions: header, + }) } export async function checkAndCreateStatusList(agent: Agent, listId: string, issuerDid: string, listSize?: number) { - const previousLock = statusListLocks.get(listId) || Promise.resolve(); - - let releaseLock: () => void; - const currentLock = new Promise((resolve) => { - releaseLock = resolve; - }); - - statusListLocks.set(listId, currentLock); - - try { - await previousLock; - - const uri = `${getServerUrl()}/${STATUS_LISTS_PATH}/${listId}`; - - const res = await fetchWithTimeout(uri, { - headers: getApiKeyHeaders() - }); - - if (res.status === 404) { - console.log(`Status list ${listId} not found, creating a new one...`); - const size = listSize || Number(process.env.STATUS_LIST_DEFAULT_SIZE); - const statusList = new StatusList(new Array(size).fill(0), 1); - - const didDocument = await agent.dids.resolve(issuerDid); - const verificationMethod = didDocument.didDocument ? getVerificationMethod(didDocument.didDocument) : undefined; - - if (!verificationMethod) { - throw new Error(`Could not find suitable verification method (assertionMethod) for DID ${issuerDid}`); - } - - const jwt = await signStatusList(agent, verificationMethod, statusList, listId, issuerDid); - const postRes = await fetchWithTimeout(`${getServerUrl()}/${STATUS_LISTS_PATH}`, { - method: 'POST', - headers: getApiKeyHeaders(), - body: JSON.stringify({ id: listId, jwt }), - }); - - if (!postRes.ok && postRes.status !== 409) { - const errBody = await postRes.text(); - throw new Error(`Failed to create list on server: ${postRes.status} ${errBody}`); - } - - console.log(`Successfully created and published new status list ${listId}`); - } else if (!res.ok) { - const errBody = await res.text().catch(() => ''); - throw new Error(`Failed to check status list ${listId} at ${uri}: ${res.status} ${res.statusText} ${errBody}`); - } - } catch (error) { - console.error(`Error in checkAndCreateStatusList:`, error); - throw error; - } finally { - releaseLock!(); - if (statusListLocks.get(listId) === currentLock) { - statusListLocks.delete(listId); - } + const previousLock = statusListLocks.get(listId) || Promise.resolve() + + let releaseLock: () => void + const currentLock = new Promise((resolve) => { + releaseLock = resolve + }) + + statusListLocks.set(listId, currentLock) + + try { + await previousLock + + const uri = `${getServerUrl()}/${STATUS_LISTS_PATH}/${listId}` + + const res = await fetchWithTimeout(uri, { + headers: getApiKeyHeaders(), + }) + + if (res.status === 404) { + console.log(`Status list ${listId} not found, creating a new one...`) + const size = listSize || Number(process.env.STATUS_LIST_DEFAULT_SIZE) + const statusList = new StatusList(new Array(size).fill(0), 1) + + const didDocument = await agent.dids.resolve(issuerDid) + const verificationMethod = didDocument.didDocument ? getVerificationMethod(didDocument.didDocument) : undefined + + if (!verificationMethod) { + throw new Error(`Could not find suitable verification method (assertionMethod) for DID ${issuerDid}`) + } + + const jwt = await signStatusList(agent, verificationMethod, statusList, listId, issuerDid) + const postRes = await fetchWithTimeout(`${getServerUrl()}/${STATUS_LISTS_PATH}`, { + method: 'POST', + headers: getApiKeyHeaders(), + body: JSON.stringify({ id: listId, jwt }), + }) + + if (!postRes.ok && postRes.status !== 409) { + const errBody = await postRes.text() + throw new Error(`Failed to create list on server: ${postRes.status} ${errBody}`) + } + + console.log(`Successfully created and published new status list ${listId}`) + } else if (!res.ok) { + const errBody = await res.text().catch(() => '') + throw new Error(`Failed to check status list ${listId} at ${uri}: ${res.status} ${res.statusText} ${errBody}`) + } + } catch (error) { + console.error(`Error in checkAndCreateStatusList:`, error) + throw error + } finally { + releaseLock!() + if (statusListLocks.get(listId) === currentLock) { + statusListLocks.delete(listId) } + } } export async function revokeCredentialInStatusList(agent: Agent, listId: string, index: number, issuerDid: string) { - const previousLock = statusListLocks.get(listId) || Promise.resolve(); - - let releaseLock: () => void; - const currentLock = new Promise((resolve) => { - releaseLock = resolve; - }); - - statusListLocks.set(listId, currentLock); - - try { - await previousLock; - - const uri = `${getServerUrl()}/${STATUS_LISTS_PATH}/${listId}`; - - const res = await fetchWithTimeout(uri, { - headers: getApiKeyHeaders(), - }); - if (!res.ok) { - const errBody = await res.text().catch(() => ''); - throw new Error(`Failed to fetch status list to revoke at ${uri}: ${res.status} ${res.statusText} ${errBody}`); - } - - const currentJwt = await res.text(); - const statusList = getListFromStatusListJWT(currentJwt); - - statusList.setStatus(index, 1); - - const didDocument = await agent.dids.resolve(issuerDid); - const verificationMethod = didDocument.didDocument ? getVerificationMethod(didDocument.didDocument) : undefined; - if (!verificationMethod) throw new Error(`Could not find suitable verification method (assertionMethod) for DID ${issuerDid}`); - - const newJwt = await signStatusList(agent, verificationMethod, statusList, listId, issuerDid); - - const patchRes = await fetchWithTimeout(`${getServerUrl()}/${STATUS_LISTS_PATH}/${listId}`, { - method: 'PATCH', - headers: getApiKeyHeaders(), - body: JSON.stringify({ jwt: newJwt }), - }); - - if (!patchRes.ok) { - const errBody = await patchRes.text(); - throw new Error(`Failed to update status list on server: ${patchRes.status} ${errBody}`); - } - } finally { - releaseLock!(); - if (statusListLocks.get(listId) === currentLock) { - statusListLocks.delete(listId); - } + const previousLock = statusListLocks.get(listId) || Promise.resolve() + + let releaseLock: () => void + const currentLock = new Promise((resolve) => { + releaseLock = resolve + }) + + statusListLocks.set(listId, currentLock) + + try { + await previousLock + + const uri = `${getServerUrl()}/${STATUS_LISTS_PATH}/${listId}` + + const res = await fetchWithTimeout(uri, { + headers: getApiKeyHeaders(), + }) + if (!res.ok) { + const errBody = await res.text().catch(() => '') + throw new Error(`Failed to fetch status list to revoke at ${uri}: ${res.status} ${res.statusText} ${errBody}`) + } + + const currentJwt = await res.text() + const statusList = getListFromStatusListJWT(currentJwt) + + statusList.setStatus(index, 1) + + const didDocument = await agent.dids.resolve(issuerDid) + const verificationMethod = didDocument.didDocument ? getVerificationMethod(didDocument.didDocument) : undefined + if (!verificationMethod) + throw new Error(`Could not find suitable verification method (assertionMethod) for DID ${issuerDid}`) + + const newJwt = await signStatusList(agent, verificationMethod, statusList, listId, issuerDid) + + const patchRes = await fetchWithTimeout(`${getServerUrl()}/${STATUS_LISTS_PATH}/${listId}`, { + method: 'PATCH', + headers: getApiKeyHeaders(), + body: JSON.stringify({ jwt: newJwt }), + }) + + if (!patchRes.ok) { + const errBody = await patchRes.text() + throw new Error(`Failed to update status list on server: ${patchRes.status} ${errBody}`) + } + } finally { + releaseLock!() + if (statusListLocks.get(listId) === currentLock) { + statusListLocks.delete(listId) } -} \ No newline at end of file + } +} diff --git a/tsconfig.build.json b/tsconfig.build.json index d8e50b2d..f8eeb955 100644 --- a/tsconfig.build.json +++ b/tsconfig.build.json @@ -13,17 +13,10 @@ "emitDecoratorMetadata": true, "skipLibCheck": true, "outDir": "./build", - "types": [ - "node" - ], - "lib": [ - "ESNext" - ] + "types": ["node"], + "lib": ["ESNext"] }, - "include": [ - "src/**/*", - "src/routes" - ], + "include": ["src/**/*", "src/routes"], "exclude": [ "node_modules", "build", diff --git a/tsoa.json b/tsoa.json index 7e8fb938..e4715fb3 100644 --- a/tsoa.json +++ b/tsoa.json @@ -25,4 +25,4 @@ "iocModule": "./src/utils/tsyringeTsoaIocContainer", "authenticationModule": "src/authentication" } -} \ No newline at end of file +} From dca73809c4e9bf8cedc0676d18f9b6800b162c8c Mon Sep 17 00:00:00 2001 From: Tipu_Singh Date: Mon, 4 May 2026 17:42:29 +0530 Subject: [PATCH 148/152] fix: yarn --fix Signed-off-by: Tipu_Singh --- src/authentication.ts | 4 ++-- src/cli.ts | 2 +- .../credentials/CredentialController.ts | 2 +- .../didcomm/outofband/OutOfBandController.ts | 2 +- .../didcomm/proofs/ProofController.ts | 5 ++--- .../issuance-sessions.Controller.ts | 3 +-- .../issuance-sessions.service.ts | 3 +-- .../openid4vc/types/issuer.types.ts | 3 +-- .../verification-sessions.Controller.ts | 2 +- src/controllers/polygon/PolygonController.ts | 2 +- src/controllers/x509/x509.types.ts | 2 +- src/events/BasicMessageEvents.ts | 4 +++- src/events/ConnectionEvents.ts | 3 ++- src/events/CredentialEvents.ts | 3 ++- src/events/ProofEvents.ts | 4 +++- src/events/ReuseConnectionEvents.ts | 3 ++- src/events/openId4VcIssuanceSessionEvents.ts | 5 +++-- .../openId4VcVerificationSessionEvents.ts | 4 +++- src/purge/PurgeConfigValidator.ts | 3 ++- src/purge/PurgeWebhook.ts | 3 ++- src/purge/PurgeWorker.ts | 4 ++-- src/purge/schedulers/CronPurgeScheduler.ts | 4 ++-- src/purge/schedulers/NatsPurgeScheduler.ts | 5 ++--- src/server.ts | 20 +++++++++---------- src/utils/NatsAuthenticator.ts | 7 +++---- src/utils/helpers.ts | 3 ++- src/utils/statusListService.ts | 5 ++++- 27 files changed, 60 insertions(+), 50 deletions(-) diff --git a/src/authentication.ts b/src/authentication.ts index 29a7e939..838a2cbf 100644 --- a/src/authentication.ts +++ b/src/authentication.ts @@ -1,15 +1,15 @@ import type { RestAgentModules, RestMultiTenantAgentModules } from './cliAgent' +import type { TenantAgent } from '@credo-ts/tenants' import type { Request } from 'express' import { Agent, LogLevel } from '@credo-ts/core' import jwt, { decode } from 'jsonwebtoken' +import { randomUUID as uuid } from 'node:crypto' import { container } from 'tsyringe' import { AgentRole, ErrorMessages, SCOPES } from './enums' import { StatusException } from './errors' import { TsLogger } from './utils/logger' -import { TenantAgent } from '@credo-ts/tenants' -import { randomUUID as uuid } from 'node:crypto' // export type AgentType = Agent | Agent | TenantAgent diff --git a/src/cli.ts b/src/cli.ts index 3ea425a1..78f49d03 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -1,8 +1,8 @@ import type { AriesRestConfig } from './cliAgent.js' +import dotenv from 'dotenv' import yargs from 'yargs' import { hideBin } from 'yargs/helpers' -import dotenv from 'dotenv' dotenv.config() diff --git a/src/controllers/didcomm/credentials/CredentialController.ts b/src/controllers/didcomm/credentials/CredentialController.ts index 0da39061..e7a7e1c3 100644 --- a/src/controllers/didcomm/credentials/CredentialController.ts +++ b/src/controllers/didcomm/credentials/CredentialController.ts @@ -14,8 +14,8 @@ import { injectable } from 'tsyringe' import { SCOPES } from '../../../enums' import ErrorHandlingService from '../../../errorHandlingService' -import { SchedulePurge } from '../../../purge/decorators/SchedulePurge' import { PurgeRecordType } from '../../../purge/PurgeTypes' +import { SchedulePurge } from '../../../purge/decorators/SchedulePurge' import { AgentType } from '../../../types' import { CredentialExchangeRecordExample, RecordId } from '../../examples' import { diff --git a/src/controllers/didcomm/outofband/OutOfBandController.ts b/src/controllers/didcomm/outofband/OutOfBandController.ts index 2923668d..7b945ecc 100644 --- a/src/controllers/didcomm/outofband/OutOfBandController.ts +++ b/src/controllers/didcomm/outofband/OutOfBandController.ts @@ -3,7 +3,6 @@ import type { RecipientKeyOption, CreateInvitationOptions, AgentMessageType } fr import type { PeerDidNumAlgo2CreateOptions } from '@credo-ts/core' import { createPeerDidDocumentFromServices, JsonTransformer, PeerDidNumAlgo } from '@credo-ts/core' - import { DidCommConnectionRecordProps, DidCommRouting, @@ -13,6 +12,7 @@ import { import { Request as Req } from 'express' import { Body, Controller, Delete, Example, Get, Path, Post, Query, Route, Tags, Security, Request } from 'tsoa' import { injectable } from 'tsyringe' + import { SCOPES } from '../../../enums' import ErrorHandlingService from '../../../errorHandlingService' import { InternalServerError, NotFoundError } from '../../../errors' diff --git a/src/controllers/didcomm/proofs/ProofController.ts b/src/controllers/didcomm/proofs/ProofController.ts index 0f23eb6a..76a870de 100644 --- a/src/controllers/didcomm/proofs/ProofController.ts +++ b/src/controllers/didcomm/proofs/ProofController.ts @@ -1,21 +1,20 @@ import type { PeerDidNumAlgo2CreateOptions } from '@credo-ts/core' +import { PeerDidNumAlgo, createPeerDidDocumentFromServices } from '@credo-ts/core' import { AcceptProofRequestOptions, DidCommProofExchangeRecordProps, ProofsProtocolVersionType, DidCommRouting, } 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 { SCOPES } from '../../../enums' import ErrorHandlingService from '../../../errorHandlingService' -import { SchedulePurge } from '../../../purge/decorators/SchedulePurge' import { PurgeRecordType } from '../../../purge/PurgeTypes' +import { SchedulePurge } from '../../../purge/decorators/SchedulePurge' import { ProofRecordExample, RecordId } from '../../examples' import { AcceptProofProposal, diff --git a/src/controllers/openid4vc/issuance-sessions/issuance-sessions.Controller.ts b/src/controllers/openid4vc/issuance-sessions/issuance-sessions.Controller.ts index a12ed7d6..72da4824 100644 --- a/src/controllers/openid4vc/issuance-sessions/issuance-sessions.Controller.ts +++ b/src/controllers/openid4vc/issuance-sessions/issuance-sessions.Controller.ts @@ -4,10 +4,9 @@ import { Body, Controller, Delete, Get, Path, Post, Put, Query, Request, Route, import { injectable } from 'tsyringe' import { SCOPES } from '../../../enums' -// eslint-disable-next-line import/order import ErrorHandlingService from '../../../errorHandlingService' -import { SchedulePurge } from '../../../purge/decorators/SchedulePurge' import { PurgeRecordType } from '../../../purge/PurgeTypes' +import { SchedulePurge } from '../../../purge/decorators/SchedulePurge' // import { AgentWithRootOrTenant } from '../../types/agent' import { OpenId4VcIssuanceSessionsCreateOffer } from '../types/issuer.types' diff --git a/src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts b/src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts index 588bec6f..97ed3f35 100644 --- a/src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts +++ b/src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts @@ -6,9 +6,8 @@ import { OpenId4VcIssuanceSessionRepository } from '@credo-ts/openid4vc' import { CredentialFormat, SignerMethod } from '../../../enums/enum' import { BadRequestError, NotFoundError } from '../../../errors/errors' - -import { checkAndCreateStatusList, getServerUrl, revokeCredentialInStatusList } from '../../../utils/statusListService' import { STATUS_LISTS_PATH } from '../../../utils/constant' +import { checkAndCreateStatusList, getServerUrl, revokeCredentialInStatusList } from '../../../utils/statusListService' class IssuanceSessionsService { public async createCredentialOffer(options: OpenId4VcIssuanceSessionsCreateOffer, agentReq: Req) { diff --git a/src/controllers/openid4vc/types/issuer.types.ts b/src/controllers/openid4vc/types/issuer.types.ts index 38c7a853..93b6dca4 100644 --- a/src/controllers/openid4vc/types/issuer.types.ts +++ b/src/controllers/openid4vc/types/issuer.types.ts @@ -1,11 +1,10 @@ +import type { SignerMethod } from '../../../enums/enum' import type { MdocNameSpaces, W3cCredential } from '@credo-ts/core' import type { OpenId4VciCredentialFormatProfile } from '@credo-ts/openid4vc' import { Kms } from '@credo-ts/core' import { OpenId4VciCreateCredentialOfferOptions, OpenId4VciSignCredentials } from '@credo-ts/openid4vc' -import { SignerMethod } from '../../../enums/enum' - export interface OpenId4VciOfferCredentials { credentialSupportedId: string format: OpenId4VciCredentialFormatProfile diff --git a/src/controllers/openid4vc/verifier-sessions/verification-sessions.Controller.ts b/src/controllers/openid4vc/verifier-sessions/verification-sessions.Controller.ts index b6d945cd..86c58f51 100644 --- a/src/controllers/openid4vc/verifier-sessions/verification-sessions.Controller.ts +++ b/src/controllers/openid4vc/verifier-sessions/verification-sessions.Controller.ts @@ -5,8 +5,8 @@ import { injectable } from 'tsyringe' import { SCOPES } from '../../../enums' import ErrorHandlingService from '../../../errorHandlingService' -import { SchedulePurge } from '../../../purge/decorators/SchedulePurge' import { PurgeRecordType } from '../../../purge/PurgeTypes' +import { SchedulePurge } from '../../../purge/decorators/SchedulePurge' import { CreateAuthorizationRequest, OpenId4VCDCQLVerificationSessionRecord } from '../types/verifier.types' import { VerificationSessionsService } from './verification-sessions.service' diff --git a/src/controllers/polygon/PolygonController.ts b/src/controllers/polygon/PolygonController.ts index c2f96ca8..034817bc 100644 --- a/src/controllers/polygon/PolygonController.ts +++ b/src/controllers/polygon/PolygonController.ts @@ -1,6 +1,7 @@ import type { SchemaMetadata } from '../types' 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' @@ -9,7 +10,6 @@ import { injectable } from 'tsyringe' import { CredentialEnum, SCOPES } from '../../enums' import ErrorHandlingService from '../../errorHandlingService' import { BadRequestError, UnprocessableEntityError } from '../../errors' -import { DidOperation, DidOperationOptions } from '@ayanworks/credo-polygon-w3c-module' @Tags('Polygon') @Route('/polygon') diff --git a/src/controllers/x509/x509.types.ts b/src/controllers/x509/x509.types.ts index 11417255..a642a0ae 100644 --- a/src/controllers/x509/x509.types.ts +++ b/src/controllers/x509/x509.types.ts @@ -1,5 +1,5 @@ +import type { Curve } from '../types' import type { X509ExtendedKeyUsage, X509KeyUsage } from '@credo-ts/core' -import { Curve } from '../types' // Enum remains the same export enum GeneralNameType { diff --git a/src/events/BasicMessageEvents.ts b/src/events/BasicMessageEvents.ts index e064995e..18c411ea 100644 --- a/src/events/BasicMessageEvents.ts +++ b/src/events/BasicMessageEvents.ts @@ -1,6 +1,8 @@ import type { ServerConfig } from '../utils/ServerConfig' import type { Agent } from '@credo-ts/core' -import { DidCommBasicMessageEventTypes, DidCommBasicMessageStateChangedEvent } from '@credo-ts/didcomm' +import type { DidCommBasicMessageStateChangedEvent } from '@credo-ts/didcomm' + +import { DidCommBasicMessageEventTypes } from '@credo-ts/didcomm' import { sendWebSocketEvent } from './WebSocketEvents' import { sendWebhookEvent } from './WebhookEvent' diff --git a/src/events/ConnectionEvents.ts b/src/events/ConnectionEvents.ts index 7a67a7d2..108e4515 100644 --- a/src/events/ConnectionEvents.ts +++ b/src/events/ConnectionEvents.ts @@ -1,7 +1,8 @@ import type { ServerConfig } from '../utils/ServerConfig' import type { Agent } from '@credo-ts/core' +import type { DidCommConnectionStateChangedEvent } from '@credo-ts/didcomm' -import { DidCommConnectionEventTypes, DidCommConnectionStateChangedEvent } from '@credo-ts/didcomm' +import { DidCommConnectionEventTypes } from '@credo-ts/didcomm' import { sendWebSocketEvent } from './WebSocketEvents' import { sendWebhookEvent } from './WebhookEvent' diff --git a/src/events/CredentialEvents.ts b/src/events/CredentialEvents.ts index e1b492fd..426dc61a 100644 --- a/src/events/CredentialEvents.ts +++ b/src/events/CredentialEvents.ts @@ -1,8 +1,9 @@ import type { RestMultiTenantAgentModules } from '../cliAgent' import type { ServerConfig } from '../utils/ServerConfig' import type { Agent } from '@credo-ts/core' +import type { DidCommCredentialStateChangedEvent } from '@credo-ts/didcomm' -import { DidCommCredentialEventTypes, DidCommCredentialStateChangedEvent } from '@credo-ts/didcomm' +import { DidCommCredentialEventTypes } from '@credo-ts/didcomm' import { sendWebSocketEvent } from './WebSocketEvents' import { sendWebhookEvent } from './WebhookEvent' diff --git a/src/events/ProofEvents.ts b/src/events/ProofEvents.ts index 1dac15db..df6ebaed 100644 --- a/src/events/ProofEvents.ts +++ b/src/events/ProofEvents.ts @@ -1,6 +1,8 @@ import type { ServerConfig } from '../utils/ServerConfig' import type { Agent } from '@credo-ts/core' -import { DidCommProofStateChangedEvent, DidCommProofEventTypes } from '@credo-ts/didcomm' +import type { DidCommProofStateChangedEvent } from '@credo-ts/didcomm' + +import { DidCommProofEventTypes } from '@credo-ts/didcomm' import { sendWebSocketEvent } from './WebSocketEvents' import { sendWebhookEvent } from './WebhookEvent' diff --git a/src/events/ReuseConnectionEvents.ts b/src/events/ReuseConnectionEvents.ts index 5ad47afc..275bc700 100644 --- a/src/events/ReuseConnectionEvents.ts +++ b/src/events/ReuseConnectionEvents.ts @@ -1,7 +1,8 @@ import type { ServerConfig } from '../utils/ServerConfig' import type { Agent } from '@credo-ts/core' +import type { DidCommHandshakeReusedEvent } from '@credo-ts/didcomm' -import { DidCommOutOfBandEventTypes, DidCommHandshakeReusedEvent } from '@credo-ts/didcomm' +import { DidCommOutOfBandEventTypes } from '@credo-ts/didcomm' import { sendWebSocketEvent } from './WebSocketEvents' import { sendWebhookEvent } from './WebhookEvent' diff --git a/src/events/openId4VcIssuanceSessionEvents.ts b/src/events/openId4VcIssuanceSessionEvents.ts index 18267b1b..cc8c63ea 100644 --- a/src/events/openId4VcIssuanceSessionEvents.ts +++ b/src/events/openId4VcIssuanceSessionEvents.ts @@ -1,10 +1,11 @@ import type { ServerConfig } from '../utils/ServerConfig' import type { Agent } from '@credo-ts/core' +import type { OpenId4VcIssuanceSessionStateChangedEvent } from '@credo-ts/openid4vc' + +import { OpenId4VcIssuerEvents } from '@credo-ts/openid4vc' import { sendWebSocketEvent } from './WebSocketEvents' import { sendWebhookEvent } from './WebhookEvent' -import { OpenId4VcIssuerEvents } from '@credo-ts/openid4vc' -import type { OpenId4VcIssuanceSessionStateChangedEvent } from '@credo-ts/openid4vc' export const openId4VcIssuanceSessionEvents = async (agent: Agent, config: ServerConfig) => { agent.events.on( diff --git a/src/events/openId4VcVerificationSessionEvents.ts b/src/events/openId4VcVerificationSessionEvents.ts index 50fbdf03..302881a2 100644 --- a/src/events/openId4VcVerificationSessionEvents.ts +++ b/src/events/openId4VcVerificationSessionEvents.ts @@ -1,9 +1,11 @@ import type { ServerConfig } from '../utils/ServerConfig' import type { Agent } from '@credo-ts/core' +import type { OpenId4VcVerificationSessionStateChangedEvent } from '@credo-ts/openid4vc' + +import { OpenId4VcVerifierEvents } from '@credo-ts/openid4vc' import { sendWebSocketEvent } from './WebSocketEvents' import { sendWebhookEvent } from './WebhookEvent' -import { OpenId4VcVerificationSessionStateChangedEvent, OpenId4VcVerifierEvents } from '@credo-ts/openid4vc' export const openId4VcVerificationSessionEvents = async (agent: Agent, config: ServerConfig) => { agent.events.on( diff --git a/src/purge/PurgeConfigValidator.ts b/src/purge/PurgeConfigValidator.ts index b2f316bf..0096f8f6 100644 --- a/src/purge/PurgeConfigValidator.ts +++ b/src/purge/PurgeConfigValidator.ts @@ -1,7 +1,8 @@ +import type { NatsConfig, PurgeConfig } from './PurgeTypes' + import { connect } from 'nats' import { buildNatsAuthenticator } from '../utils/NatsAuthenticator' -import type { NatsConfig, PurgeConfig } from './PurgeTypes' export async function validatePurgeConfig(config: PurgeConfig): Promise { const { natsConfig, cronConfig } = config diff --git a/src/purge/PurgeWebhook.ts b/src/purge/PurgeWebhook.ts index fa1dbf55..377676d1 100644 --- a/src/purge/PurgeWebhook.ts +++ b/src/purge/PurgeWebhook.ts @@ -1,8 +1,9 @@ +import type { PurgeRecordType } from './PurgeTypes' import type { Logger } from '@credo-ts/core' import { sleep } from '../utils/webhook' + import { PURGE_WEBHOOK_PATHS, PURGE_WEBHOOK_RETRY_DELAYS_MS } from './PurgeConstants' -import type { PurgeRecordType } from './PurgeTypes' export enum PurgeDeletionStatus { DELETED = 'deleted', diff --git a/src/purge/PurgeWorker.ts b/src/purge/PurgeWorker.ts index 85e69a65..2167927a 100644 --- a/src/purge/PurgeWorker.ts +++ b/src/purge/PurgeWorker.ts @@ -1,3 +1,5 @@ +import type { PurgeJob } from './PurgeTypes' +import type { PurgeRecordType } from './PurgeTypes' import type { Agent } from '@credo-ts/core' import type { Consumer } from 'nats' @@ -7,8 +9,6 @@ import { StringCodec } from 'nats' import { PURGE_CONSUMER_MAX_DELIVER, PURGE_WORKER_RESTART_DELAY_MS } from './PurgeConstants' import { deletePurgeRecord } from './PurgeDeleteRecord' import { sendPurgeWebhook, PurgeDeletionStatus } from './PurgeWebhook' -import type { PurgeJob } from './PurgeTypes' -import { PurgeRecordType } from './PurgeTypes' const sc = StringCodec() diff --git a/src/purge/schedulers/CronPurgeScheduler.ts b/src/purge/schedulers/CronPurgeScheduler.ts index 2d47b1da..8295852e 100644 --- a/src/purge/schedulers/CronPurgeScheduler.ts +++ b/src/purge/schedulers/CronPurgeScheduler.ts @@ -1,3 +1,4 @@ +import type { PurgeConfig } from '../PurgeTypes' import type { Agent } from '@credo-ts/core' import type { ScheduledTask } from 'node-cron' @@ -6,9 +7,8 @@ import { OpenId4VcIssuanceSessionRepository, OpenId4VcVerificationSessionReposit import cron from 'node-cron' import { deletePurgeRecord } from '../PurgeDeleteRecord' -import { sendPurgeWebhook, PurgeDeletionStatus } from '../PurgeWebhook' -import type { PurgeConfig } from '../PurgeTypes' import { PurgeRecordType } from '../PurgeTypes' +import { sendPurgeWebhook, PurgeDeletionStatus } from '../PurgeWebhook' export class CronPurgeScheduler { private job: ScheduledTask | null = null diff --git a/src/purge/schedulers/NatsPurgeScheduler.ts b/src/purge/schedulers/NatsPurgeScheduler.ts index 31a43bca..ff660013 100644 --- a/src/purge/schedulers/NatsPurgeScheduler.ts +++ b/src/purge/schedulers/NatsPurgeScheduler.ts @@ -1,10 +1,11 @@ +import type { AgentMode, PurgeConfig, PurgeJob } from '../PurgeTypes' +import type { PurgeRecordType } from '../PurgeTypes' import type { Agent } from '@credo-ts/core' import type { JetStreamClient, JetStreamManager, NatsConnection } from 'nats' import { AckPolicy, DiscardPolicy, RetentionPolicy, StorageType, StringCodec, connect, headers } from 'nats' import { buildNatsAuthenticator } from '../../utils/NatsAuthenticator' - import { NATS_ERR_CONSUMER_ALREADY_EXISTS, NATS_ERR_STREAM_ALREADY_EXISTS, @@ -21,8 +22,6 @@ import { PURGE_STREAM, PURGE_STREAM_BUFFER_NS, } from '../PurgeConstants' -import type { AgentMode, PurgeConfig, PurgeJob } from '../PurgeTypes' -import { PurgeRecordType } from '../PurgeTypes' import { PurgeWorker } from '../PurgeWorker' const sc = StringCodec() diff --git a/src/server.ts b/src/server.ts index 31042563..85355442 100644 --- a/src/server.ts +++ b/src/server.ts @@ -7,17 +7,7 @@ import type { ServerConfig } from './utils/ServerConfig' import type { Response as ExResponse, Request as ExRequest, NextFunction, ErrorRequestHandler } from 'express' import { Agent } from '@credo-ts/core' -import bodyParser from 'body-parser' -import cors from 'cors' -import dotenv from 'dotenv' -import express from 'express' -import { rateLimit } from 'express-rate-limit' -import * as fs from 'fs' -import { generateHTML, serve } from 'swagger-ui-express' -import { ValidateError } from 'tsoa' -import { container } from 'tsyringe' -import { setDynamicApiKey } from './authentication' import { validateAuthConfig } from './utils/auth' import { ErrorMessages } from './enums' import { BaseError } from './errors/errors' @@ -32,6 +22,16 @@ import { SecurityMiddleware } from './securityMiddleware' import { openId4VcIssuanceSessionEvents } from './events/openId4VcIssuanceSessionEvents' import { openId4VcVerificationSessionEvents } from './events/openId4VcVerificationSessionEvents' import { TenantAgent } from '@credo-ts/tenants' +import bodyParser from 'body-parser' +import cors from 'cors' +import dotenv from 'dotenv' +import express from 'express' +import { rateLimit } from 'express-rate-limit' +import * as fs from 'fs' +import { generateHTML, serve } from 'swagger-ui-express' +import { ValidateError } from 'tsoa' +import { container } from 'tsyringe' +import { setDynamicApiKey } from './authentication' dotenv.config() diff --git a/src/utils/NatsAuthenticator.ts b/src/utils/NatsAuthenticator.ts index a3420589..36f232d6 100644 --- a/src/utils/NatsAuthenticator.ts +++ b/src/utils/NatsAuthenticator.ts @@ -1,9 +1,8 @@ -import { readFileSync } from 'node:fs' - +import type { NatsConfig } from '../purge/PurgeTypes' import type { Authenticator } from 'nats' -import { credsAuthenticator, nkeyAuthenticator, usernamePasswordAuthenticator } from 'nats' -import type { NatsConfig } from '../purge/PurgeTypes' +import { credsAuthenticator, nkeyAuthenticator, usernamePasswordAuthenticator } from 'nats' +import { readFileSync } from 'node:fs' export type NatsAuthType = 'nkey' | 'creds' | 'usernamePassword' | 'none' diff --git a/src/utils/helpers.ts b/src/utils/helpers.ts index 6d0d24e5..b7ef074f 100644 --- a/src/utils/helpers.ts +++ b/src/utils/helpers.ts @@ -1,7 +1,8 @@ import type { Curve, EcCurve, EcType, OkpCurve, OkpType } from '../controllers/types' +import type { DidDocument, VerificationMethod } from '@credo-ts/core' import type { KeyAlgorithm } from '@openwallet-foundation/askar-nodejs' -import { JsonEncoder, JsonTransformer, DidDocument, VerificationMethod } from '@credo-ts/core' +import { JsonEncoder, JsonTransformer } from '@credo-ts/core' import axios from 'axios' import { randomBytes } from 'crypto' diff --git a/src/utils/statusListService.ts b/src/utils/statusListService.ts index 4081f57d..f89e0117 100644 --- a/src/utils/statusListService.ts +++ b/src/utils/statusListService.ts @@ -1,5 +1,8 @@ -import { Agent, JwsProtectedHeaderOptions, JwsService, JwtPayload, VerificationMethod } from '@credo-ts/core' +import type { Agent, JwsProtectedHeaderOptions, VerificationMethod } from '@credo-ts/core' + +import { JwsService, JwtPayload } from '@credo-ts/core' import { StatusList, getListFromStatusListJWT } from '@sd-jwt/jwt-status-list' + import { STATUS_LISTS_PATH } from './constant' import { getAlgFromVerificationMethod, getVerificationMethod, fetchWithTimeout } from './helpers' From 80f4e50954f63b3770822ce07eb1ded6ff786e34 Mon Sep 17 00:00:00 2001 From: Tipu_Singh Date: Mon, 4 May 2026 18:25:11 +0530 Subject: [PATCH 149/152] fix: linting issues Signed-off-by: Tipu_Singh --- eslint.config.mjs | 8 ++-- package.json | 1 + .../issuance-sessions.Controller.ts | 1 - src/purge/PurgeWorker.ts | 24 +--------- src/purge/decorators/SchedulePurge.ts | 19 ++------ src/purge/schedulers/CronPurgeScheduler.ts | 26 +---------- src/purge/schedulers/NatsPurgeScheduler.ts | 46 +++++-------------- src/server.ts | 28 +++++------ src/utils/auth.ts | 3 -- src/utils/helpers.ts | 38 +-------------- src/utils/statusListService.ts | 4 -- 11 files changed, 39 insertions(+), 159 deletions(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index 9b366d5c..e35eed41 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -9,12 +9,12 @@ const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); export default [ + { + ignores: ['**/build/**', '**/*.js', '**/*.d.ts'], + }, { ignores: [ - '**/tests/*', - '**/build/**', - '**/*.js', - '**/*.d.ts', + '**/tests/*', ], files: ['**/*.ts'], languageOptions: { diff --git a/package.json b/package.json index a7c26005..9ad5fcdc 100644 --- a/package.json +++ b/package.json @@ -40,6 +40,7 @@ }, "dependencies": { "@ayanworks/credo-polygon-w3c-module": "2.0.2", + "@sd-jwt/jwt-status-list": "0.19.0", "@credo-ts/anoncreds": "0.6.2", "@credo-ts/askar": "0.6.2", "@credo-ts/core": "0.6.2", diff --git a/src/controllers/openid4vc/issuance-sessions/issuance-sessions.Controller.ts b/src/controllers/openid4vc/issuance-sessions/issuance-sessions.Controller.ts index 72da4824..642458cc 100644 --- a/src/controllers/openid4vc/issuance-sessions/issuance-sessions.Controller.ts +++ b/src/controllers/openid4vc/issuance-sessions/issuance-sessions.Controller.ts @@ -7,7 +7,6 @@ import { SCOPES } from '../../../enums' import ErrorHandlingService from '../../../errorHandlingService' import { PurgeRecordType } from '../../../purge/PurgeTypes' import { SchedulePurge } from '../../../purge/decorators/SchedulePurge' - // import { AgentWithRootOrTenant } from '../../types/agent' import { OpenId4VcIssuanceSessionsCreateOffer } from '../types/issuer.types' diff --git a/src/purge/PurgeWorker.ts b/src/purge/PurgeWorker.ts index 2167927a..1ead1fa4 100644 --- a/src/purge/PurgeWorker.ts +++ b/src/purge/PurgeWorker.ts @@ -17,24 +17,21 @@ export class PurgeWorker { private consumerName: string private webhookUrl: string | undefined - constructor(recordType: PurgeRecordType, consumerName: string, webhookUrl?: string) { + public constructor(recordType: PurgeRecordType, consumerName: string, webhookUrl?: string) { this.recordType = recordType this.consumerName = consumerName this.webhookUrl = webhookUrl } - async start(agent: Agent, consumer: Consumer): Promise { - console.log(`[Purge][Worker] Started — consumer=${this.consumerName} recordType=${this.recordType}`) + public async start(agent: Agent, consumer: Consumer): Promise { agent.config.logger.info('[Purge] Worker started', { consumer: this.consumerName }) while (true) { try { const messages = await consumer.consume() - console.log(`[Purge][Worker] Consuming messages — consumer=${this.consumerName}`) for await (const msg of messages) { await this.processMessage(msg, agent) } - console.warn(`[Purge][Worker] Consume loop ended — restarting consumer=${this.consumerName}`) agent.config.logger.warn('[Purge] Consume loop ended — restarting', { consumer: this.consumerName }) } catch (err: any) { agent.config.logger.error('[Purge] Consume loop error — restarting after delay', { @@ -71,9 +68,6 @@ export class PurgeWorker { return } - console.log( - `[Purge][Worker] Job received — recordType=${recordType} recordId=${recordId} tenantId="${tenantId}" deliveryCount=${deliveryCount}`, - ) logger.info('[Purge] Job received', { recordId, recordType, tenantId, deliveryCount }) try { @@ -85,9 +79,6 @@ export class PurgeWorker { await deletePurgeRecord(agent, this.recordType, recordId) } - console.log( - `[Purge][Worker] Record deleted — recordType=${recordType} recordId=${recordId} tenantId="${tenantId}"`, - ) logger.info('[Purge] Record deleted', { recordId, recordType, tenantId }) msg.ack() @@ -111,7 +102,6 @@ export class PurgeWorker { } } catch (err: any) { if (err instanceof RecordNotFoundError) { - console.warn(`[Purge][Worker] Record already absent — recordType=${recordType} recordId=${recordId}`) logger.warn('[Purge] Record already absent — treating as success', { recordId, recordType }) msg.ack() @@ -136,22 +126,12 @@ export class PurgeWorker { return } - console.warn( - `[Purge][Worker] Job failed — recordType=${recordType} recordId=${recordId} deliveryCount=${deliveryCount}`, - err?.message, - ) logger.warn('[Purge] Job failed', { recordId, recordType, deliveryCount, error: err?.message }) if (deliveryCount >= PURGE_CONSUMER_MAX_DELIVER) { - console.error( - `[Purge][Worker] Job dropped after max retries — recordType=${recordType} recordId=${recordId} tenantId="${tenantId}"`, - ) logger.error('[Purge] Job dropped after max retries', { recordId, recordType, tenantId, deliveryCount }) msg.ack() } else { - console.log( - `[Purge][Worker] Nacking job for retry — recordType=${recordType} recordId=${recordId} deliveryCount=${deliveryCount}`, - ) msg.nak() } } diff --git a/src/purge/decorators/SchedulePurge.ts b/src/purge/decorators/SchedulePurge.ts index 4aff2360..8c6d8d02 100644 --- a/src/purge/decorators/SchedulePurge.ts +++ b/src/purge/decorators/SchedulePurge.ts @@ -1,6 +1,6 @@ import type { AgentMode, PurgeRecordType } from '../PurgeTypes' -import { getCronPurgeScheduler, getNatsPurgeScheduler } from '../PurgeSchedulerFactory' +import { getNatsPurgeScheduler } from '../PurgeSchedulerFactory' export function SchedulePurge(recordType: PurgeRecordType, idExtractor: (result: unknown) => string | undefined) { return function (_target: object, _key: string, descriptor: PropertyDescriptor) { @@ -12,17 +12,12 @@ export function SchedulePurge(recordType: PurgeRecordType, idExtractor: (result: const scheduler = getNatsPurgeScheduler() if (!scheduler) { - console.warn(`[Purge] @SchedulePurge(${recordType}): NATS scheduler not initialized — skipping`) return result } const recordId = idExtractor(result) if (!recordId) { - const resultKeys = result && typeof result === 'object' ? Object.keys(result) : typeof result - console.warn( - `[Purge] @SchedulePurge(${recordType}): could not extract recordId — result shape: ${JSON.stringify(resultKeys)}`, - ) return result } @@ -34,18 +29,10 @@ export function SchedulePurge(recordType: PurgeRecordType, idExtractor: (result: : '' const agentMode: AgentMode = tenantId ? 'shared' : 'dedicated' - console.info( - `[Purge] Scheduling purge: ${recordType} recordId=${recordId} tenantId="${tenantId}" agentMode=${agentMode}`, - ) - // Fire-and-forget: purge scheduling must not block record creation. // If NATS publish fails and cron is disabled, this record will not be purged. - scheduler.schedulePurge(recordType, recordId, tenantId, agentMode).catch((err: Error) => { - const hasCronFallback = getCronPurgeScheduler() !== null - const level = hasCronFallback ? 'warn' : 'error' - console[level]( - `[Purge] Failed to schedule NATS purge for ${recordType}:${recordId} — ${hasCronFallback ? 'cron fallback active' : 'NO cron fallback, record may leak'}: ${err?.message}`, - ) + scheduler.schedulePurge(recordType, recordId, tenantId, agentMode).catch(() => { + // intentionally silent — cron fallback or record TTL handles cleanup }) return result diff --git a/src/purge/schedulers/CronPurgeScheduler.ts b/src/purge/schedulers/CronPurgeScheduler.ts index 8295852e..0b41854a 100644 --- a/src/purge/schedulers/CronPurgeScheduler.ts +++ b/src/purge/schedulers/CronPurgeScheduler.ts @@ -14,20 +14,17 @@ export class CronPurgeScheduler { private job: ScheduledTask | null = null private isRunning = false - async start(agent: Agent, config: PurgeConfig, webhookUrl: string | undefined): Promise { + public async start(agent: Agent, config: PurgeConfig, webhookUrl: string | undefined): Promise { const { cronConfig } = config this.job = cron.schedule(cronConfig.cronSchedule, () => { - console.log(`[Purge][Cron] Tick fired — schedule="${cronConfig.cronSchedule}"`) if (this.isRunning) { - console.warn('[Purge][Cron] Scan still running — skipping this tick') agent.config.logger.warn('[Purge] Cron scan still running — skipping this tick') return } this.isRunning = true this.runScan(agent, config, webhookUrl) .catch((err: Error) => { - console.error('[Purge][Cron] Scan error', err?.message) agent.config.logger.error('[Purge] Cron scan error', { error: err?.message }) }) .finally(() => { @@ -35,9 +32,6 @@ export class CronPurgeScheduler { }) }) - console.log( - `[Purge][Cron] Scheduler started — schedule="${cronConfig.cronSchedule}" ttlSeconds=${cronConfig.ttlSeconds} recordTypes=${cronConfig.recordTypes.join(', ')}`, - ) agent.config.logger.info('[Purge] CronPurgeScheduler started', { cronSchedule: cronConfig.cronSchedule, ttlSeconds: cronConfig.ttlSeconds, @@ -45,7 +39,7 @@ export class CronPurgeScheduler { }) } - async stop(): Promise { + public async stop(): Promise { this.job?.stop() this.job = null } @@ -54,7 +48,6 @@ export class CronPurgeScheduler { const logger = agent.config.logger const isShared = typeof (agent as any).modules?.tenants?.getAllTenants === 'function' - console.log(`[Purge][Cron] Scan started — agentMode=${isShared ? 'shared' : 'dedicated'}`) logger.info('[Purge] Cron scan started', { agentMode: isShared ? 'shared' : 'dedicated' }) let totalDeleted = 0 @@ -69,7 +62,6 @@ export class CronPurgeScheduler { totalDeleted += count }) } catch (err: any) { - console.error(`[Purge][Cron] Failed to scan tenant tenantId=${tenant.id}`, err?.message) logger.error('[Purge] Failed to scan tenant', { tenantId: tenant.id, error: err?.message }) } } @@ -77,7 +69,6 @@ export class CronPurgeScheduler { totalDeleted = await this.scanTenant(agent, '', config, webhookUrl) } - console.log(`[Purge][Cron] Scan completed — totalDeleted=${totalDeleted}`) logger.info('[Purge] Cron scan completed', { totalDeleted }) } @@ -93,20 +84,13 @@ export class CronPurgeScheduler { for (const recordType of cronConfig.recordTypes) { try { const expiredIds = await this.queryExpiredRecords(tenantAgent, recordType, cronConfig.ttlSeconds) - console.log( - `[Purge][Cron] Queried expired records — recordType=${recordType} tenantId="${tenantId}" found=${expiredIds.length}`, - ) for (const recordId of expiredIds) { - console.log( - `[Purge][Cron] Deleting record — recordType=${recordType} recordId=${recordId} tenantId="${tenantId}"`, - ) if (await this.deleteAndNotify(tenantAgent, recordId, recordType, tenantId, webhookUrl)) { deleted++ } } } catch (err: any) { - console.error(`[Purge][Cron] Error scanning recordType=${recordType} tenantId="${tenantId}"`, err?.message) tenantAgent.config.logger.error('[Purge] Error scanning record type', { tenantId, recordType, @@ -173,19 +157,13 @@ export class CronPurgeScheduler { try { await deletePurgeRecord(agent, recordType, recordId) - console.log(`[Purge][Cron] Record deleted — recordType=${recordType} recordId=${recordId} tenantId="${tenantId}"`) logger.info('[Purge] Record deleted by cron', { recordId, recordType, tenantId }) status = PurgeDeletionStatus.DELETED } catch (err: any) { if (err instanceof RecordNotFoundError) { - console.warn(`[Purge][Cron] Record already absent — recordType=${recordType} recordId=${recordId}`) logger.warn('[Purge] Record already absent — skipping', { recordId, recordType }) status = PurgeDeletionStatus.ALREADY_ABSENT } else { - console.error( - `[Purge][Cron] Failed to delete record — recordType=${recordType} recordId=${recordId}`, - err?.message, - ) logger.error('[Purge] Failed to delete record', { recordId, recordType, error: err?.message }) return false } diff --git a/src/purge/schedulers/NatsPurgeScheduler.ts b/src/purge/schedulers/NatsPurgeScheduler.ts index ff660013..320bfdd8 100644 --- a/src/purge/schedulers/NatsPurgeScheduler.ts +++ b/src/purge/schedulers/NatsPurgeScheduler.ts @@ -33,7 +33,7 @@ export class NatsPurgeScheduler { private ttlSeconds = 0 private recordTypes: PurgeRecordType[] = [] - async start(agent: Agent, config: PurgeConfig, webhookUrl: string | undefined): Promise { + public async start(agent: Agent, config: PurgeConfig, webhookUrl: string | undefined): Promise { const { natsConfig } = config this.ttlSeconds = natsConfig.ttlSeconds this.recordTypes = natsConfig.recordTypes @@ -47,28 +47,20 @@ export class NatsPurgeScheduler { this.js = this.nc.jetstream() this.jsm = await this.nc.jetstreamManager() - console.log(`[Purge][NATS] Connected to NATS server(s): ${natsConfig.nats.servers}`) - console.log('[Purge][NATS] Provisioning streams...') agent.config.logger.info('[Purge] Provisioning NATS streams...') await this.provisionStreams() - console.log('[Purge][NATS] Streams ready') agent.config.logger.info('[Purge] NATS streams ready') - console.log('[Purge][NATS] Provisioning consumers...') agent.config.logger.info('[Purge] Provisioning NATS consumers...') await this.provisionConsumers() - console.log(`[Purge][NATS] Consumers ready — recordTypes=${this.recordTypes.join(', ')}`) agent.config.logger.info('[Purge] NATS consumers ready') await this.startWorkers(agent, webhookUrl) - console.log( - `[Purge][NATS] Scheduler started — ttlSeconds=${this.ttlSeconds} recordTypes=${this.recordTypes.join(', ')}`, - ) agent.config.logger.info('[Purge] NatsPurgeScheduler started', { ttlSeconds: this.ttlSeconds }) } - async schedulePurge( + public async schedulePurge( recordType: PurgeRecordType, recordId: string, tenantId: string, @@ -90,13 +82,9 @@ export class NatsPurgeScheduler { h.set('Nats-Msg-Id', `purge-${recordType}-${tenantScope}-${recordId}`) await this.js.publish(scheduleSubject, sc.encode(JSON.stringify(job)), { headers: h }) - - console.info( - `[Purge] Scheduled: ${recordType} recordId=${recordId} tenantId="${tenantId}" agentMode=${agentMode} fireAt=${fireAt}`, - ) } - async stop(): Promise { + public async stop(): Promise { if (this.nc) { await this.nc.drain() this.nc = null @@ -127,8 +115,6 @@ export class NatsPurgeScheduler { if (this.isAlreadyExistsError(err)) { await this.jsm.streams.update(config.name, config) } else if (err?.message?.includes('subjects overlap')) { - // Stale streams from a previous version — delete and retry - console.warn('[Purge] Subject overlap detected — purging stale streams and retrying') await this.deleteStaleStreams(config.subjects) await this.jsm.streams.add(config) } else { @@ -147,7 +133,6 @@ export class NatsPurgeScheduler { (s: string) => s.startsWith('purge.schedule.') || s.startsWith('purge.execute.'), ) if (isPurgeStream) { - console.warn(`[Purge] Deleting stale purge stream: ${stream.config.name}`) await this.jsm.streams.delete(stream.config.name) } } @@ -177,7 +162,6 @@ export class NatsPurgeScheduler { for (const recordType of this.recordTypes) { const consumerName = PURGE_CONSUMER_NAMES[recordType] - console.log(`[Purge][NATS] Starting worker — recordType=${recordType} consumer=${consumerName}`) agent.config.logger.info('[Purge] Starting worker', { recordType, consumerName }) this.runWorkerWithRestart(agent, recordType, consumerName, webhookUrl) } @@ -200,22 +184,16 @@ export class NatsPurgeScheduler { await worker.start(agent, consumer) } - launch() - .then(() => console.log(`[Purge][NATS] Worker launched — consumer=${consumerName}`)) - .catch((err: Error) => { - if (!this.nc) return // scheduler stopped — do not restart - console.error( - `[Purge][NATS] Worker crashed — consumer=${consumerName} attempt=${attempt} retryIn=${delayMs}ms`, - err?.message, - ) - agent.config.logger.error('[Purge] Worker crashed — restarting', { - consumerName, - attempt, - delayMs, - error: err?.message, - }) - setTimeout(() => this.runWorkerWithRestart(agent, recordType, consumerName, webhookUrl, attempt + 1), delayMs) + launch().catch((err: Error) => { + if (!this.nc) return // scheduler stopped — do not restart + agent.config.logger.error('[Purge] Worker crashed — restarting', { + consumerName, + attempt, + delayMs, + error: err?.message, }) + setTimeout(() => this.runWorkerWithRestart(agent, recordType, consumerName, webhookUrl, attempt + 1), delayMs) + }) } private isAlreadyExistsError(err: any): boolean { diff --git a/src/server.ts b/src/server.ts index 85355442..ce26a974 100644 --- a/src/server.ts +++ b/src/server.ts @@ -7,20 +7,6 @@ import type { ServerConfig } from './utils/ServerConfig' import type { Response as ExResponse, Request as ExRequest, NextFunction, ErrorRequestHandler } from 'express' import { Agent } from '@credo-ts/core' - -import { validateAuthConfig } from './utils/auth' -import { ErrorMessages } from './enums' -import { BaseError } from './errors/errors' -import { basicMessageEvents } from './events/BasicMessageEvents' -import { connectionEvents } from './events/ConnectionEvents' -import { credentialEvents } from './events/CredentialEvents' -import { proofEvents } from './events/ProofEvents' -import { questionAnswerEvents } from './events/QuestionAnswerEvents' -import { reuseConnectionEvents } from './events/ReuseConnectionEvents' -import { RegisterRoutes } from './routes/routes' -import { SecurityMiddleware } from './securityMiddleware' -import { openId4VcIssuanceSessionEvents } from './events/openId4VcIssuanceSessionEvents' -import { openId4VcVerificationSessionEvents } from './events/openId4VcVerificationSessionEvents' import { TenantAgent } from '@credo-ts/tenants' import bodyParser from 'body-parser' import cors from 'cors' @@ -31,7 +17,21 @@ import * as fs from 'fs' import { generateHTML, serve } from 'swagger-ui-express' import { ValidateError } from 'tsoa' import { container } from 'tsyringe' + import { setDynamicApiKey } from './authentication' +import { ErrorMessages } from './enums' +import { BaseError } from './errors/errors' +import { basicMessageEvents } from './events/BasicMessageEvents' +import { connectionEvents } from './events/ConnectionEvents' +import { credentialEvents } from './events/CredentialEvents' +import { proofEvents } from './events/ProofEvents' +import { questionAnswerEvents } from './events/QuestionAnswerEvents' +import { reuseConnectionEvents } from './events/ReuseConnectionEvents' +import { openId4VcIssuanceSessionEvents } from './events/openId4VcIssuanceSessionEvents' +import { openId4VcVerificationSessionEvents } from './events/openId4VcVerificationSessionEvents' +import { RegisterRoutes } from './routes/routes' +import { SecurityMiddleware } from './securityMiddleware' +import { validateAuthConfig } from './utils/auth' dotenv.config() diff --git a/src/utils/auth.ts b/src/utils/auth.ts index d5b50b96..2f3ac817 100644 --- a/src/utils/auth.ts +++ b/src/utils/auth.ts @@ -25,7 +25,6 @@ const SUPPORTED_AUTH_TYPES = Object.values(AuthTypes) satisfies AuthType[] export function getAuthType(): AuthType { const authType = process.env.TRUST_SERVICE_AUTH_TYPE as AuthType if (!authType) { - console.warn('[getAuthType] TRUST_SERVICE_AUTH_TYPE is not set — defaulting to NoAuth') return AuthTypes.NoAuth } if (!SUPPORTED_AUTH_TYPES.includes(authType)) { @@ -38,7 +37,6 @@ export function getAuthType(): AuthType { export function validateAuthConfig(): void { const authType = getAuthType() - console.log('[validateAuthConfig] TRUST_SERVICE_AUTH_TYPE:', authType) const validators: Record void> = { NoAuth: () => { @@ -56,5 +54,4 @@ export function validateAuthConfig(): void { } validators[authType]() - console.log('[validateAuthConfig] configuration valid for auth type:', authType) } diff --git a/src/utils/helpers.ts b/src/utils/helpers.ts index b7ef074f..2058ac6a 100644 --- a/src/utils/helpers.ts +++ b/src/utils/helpers.ts @@ -233,8 +233,6 @@ async function fetchPlatformToken( return cachedToken } - console.log(`[${label}] fetching token from:`, tokenUrl) - let tokenResponse try { tokenResponse = await axios.post( @@ -244,13 +242,6 @@ async function fetchPlatformToken( ) } catch (error) { if (axios.isAxiosError(error)) { - console.error(`[${label}] token request failed:`, { - url: tokenUrl, - status: error.response?.status, - statusText: error.response?.statusText, - data: error.response?.data, - message: error.message, - }) throw new Error( `[${label}] platform token request failed with status ${error.response?.status ?? 'no response'}: ${JSON.stringify(error.response?.data ?? error.message)}`, ) @@ -265,12 +256,6 @@ async function fetchPlatformToken( const expiresAt = getTokenExpiry(token) tokenCache.set(clientId, { token, expiresAt }) - console.log( - `[${label}] token cached for clientId:`, - clientId, - '| expires at:', - new Date(expiresAt * 1000).toISOString(), - ) return token } @@ -283,7 +268,6 @@ async function checkTrustCertificatesExist( token?: string, ): Promise { const matchUrl = trustServiceUrl - console.log(`[${label}] calling match API:`, matchUrl) const authHeaders = token ? { Authorization: `Bearer ${token}` } : {} @@ -294,25 +278,9 @@ async function checkTrustCertificatesExist( { headers: { 'Content-Type': 'application/json', accept: 'application/json', ...authHeaders } }, ) - console.log(`[${label}] match response status:`, matchResponse.status) - - const isTrusted = matchResponse.data?.matched === true - console.log(`[${label}] isTrusted:`, isTrusted) - - if (!isTrusted) { - console.warn(`[${label}] certificate chain not trusted${tenantId ? ` for tenantId: ${tenantId}` : ''}`) - } - - return isTrusted + return matchResponse.data?.matched === true } catch (error) { if (axios.isAxiosError(error)) { - console.error(`[${label}] match request failed:`, { - url: matchUrl, - status: error.response?.status, - statusText: error.response?.statusText, - data: error.response?.data, - message: error.message, - }) throw new Error( `[${label}] trust-service match request failed with status ${error.response?.status ?? 'no response'}: ${JSON.stringify(error.response?.data ?? error.message)}`, ) @@ -348,10 +316,6 @@ export async function checkX509Certificates( if (!resolvedTenantId) throw new Error(`[${label}] tenantId is required for shared agent but was not provided`) } - console.log( - `[${label}] agent type: ${isDedicated ? 'dedicated' : 'shared'}, certificate count: ${x509Certificates.length}`, - ) - const token = await fetchPlatformToken(tokenUrl, clientId, clientSecret, label) return checkTrustCertificatesExist(trustListUrl, x509Certificates, label, resolvedTenantId, token) diff --git a/src/utils/statusListService.ts b/src/utils/statusListService.ts index f89e0117..014873f7 100644 --- a/src/utils/statusListService.ts +++ b/src/utils/statusListService.ts @@ -97,7 +97,6 @@ export async function checkAndCreateStatusList(agent: Agent, listId: string, iss }) if (res.status === 404) { - console.log(`Status list ${listId} not found, creating a new one...`) const size = listSize || Number(process.env.STATUS_LIST_DEFAULT_SIZE) const statusList = new StatusList(new Array(size).fill(0), 1) @@ -119,14 +118,11 @@ export async function checkAndCreateStatusList(agent: Agent, listId: string, iss const errBody = await postRes.text() throw new Error(`Failed to create list on server: ${postRes.status} ${errBody}`) } - - console.log(`Successfully created and published new status list ${listId}`) } else if (!res.ok) { const errBody = await res.text().catch(() => '') throw new Error(`Failed to check status list ${listId} at ${uri}: ${res.status} ${res.statusText} ${errBody}`) } } catch (error) { - console.error(`Error in checkAndCreateStatusList:`, error) throw error } finally { releaseLock!() From 12efb50eab464587ec5f71749c2ad90857346650 Mon Sep 17 00:00:00 2001 From: Tipu_Singh Date: Mon, 4 May 2026 18:54:07 +0530 Subject: [PATCH 150/152] refactor: added sonarcloud config file Signed-off-by: Tipu_Singh --- .sonarcloud.properties | 1 + 1 file changed, 1 insertion(+) create mode 100644 .sonarcloud.properties diff --git a/.sonarcloud.properties b/.sonarcloud.properties new file mode 100644 index 00000000..a585f6dd --- /dev/null +++ b/.sonarcloud.properties @@ -0,0 +1 @@ +sonar.exclusions=samples/cliConfig.json From 673ef32f8edfe6cb553f09e8879ff703ab009295 Mon Sep 17 00:00:00 2001 From: Tipu_Singh Date: Tue, 5 May 2026 12:56:28 +0530 Subject: [PATCH 151/152] fix:sonar cloud issues Signed-off-by: Tipu_Singh --- .sonarcloud.properties | 2 +- src/purge/PurgeWorker.ts | 8 +++++++- src/purge/schedulers/NatsPurgeScheduler.ts | 7 +++++++ src/utils/statusListService.ts | 5 +++++ 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/.sonarcloud.properties b/.sonarcloud.properties index a585f6dd..76caf6f6 100644 --- a/.sonarcloud.properties +++ b/.sonarcloud.properties @@ -1 +1 @@ -sonar.exclusions=samples/cliConfig.json +sonar.exclusions=samples/cliConfig.json,src/routes/routes.ts diff --git a/src/purge/PurgeWorker.ts b/src/purge/PurgeWorker.ts index 1ead1fa4..c28531db 100644 --- a/src/purge/PurgeWorker.ts +++ b/src/purge/PurgeWorker.ts @@ -16,6 +16,7 @@ export class PurgeWorker { private recordType: PurgeRecordType private consumerName: string private webhookUrl: string | undefined + private stopped = false public constructor(recordType: PurgeRecordType, consumerName: string, webhookUrl?: string) { this.recordType = recordType @@ -23,10 +24,14 @@ export class PurgeWorker { this.webhookUrl = webhookUrl } + public stop(): void { + this.stopped = true + } + public async start(agent: Agent, consumer: Consumer): Promise { agent.config.logger.info('[Purge] Worker started', { consumer: this.consumerName }) - while (true) { + while (!this.stopped) { try { const messages = await consumer.consume() for await (const msg of messages) { @@ -34,6 +39,7 @@ export class PurgeWorker { } agent.config.logger.warn('[Purge] Consume loop ended — restarting', { consumer: this.consumerName }) } catch (err: any) { + if (this.stopped) return agent.config.logger.error('[Purge] Consume loop error — restarting after delay', { consumer: this.consumerName, error: err?.message, diff --git a/src/purge/schedulers/NatsPurgeScheduler.ts b/src/purge/schedulers/NatsPurgeScheduler.ts index 320bfdd8..e9404c91 100644 --- a/src/purge/schedulers/NatsPurgeScheduler.ts +++ b/src/purge/schedulers/NatsPurgeScheduler.ts @@ -32,6 +32,7 @@ export class NatsPurgeScheduler { private jsm: JetStreamManager | null = null private ttlSeconds = 0 private recordTypes: PurgeRecordType[] = [] + private workers: PurgeWorker[] = [] public async start(agent: Agent, config: PurgeConfig, webhookUrl: string | undefined): Promise { const { natsConfig } = config @@ -85,6 +86,10 @@ export class NatsPurgeScheduler { } public async stop(): Promise { + for (const worker of this.workers) { + worker.stop() + } + this.workers = [] if (this.nc) { await this.nc.drain() this.nc = null @@ -181,7 +186,9 @@ export class NatsPurgeScheduler { const launch = async () => { const consumer = await this.js!.consumers.get(PURGE_STREAM, consumerName) const worker = new PurgeWorker(recordType, consumerName, webhookUrl) + this.workers.push(worker) await worker.start(agent, consumer) + this.workers = this.workers.filter((w) => w !== worker) } launch().catch((err: Error) => { diff --git a/src/utils/statusListService.ts b/src/utils/statusListService.ts index 014873f7..fbe0d498 100644 --- a/src/utils/statusListService.ts +++ b/src/utils/statusListService.ts @@ -98,6 +98,11 @@ export async function checkAndCreateStatusList(agent: Agent, listId: string, iss if (res.status === 404) { const size = listSize || Number(process.env.STATUS_LIST_DEFAULT_SIZE) + if (!size || !Number.isInteger(size) || size <= 0) { + throw new Error( + `[checkAndCreateStatusList] invalid status list size: ${size}. Set STATUS_LIST_DEFAULT_SIZE to a positive integer.`, + ) + } const statusList = new StatusList(new Array(size).fill(0), 1) const didDocument = await agent.dids.resolve(issuerDid) From a97f464711992ee14118faa9b9c286ff3d9aacb9 Mon Sep 17 00:00:00 2001 From: Tipu_Singh Date: Tue, 5 May 2026 13:30:48 +0530 Subject: [PATCH 152/152] fix: change method name Signed-off-by: Tipu_Singh --- src/controllers/x509/crypto-util.ts | 2 +- src/controllers/x509/x509.service.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/controllers/x509/crypto-util.ts b/src/controllers/x509/crypto-util.ts index e864f9e4..c01e4e65 100644 --- a/src/controllers/x509/crypto-util.ts +++ b/src/controllers/x509/crypto-util.ts @@ -22,7 +22,7 @@ async function pemToRawEcPrivateKey(pem: string): Promise { /** * Extracts the raw private key (hex) from a PEM-encoded Ed25519 private key. */ -export async function pemToRawEd25519PrivateKey(derKey: string | Buffer): Promise { +export async function pemToRawPrivateKey(derKey: string | Buffer): Promise { // If it's a base64 string, convert to Buffer const keyBuffer = typeof derKey === 'string' ? Buffer.from(derKey, 'base64') : derKey diff --git a/src/controllers/x509/x509.service.ts b/src/controllers/x509/x509.service.ts index d3ae231d..b2789ccb 100644 --- a/src/controllers/x509/x509.service.ts +++ b/src/controllers/x509/x509.service.ts @@ -18,7 +18,7 @@ import { KeyAlgorithm } from '@openwallet-foundation/askar-nodejs' import { keyAlgorithmToCurve } from '../../utils/constant' import { generateSecretKey, getCertificateValidityForSystem, getTypeFromCurve } from '../../utils/helpers' -import { pemToRawEd25519PrivateKey } from './crypto-util' +import { pemToRawPrivateKey } from './crypto-util' import { type X509CreateCertificateOptionsDto } from './x509.types' class x509Service { @@ -131,7 +131,7 @@ class x509Service { const agent = agentReq.agent if (!options.privateKey) throw new Error('[ImportX509Certificates] privateKey is required') agent.config.logger.debug(`Start validating keys`) - const secretHexKey = await pemToRawEd25519PrivateKey(options.privateKey) + const secretHexKey = await pemToRawPrivateKey(options.privateKey) const privateKey = TypedArrayEncoder.fromHex(secretHexKey) agent.config.logger.debug(`Decode certificate`)