@credo-ts/openid4vc 0.5.0-alpha.153 → 0.5.0-alpha.155

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/OpenId4VciHolderService.js +3 -1
  2. package/build/openid4vc-holder/OpenId4VciHolderService.js.map +1 -1
  3. package/build/openid4vc-issuer/OpenId4VcIssuanceSessionState.d.ts +9 -0
  4. package/build/openid4vc-issuer/OpenId4VcIssuanceSessionState.js +14 -0
  5. package/build/openid4vc-issuer/OpenId4VcIssuanceSessionState.js.map +1 -0
  6. package/build/openid4vc-issuer/OpenId4VcIssuerApi.d.ts +12 -19
  7. package/build/openid4vc-issuer/OpenId4VcIssuerApi.js +15 -27
  8. package/build/openid4vc-issuer/OpenId4VcIssuerApi.js.map +1 -1
  9. package/build/openid4vc-issuer/OpenId4VcIssuerEvents.d.ts +13 -0
  10. package/build/openid4vc-issuer/OpenId4VcIssuerEvents.js +8 -0
  11. package/build/openid4vc-issuer/OpenId4VcIssuerEvents.js.map +1 -0
  12. package/build/openid4vc-issuer/OpenId4VcIssuerModule.js +3 -0
  13. package/build/openid4vc-issuer/OpenId4VcIssuerModule.js.map +1 -1
  14. package/build/openid4vc-issuer/OpenId4VcIssuerModuleConfig.d.ts +7 -9
  15. package/build/openid4vc-issuer/OpenId4VcIssuerModuleConfig.js +11 -33
  16. package/build/openid4vc-issuer/OpenId4VcIssuerModuleConfig.js.map +1 -1
  17. package/build/openid4vc-issuer/OpenId4VcIssuerService.d.ts +24 -10
  18. package/build/openid4vc-issuer/OpenId4VcIssuerService.js +76 -65
  19. package/build/openid4vc-issuer/OpenId4VcIssuerService.js.map +1 -1
  20. package/build/openid4vc-issuer/OpenId4VcIssuerServiceOptions.d.ts +1 -11
  21. package/build/openid4vc-issuer/index.d.ts +2 -0
  22. package/build/openid4vc-issuer/index.js +2 -0
  23. package/build/openid4vc-issuer/index.js.map +1 -1
  24. package/build/openid4vc-issuer/repository/OpenId4VcCNonceStateManager.d.ts +17 -0
  25. package/build/openid4vc-issuer/repository/OpenId4VcCNonceStateManager.js +90 -0
  26. package/build/openid4vc-issuer/repository/OpenId4VcCNonceStateManager.js.map +1 -0
  27. package/build/openid4vc-issuer/repository/OpenId4VcCredentialOfferSessionStateManager.d.ts +21 -0
  28. package/build/openid4vc-issuer/repository/OpenId4VcCredentialOfferSessionStateManager.js +182 -0
  29. package/build/openid4vc-issuer/repository/OpenId4VcCredentialOfferSessionStateManager.js.map +1 -0
  30. package/build/openid4vc-issuer/repository/OpenId4VcCredentialOfferUriStateManager.d.ts +17 -0
  31. package/build/openid4vc-issuer/repository/OpenId4VcCredentialOfferUriStateManager.js +68 -0
  32. package/build/openid4vc-issuer/repository/OpenId4VcCredentialOfferUriStateManager.js.map +1 -0
  33. package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRecord.d.ts +79 -0
  34. package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRecord.js +39 -0
  35. package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRecord.js.map +1 -0
  36. package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRepository.d.ts +5 -0
  37. package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRepository.js +29 -0
  38. package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRepository.js.map +1 -0
  39. package/build/openid4vc-issuer/repository/index.d.ts +2 -0
  40. package/build/openid4vc-issuer/repository/index.js +2 -0
  41. package/build/openid4vc-issuer/repository/index.js.map +1 -1
  42. package/build/openid4vc-issuer/router/accessTokenEndpoint.js +15 -10
  43. package/build/openid4vc-issuer/router/accessTokenEndpoint.js.map +1 -1
  44. package/build/openid4vc-issuer/router/credentialEndpoint.js +22 -4
  45. package/build/openid4vc-issuer/router/credentialEndpoint.js.map +1 -1
  46. package/build/openid4vc-issuer/router/credentialOfferEndpoint.d.ts +11 -0
  47. package/build/openid4vc-issuer/router/credentialOfferEndpoint.js +54 -0
  48. package/build/openid4vc-issuer/router/credentialOfferEndpoint.js.map +1 -0
  49. package/build/openid4vc-issuer/router/index.d.ts +1 -0
  50. package/build/openid4vc-issuer/router/index.js +3 -1
  51. package/build/openid4vc-issuer/router/index.js.map +1 -1
  52. package/build/openid4vc-issuer/router/verifyAccessToken.d.ts +3 -0
  53. package/build/openid4vc-issuer/router/verifyAccessToken.js +33 -0
  54. package/build/openid4vc-issuer/router/verifyAccessToken.js.map +1 -0
  55. package/build/openid4vc-issuer/util/credentialRequest.d.ts +5 -0
  56. package/build/openid4vc-issuer/util/credentialRequest.js +18 -0
  57. package/build/openid4vc-issuer/util/credentialRequest.js.map +1 -0
  58. package/build/openid4vc-verifier/OpenId4VcSiopVerifierService.d.ts +22 -6
  59. package/build/openid4vc-verifier/OpenId4VcSiopVerifierService.js +137 -57
  60. package/build/openid4vc-verifier/OpenId4VcSiopVerifierService.js.map +1 -1
  61. package/build/openid4vc-verifier/OpenId4VcSiopVerifierServiceOptions.d.ts +5 -4
  62. package/build/openid4vc-verifier/OpenId4VcVerificationSessionState.d.ts +6 -0
  63. package/build/openid4vc-verifier/OpenId4VcVerificationSessionState.js +11 -0
  64. package/build/openid4vc-verifier/OpenId4VcVerificationSessionState.js.map +1 -0
  65. package/build/openid4vc-verifier/OpenId4VcVerifierApi.d.ts +17 -5
  66. package/build/openid4vc-verifier/OpenId4VcVerifierApi.js +19 -6
  67. package/build/openid4vc-verifier/OpenId4VcVerifierApi.js.map +1 -1
  68. package/build/openid4vc-verifier/OpenId4VcVerifierEvents.d.ts +13 -0
  69. package/build/openid4vc-verifier/OpenId4VcVerifierEvents.js +8 -0
  70. package/build/openid4vc-verifier/OpenId4VcVerifierEvents.js.map +1 -0
  71. package/build/openid4vc-verifier/OpenId4VcVerifierModule.js +6 -1
  72. package/build/openid4vc-verifier/OpenId4VcVerifierModule.js.map +1 -1
  73. package/build/openid4vc-verifier/OpenId4VcVerifierModuleConfig.d.ts +4 -7
  74. package/build/openid4vc-verifier/OpenId4VcVerifierModuleConfig.js +6 -23
  75. package/build/openid4vc-verifier/OpenId4VcVerifierModuleConfig.js.map +1 -1
  76. package/build/openid4vc-verifier/index.d.ts +2 -0
  77. package/build/openid4vc-verifier/index.js +2 -0
  78. package/build/openid4vc-verifier/index.js.map +1 -1
  79. package/build/openid4vc-verifier/repository/OpenId4VcRelyingPartyEventEmitter.d.ts +50 -0
  80. package/build/openid4vc-verifier/repository/OpenId4VcRelyingPartyEventEmitter.js +229 -0
  81. package/build/openid4vc-verifier/repository/OpenId4VcRelyingPartyEventEmitter.js.map +1 -0
  82. package/build/openid4vc-verifier/repository/OpenId4VcRelyingPartySessionManager.d.ts +19 -0
  83. package/build/openid4vc-verifier/repository/OpenId4VcRelyingPartySessionManager.js +146 -0
  84. package/build/openid4vc-verifier/repository/OpenId4VcRelyingPartySessionManager.js.map +1 -0
  85. package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRecord.d.ts +61 -0
  86. package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRecord.js +45 -0
  87. package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRecord.js.map +1 -0
  88. package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRepository.d.ts +5 -0
  89. package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRepository.js +29 -0
  90. package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRepository.js.map +1 -0
  91. package/build/openid4vc-verifier/repository/index.d.ts +2 -0
  92. package/build/openid4vc-verifier/repository/index.js +2 -0
  93. package/build/openid4vc-verifier/repository/index.js.map +1 -1
  94. package/build/openid4vc-verifier/router/authorizationEndpoint.js +9 -2
  95. package/build/openid4vc-verifier/router/authorizationEndpoint.js.map +1 -1
  96. package/build/openid4vc-verifier/router/authorizationRequestEndpoint.d.ts +11 -0
  97. package/build/openid4vc-verifier/router/authorizationRequestEndpoint.js +59 -0
  98. package/build/openid4vc-verifier/router/authorizationRequestEndpoint.js.map +1 -0
  99. package/build/shared/models/index.js.map +1 -1
  100. package/package.json +10 -9
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.configureCredentialOfferEndpoint = void 0;
4
+ const core_1 = require("@credo-ts/core");
5
+ const router_1 = require("../../shared/router");
6
+ const OpenId4VcIssuanceSessionState_1 = require("../OpenId4VcIssuanceSessionState");
7
+ const OpenId4VcIssuerEvents_1 = require("../OpenId4VcIssuerEvents");
8
+ const OpenId4VcIssuerModuleConfig_1 = require("../OpenId4VcIssuerModuleConfig");
9
+ const repository_1 = require("../repository");
10
+ function configureCredentialOfferEndpoint(router, config) {
11
+ router.get((0, core_1.joinUriParts)(config.endpointPath, [':credentialOfferId']), async (request, response, next) => {
12
+ const { agentContext, issuer } = (0, router_1.getRequestContext)(request);
13
+ try {
14
+ const openId4VcIssuanceSessionRepository = agentContext.dependencyManager.resolve(repository_1.OpenId4VcIssuanceSessionRepository);
15
+ const issuerConfig = agentContext.dependencyManager.resolve(OpenId4VcIssuerModuleConfig_1.OpenId4VcIssuerModuleConfig);
16
+ // TODO: is there a cleaner way to get the host (including port)?
17
+ const [, , host] = issuerConfig.baseUrl.split('/');
18
+ const credentialOfferUri = `${request.protocol}://${host}${request.originalUrl}`;
19
+ const openId4VcIssuanceSession = await openId4VcIssuanceSessionRepository.findSingleByQuery(agentContext, {
20
+ issuerId: issuer.issuerId,
21
+ credentialOfferUri,
22
+ });
23
+ if (!openId4VcIssuanceSession || !openId4VcIssuanceSession.credentialOfferPayload) {
24
+ return (0, router_1.sendErrorResponse)(response, agentContext.config.logger, 404, 'not_found', 'Credential offer not found');
25
+ }
26
+ if (![OpenId4VcIssuanceSessionState_1.OpenId4VcIssuanceSessionState.OfferCreated, OpenId4VcIssuanceSessionState_1.OpenId4VcIssuanceSessionState.OfferUriRetrieved].includes(openId4VcIssuanceSession.state)) {
27
+ return (0, router_1.sendErrorResponse)(response, agentContext.config.logger, 400, 'invalid_request', 'Invalid state for credential offer');
28
+ }
29
+ // It's okay to retrieve the offer multiple times. So we only update the state if it's not already retrieved
30
+ if (openId4VcIssuanceSession.state !== OpenId4VcIssuanceSessionState_1.OpenId4VcIssuanceSessionState.OfferUriRetrieved) {
31
+ const previousState = openId4VcIssuanceSession.state;
32
+ openId4VcIssuanceSession.state = OpenId4VcIssuanceSessionState_1.OpenId4VcIssuanceSessionState.OfferUriRetrieved;
33
+ await openId4VcIssuanceSessionRepository.update(agentContext, openId4VcIssuanceSession);
34
+ agentContext.dependencyManager
35
+ .resolve(core_1.EventEmitter)
36
+ .emit(agentContext, {
37
+ type: OpenId4VcIssuerEvents_1.OpenId4VcIssuerEvents.IssuanceSessionStateChanged,
38
+ payload: {
39
+ issuanceSession: openId4VcIssuanceSession.clone(),
40
+ previousState,
41
+ },
42
+ });
43
+ }
44
+ response.json(openId4VcIssuanceSession.credentialOfferPayload);
45
+ }
46
+ catch (error) {
47
+ (0, router_1.sendErrorResponse)(response, agentContext.config.logger, 500, 'invalid_request', error);
48
+ }
49
+ // NOTE: if we don't call next, the agentContext session handler will NOT be called
50
+ next();
51
+ });
52
+ }
53
+ exports.configureCredentialOfferEndpoint = configureCredentialOfferEndpoint;
54
+ //# sourceMappingURL=credentialOfferEndpoint.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"credentialOfferEndpoint.js","sourceRoot":"","sources":["../../../src/openid4vc-issuer/router/credentialOfferEndpoint.ts"],"names":[],"mappings":";;;AAIA,yCAA2D;AAE3D,gDAA0E;AAC1E,oFAAgF;AAChF,oEAAgE;AAChE,gFAA4E;AAC5E,8CAAkE;AAYlE,SAAgB,gCAAgC,CAAC,MAAc,EAAE,MAA+C;IAC9G,MAAM,CAAC,GAAG,CACR,IAAA,mBAAY,EAAC,MAAM,CAAC,YAAY,EAAE,CAAC,oBAAoB,CAAC,CAAC,EACzD,KAAK,EAAE,OAAiC,EAAE,QAAkB,EAAE,IAAI,EAAE,EAAE;QACpE,MAAM,EAAE,YAAY,EAAE,MAAM,EAA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A6B,CAAC,iBAAiB,CAAA;gBAChF,MAAM,kCAAkC,CAAC,MAAM,CAAC,YAAY,EAAE,wBAAwB,CAAC,CAAA;gBAEvF,YAAY,CAAC,iBAAiB;qBAC3B,OAAO,CAAC,mBAAY,CAAC;qBACrB,IAAI,CAA4C,YAAY,EAAE;oBAC7D,IAAI,EAAE,6CAAqB,CAAC,2BAA2B;oBACvD,OAAO,EAAE;wBACP,eAAe,EAAE,wBAAwB,CAAC,KAAK,EAAE;wBACjD,aAAa;qBACd;iBACF,CAAC,CAAA;aACL;YAED,QAAQ,CAAC,IAAI,CAAC,wBAAwB,CAAC,sBAAsB,CAAC,CAAA;SAC/D;QAAC,OAAO,KAAK,EAAE;YACd,IAAA,0BAAiB,EAAC,QAAQ,EAAE,YAAY,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,EAAE,iBAAiB,EAAE,KAAK,CAAC,CAAA;SACvF;QAED,mFAAmF;QACnF,IAAI,EAAE,CAAA;IACR,CAAC,CACF,CAAA;AACH,CAAC;AAlED,4EAkEC"}
@@ -1,4 +1,5 @@
1
1
  export { configureAccessTokenEndpoint, OpenId4VciAccessTokenEndpointConfig } from './accessTokenEndpoint';
2
2
  export { configureCredentialEndpoint, OpenId4VciCredentialEndpointConfig } from './credentialEndpoint';
3
3
  export { configureIssuerMetadataEndpoint } from './metadataEndpoint';
4
+ export { configureCredentialOfferEndpoint, OpenId4VciCredentialOfferEndpointConfig } from './credentialOfferEndpoint';
4
5
  export { OpenId4VcIssuanceRequest } from './requestContext';
@@ -1,10 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.configureIssuerMetadataEndpoint = exports.configureCredentialEndpoint = exports.configureAccessTokenEndpoint = void 0;
3
+ exports.configureCredentialOfferEndpoint = exports.configureIssuerMetadataEndpoint = exports.configureCredentialEndpoint = exports.configureAccessTokenEndpoint = void 0;
4
4
  var accessTokenEndpoint_1 = require("./accessTokenEndpoint");
5
5
  Object.defineProperty(exports, "configureAccessTokenEndpoint", { enumerable: true, get: function () { return accessTokenEndpoint_1.configureAccessTokenEndpoint; } });
6
6
  var credentialEndpoint_1 = require("./credentialEndpoint");
7
7
  Object.defineProperty(exports, "configureCredentialEndpoint", { enumerable: true, get: function () { return credentialEndpoint_1.configureCredentialEndpoint; } });
8
8
  var metadataEndpoint_1 = require("./metadataEndpoint");
9
9
  Object.defineProperty(exports, "configureIssuerMetadataEndpoint", { enumerable: true, get: function () { return metadataEndpoint_1.configureIssuerMetadataEndpoint; } });
10
+ var credentialOfferEndpoint_1 = require("./credentialOfferEndpoint");
11
+ Object.defineProperty(exports, "configureCredentialOfferEndpoint", { enumerable: true, get: function () { return credentialOfferEndpoint_1.configureCredentialOfferEndpoint; } });
10
12
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/openid4vc-issuer/router/index.ts"],"names":[],"mappings":";;;AAAA,6DAAyG;AAAhG,mIAAA,4BAA4B,OAAA;AACrC,2DAAsG;AAA7F,iIAAA,2BAA2B,OAAA;AACpC,uDAAoE;AAA3D,mIAAA,+BAA+B,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/openid4vc-issuer/router/index.ts"],"names":[],"mappings":";;;AAAA,6DAAyG;AAAhG,mIAAA,4BAA4B,OAAA;AACrC,2DAAsG;AAA7F,iIAAA,2BAA2B,OAAA;AACpC,uDAAoE;AAA3D,mIAAA,+BAA+B,OAAA;AACxC,qEAAqH;AAA5G,2IAAA,gCAAgC,OAAA"}
@@ -0,0 +1,3 @@
1
+ import type { OpenId4VcIssuerRecord } from '../repository';
2
+ import type { AgentContext } from '@credo-ts/core';
3
+ export declare function verifyAccessToken(agentContext: AgentContext, issuer: OpenId4VcIssuerRecord, authorizationHeader?: string): Promise<void>;
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.verifyAccessToken = void 0;
4
+ const core_1 = require("@credo-ts/core");
5
+ const OpenId4VcIssuerService_1 = require("../OpenId4VcIssuerService");
6
+ async function verifyAccessToken(agentContext, issuer, authorizationHeader) {
7
+ const openId4VcIssuerService = agentContext.dependencyManager.resolve(OpenId4VcIssuerService_1.OpenId4VcIssuerService);
8
+ if (!authorizationHeader || !authorizationHeader.startsWith('Bearer ')) {
9
+ throw new core_1.CredoError('No access token provided in the authorization header');
10
+ }
11
+ const issuerMetadata = openId4VcIssuerService.getIssuerMetadata(agentContext, issuer);
12
+ const accessToken = core_1.Jwt.fromSerializedJwt(authorizationHeader.replace('Bearer ', ''));
13
+ const jwsService = agentContext.dependencyManager.resolve(core_1.JwsService);
14
+ const { isValid, signerKeys } = await jwsService.verifyJws(agentContext, {
15
+ jws: accessToken.serializedJwt,
16
+ jwkResolver: () => {
17
+ throw new Error('No JWK resolver available for access token verification');
18
+ },
19
+ });
20
+ if (!isValid) {
21
+ throw new core_1.CredoError('Signature on access token is invalid');
22
+ }
23
+ if (!signerKeys.map((key) => key.fingerprint).includes(issuer.accessTokenPublicKeyFingerprint)) {
24
+ throw new core_1.CredoError('Access token was not signed by the expected issuer');
25
+ }
26
+ // Finally validate the JWT payload (expiry etc..)
27
+ accessToken.payload.validate();
28
+ if (accessToken.payload.iss !== issuerMetadata.issuerUrl) {
29
+ throw new core_1.CredoError('Access token was not issued by the expected issuer');
30
+ }
31
+ }
32
+ exports.verifyAccessToken = verifyAccessToken;
33
+ //# sourceMappingURL=verifyAccessToken.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verifyAccessToken.js","sourceRoot":"","sources":["../../../src/openid4vc-issuer/router/verifyAccessToken.ts"],"names":[],"mappings":";;;AAGA,yCAA4D;AAE5D,sEAAkE;AAE3D,KAAK,UAAU,iBAAiB,CACrC,YAA0B,EAC1B,MAA6B,EAC7B,mBAA4B;IAE5B,MAAM,sBAAsB,GAAG,YAAY,CAAC,iBAAiB,CAAC,OAAO,CAAC,+CAAsB,CAAC,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../shared';
2
+ /**
3
+ * Extract the 'nonce' parameter from the JWT payload of the credential request.
4
+ */
5
+ export declare function getCNonceFromCredentialRequest(credentialRequest: OpenId4VciCredentialRequest): string;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getCNonceFromCredentialRequest = void 0;
4
+ const core_1 = require("@credo-ts/core");
5
+ /**
6
+ * Extract the 'nonce' parameter from the JWT payload of the credential request.
7
+ */
8
+ function getCNonceFromCredentialRequest(credentialRequest) {
9
+ var _a;
10
+ if (!((_a = credentialRequest.proof) === null || _a === void 0 ? void 0 : _a.jwt))
11
+ throw new core_1.CredoError('No jwt in the credentialRequest proof.');
12
+ const jwt = core_1.Jwt.fromSerializedJwt(credentialRequest.proof.jwt);
13
+ if (!jwt.payload.additionalClaims.nonce || typeof jwt.payload.additionalClaims.nonce !== 'string')
14
+ throw new core_1.CredoError('No nonce in the credentialRequest JWT proof payload.');
15
+ return jwt.payload.additionalClaims.nonce;
16
+ }
17
+ exports.getCNonceFromCredentialRequest = getCNonceFromCredentialRequest;
18
+ //# sourceMappingURL=credentialRequest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"credentialRequest.js","sourceRoot":"","sources":["../../../src/openid4vc-issuer/util/credentialRequest.ts"],"names":[],"mappings":";;;AAEA,yCAAgD;AAEhD;;GAEG;AACH,SAAgB,8BAA8B,CAAC,iBAA8C;;IAC3F,IAAI,CAAC,CAAA,MAAA,iBAAiB,CAAC,KAAK,0CAAE,GAAG,CAAA;QAAE,MAAM,IAAI,iBAAU,CAAC,wCAAwC,CAAC,CAAA;IACjG,MAAM,GAAG,GAAG,UAAG,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IAC9D,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,gBAAgB,CAAC,KAAK,IAAI,OAAO,GAAG,CAAC,OAAO,CAAC,gBAAgB,CAAC,KAAK,KAAK,QAAQ;QAC/F,MAAM,IAAI,iBAAU,CAAC,sDAAsD,CAAC,CAAA;IAC9E,OAAO,GAAG,CAAC,OAAO,CAAC,gBAAgB,CAAC,KAAK,CAAA;AAC3C,CAAC;AAND,wEAMC"}
@@ -1,8 +1,10 @@
1
1
  import type { OpenId4VcSiopCreateAuthorizationRequestOptions, OpenId4VcSiopCreateAuthorizationRequestReturn, OpenId4VcSiopCreateVerifierOptions, OpenId4VcSiopVerifiedAuthorizationResponse, OpenId4VcSiopVerifyAuthorizationResponseOptions } from './OpenId4VcSiopVerifierServiceOptions';
2
- import type { AgentContext } from '@credo-ts/core';
2
+ import type { OpenId4VcVerificationSessionRecord } from './repository';
3
+ import type { OpenId4VcSiopAuthorizationResponsePayload } from '../shared';
4
+ import type { AgentContext, Query } from '@credo-ts/core';
3
5
  import { Logger, W3cCredentialService } from '@credo-ts/core';
4
6
  import { OpenId4VcVerifierModuleConfig } from './OpenId4VcVerifierModuleConfig';
5
- import { OpenId4VcVerifierRecord, OpenId4VcVerifierRepository } from './repository';
7
+ import { OpenId4VcVerificationSessionRepository, OpenId4VcVerifierRecord, OpenId4VcVerifierRepository } from './repository';
6
8
  /**
7
9
  * @internal
8
10
  */
@@ -11,17 +13,31 @@ export declare class OpenId4VcSiopVerifierService {
11
13
  private w3cCredentialService;
12
14
  private openId4VcVerifierRepository;
13
15
  private config;
14
- constructor(logger: Logger, w3cCredentialService: W3cCredentialService, openId4VcVerifierRepository: OpenId4VcVerifierRepository, config: OpenId4VcVerifierModuleConfig);
16
+ private openId4VcVerificationSessionRepository;
17
+ constructor(logger: Logger, w3cCredentialService: W3cCredentialService, openId4VcVerifierRepository: OpenId4VcVerifierRepository, config: OpenId4VcVerifierModuleConfig, openId4VcVerificationSessionRepository: OpenId4VcVerificationSessionRepository);
15
18
  createAuthorizationRequest(agentContext: AgentContext, options: OpenId4VcSiopCreateAuthorizationRequestOptions & {
16
19
  verifier: OpenId4VcVerifierRecord;
17
20
  }): Promise<OpenId4VcSiopCreateAuthorizationRequestReturn>;
18
21
  verifyAuthorizationResponse(agentContext: AgentContext, options: OpenId4VcSiopVerifyAuthorizationResponseOptions & {
19
- verifier: OpenId4VcVerifierRecord;
20
- }): Promise<OpenId4VcSiopVerifiedAuthorizationResponse>;
22
+ verificationSession: OpenId4VcVerificationSessionRecord;
23
+ }): Promise<OpenId4VcSiopVerifiedAuthorizationResponse & {
24
+ verificationSession: OpenId4VcVerificationSessionRecord;
25
+ }>;
26
+ getVerifiedAuthorizationResponse(verificationSession: OpenId4VcVerificationSessionRecord): Promise<OpenId4VcSiopVerifiedAuthorizationResponse>;
27
+ /**
28
+ * Find the verification session associated with an authorization response. You can optionally provide a verifier id
29
+ * if the verifier that the response is associated with is already known.
30
+ */
31
+ findVerificationSessionForAuthorizationResponse(agentContext: AgentContext, { authorizationResponse, verifierId, }: {
32
+ authorizationResponse: OpenId4VcSiopAuthorizationResponsePayload;
33
+ verifierId?: string;
34
+ }): Promise<OpenId4VcVerificationSessionRecord | null>;
21
35
  getAllVerifiers(agentContext: AgentContext): Promise<OpenId4VcVerifierRecord[]>;
22
- getByVerifierId(agentContext: AgentContext, verifierId: string): Promise<OpenId4VcVerifierRecord>;
36
+ getVerifierByVerifierId(agentContext: AgentContext, verifierId: string): Promise<OpenId4VcVerifierRecord>;
23
37
  updateVerifier(agentContext: AgentContext, verifier: OpenId4VcVerifierRecord): Promise<void>;
24
38
  createVerifier(agentContext: AgentContext, options?: OpenId4VcSiopCreateVerifierOptions): Promise<OpenId4VcVerifierRecord>;
39
+ findVerificationSessionsByQuery(agentContext: AgentContext, query: Query<OpenId4VcVerificationSessionRecord>): Promise<OpenId4VcVerificationSessionRecord[]>;
40
+ getVerificationSessionById(agentContext: AgentContext, verificationSessionId: string): Promise<OpenId4VcVerificationSessionRecord>;
25
41
  private getRelyingParty;
26
42
  private getPresentationVerificationCallback;
27
43
  }
@@ -15,79 +15,107 @@ Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.OpenId4VcSiopVerifierService = void 0;
16
16
  const core_1 = require("@credo-ts/core");
17
17
  const did_auth_siop_1 = require("@sphereon/did-auth-siop");
18
+ const OpenID4VP_1 = require("@sphereon/did-auth-siop/dist/authorization-response/OpenID4VP");
19
+ const rxjs_1 = require("rxjs");
18
20
  const router_1 = require("../shared/router");
19
21
  const transform_1 = require("../shared/transform");
20
22
  const utils_1 = require("../shared/utils");
23
+ const OpenId4VcVerificationSessionState_1 = require("./OpenId4VcVerificationSessionState");
21
24
  const OpenId4VcVerifierModuleConfig_1 = require("./OpenId4VcVerifierModuleConfig");
22
25
  const repository_1 = require("./repository");
26
+ const OpenId4VcRelyingPartyEventEmitter_1 = require("./repository/OpenId4VcRelyingPartyEventEmitter");
27
+ const OpenId4VcRelyingPartySessionManager_1 = require("./repository/OpenId4VcRelyingPartySessionManager");
23
28
  /**
24
29
  * @internal
25
30
  */
26
31
  let OpenId4VcSiopVerifierService = class OpenId4VcSiopVerifierService {
27
- constructor(logger, w3cCredentialService, openId4VcVerifierRepository, config) {
32
+ constructor(logger, w3cCredentialService, openId4VcVerifierRepository, config, openId4VcVerificationSessionRepository) {
28
33
  this.logger = logger;
29
34
  this.w3cCredentialService = w3cCredentialService;
30
35
  this.openId4VcVerifierRepository = openId4VcVerifierRepository;
31
36
  this.config = config;
37
+ this.openId4VcVerificationSessionRepository = openId4VcVerificationSessionRepository;
32
38
  }
33
39
  async createAuthorizationRequest(agentContext, options) {
34
40
  var _a;
35
41
  const nonce = await agentContext.wallet.generateNonce();
36
42
  const state = await agentContext.wallet.generateNonce();
43
+ // Correlation id will be the id of the verification session record
37
44
  const correlationId = core_1.utils.uuid();
38
- const relyingParty = await this.getRelyingParty(agentContext, options.verifier, {
45
+ const relyingParty = await this.getRelyingParty(agentContext, options.verifier.verifierId, {
39
46
  presentationDefinition: (_a = options.presentationExchange) === null || _a === void 0 ? void 0 : _a.definition,
40
47
  requestSigner: options.requestSigner,
41
48
  });
49
+ // We always use shortened URIs currently
50
+ const hostedAuthorizationRequestUri = (0, core_1.joinUriParts)(this.config.baseUrl, [
51
+ options.verifier.verifierId,
52
+ this.config.authorizationRequestEndpoint.endpointPath,
53
+ // It doesn't really matter what the url is, as long as it's unique
54
+ core_1.utils.uuid(),
55
+ ]);
56
+ // This is very unfortunate, but storing state in sphereon's SiOP-OID4VP library
57
+ // is done async, so we can't be certain yet that the verification session record
58
+ // is created already when we have created the authorization request. So we need to
59
+ // wait for a short while before we can be certain that the verification session record
60
+ // is created. To not use arbitrary timeouts, we wait for the specific RecordSavedEvent
61
+ // that is emitted when the verification session record is created.
62
+ const eventEmitter = agentContext.dependencyManager.resolve(core_1.EventEmitter);
63
+ const verificationSessionCreatedPromise = (0, rxjs_1.firstValueFrom)(eventEmitter
64
+ .observable(core_1.RepositoryEventTypes.RecordSaved)
65
+ .pipe((0, rxjs_1.filter)((e) => e.metadata.contextCorrelationId === agentContext.contextCorrelationId), (0, rxjs_1.filter)((e) => e.payload.record.id === correlationId && e.payload.record.verifierId === options.verifier.verifierId), (0, rxjs_1.first)(), (0, rxjs_1.timeout)({
66
+ first: 10000,
67
+ meta: 'OpenId4VcSiopVerifierService.createAuthorizationRequest',
68
+ }), (0, rxjs_1.map)((e) => e.payload.record)));
42
69
  const authorizationRequest = await relyingParty.createAuthorizationRequest({
43
70
  correlationId,
44
71
  nonce,
45
72
  state,
73
+ requestByReferenceURI: hostedAuthorizationRequestUri,
46
74
  });
47
75
  const authorizationRequestUri = await authorizationRequest.uri();
76
+ const verificationSession = await verificationSessionCreatedPromise;
48
77
  return {
49
- authorizationRequestUri: authorizationRequestUri.encodedUri,
50
- authorizationRequestPayload: authorizationRequest.payload,
78
+ authorizationRequest: authorizationRequestUri.encodedUri,
79
+ verificationSession,
51
80
  };
52
81
  }
53
82
  async verifyAuthorizationResponse(agentContext, options) {
54
- var _a, _b, _c, _d;
55
- const authorizationResponse = await did_auth_siop_1.AuthorizationResponse.fromPayload(options.authorizationResponse).catch(() => {
56
- throw new core_1.CredoError(`Unable to parse authorization response payload. ${JSON.stringify(options.authorizationResponse)}`);
57
- });
58
- const responseNonce = await authorizationResponse.getMergedProperty('nonce', {
59
- hasher: core_1.Hasher.hash,
60
- });
61
- const responseState = await authorizationResponse.getMergedProperty('state', {
62
- hasher: core_1.Hasher.hash,
63
- });
64
- const sessionManager = this.config.getSessionManager(agentContext);
65
- const correlationId = responseNonce
66
- ? await sessionManager.getCorrelationIdByNonce(responseNonce, false)
67
- : responseState
68
- ? await sessionManager.getCorrelationIdByState(responseState, false)
69
- : undefined;
70
- if (!correlationId) {
71
- throw new core_1.CredoError(`Unable to find correlationId for nonce '${responseNonce}' or state '${responseState}'`);
72
- }
73
- const requestSessionState = await sessionManager.getRequestStateByCorrelationId(correlationId);
74
- if (!requestSessionState) {
75
- throw new core_1.CredoError(`Unable to find request state for correlationId '${correlationId}'`);
76
- }
77
- const requestClientId = await requestSessionState.request.getMergedProperty('client_id');
78
- const requestNonce = await requestSessionState.request.getMergedProperty('nonce');
79
- const requestState = await requestSessionState.request.getMergedProperty('state');
80
- const presentationDefinitionsWithLocation = await requestSessionState.request.getPresentationDefinitions();
83
+ var _a;
84
+ // Assert state
85
+ options.verificationSession.assertState([
86
+ OpenId4VcVerificationSessionState_1.OpenId4VcVerificationSessionState.RequestUriRetrieved,
87
+ OpenId4VcVerificationSessionState_1.OpenId4VcVerificationSessionState.RequestCreated,
88
+ ]);
89
+ const authorizationRequest = await did_auth_siop_1.AuthorizationRequest.fromUriOrJwt(options.verificationSession.authorizationRequestJwt);
90
+ const requestClientId = await authorizationRequest.getMergedProperty('client_id');
91
+ const requestNonce = await authorizationRequest.getMergedProperty('nonce');
92
+ const requestState = await authorizationRequest.getMergedProperty('state');
93
+ const presentationDefinitionsWithLocation = await authorizationRequest.getPresentationDefinitions();
81
94
  if (!requestNonce || !requestClientId || !requestState) {
82
- throw new core_1.CredoError(`Unable to find nonce, state, or client_id in authorization request for correlationId '${correlationId}'`);
95
+ throw new core_1.CredoError(`Unable to find nonce, state, or client_id in authorization request for verification session '${options.verificationSession.id}'`);
83
96
  }
84
- const relyingParty = await this.getRelyingParty(agentContext, options.verifier, {
97
+ const relyingParty = await this.getRelyingParty(agentContext, options.verificationSession.verifierId, {
85
98
  presentationDefinition: (_a = presentationDefinitionsWithLocation === null || presentationDefinitionsWithLocation === void 0 ? void 0 : presentationDefinitionsWithLocation[0]) === null || _a === void 0 ? void 0 : _a.definition,
86
99
  clientId: requestClientId,
87
100
  });
88
- const response = await relyingParty.verifyAuthorizationResponse(authorizationResponse.payload, {
101
+ // This is very unfortunate, but storing state in sphereon's SiOP-OID4VP library
102
+ // is done async, so we can't be certain yet that the verification session record
103
+ // is updated already when we have verified the authorization response. So we need to
104
+ // wait for a short while before we can be certain that the verification session record
105
+ // is updated. To not use arbitrary timeouts, we wait for the specific RecordUpdatedEvent
106
+ // that is emitted when the verification session record is updated.
107
+ const eventEmitter = agentContext.dependencyManager.resolve(core_1.EventEmitter);
108
+ const verificationSessionUpdatedPromise = (0, rxjs_1.firstValueFrom)(eventEmitter
109
+ .observable(core_1.RepositoryEventTypes.RecordUpdated)
110
+ .pipe((0, rxjs_1.filter)((e) => e.metadata.contextCorrelationId === agentContext.contextCorrelationId), (0, rxjs_1.filter)((e) => e.payload.record.id === options.verificationSession.id &&
111
+ e.payload.record.verifierId === options.verificationSession.verifierId &&
112
+ e.payload.record.state === OpenId4VcVerificationSessionState_1.OpenId4VcVerificationSessionState.ResponseVerified), (0, rxjs_1.first)(), (0, rxjs_1.timeout)({
113
+ first: 10000,
114
+ meta: 'OpenId4VcSiopVerifierService.verifyAuthorizationResponse',
115
+ }), (0, rxjs_1.map)((e) => e.payload.record)));
116
+ await relyingParty.verifyAuthorizationResponse(options.authorizationResponse, {
89
117
  audience: requestClientId,
90
- correlationId,
118
+ correlationId: options.verificationSession.id,
91
119
  state: requestState,
92
120
  presentationDefinitions: presentationDefinitionsWithLocation,
93
121
  verification: {
@@ -101,31 +129,73 @@ let OpenId4VcSiopVerifierService = class OpenId4VcSiopVerifierService {
101
129
  resolveOpts: { noUniversalResolverFallback: true, resolver: (0, utils_1.getSphereonDidResolver)(agentContext) },
102
130
  },
103
131
  });
104
- const presentationExchange = ((_b = response.oid4vpSubmission) === null || _b === void 0 ? void 0 : _b.submissionData)
105
- ? {
106
- submission: response.oid4vpSubmission.submissionData,
107
- definition: (_c = response.oid4vpSubmission.presentationDefinitions[0]) === null || _c === void 0 ? void 0 : _c.definition,
108
- presentations: (_d = response.oid4vpSubmission) === null || _d === void 0 ? void 0 : _d.presentations.map(transform_1.getVerifiablePresentationFromSphereonWrapped),
109
- }
132
+ const verificationSession = await verificationSessionUpdatedPromise;
133
+ const verifiedAuthorizationResponse = await this.getVerifiedAuthorizationResponse(verificationSession);
134
+ return Object.assign(Object.assign({}, verifiedAuthorizationResponse), { verificationSession: await verificationSessionUpdatedPromise });
135
+ }
136
+ // TODO: we can also choose to store this in the verification session, however we can easily derive it
137
+ // so it's probably easier to make changes in the future if we just store the raw payload.
138
+ async getVerifiedAuthorizationResponse(verificationSession) {
139
+ var _a, _b, _c, _d;
140
+ verificationSession.assertState(OpenId4VcVerificationSessionState_1.OpenId4VcVerificationSessionState.ResponseVerified);
141
+ if (!verificationSession.authorizationResponsePayload) {
142
+ throw new core_1.CredoError('No authorization response payload found in the verification session.');
143
+ }
144
+ const authorizationResponse = await did_auth_siop_1.AuthorizationResponse.fromPayload(verificationSession.authorizationResponsePayload);
145
+ const authorizationRequest = await did_auth_siop_1.AuthorizationRequest.fromUriOrJwt(verificationSession.authorizationRequestJwt);
146
+ const idToken = authorizationResponse.idToken
147
+ ? { payload: await ((_a = authorizationResponse.idToken) === null || _a === void 0 ? void 0 : _a.payload()) }
110
148
  : undefined;
111
- const idToken = response.authorizationResponse.idToken
112
- ? {
113
- payload: await response.authorizationResponse.idToken.payload(),
149
+ let presentationExchange = undefined;
150
+ const presentationDefinitions = await authorizationRequest.getPresentationDefinitions();
151
+ if (presentationDefinitions && presentationDefinitions.length > 0) {
152
+ const presentations = await (0, OpenID4VP_1.extractPresentationsFromAuthorizationResponse)(authorizationResponse, {
153
+ hasher: core_1.Hasher.hash,
154
+ });
155
+ // TODO: Probably wise to check against request for the location of the submission_data
156
+ const submission = (_d = (_c = (_b = idToken === null || idToken === void 0 ? void 0 : idToken.payload) === null || _b === void 0 ? void 0 : _b._vp_token) === null || _c === void 0 ? void 0 : _c.presentation_submission) !== null && _d !== void 0 ? _d : authorizationResponse.payload.presentation_submission;
157
+ if (!submission) {
158
+ throw new core_1.CredoError('Unable to extract submission from the response.');
114
159
  }
115
- : undefined;
116
- // TODO: do we need to verify whether idToken or vpToken is present?
117
- // Or is that properly handled by sphereon's library?
160
+ presentationExchange = {
161
+ definition: presentationDefinitions[0].definition,
162
+ presentations: presentations.map(transform_1.getVerifiablePresentationFromSphereonWrapped),
163
+ submission,
164
+ };
165
+ }
166
+ if (!idToken && !presentationExchange) {
167
+ throw new core_1.CredoError('No idToken or presentationExchange found in the response.');
168
+ }
118
169
  return {
119
- // Parameters related to ID Token.
120
170
  idToken,
121
- // Parameters related to DIF Presentation Exchange
122
171
  presentationExchange,
123
172
  };
124
173
  }
174
+ /**
175
+ * Find the verification session associated with an authorization response. You can optionally provide a verifier id
176
+ * if the verifier that the response is associated with is already known.
177
+ */
178
+ async findVerificationSessionForAuthorizationResponse(agentContext, { authorizationResponse, verifierId, }) {
179
+ const authorizationResponseInstance = await did_auth_siop_1.AuthorizationResponse.fromPayload(authorizationResponse).catch(() => {
180
+ throw new core_1.CredoError(`Unable to parse authorization response payload. ${JSON.stringify(authorizationResponse)}`);
181
+ });
182
+ const responseNonce = await authorizationResponseInstance.getMergedProperty('nonce', {
183
+ hasher: core_1.Hasher.hash,
184
+ });
185
+ const responseState = await authorizationResponseInstance.getMergedProperty('state', {
186
+ hasher: core_1.Hasher.hash,
187
+ });
188
+ const verificationSession = await this.openId4VcVerificationSessionRepository.findSingleByQuery(agentContext, {
189
+ nonce: responseNonce,
190
+ payloadState: responseState,
191
+ verifierId,
192
+ });
193
+ return verificationSession;
194
+ }
125
195
  async getAllVerifiers(agentContext) {
126
196
  return this.openId4VcVerifierRepository.getAll(agentContext);
127
197
  }
128
- async getByVerifierId(agentContext, verifierId) {
198
+ async getVerifierByVerifierId(agentContext, verifierId) {
129
199
  return this.openId4VcVerifierRepository.getByVerifierId(agentContext, verifierId);
130
200
  }
131
201
  async updateVerifier(agentContext, verifier) {
@@ -140,9 +210,15 @@ let OpenId4VcSiopVerifierService = class OpenId4VcSiopVerifierService {
140
210
  await (0, router_1.storeActorIdForContextCorrelationId)(agentContext, openId4VcVerifier.verifierId);
141
211
  return openId4VcVerifier;
142
212
  }
143
- async getRelyingParty(agentContext, verifier, { presentationDefinition, requestSigner, clientId, }) {
213
+ async findVerificationSessionsByQuery(agentContext, query) {
214
+ return this.openId4VcVerificationSessionRepository.findByQuery(agentContext, query);
215
+ }
216
+ async getVerificationSessionById(agentContext, verificationSessionId) {
217
+ return this.openId4VcVerificationSessionRepository.getById(agentContext, verificationSessionId);
218
+ }
219
+ async getRelyingParty(agentContext, verifierId, { presentationDefinition, requestSigner, clientId, }) {
144
220
  const authorizationResponseUrl = (0, core_1.joinUriParts)(this.config.baseUrl, [
145
- verifier.verifierId,
221
+ verifierId,
146
222
  this.config.authorizationEndpoint.endpointPath,
147
223
  ]);
148
224
  const signatureSuiteRegistry = agentContext.dependencyManager.resolve(core_1.SignatureSuiteRegistry);
@@ -163,6 +239,11 @@ let OpenId4VcSiopVerifierService = class OpenId4VcSiopVerifierService {
163
239
  const supportedDidMethods = agentContext.dependencyManager
164
240
  .resolve(core_1.DidsApi)
165
241
  .supportedResolverMethods.filter((m) => m !== 'peer');
242
+ // The OpenId4VcRelyingPartyEventHandler is a global event handler that makes sure that
243
+ // all the events are handled, and that the correct context is used for the events.
244
+ const sphereonEventEmitter = agentContext.dependencyManager
245
+ .resolve(OpenId4VcRelyingPartyEventEmitter_1.OpenId4VcRelyingPartyEventHandler)
246
+ .getEventEmitterForVerifier(agentContext.contextCorrelationId, verifierId);
166
247
  builder
167
248
  .withRedirectUri(authorizationResponseUrl)
168
249
  .withIssuer(did_auth_siop_1.ResponseIss.SELF_ISSUED_V2)
@@ -201,14 +282,12 @@ let OpenId4VcSiopVerifierService = class OpenId4VcSiopVerifierService {
201
282
  .withResponseType(presentationDefinition ? [did_auth_siop_1.ResponseType.ID_TOKEN, did_auth_siop_1.ResponseType.VP_TOKEN] : did_auth_siop_1.ResponseType.ID_TOKEN)
202
283
  .withScope('openid')
203
284
  .withHasher(core_1.Hasher.hash)
204
- // TODO: support hosting requests within AFJ and passing it by reference
205
- .withRequestBy(did_auth_siop_1.PassBy.VALUE)
206
285
  .withCheckLinkedDomain(did_auth_siop_1.CheckLinkedDomain.NEVER)
207
286
  // FIXME: should allow verification of revocation
208
287
  // .withRevocationVerificationCallback()
209
288
  .withRevocationVerification(did_auth_siop_1.RevocationVerification.NEVER)
210
- .withSessionManager(this.config.getSessionManager(agentContext))
211
- .withEventEmitter(this.config.getEventEmitter(agentContext));
289
+ .withSessionManager(new OpenId4VcRelyingPartySessionManager_1.OpenId4VcRelyingPartySessionManager(agentContext, verifierId))
290
+ .withEventEmitter(sphereonEventEmitter);
212
291
  if (presentationDefinition) {
213
292
  builder.withPresentationDefinition({ definition: presentationDefinition }, [did_auth_siop_1.PropertyTarget.REQUEST_OBJECT]);
214
293
  }
@@ -271,7 +350,8 @@ OpenId4VcSiopVerifierService = __decorate([
271
350
  __param(0, (0, core_1.inject)(core_1.InjectionSymbols.Logger)),
272
351
  __metadata("design:paramtypes", [Object, core_1.W3cCredentialService,
273
352
  repository_1.OpenId4VcVerifierRepository,
274
- OpenId4VcVerifierModuleConfig_1.OpenId4VcVerifierModuleConfig])
353
+ OpenId4VcVerifierModuleConfig_1.OpenId4VcVerifierModuleConfig,
354
+ repository_1.OpenId4VcVerificationSessionRepository])
275
355
  ], OpenId4VcSiopVerifierService);
276
356
  exports.OpenId4VcSiopVerifierService = OpenId4VcSiopVerifierService;
277
357
  //# sourceMappingURL=OpenId4VcSiopVerifierService.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"OpenId4VcSiopVerifierService.js","sourceRoot":"","sources":["../../src/openid4vc-verifier/OpenId4VcSiopVerifierService.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAWA,yCAeuB;AACvB,2DAYgC;AAEhC,6CAAsE;AACtE,mDAAkF;AAClF,2CAIwB;AAExB,mFAA+E;AAC/E,6CAAmF;AAEnF;;GAEG;AAEI,IAAM,4BAA4B,GAAlC,MAAM,4BAA4B;IACvC,YAC2C,MAAc,EAC/C,oBAA0C,EAC1C,2BAAwD,EACxD,MAAqC;QAHJ,WAAM,GAAN,MAAM,CAAQ;QAC/C,yBAAoB,GAApB,oBAAoB,CAAsB;QAC1C,gCAA2B,GAA3B,2BAA2B,CAA6B;QACxD,WAAM,GAAN,MAAM,CAA+B;IAC5C,CAAC;IAEG,KAAK,CAAC,0BAA0B,CACrC,YAA0B,EAC1B,OAA+F;;QAE/F,MAAM,KAAK,GAAG,MAAM,YAAY,CAAC,MAAM,CAAC,aAAa,EAAE,CAAA;QACvD,MAAM,KAAK,GAAG,MAAM,YAAY,CAAC,MAAM,CAAC,aAAa,EAAE,CAAA;QACvD,MAAM,aAAa,GAAG,YAAK,CAAC,IAAI,EAAE,CAAA;QAElC,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,YAAY,EAAE,OAAO,CAAC,QAAQ,EAAE;YAC9E,sBAAsB,EAAE,MAAA,OAAO,CAAC,oBAAoB,0CAAE,UAAU;YAChE,aAAa,EAAE,OAAO,CAAC,aAAa;SACrC,CAAC,CAAA;QAEF,MAAM,oBAAoB,GAAG,MAAM,YAAY,CAAC,0BAA0B,CAAC;YACzE,aAAa;YACb,KAAK;YACL,KAAK;SACN,CAAC,CAAA;QAEF,MAAM,uBAAuB,GAAG,MAAM,oBAAoB,CAAC,GAAG,EAAE,CAAA;QAEhE,OAAO;YACL,uBAAuB,EAAE,uBAAuB,CAAC,U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BAAU,GAAE;IAGR,WAAA,IAAA,aAAM,EAAC,uBAAgB,CAAC,MAAM,CAAC,CAAA;6CACF,2BAAoB;QACb,wCAA2B;QAChD,6DAA6B;GALpC,4BAA4B,CAkTxC;AAlTY,oEAA4B"}
1
+ {"version":3,"file":"OpenId4VcSiopVerifierService.js","sourceRoot":"","sources":["../../src/openid4vc-verifier/OpenId4VcSiopVerifierService.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAkBA,yCAiBuB;AACvB,2DAagC;AAChC,6FAA6H;AAC7H,+BAAkE;AAElE,6CAAsE;AACtE,mDAAkF;AAClF,2CAIwB;AAExB,2FAAuF;AACvF,mFAA+E;AAC/E,6CAIqB;AACrB,sGAAkG;AAClG,0GAAsG;AAEtG;;GAEG;AAEI,IAAM,4BAA4B,GAAlC,MAAM,4BAA4B;IACvC,YAC2C,MAAc,EAC/C,oBAA0C,EAC1C,2BAAwD,EACxD,MAAqC,EACrC,sCAA8E;QAJ7C,WAAM,GAAN,MAAM,CAAQ;QAC/C,yBAAoB,GAApB,oBAAoB,CAAsB;QAC1C,gCAA2B,GAA3B,2BAA2B,CAA6B;QACxD,WAAM,GAAN,MAAM,CAA+B;QACrC,2CAAsC,GAAtC,sCAAsC,CAAwC;IACrF,CAAC;IAEG,KAAK,CAAC,0BAA0B,CACrC,YAA0B,EAC1B,OAA+F;;QAE/F,MAAM,KAAK,GAAG,MAAM,YAAY,CAAC,MAAM,CAAC,aAAa,EAAE,CAAA;QACvD,MAAM,KAAK,GAAG,MAAM,YAAY,CAAC,MAAM,CAAC,aAAa,EAAE,CAAA;QAEvD,mEAAmE;QACnE,MAAM,aAAa,GAAG,YAAK,CAAC,IAAI,EAAE,CAAA;QAElC,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,YAAY,EAAE,OAAO,CAAC,QAAQ,CAAC,UAAU,EAAE;YACzF,sBAAsB,EAAE,MAAA,OAAO,CAAC,oBAAoB,0CAAE,UAAU;YAChE,aAAa,E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A6B;QACG,mDAAsC;GAN7E,4BAA4B,CAsbxC;AAtbY,oEAA4B"}
@@ -1,4 +1,5 @@
1
- import type { OpenId4VcJwtIssuer, OpenId4VcSiopAuthorizationRequestPayload, OpenId4VcSiopAuthorizationResponsePayload, OpenId4VcSiopIdTokenPayload } from '../shared';
1
+ import type { OpenId4VcVerificationSessionRecord } from './repository';
2
+ import type { OpenId4VcJwtIssuer, OpenId4VcSiopAuthorizationResponsePayload, OpenId4VcSiopIdTokenPayload } from '../shared';
2
3
  import type { DifPresentationExchangeDefinition, DifPresentationExchangeSubmission, DifPresentationExchangeDefinitionV2, VerifiablePresentation } from '@credo-ts/core';
3
4
  export interface OpenId4VcSiopCreateAuthorizationRequestOptions {
4
5
  /**
@@ -20,8 +21,8 @@ export interface OpenId4VcSiopVerifyAuthorizationResponseOptions {
20
21
  authorizationResponse: OpenId4VcSiopAuthorizationResponsePayload;
21
22
  }
22
23
  export interface OpenId4VcSiopCreateAuthorizationRequestReturn {
23
- authorizationRequestUri: string;
24
- authorizationRequestPayload: OpenId4VcSiopAuthorizationRequestPayload;
24
+ authorizationRequest: string;
25
+ verificationSession: OpenId4VcVerificationSessionRecord;
25
26
  }
26
27
  /**
27
28
  * Either `idToken` and/or `presentationExchange` will be present, but not none.
@@ -38,7 +39,7 @@ export interface OpenId4VcSiopVerifiedAuthorizationResponse {
38
39
  }
39
40
  export interface OpenId4VcSiopCreateVerifierOptions {
40
41
  /**
41
- * Id of the verifier, not the id of the verified record. Will be exposed publicly
42
+ * Id of the verifier, not the id of the verifier record. Will be exposed publicly
42
43
  */
43
44
  verifierId?: string;
44
45
  }
@@ -0,0 +1,6 @@
1
+ export declare enum OpenId4VcVerificationSessionState {
2
+ RequestCreated = "RequestCreated",
3
+ RequestUriRetrieved = "RequestUriRetrieved",
4
+ ResponseVerified = "ResponseVerified",
5
+ Error = "Error"
6
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OpenId4VcVerificationSessionState = void 0;
4
+ var OpenId4VcVerificationSessionState;
5
+ (function (OpenId4VcVerificationSessionState) {
6
+ OpenId4VcVerificationSessionState["RequestCreated"] = "RequestCreated";
7
+ OpenId4VcVerificationSessionState["RequestUriRetrieved"] = "RequestUriRetrieved";
8
+ OpenId4VcVerificationSessionState["ResponseVerified"] = "ResponseVerified";
9
+ OpenId4VcVerificationSessionState["Error"] = "Error";
10
+ })(OpenId4VcVerificationSessionState = exports.OpenId4VcVerificationSessionState || (exports.OpenId4VcVerificationSessionState = {}));
11
+ //# sourceMappingURL=OpenId4VcVerificationSessionState.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OpenId4VcVerificationSessionState.js","sourceRoot":"","sources":["../../src/openid4vc-verifier/OpenId4VcVerificationSessionState.ts"],"names":[],"mappings":";;;AAAA,IAAY,iCAKX;AALD,WAAY,iCAAiC;IAC3C,sEAAiC,CAAA;IACjC,gFAA2C,CAAA;IAC3C,0EAAqC,CAAA;IACrC,oDAAe,CAAA;AACjB,CAAC,EALW,iCAAiC,GAAjC,yCAAiC,KAAjC,yCAAiC,QAK5C"}