@credo-ts/openid4vc 0.6.0-pr-2195-20250226100854 → 0.6.0-pr-2195-20250321180923

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/build/openid4vc-holder/OpenId4VcHolderApi.d.ts +29 -29
  2. package/build/openid4vc-holder/OpenId4VcHolderApi.js +16 -16
  3. package/build/openid4vc-holder/OpenId4VcHolderApi.js.map +1 -1
  4. package/build/openid4vc-holder/OpenId4VcHolderModule.js +2 -2
  5. package/build/openid4vc-holder/OpenId4VcHolderModule.js.map +1 -1
  6. package/build/openid4vc-holder/OpenId4VciHolderService.d.ts +2 -2
  7. package/build/openid4vc-holder/OpenId4VciHolderService.js +6 -6
  8. package/build/openid4vc-holder/OpenId4VciHolderService.js.map +1 -1
  9. package/build/openid4vc-holder/OpenId4VciHolderServiceOptions.d.ts +1 -1
  10. package/build/openid4vc-holder/{OpenId4vcSiopHolderService.d.ts → OpenId4vpHolderService.d.ts} +21 -22
  11. package/build/openid4vc-holder/OpenId4vpHolderService.js +317 -0
  12. package/build/openid4vc-holder/OpenId4vpHolderService.js.map +1 -0
  13. package/build/openid4vc-holder/OpenId4vpHolderServiceOptions.d.ts +81 -0
  14. package/build/openid4vc-holder/{OpenId4vcSiopHolderServiceOptions.js → OpenId4vpHolderServiceOptions.js} +1 -1
  15. package/build/openid4vc-holder/OpenId4vpHolderServiceOptions.js.map +1 -0
  16. package/build/openid4vc-holder/index.d.ts +2 -2
  17. package/build/openid4vc-holder/index.js +2 -2
  18. package/build/openid4vc-holder/index.js.map +1 -1
  19. package/build/openid4vc-issuer/OpenId4VcIssuerEvents.d.ts +1 -1
  20. package/build/openid4vc-issuer/OpenId4VcIssuerModule.d.ts +1 -1
  21. package/build/openid4vc-issuer/OpenId4VcIssuerModuleConfig.d.ts +1 -1
  22. package/build/openid4vc-issuer/OpenId4VcIssuerService.d.ts +2 -3
  23. package/build/openid4vc-issuer/OpenId4VcIssuerService.js +13 -16
  24. package/build/openid4vc-issuer/OpenId4VcIssuerService.js.map +1 -1
  25. package/build/openid4vc-issuer/OpenId4VcIssuerServiceOptions.d.ts +8 -8
  26. package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRecord.d.ts +11 -1
  27. package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRecord.js +3 -0
  28. package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRecord.js.map +1 -1
  29. package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRepository.d.ts +1 -1
  30. package/build/openid4vc-issuer/repository/OpenId4VcIssuerRecord.d.ts +1 -1
  31. package/build/openid4vc-issuer/repository/OpenId4VcIssuerRecord.js +1 -1
  32. package/build/openid4vc-issuer/repository/OpenId4VcIssuerRecord.js.map +1 -1
  33. package/build/openid4vc-issuer/repository/OpenId4VcIssuerRepository.d.ts +1 -1
  34. package/build/openid4vc-issuer/router/accessTokenEndpoint.d.ts +2 -2
  35. package/build/openid4vc-issuer/router/authorizationChallengeEndpoint.js.map +1 -1
  36. package/build/openid4vc-issuer/router/credentialEndpoint.d.ts +1 -1
  37. package/build/openid4vc-issuer/router/credentialEndpoint.js +1 -0
  38. package/build/openid4vc-issuer/router/credentialEndpoint.js.map +1 -1
  39. package/build/openid4vc-issuer/router/credentialOfferEndpoint.d.ts +1 -1
  40. package/build/openid4vc-issuer/router/credentialOfferEndpoint.js +15 -0
  41. package/build/openid4vc-issuer/router/credentialOfferEndpoint.js.map +1 -1
  42. package/build/openid4vc-issuer/router/jwksEndpoint.d.ts +1 -1
  43. package/build/openid4vc-issuer/router/nonceEndpoint.d.ts +1 -1
  44. package/build/openid4vc-issuer/util/txCode.d.ts +1 -1
  45. package/build/openid4vc-verifier/OpenId4VcVerifierApi.d.ts +13 -26
  46. package/build/openid4vc-verifier/OpenId4VcVerifierApi.js +16 -25
  47. package/build/openid4vc-verifier/OpenId4VcVerifierApi.js.map +1 -1
  48. package/build/openid4vc-verifier/OpenId4VcVerifierEvents.d.ts +1 -1
  49. package/build/openid4vc-verifier/OpenId4VcVerifierModule.d.ts +1 -1
  50. package/build/openid4vc-verifier/OpenId4VcVerifierModule.js +4 -4
  51. package/build/openid4vc-verifier/OpenId4VcVerifierModule.js.map +1 -1
  52. package/build/openid4vc-verifier/OpenId4VcVerifierModuleConfig.d.ts +30 -7
  53. package/build/openid4vc-verifier/OpenId4VcVerifierModuleConfig.js +16 -12
  54. package/build/openid4vc-verifier/OpenId4VcVerifierModuleConfig.js.map +1 -1
  55. package/build/openid4vc-verifier/{OpenId4VcSiopVerifierService.d.ts → OpenId4VpVerifierService.d.ts} +17 -33
  56. package/build/openid4vc-verifier/OpenId4VpVerifierService.js +765 -0
  57. package/build/openid4vc-verifier/OpenId4VpVerifierService.js.map +1 -0
  58. package/build/openid4vc-verifier/OpenId4VpVerifierServiceOptions.d.ts +146 -0
  59. package/build/openid4vc-verifier/{OpenId4VcSiopVerifierServiceOptions.js → OpenId4VpVerifierServiceOptions.js} +1 -1
  60. package/build/openid4vc-verifier/OpenId4VpVerifierServiceOptions.js.map +1 -0
  61. package/build/openid4vc-verifier/index.d.ts +2 -2
  62. package/build/openid4vc-verifier/index.js +2 -2
  63. package/build/openid4vc-verifier/index.js.map +1 -1
  64. package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRecord.d.ts +25 -9
  65. package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRecord.js +21 -2
  66. package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRecord.js.map +1 -1
  67. package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRepository.d.ts +1 -1
  68. package/build/openid4vc-verifier/repository/OpenId4VcVerifierRecord.d.ts +3 -3
  69. package/build/openid4vc-verifier/repository/OpenId4VcVerifierRepository.d.ts +1 -1
  70. package/build/openid4vc-verifier/router/authorizationEndpoint.d.ts +2 -10
  71. package/build/openid4vc-verifier/router/authorizationEndpoint.js +94 -7
  72. package/build/openid4vc-verifier/router/authorizationEndpoint.js.map +1 -1
  73. package/build/openid4vc-verifier/router/authorizationRequestEndpoint.d.ts +2 -10
  74. package/build/openid4vc-verifier/router/authorizationRequestEndpoint.js +18 -6
  75. package/build/openid4vc-verifier/router/authorizationRequestEndpoint.js.map +1 -1
  76. package/build/shared/callbacks.d.ts +2 -2
  77. package/build/shared/callbacks.js +10 -7
  78. package/build/shared/callbacks.js.map +1 -1
  79. package/build/shared/models/index.d.ts +4 -4
  80. package/build/shared/models/index.js.map +1 -1
  81. package/build/shared/router/context.d.ts +2 -2
  82. package/build/shared/router/context.js +9 -5
  83. package/build/shared/router/context.js.map +1 -1
  84. package/build/shared/router/express.js +1 -2
  85. package/build/shared/router/express.js.map +1 -1
  86. package/build/shared/transactionData.d.ts +5 -0
  87. package/build/shared/transactionData.js +22 -0
  88. package/build/shared/transactionData.js.map +1 -0
  89. package/build/shared/utils.d.ts +1 -1
  90. package/build/shared/utils.js +3 -3
  91. package/build/shared/utils.js.map +1 -1
  92. package/package.json +7 -6
  93. package/build/openid4vc-holder/OpenId4vcSiopHolderService.js +0 -306
  94. package/build/openid4vc-holder/OpenId4vcSiopHolderService.js.map +0 -1
  95. package/build/openid4vc-holder/OpenId4vcSiopHolderServiceOptions.d.ts +0 -54
  96. package/build/openid4vc-holder/OpenId4vcSiopHolderServiceOptions.js.map +0 -1
  97. package/build/openid4vc-verifier/OpenId4VcSiopVerifierService.js +0 -806
  98. package/build/openid4vc-verifier/OpenId4VcSiopVerifierService.js.map +0 -1
  99. package/build/openid4vc-verifier/OpenId4VcSiopVerifierServiceOptions.d.ts +0 -93
  100. package/build/openid4vc-verifier/OpenId4VcSiopVerifierServiceOptions.js.map +0 -1
@@ -11,61 +11,55 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.OpenId4VcVerifierApi = void 0;
13
13
  const core_1 = require("@credo-ts/core");
14
- const OpenId4VcSiopVerifierService_1 = require("./OpenId4VcSiopVerifierService");
15
14
  const OpenId4VcVerifierModuleConfig_1 = require("./OpenId4VcVerifierModuleConfig");
15
+ const OpenId4VpVerifierService_1 = require("./OpenId4VpVerifierService");
16
16
  /**
17
17
  * @public
18
18
  */
19
19
  let OpenId4VcVerifierApi = class OpenId4VcVerifierApi {
20
- constructor(config, agentContext, openId4VcSiopVerifierService) {
20
+ constructor(config, agentContext, openId4VpVerifierService) {
21
21
  this.config = config;
22
22
  this.agentContext = agentContext;
23
- this.openId4VcSiopVerifierService = openId4VcSiopVerifierService;
23
+ this.openId4VpVerifierService = openId4VpVerifierService;
24
24
  }
25
25
  /**
26
26
  * Retrieve all verifier records from storage
27
27
  */
28
28
  async getAllVerifiers() {
29
- return this.openId4VcSiopVerifierService.getAllVerifiers(this.agentContext);
29
+ return this.openId4VpVerifierService.getAllVerifiers(this.agentContext);
30
30
  }
31
31
  /**
32
32
  * Retrieve a verifier record from storage by its verified id
33
33
  */
34
34
  async getVerifierByVerifierId(verifierId) {
35
- return this.openId4VcSiopVerifierService.getVerifierByVerifierId(this.agentContext, verifierId);
35
+ return this.openId4VpVerifierService.getVerifierByVerifierId(this.agentContext, verifierId);
36
36
  }
37
37
  /**
38
38
  * Create a new verifier and store the new verifier record.
39
39
  */
40
40
  async createVerifier(options) {
41
- return this.openId4VcSiopVerifierService.createVerifier(this.agentContext, options);
41
+ return this.openId4VpVerifierService.createVerifier(this.agentContext, options);
42
42
  }
43
43
  async updateVerifierMetadata(options) {
44
44
  const { verifierId, clientMetadata } = options;
45
- const verifier = await this.openId4VcSiopVerifierService.getVerifierByVerifierId(this.agentContext, verifierId);
45
+ const verifier = await this.openId4VpVerifierService.getVerifierByVerifierId(this.agentContext, verifierId);
46
46
  verifier.clientMetadata = clientMetadata;
47
- return this.openId4VcSiopVerifierService.updateVerifier(this.agentContext, verifier);
47
+ return this.openId4VpVerifierService.updateVerifier(this.agentContext, verifier);
48
48
  }
49
49
  async findVerificationSessionsByQuery(query, queryOptions) {
50
- return this.openId4VcSiopVerifierService.findVerificationSessionsByQuery(this.agentContext, query, queryOptions);
50
+ return this.openId4VpVerifierService.findVerificationSessionsByQuery(this.agentContext, query, queryOptions);
51
51
  }
52
52
  async getVerificationSessionById(verificationSessionId) {
53
- return this.openId4VcSiopVerifierService.getVerificationSessionById(this.agentContext, verificationSessionId);
53
+ return this.openId4VpVerifierService.getVerificationSessionById(this.agentContext, verificationSessionId);
54
54
  }
55
55
  /**
56
- * Create an authorization request, acting as a Relying Party (RP).
56
+ * Create an OpenID4VP authorization request, acting as a Relying Party (RP).
57
57
  *
58
- * Currently two types of requests are supported:
59
- * - SIOP Self-Issued ID Token request: request to a Self-Issued OP from an RP
60
- * - SIOP Verifiable Presentation Request: request to a Self-Issued OP from an RP, requesting a Verifiable Presentation using OpenID4VP
61
- *
62
- * Other flows (non-SIOP) are not supported at the moment, but can be added in the future.
63
- *
64
- * See {@link OpenId4VcSiopCreateAuthorizationRequestOptions} for detailed documentation on the options.
58
+ * See {@link OpenId4VpCreateAuthorizationRequestOptions} for detailed documentation on the options.
65
59
  */
66
60
  async createAuthorizationRequest({ verifierId, ...otherOptions }) {
67
61
  const verifier = await this.getVerifierByVerifierId(verifierId);
68
- return await this.openId4VcSiopVerifierService.createAuthorizationRequest(this.agentContext, {
62
+ return await this.openId4VpVerifierService.createAuthorizationRequest(this.agentContext, {
69
63
  ...otherOptions,
70
64
  verifier,
71
65
  });
@@ -78,17 +72,14 @@ let OpenId4VcVerifierApi = class OpenId4VcVerifierApi {
78
72
  */
79
73
  async verifyAuthorizationResponse({ verificationSessionId, ...otherOptions }) {
80
74
  const verificationSession = await this.getVerificationSessionById(verificationSessionId);
81
- return await this.openId4VcSiopVerifierService.verifyAuthorizationResponse(this.agentContext, {
75
+ return await this.openId4VpVerifierService.verifyAuthorizationResponse(this.agentContext, {
82
76
  ...otherOptions,
83
77
  verificationSession,
84
78
  });
85
79
  }
86
80
  async getVerifiedAuthorizationResponse(verificationSessionId) {
87
81
  const verificationSession = await this.getVerificationSessionById(verificationSessionId);
88
- return this.openId4VcSiopVerifierService.getVerifiedAuthorizationResponse(this.agentContext, verificationSession);
89
- }
90
- async findVerificationSessionForAuthorizationResponse(options) {
91
- return this.openId4VcSiopVerifierService.findVerificationSessionForAuthorizationResponse(this.agentContext, options);
82
+ return this.openId4VpVerifierService.getVerifiedAuthorizationResponse(this.agentContext, verificationSession);
92
83
  }
93
84
  };
94
85
  exports.OpenId4VcVerifierApi = OpenId4VcVerifierApi;
@@ -96,6 +87,6 @@ exports.OpenId4VcVerifierApi = OpenId4VcVerifierApi = __decorate([
96
87
  (0, core_1.injectable)(),
97
88
  __metadata("design:paramtypes", [OpenId4VcVerifierModuleConfig_1.OpenId4VcVerifierModuleConfig,
98
89
  core_1.AgentContext,
99
- OpenId4VcSiopVerifierService_1.OpenId4VcSiopVerifierService])
90
+ OpenId4VpVerifierService_1.OpenId4VpVerifierService])
100
91
  ], OpenId4VcVerifierApi);
101
92
  //# sourceMappingURL=OpenId4VcVerifierApi.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"OpenId4VcVerifierApi.js","sourceRoot":"","sources":["../../src/openid4vc-verifier/OpenId4VcVerifierApi.ts"],"names":[],"mappings":";;;;;;;;;;;;AAWA,yCAAyD;AAEzD,iFAA6E;AAC7E,mFAA+E;AAE/E;;GAEG;AAEI,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAC/B,YACkB,MAAqC,EAC7C,YAA0B,EAC1B,4BAA0D;QAFlD,WAAM,GAAN,MAAM,CAA+B;QAC7C,iBAAY,GAAZ,YAAY,CAAc;QAC1B,iCAA4B,GAA5B,4BAA4B,CAA8B;IACjE,CAAC;IAEJ;;OAEG;IACI,KAAK,CAAC,eAAe;QAC1B,OAAO,IAAI,CAAC,4BAA4B,CAAC,eAAe,CAAC,IAAI,CAAC,YAAY,CAAC,CAAA;IAC7E,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,uBAAuB,CAAC,UAAkB;QACrD,OAAO,IAAI,CAAC,4BAA4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AC,uBAAuB,CAAC,UAAU,CAAC,CAAA;QAC/D,OAAO,MAAM,IAAI,CAAC,wBAAwB,CAAC,0BAA0B,CAAC,IAAI,CAAC,YAAY,EAAE;YACvF,GAAG,YAAY;YACf,QAAQ;SACT,CAAC,CAAA;IACJ,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,2BAA2B,CAAC,EACvC,qBAAqB,EACrB,GAAG,YAAY,EAGhB;QACC,MAAM,mBAAmB,GAAG,MAAM,IAAI,CAAC,0BAA0B,CAAC,qBAAqB,CAAC,CAAA;QACxF,OAAO,MAAM,IAAI,CAAC,wBAAwB,CAAC,2BAA2B,CAAC,IAAI,CAAC,YAAY,EAAE;YACxF,GAAG,YAAY;YACf,mBAAmB;SACpB,CAAC,CAAA;IACJ,CAAC;IAEM,KAAK,CAAC,gCAAgC,CAAC,qBAA6B;QACzE,MAAM,mBAAmB,GAAG,MAAM,IAAI,CAAC,0BAA0B,CAAC,qBAAqB,CAAC,CAAA;QACxF,OAAO,IAAI,CAAC,wBAAwB,CAAC,gCAAgC,CAAC,IAAI,CAAC,YAAY,EAAE,mBAAmB,CAAC,CAAA;IAC/G,CAAC;CACF,CAAA;AA1FY,oDAAoB;+BAApB,oBAAoB;IADhC,IAAA,iBAAU,GAAE;qCAGe,6DAA6B;QAC/B,mBAAY;QACA,mDAAwB;GAJjD,oBAAoB,CA0FhC"}
@@ -1,6 +1,6 @@
1
+ import type { BaseEvent } from '@credo-ts/core';
1
2
  import type { OpenId4VcVerificationSessionState } from './OpenId4VcVerificationSessionState';
2
3
  import type { OpenId4VcVerificationSessionRecord } from './repository';
3
- import type { BaseEvent } from '@credo-ts/core';
4
4
  export declare enum OpenId4VcVerifierEvents {
5
5
  VerificationSessionStateChanged = "OpenId4VcVerifier.VerificationSessionStateChanged"
6
6
  }
@@ -1,5 +1,5 @@
1
- import type { OpenId4VcVerifierModuleConfigOptions } from './OpenId4VcVerifierModuleConfig';
2
1
  import type { AgentContext, DependencyManager, Module } from '@credo-ts/core';
2
+ import type { OpenId4VcVerifierModuleConfigOptions } from './OpenId4VcVerifierModuleConfig';
3
3
  import { OpenId4VcVerifierApi } from './OpenId4VcVerifierApi';
4
4
  import { OpenId4VcVerifierModuleConfig } from './OpenId4VcVerifierModuleConfig';
5
5
  /**
@@ -4,9 +4,9 @@ exports.OpenId4VcVerifierModule = void 0;
4
4
  const core_1 = require("@credo-ts/core");
5
5
  const oauth2_1 = require("@openid4vc/oauth2");
6
6
  const router_1 = require("../shared/router");
7
- const OpenId4VcSiopVerifierService_1 = require("./OpenId4VcSiopVerifierService");
8
7
  const OpenId4VcVerifierApi_1 = require("./OpenId4VcVerifierApi");
9
8
  const OpenId4VcVerifierModuleConfig_1 = require("./OpenId4VcVerifierModuleConfig");
9
+ const OpenId4VpVerifierService_1 = require("./OpenId4VpVerifierService");
10
10
  const repository_1 = require("./repository");
11
11
  const router_2 = require("./router");
12
12
  const authorizationRequestEndpoint_1 = require("./router/authorizationRequestEndpoint");
@@ -33,7 +33,7 @@ class OpenId4VcVerifierModule {
33
33
  // Register config
34
34
  dependencyManager.registerInstance(OpenId4VcVerifierModuleConfig_1.OpenId4VcVerifierModuleConfig, this.config);
35
35
  // Services
36
- dependencyManager.registerSingleton(OpenId4VcSiopVerifierService_1.OpenId4VcSiopVerifierService);
36
+ dependencyManager.registerSingleton(OpenId4VpVerifierService_1.OpenId4VpVerifierService);
37
37
  // Repository
38
38
  dependencyManager.registerSingleton(repository_1.OpenId4VcVerifierRepository);
39
39
  }
@@ -86,8 +86,8 @@ class OpenId4VcVerifierModule {
86
86
  });
87
87
  contextRouter.use('/:verifierId', endpointRouter);
88
88
  // Configure endpoints
89
- (0, router_2.configureAuthorizationEndpoint)(endpointRouter, this.config.authorizationEndpoint);
90
- (0, authorizationRequestEndpoint_1.configureAuthorizationRequestEndpoint)(endpointRouter, this.config.authorizationRequestEndpoint);
89
+ (0, router_2.configureAuthorizationEndpoint)(endpointRouter, this.config);
90
+ (0, authorizationRequestEndpoint_1.configureAuthorizationRequestEndpoint)(endpointRouter, this.config);
91
91
  // First one will be called for all requests (when next is called)
92
92
  contextRouter.use(async (req, _res, next) => {
93
93
  const { agentContext } = (0, router_1.getRequestContext)(req);
@@ -1 +1 @@
1
- {"version":3,"file":"OpenId4VcVerifierModule.js","sourceRoot":"","sources":["../../src/openid4vc-verifier/OpenId4VcVerifierModule.ts"],"names":[],"mappings":";;;AAKA,yCAA4C;AAC5C,8CAAmD;AAEnD,6CAA8F;AAE9F,iFAA6E;AAC7E,iEAA6D;AAC7D,mFAA+E;AAC/E,6CAA0D;AAC1D,qCAAyD;AACzD,wFAA6F;AAE7F;;GAEG;AACH,MAAa,uBAAuB;IAIlC,YAAmB,OAA6C;QAHhD,QAAG,GAAG,2CAAoB,CAAA;QAIxC,IAAI,CAAC,MAAM,GAAG,IAAI,6DAA6B,CAAC,OAAO,CAAC,CAAA;IAC1D,CAAC;IAED;;OAEG;IACI,QAAQ,CAAC,iBAAoC;QAClD,MAAM,WAAW,GAAG,iBAAiB,CAAC,OAAO,CAAC,kBAAW,CAAC,CAAA;QAE1D,iCAAiC;QACjC,WAAW,CAAC,MAAM,CAAC,IAAI,CACrB,0LAA0L,CAC3L,CAAA;QAED,IAAI,WAAW,CAAC,qBAAqB,EAAE,CAAC;YACtC,IAAA,wBAAe,EAAC;gBACd,iBAAiB,EAAE,IAAI;aACxB,CAAC,CAAA;QACJ,CAAC;QAED,kBAAkB;QAClB,iBAAiB,CAAC,gBAAgB,CAAC,6DAA6B,EAAE,IAAI,CAAC,MAAM,CAAC,CAAA;QAE9E,WAAW;QACX,iBAAiB,CAAC,iBAAiB,CAAC,2DAA4B,CAAC,CAAA;QAEjE,aAAa;QACb,iBAAiB,CAAC,iBAAiB,CAAC,wCAA2B,CAAC,CAAA;IAClE,CAAC;IAEM,KAAK,CAAC,UAAU,CAAC,gBAA8B;QACpD,IAAI,CAAC,eAAe,CAAC,gBAAgB,CAAC,CAAA;IACxC,CAAC;IAED;;OAEG;IACK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C;YAED,IAAI,EAAE,CAAA;QACR,CAAC,CAAC,CAAA;QAEF,aAAa,CAAC,GAAG,CAAC,cAAc,EAAE,cAAc,CAAC,CAAA;QAEjD,sBAAsB;QACtB,IAAA,uCAA8B,EAAC,cAAc,EAAE,IAAI,CAAC,MAAM,CAAC,CAAA;QAC3D,IAAA,oEAAqC,EAAC,cAAc,EAAE,IAAI,CAAC,MAAM,CAAC,CAAA;QAElE,kEAAkE;QAClE,aAAa,CAAC,GAAG,CAAC,KAAK,EAAE,GAAiC,EAAE,IAAa,EAAE,IAAI,EAAE,EAAE;YACjF,MAAM,EAAE,YAAY,EAAE,GAAG,IAAA,0BAAiB,EAAC,GAAG,CAAC,CAAA;YAC/C,MAAM,YAAY,CAAC,UAAU,EAAE,CAAA;YAC/B,IAAI,EAAE,CAAA;QACR,CAAC,CAAC,CAAA;QAEF,yDAAyD;QACzD,aAAa,CAAC,GAAG,CAAC,KAAK,EAAE,MAAe,EAAE,GAAiC,EAAE,IAAa,EAAE,IAAkB,EAAE,EAAE;YAChH,MAAM,EAAE,YAAY,EAAE,GAAG,IAAA,0BAAiB,EAAC,GAAG,CAAC,CAAA;YAC/C,MAAM,YAAY,CAAC,UAAU,EAAE,CAAA;YAC/B,IAAI,EAAE,CAAA;QACR,CAAC,CAAC,CAAA;IACJ,CAAC;CACF;AApHD,0DAoHC"}
@@ -1,6 +1,3 @@
1
- import type { OpenId4VcSiopAuthorizationEndpointConfig } from './router/authorizationEndpoint';
2
- import type { OpenId4VcSiopAuthorizationRequestEndpointConfig } from './router/authorizationRequestEndpoint';
3
- import type { Optional } from '@credo-ts/core';
4
1
  import type { Router } from 'express';
5
2
  export interface OpenId4VcVerifierModuleConfigOptions {
6
3
  /**
@@ -16,9 +13,23 @@ export interface OpenId4VcVerifierModuleConfigOptions {
16
13
  * expose this on a public url that is reachable when `baseUrl` is called.
17
14
  */
18
15
  router?: Router;
16
+ /**
17
+ * The number of seconds after which a created authorization request will expire.
18
+ *
19
+ * This is used for the `exp` field of a signed authorization request.
20
+ *
21
+ * @default 300
22
+ */
23
+ authorizationRequestExpirationInSeconds?: number;
19
24
  endpoints?: {
20
- authorization?: Optional<OpenId4VcSiopAuthorizationEndpointConfig, 'endpointPath'>;
21
- authorizationRequest?: Optional<OpenId4VcSiopAuthorizationRequestEndpointConfig, 'endpointPath'>;
25
+ /**
26
+ * @default /authorize
27
+ */
28
+ authorization?: string;
29
+ /**
30
+ * @default /authorization-requests
31
+ */
32
+ authorizationRequest?: string;
22
33
  };
23
34
  }
24
35
  export declare class OpenId4VcVerifierModuleConfig {
@@ -26,6 +37,18 @@ export declare class OpenId4VcVerifierModuleConfig {
26
37
  readonly router: Router;
27
38
  constructor(options: OpenId4VcVerifierModuleConfigOptions);
28
39
  get baseUrl(): string;
29
- get authorizationRequestEndpoint(): OpenId4VcSiopAuthorizationRequestEndpointConfig;
30
- get authorizationEndpoint(): OpenId4VcSiopAuthorizationEndpointConfig;
40
+ /**
41
+ * @default /authorize
42
+ */
43
+ get authorizationRequestEndpoint(): string;
44
+ /**
45
+ * @default /authorize
46
+ */
47
+ get authorizationEndpoint(): string;
48
+ /**
49
+ * Time in seconds after which an authorization request will expire
50
+ *
51
+ * @default 300
52
+ */
53
+ get authorizationRequestExpiresInSeconds(): number;
31
54
  }
@@ -10,21 +10,25 @@ class OpenId4VcVerifierModuleConfig {
10
10
  get baseUrl() {
11
11
  return this.options.baseUrl;
12
12
  }
13
+ /**
14
+ * @default /authorize
15
+ */
13
16
  get authorizationRequestEndpoint() {
14
- // Use user supplied options, or return defaults.
15
- const userOptions = this.options.endpoints?.authorizationRequest;
16
- return {
17
- ...userOptions,
18
- endpointPath: this.options.endpoints?.authorizationRequest?.endpointPath ?? '/authorization-requests',
19
- };
17
+ return this.options.endpoints?.authorizationRequest ?? '/authorization-requests';
20
18
  }
19
+ /**
20
+ * @default /authorize
21
+ */
21
22
  get authorizationEndpoint() {
22
- // Use user supplied options, or return defaults.
23
- const userOptions = this.options.endpoints?.authorization;
24
- return {
25
- ...userOptions,
26
- endpointPath: userOptions?.endpointPath ?? '/authorize',
27
- };
23
+ return this.options.endpoints?.authorization ?? '/authorize';
24
+ }
25
+ /**
26
+ * Time in seconds after which an authorization request will expire
27
+ *
28
+ * @default 300
29
+ */
30
+ get authorizationRequestExpiresInSeconds() {
31
+ return this.options.authorizationRequestExpirationInSeconds ?? 300;
28
32
  }
29
33
  }
30
34
  exports.OpenId4VcVerifierModuleConfig = OpenId4VcVerifierModuleConfig;
@@ -1 +1 @@
1
- {"version":3,"file":"OpenId4VcVerifierModuleConfig.js","sourceRoot":"","sources":["../../src/openid4vc-verifier/OpenId4VcVerifierModuleConfig.ts"],"names":[],"mappings":";;;AAKA,6CAAgD;AAwBhD,MAAa,6BAA6B;IAIxC,YAAmB,OAA6C;QAC9D,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QAEtB,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,IAAA,sBAAa,GAAE,CAAC,MAAM,EAAE,CAAA;IAC1D,CAAC;IAED,IAAW,OAAO;QAChB,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAA;IAC7B,CAAC;IAED,IAAW,4BAA4B;QACrC,iDAAiD;QACjD,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,oBAAoB,CAAA;QAEhE,OAAO;YACL,GAAG,WAAW;YACd,YAAY,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,oBAAoB,EAAE,YAAY,IAAI,yBAAyB;SACtG,CAAA;IACH,CAAC;IAED,IAAW,qBAAqB;QAC9B,iDAAiD;QACjD,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,aAAa,CAAA;QAEzD,OAAO;YACL,GAAG,WAAW;YACd,YAAY,EAAE,WAAW,EAAE,YAAY,IAAI,YAAY;SACxD,CAAA;IACH,CAAC;CACF;AAjCD,sEAiCC"}
1
+ {"version":3,"file":"OpenId4VcVerifierModuleConfig.js","sourceRoot":"","sources":["../../src/openid4vc-verifier/OpenId4VcVerifierModuleConfig.ts"],"names":[],"mappings":";;;AAEA,6CAAgD;AAwChD,MAAa,6BAA6B;IAIxC,YAAmB,OAA6C;QAC9D,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QAEtB,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,IAAA,sBAAa,GAAE,CAAC,MAAM,EAAE,CAAA;IAC1D,CAAC;IAED,IAAW,OAAO;QAChB,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAA;IAC7B,CAAC;IAED;;OAEG;IACH,IAAW,4BAA4B;QACrC,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,oBAAoB,IAAI,yBAAyB,CAAA;IAClF,CAAC;IAED;;OAEG;IACH,IAAW,qBAAqB;QAC9B,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,aAAa,IAAI,YAAY,CAAA;IAC9D,CAAC;IAED;;;;OAIG;IACH,IAAW,oCAAoC;QAC7C,OAAO,IAAI,CAAC,OAAO,CAAC,uCAAuC,IAAI,GAAG,CAAA;IACpE,CAAC;CACF;AApCD,sEAoCC"}
@@ -1,14 +1,13 @@
1
- import type { OpenId4VcSiopCreateAuthorizationRequestOptions, OpenId4VcSiopCreateAuthorizationRequestReturn, OpenId4VcSiopCreateVerifierOptions, OpenId4VcSiopVerifiedAuthorizationResponse, OpenId4VcSiopVerifyAuthorizationResponseOptions } from './OpenId4VcSiopVerifierServiceOptions';
2
- import type { AgentContext, Query, QueryOptions } from '@credo-ts/core';
1
+ import { AgentContext, Query, QueryOptions } from '@credo-ts/core';
2
+ import type { OpenId4VpCreateAuthorizationRequestOptions, OpenId4VpCreateAuthorizationRequestReturn, OpenId4VpCreateVerifierOptions, OpenId4VpVerifiedAuthorizationResponse, OpenId4VpVerifyAuthorizationResponseOptions } from './OpenId4VpVerifierServiceOptions';
3
3
  import { Logger, W3cCredentialService } from '@credo-ts/core';
4
- import { OpenId4VcSiopAuthorizationResponsePayload } from '../shared/index';
5
4
  import { OpenId4VcVerificationSessionState } from './OpenId4VcVerificationSessionState';
6
5
  import { OpenId4VcVerifierModuleConfig } from './OpenId4VcVerifierModuleConfig';
7
6
  import { OpenId4VcVerificationSessionRecord, OpenId4VcVerificationSessionRepository, OpenId4VcVerifierRecord, OpenId4VcVerifierRepository } from './repository';
8
7
  /**
9
8
  * @internal
10
9
  */
11
- export declare class OpenId4VcSiopVerifierService {
10
+ export declare class OpenId4VpVerifierService {
12
11
  private logger;
13
12
  private w3cCredentialService;
14
13
  private openId4VcVerifierRepository;
@@ -16,48 +15,33 @@ export declare class OpenId4VcSiopVerifierService {
16
15
  private openId4VcVerificationSessionRepository;
17
16
  constructor(logger: Logger, w3cCredentialService: W3cCredentialService, openId4VcVerifierRepository: OpenId4VcVerifierRepository, config: OpenId4VcVerifierModuleConfig, openId4VcVerificationSessionRepository: OpenId4VcVerificationSessionRepository);
18
17
  private getOpenid4vpVerifier;
19
- createAuthorizationRequest(agentContext: AgentContext, options: OpenId4VcSiopCreateAuthorizationRequestOptions & {
18
+ createAuthorizationRequest(agentContext: AgentContext, options: OpenId4VpCreateAuthorizationRequestOptions & {
20
19
  verifier: OpenId4VcVerifierRecord;
21
- }): Promise<OpenId4VcSiopCreateAuthorizationRequestReturn>;
20
+ }): Promise<OpenId4VpCreateAuthorizationRequestReturn>;
22
21
  private getDcqlVerifiedResponse;
23
22
  private parseAuthorizationResponse;
24
- verifyAuthorizationResponse(agentContext: AgentContext, options: OpenId4VcSiopVerifyAuthorizationResponseOptions & ({
25
- verifierId: string;
26
- verificationSession?: never;
27
- } | {
23
+ verifyAuthorizationResponse(agentContext: AgentContext, options: OpenId4VpVerifyAuthorizationResponseOptions & {
24
+ /**
25
+ * The verification session associated with the response
26
+ */
28
27
  verificationSession: OpenId4VcVerificationSessionRecord;
29
- verifierId?: never;
30
- })): Promise<OpenId4VcSiopVerifiedAuthorizationResponse & {
31
- verificationSession: OpenId4VcVerificationSessionRecord;
32
- }>;
33
- getVerifiedAuthorizationResponse(agentContext: AgentContext, verificationSession: OpenId4VcVerificationSessionRecord): Promise<OpenId4VcSiopVerifiedAuthorizationResponse>;
28
+ }): Promise<OpenId4VpVerifiedAuthorizationResponse>;
34
29
  /**
35
- * Find the verification session associated with an authorization response. You can optionally provide a verifier id
36
- * if the verifier that the response is associated with is already known.
30
+ * Get the format based on an encoded presentation. This is mostly leveraged for
31
+ * PEX where it's not known based on the request which format to expect
37
32
  */
38
- findVerificationSessionForAuthorizationResponse(agentContext: AgentContext, { authorizationResponse, authorizationResponseParams, verifierId, }: {
39
- authorizationResponse?: never;
40
- authorizationResponseParams: {
41
- state?: string;
42
- nonce?: string;
43
- };
44
- verifierId?: string;
45
- } | {
46
- authorizationResponse: OpenId4VcSiopAuthorizationResponsePayload;
47
- authorizationResponseParams?: never;
48
- verifierId?: string;
49
- }): Promise<OpenId4VcVerificationSessionRecord | null>;
33
+ private claimFormatFromEncodedPresentation;
34
+ getVerifiedAuthorizationResponse(agentContext: AgentContext, verificationSession: OpenId4VcVerificationSessionRecord): Promise<OpenId4VpVerifiedAuthorizationResponse>;
35
+ private getVerifiedTransactionData;
50
36
  getAllVerifiers(agentContext: AgentContext): Promise<OpenId4VcVerifierRecord[]>;
51
37
  getVerifierByVerifierId(agentContext: AgentContext, verifierId: string): Promise<OpenId4VcVerifierRecord>;
52
38
  updateVerifier(agentContext: AgentContext, verifier: OpenId4VcVerifierRecord): Promise<void>;
53
- createVerifier(agentContext: AgentContext, options?: OpenId4VcSiopCreateVerifierOptions): Promise<OpenId4VcVerifierRecord>;
39
+ createVerifier(agentContext: AgentContext, options?: OpenId4VpCreateVerifierOptions): Promise<OpenId4VcVerifierRecord>;
54
40
  findVerificationSessionsByQuery(agentContext: AgentContext, query: Query<OpenId4VcVerificationSessionRecord>, queryOptions?: QueryOptions): Promise<OpenId4VcVerificationSessionRecord[]>;
55
41
  getVerificationSessionById(agentContext: AgentContext, verificationSessionId: string): Promise<OpenId4VcVerificationSessionRecord>;
56
42
  private getClientMetadata;
57
- private getPresentationFromVpTokenParseResult;
58
- private getTransactionDataMeta;
59
43
  private decodePresentation;
60
- private verifyPresentations;
44
+ private verifyPresentation;
61
45
  /**
62
46
  * Update the record to a new state and emit an state changed event. Also updates the record
63
47
  * in storage.