@sphereon/ssi-sdk.siopv2-oid4vp-rp-rest-api 0.32.1-next.54 → 0.33.1-feature.vcdm2.4

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.
@@ -3,16 +3,19 @@ import { IPresentationExchange } from '@sphereon/ssi-sdk.presentation-exchange';
3
3
  import { ISIOPv2RP } from '@sphereon/ssi-sdk.siopv2-oid4vp-rp-auth';
4
4
  import { IAgentContext, ICredentialVerifier } from '@veramo/core';
5
5
  import { IPDManager } from '@sphereon/ssi-sdk.pd-manager';
6
+ import { QRCodeOpts } from './QRCode.types';
6
7
  export type SiopFeatures = 'rp-status' | 'siop';
7
8
  export interface ISIOPv2RPRestAPIOpts {
8
9
  enableFeatures?: SiopFeatures[];
9
10
  endpointOpts?: {
10
11
  basePath?: string;
12
+ trustProxy?: boolean | Array<string>;
11
13
  globalAuth?: GenericAuthArgs & {
12
14
  secureSiopEndpoints?: boolean;
13
15
  };
14
16
  webappCreateAuthRequest?: ICreateAuthRequestWebappEndpointOpts;
15
17
  webappDeleteAuthRequest?: ISingleEndpointOpts;
18
+ webappGetDefinitions?: ISingleEndpointOpts;
16
19
  webappAuthStatus?: ISingleEndpointOpts;
17
20
  siopVerifyAuthResponse?: ISingleEndpointOpts;
18
21
  siopGetAuthRequest?: ISingleEndpointOpts;
@@ -20,9 +23,10 @@ export interface ISIOPv2RPRestAPIOpts {
20
23
  }
21
24
  export interface ICreateAuthRequestWebappEndpointOpts extends ISingleEndpointOpts {
22
25
  siopBaseURI?: string;
26
+ qrCodeOpts?: QRCodeOpts;
23
27
  webappAuthStatusPath?: string;
24
28
  webappBaseURI?: string;
25
- nonce?: string;
29
+ responseRedirectURI?: string;
26
30
  }
27
31
  export type IRequiredPlugins = ICredentialVerifier & ISIOPv2RP & IPresentationExchange & IPDManager;
28
32
  export type IRequiredContext = IAgentContext<IRequiredPlugins>;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","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AM,gBAAgB,GAAG,mBAAmB,GAAG,SAAS,GAAG,qBAAqB,GAAG,UAAU,CAAA;AACnG,MAAM,MAAM,gBAAgB,GAAG,aAAa,CAAC,gBAAgB,CAAC,CAAA"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types/types.ts"],"names":[],"mappings":""}
@@ -4,4 +4,5 @@ import { ICreateAuthRequestWebappEndpointOpts, IRequiredContext } from './types'
4
4
  export declare function createAuthRequestWebappEndpoint(router: Router, context: IRequiredContext, opts?: ICreateAuthRequestWebappEndpointOpts): void;
5
5
  export declare function authStatusWebappEndpoint(router: Router, context: IRequiredContext, opts?: ISingleEndpointOpts): void;
6
6
  export declare function removeAuthRequestStateWebappEndpoint(router: Router, context: IRequiredContext, opts?: ISingleEndpointOpts): void;
7
+ export declare function getDefinitionsEndpoint(router: Router, context: IRequiredContext, opts?: ISingleEndpointOpts): void;
7
8
  //# sourceMappingURL=webapp-api-functions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"webapp-api-functions.d.ts","sourceRoot":"","sources":["../src/webapp-api-functions.ts"],"names":[],"mappings":"AACA,OAAO,EAAa,mBAAmB,EAAqB,MAAM,+BAA+B,CAAA;AAGjG,OAAO,EAAqB,MAAM,EAAE,MAAM,SAAS,CAAA;AAEnD,OAAO,EAAE,oCAAoC,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAGhF,wBAAgB,+BAA+B,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,gBAAgB,EAAE,IAAI,CAAC,EAAE,oCAAoC,QAyCrI;AAED,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,gBAAgB,EAAE,IAAI,CAAC,EAAE,mBAAmB,QA2E7G;AAED,wBAAgB,oCAAoC,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,gBAAgB,EAAE,IAAI,CAAC,EAAE,mBAAmB,QAoBzH"}
1
+ {"version":3,"file":"webapp-api-functions.d.ts","sourceRoot":"","sources":["../src/webapp-api-functions.ts"],"names":[],"mappings":"AACA,OAAO,EAAa,mBAAmB,EAAqB,MAAM,+BAA+B,CAAA;AAGjG,OAAO,EAAqB,MAAM,EAAE,MAAM,SAAS,CAAA;AAEnD,OAAO,EAAE,oCAAoC,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAGhF,wBAAgB,+BAA+B,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,gBAAgB,EAAE,IAAI,CAAC,EAAE,oCAAoC,QAyDrI;AAED,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,gBAAgB,EAAE,IAAI,CAAC,EAAE,mBAAmB,QA2E7G;AAED,wBAAgB,oCAAoC,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,gBAAgB,EAAE,IAAI,CAAC,EAAE,mBAAmB,QAoBzH;AAED,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,gBAAgB,EAAE,IAAI,CAAC,EAAE,mBAAmB,QAe3G"}
@@ -1,77 +1,77 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.createAuthRequestWebappEndpoint = createAuthRequestWebappEndpoint;
16
- exports.authStatusWebappEndpoint = authStatusWebappEndpoint;
17
- exports.removeAuthRequestStateWebappEndpoint = removeAuthRequestStateWebappEndpoint;
18
- const did_auth_siop_1 = require("@sphereon/did-auth-siop");
19
- const ssi_express_support_1 = require("@sphereon/ssi-express-support");
20
- const ssi_sdk_siopv2_oid4vp_common_1 = require("@sphereon/ssi-sdk.siopv2-oid4vp-common");
21
- const ssi_sdk_siopv2_oid4vp_rp_auth_1 = require("@sphereon/ssi-sdk.siopv2-oid4vp-rp-auth");
22
- const short_uuid_1 = __importDefault(require("short-uuid"));
23
- const ssi_sdk_core_1 = require("@sphereon/ssi-sdk.core");
24
- function createAuthRequestWebappEndpoint(router, context, opts) {
25
- var _a;
26
- if ((opts === null || opts === void 0 ? void 0 : opts.enabled) === false) {
1
+ import { AuthorizationResponseStateStatus } from '@sphereon/did-auth-siop';
2
+ import { checkAuth, sendErrorResponse } from '@sphereon/ssi-express-support';
3
+ import { uriWithBase } from '@sphereon/ssi-sdk.siopv2-oid4vp-common';
4
+ import { VerifiedDataMode } from '@sphereon/ssi-sdk.siopv2-oid4vp-rp-auth';
5
+ import uuid from 'short-uuid';
6
+ import { shaHasher as defaultHasher } from '@sphereon/ssi-sdk.core';
7
+ export function createAuthRequestWebappEndpoint(router, context, opts) {
8
+ if (opts?.enabled === false) {
27
9
  console.log(`createAuthRequest Webapp endpoint is disabled`);
28
10
  return;
29
11
  }
30
- const path = (_a = opts === null || opts === void 0 ? void 0 : opts.path) !== null && _a !== void 0 ? _a : '/webapp/definitions/:definitionId/auth-requests';
31
- router.post(path, (0, ssi_express_support_1.checkAuth)(opts === null || opts === void 0 ? void 0 : opts.endpoint), (request, response) => __awaiter(this, void 0, void 0, function* () {
32
- var _a;
12
+ const path = opts?.path ?? '/webapp/definitions/:definitionId/auth-requests';
13
+ router.post(path, checkAuth(opts?.endpoint), async (request, response) => {
33
14
  try {
34
15
  // if (!request.agent) throw Error('No agent configured')
35
16
  const definitionId = request.params.definitionId;
36
- const state = short_uuid_1.default.uuid();
37
- const correlationId = state;
38
- const requestByReferenceURI = (0, ssi_sdk_siopv2_oid4vp_common_1.uriWithBase)(`/siop/definitions/${definitionId}/auth-requests/${correlationId}`, {
39
- baseURI: opts === null || opts === void 0 ? void 0 : opts.siopBaseURI,
17
+ if (!definitionId) {
18
+ return sendErrorResponse(response, 400, 'No definitionId query parameter provided');
19
+ }
20
+ const state = request.body.state ?? uuid.uuid();
21
+ const correlationId = request.body.correlationId ?? state;
22
+ const qrCodeOpts = request.body.qrCodeOpts ?? opts?.qrCodeOpts;
23
+ const requestByReferenceURI = uriWithBase(`/siop/definitions/${definitionId}/auth-requests/${state}`, {
24
+ baseURI: opts?.siopBaseURI,
40
25
  });
41
- const responseURI = (0, ssi_sdk_siopv2_oid4vp_common_1.uriWithBase)(`/siop/definitions/${definitionId}/auth-responses/${correlationId}`, { baseURI: opts === null || opts === void 0 ? void 0 : opts.siopBaseURI });
42
- const responseRedirectURI = 'response_redirect_uri' in request.body && request.body.response_redirect_uri;
43
- const authRequestURI = yield context.agent.siopCreateAuthRequestURI(Object.assign({ definitionId,
26
+ const responseURI = uriWithBase(`/siop/definitions/${definitionId}/auth-responses/${state}`, { baseURI: opts?.siopBaseURI });
27
+ // first version is for backwards compat
28
+ const responseRedirectURI = ('response_redirect_uri' in request.body && request.body.response_redirect_uri) ??
29
+ ('responseRedirectURI' in request.body && request.body.responseRedirectURI);
30
+ const authRequestURI = await context.agent.siopCreateAuthRequestURI({
31
+ definitionId,
44
32
  correlationId,
45
- state, nonce: opts === null || opts === void 0 ? void 0 : opts.nonce, requestByReferenceURI, responseURIType: 'response_uri', responseURI }, (responseRedirectURI && { responseRedirectURI })));
33
+ state,
34
+ nonce: uuid.uuid(),
35
+ requestByReferenceURI,
36
+ responseURIType: 'response_uri',
37
+ responseURI,
38
+ ...(responseRedirectURI && { responseRedirectURI }),
39
+ });
40
+ let qrCodeDataUri;
41
+ if (qrCodeOpts) {
42
+ const { AwesomeQR } = await import('awesome-qr');
43
+ const qrCode = new AwesomeQR({ ...qrCodeOpts, text: authRequestURI });
44
+ qrCodeDataUri = `data:image/png;base64,${(await qrCode.draw()).toString('base64')}`;
45
+ }
46
46
  const authRequestBody = {
47
47
  correlationId,
48
+ state,
48
49
  definitionId,
49
50
  authRequestURI,
50
- authStatusURI: `${(0, ssi_sdk_siopv2_oid4vp_common_1.uriWithBase)((_a = opts === null || opts === void 0 ? void 0 : opts.webappAuthStatusPath) !== null && _a !== void 0 ? _a : '/webapp/auth-status', { baseURI: opts === null || opts === void 0 ? void 0 : opts.webappBaseURI })}`,
51
+ authStatusURI: `${uriWithBase(opts?.webappAuthStatusPath ?? '/webapp/auth-status', { baseURI: opts?.webappBaseURI })}`,
52
+ ...(qrCodeDataUri && { qrCodeDataUri }),
51
53
  };
52
54
  console.log(`Auth Request URI data to send back: ${JSON.stringify(authRequestBody)}`);
53
- return response.send(authRequestBody);
55
+ return response.json(authRequestBody);
54
56
  }
55
57
  catch (error) {
56
- return (0, ssi_express_support_1.sendErrorResponse)(response, 500, 'Could not create an authorization request URI', error);
58
+ return sendErrorResponse(response, 500, 'Could not create an authorization request URI', error);
57
59
  }
58
- }));
60
+ });
59
61
  }
60
- function authStatusWebappEndpoint(router, context, opts) {
61
- var _a;
62
- if ((opts === null || opts === void 0 ? void 0 : opts.enabled) === false) {
62
+ export function authStatusWebappEndpoint(router, context, opts) {
63
+ if (opts?.enabled === false) {
63
64
  console.log(`authStatus Webapp endpoint is disabled`);
64
65
  return;
65
66
  }
66
- const path = (_a = opts === null || opts === void 0 ? void 0 : opts.path) !== null && _a !== void 0 ? _a : '/webapp/auth-status';
67
- router.post(path, (0, ssi_express_support_1.checkAuth)(opts === null || opts === void 0 ? void 0 : opts.endpoint), (request, response) => __awaiter(this, void 0, void 0, function* () {
68
- var _a;
67
+ const path = opts?.path ?? '/webapp/auth-status';
68
+ router.post(path, checkAuth(opts?.endpoint), async (request, response) => {
69
69
  try {
70
70
  console.log('Received auth-status request...');
71
71
  const correlationId = request.body.correlationId;
72
72
  const definitionId = request.body.definitionId;
73
73
  const requestState = correlationId && definitionId
74
- ? yield context.agent.siopGetAuthRequestState({
74
+ ? await context.agent.siopGetAuthRequestState({
75
75
  correlationId,
76
76
  definitionId,
77
77
  errorOnNotFound: false,
@@ -87,63 +87,85 @@ function authStatusWebappEndpoint(router, context, opts) {
87
87
  definitionId,
88
88
  lastUpdated: requestState ? requestState.lastUpdated : Date.now(),
89
89
  };
90
- return response.send(statusBody);
90
+ return response.json(statusBody);
91
91
  }
92
- let includeVerifiedData = ssi_sdk_siopv2_oid4vp_rp_auth_1.VerifiedDataMode.NONE;
92
+ let includeVerifiedData = VerifiedDataMode.NONE;
93
93
  if ('includeVerifiedData' in request.body) {
94
94
  includeVerifiedData = request.body.includeVerifiedData;
95
95
  }
96
96
  let responseState;
97
97
  if (requestState.status === 'sent') {
98
- responseState = (yield context.agent.siopGetAuthResponseState({
98
+ responseState = (await context.agent.siopGetAuthResponseState({
99
99
  correlationId,
100
100
  definitionId,
101
101
  includeVerifiedData: includeVerifiedData,
102
102
  errorOnNotFound: false,
103
103
  }));
104
104
  }
105
- const overallState = responseState !== null && responseState !== void 0 ? responseState : requestState;
106
- const statusBody = Object.assign(Object.assign(Object.assign({ status: overallState.status }, (overallState.error ? { error: (_a = overallState.error) === null || _a === void 0 ? void 0 : _a.message } : {})), { correlationId,
107
- definitionId, lastUpdated: overallState.lastUpdated }), (responseState && responseState.status === did_auth_siop_1.AuthorizationResponseStateStatus.VERIFIED
108
- ? {
109
- payload: yield responseState.response.mergedPayloads({ hasher: ssi_sdk_core_1.shaHasher }),
110
- verifiedData: responseState.verifiedData,
111
- }
112
- : {}));
113
- console.log(`Will send auth status: ${JSON.stringify(statusBody)}`);
105
+ const overallState = responseState ?? requestState;
106
+ const statusBody = {
107
+ status: overallState.status,
108
+ ...(overallState.error ? { error: overallState.error?.message } : {}),
109
+ correlationId,
110
+ definitionId,
111
+ lastUpdated: overallState.lastUpdated,
112
+ ...(responseState && responseState.status === AuthorizationResponseStateStatus.VERIFIED
113
+ ? {
114
+ payload: await responseState.response.mergedPayloads({ hasher: defaultHasher }),
115
+ verifiedData: responseState.verifiedData,
116
+ }
117
+ : {}),
118
+ };
119
+ console.debug(`Will send auth status: ${JSON.stringify(statusBody)}`);
114
120
  if (overallState.status === 'error') {
115
121
  response.statusCode = 500;
116
- return response.send(statusBody);
122
+ return response.json(statusBody);
117
123
  }
118
124
  response.statusCode = 200;
119
- return response.send(statusBody);
125
+ return response.json(statusBody);
120
126
  }
121
127
  catch (error) {
122
- return (0, ssi_express_support_1.sendErrorResponse)(response, 500, error.message, error);
128
+ return sendErrorResponse(response, 500, error.message, error);
123
129
  }
124
- }));
130
+ });
125
131
  }
126
- function removeAuthRequestStateWebappEndpoint(router, context, opts) {
127
- var _a;
128
- if ((opts === null || opts === void 0 ? void 0 : opts.enabled) === false) {
132
+ export function removeAuthRequestStateWebappEndpoint(router, context, opts) {
133
+ if (opts?.enabled === false) {
129
134
  console.log(`removeAuthStatus Webapp endpoint is disabled`);
130
135
  return;
131
136
  }
132
- const path = (_a = opts === null || opts === void 0 ? void 0 : opts.path) !== null && _a !== void 0 ? _a : '/webapp/definitions/:definitionId/auth-requests/:correlationId';
133
- router.delete(path, (0, ssi_express_support_1.checkAuth)(opts === null || opts === void 0 ? void 0 : opts.endpoint), (request, response) => __awaiter(this, void 0, void 0, function* () {
137
+ const path = opts?.path ?? '/webapp/definitions/:definitionId/auth-requests/:correlationId';
138
+ router.delete(path, checkAuth(opts?.endpoint), async (request, response) => {
134
139
  try {
135
140
  const correlationId = request.params.correlationId;
136
141
  const definitionId = request.params.definitionId;
137
142
  if (!correlationId || !definitionId) {
138
143
  console.log(`No authorization request could be found for the given url. correlationId: ${correlationId}, definitionId: ${definitionId}`);
139
- return (0, ssi_express_support_1.sendErrorResponse)(response, 404, 'No authorization request could be found');
144
+ return sendErrorResponse(response, 404, 'No authorization request could be found');
140
145
  }
141
146
  response.statusCode = 200;
142
- return response.send(context.agent.siopDeleteAuthState({ definitionId, correlationId }));
147
+ return response.json(await context.agent.siopDeleteAuthState({ definitionId, correlationId }));
143
148
  }
144
149
  catch (error) {
145
- return (0, ssi_express_support_1.sendErrorResponse)(response, 500, error.message, error);
150
+ return sendErrorResponse(response, 500, error.message, error);
146
151
  }
147
- }));
152
+ });
153
+ }
154
+ export function getDefinitionsEndpoint(router, context, opts) {
155
+ if (opts?.enabled === false) {
156
+ console.log(`getDefinitions Webapp endpoint is disabled`);
157
+ return;
158
+ }
159
+ const path = opts?.path ?? '/webapp/definitions';
160
+ router.get(path, checkAuth(opts?.endpoint), async (request, response) => {
161
+ try {
162
+ const definitions = await context.agent.pdmGetDefinitions();
163
+ response.statusCode = 200;
164
+ return response.json(definitions);
165
+ }
166
+ catch (error) {
167
+ return sendErrorResponse(response, 500, error.message, error);
168
+ }
169
+ });
148
170
  }
149
171
  //# sourceMappingURL=webapp-api-functions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"webapp-api-functions.js","sourceRoot":"","sources":["../src/webapp-api-functions.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AASA,0EAyCC;AAED,4DA2EC;AAED,oFAoBC;AArJD,2DAAqG;AACrG,uEAAiG;AACjG,yFAAwH;AACxH,2FAAsH;AAEtH,4DAA6B;AAE7B,yDAAmE;AAEnE,SAAgB,+BAA+B,CAAC,MAAc,EAAE,OAAyB,EAAE,IAA2C;;IACpI,IAAI,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,OAAO,MAAK,KAAK,EAAE,CAAC;QAC5B,OAAO,CAAC,GAAG,CAAC,+CAA+C,CAAC,CAAA;QAC5D,OAAM;IACR,CAAC;IACD,MAAM,IAAI,GAAG,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,IAAI,mCAAI,iDAAiD,CAAA;IAC5E,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,IAAA,+BA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AC;IACH,CAAC,CAAC,CAAA;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sphereon/ssi-sdk.siopv2-oid4vp-rp-rest-api",
3
- "version": "0.32.1-next.54+3b988a2b",
3
+ "version": "0.33.1-feature.vcdm2.4+9f634bdb",
4
4
  "source": "src/index.ts",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -11,18 +11,19 @@
11
11
  "start:dev": "ts-node __tests__/RestAPI.ts"
12
12
  },
13
13
  "dependencies": {
14
- "@sphereon/did-auth-siop": "0.16.1-next.339",
15
- "@sphereon/ssi-express-support": "0.32.1-next.54+3b988a2b",
16
- "@sphereon/ssi-sdk.core": "0.32.1-next.54+3b988a2b",
17
- "@sphereon/ssi-sdk.credential-validation": "0.32.1-next.54+3b988a2b",
18
- "@sphereon/ssi-sdk.kv-store-temp": "0.32.1-next.54+3b988a2b",
19
- "@sphereon/ssi-sdk.pd-manager": "0.32.1-next.54+3b988a2b",
20
- "@sphereon/ssi-sdk.presentation-exchange": "0.32.1-next.54+3b988a2b",
21
- "@sphereon/ssi-sdk.siopv2-oid4vp-common": "0.32.1-next.54+3b988a2b",
22
- "@sphereon/ssi-sdk.siopv2-oid4vp-rp-auth": "0.32.1-next.54+3b988a2b",
23
- "@sphereon/ssi-types": "0.32.1-next.54+3b988a2b",
14
+ "@sphereon/did-auth-siop": "0.17.0",
15
+ "@sphereon/ssi-express-support": "0.33.1-feature.vcdm2.4+9f634bdb",
16
+ "@sphereon/ssi-sdk.core": "0.33.1-feature.vcdm2.4+9f634bdb",
17
+ "@sphereon/ssi-sdk.credential-validation": "0.33.1-feature.vcdm2.4+9f634bdb",
18
+ "@sphereon/ssi-sdk.kv-store-temp": "0.33.1-feature.vcdm2.4+9f634bdb",
19
+ "@sphereon/ssi-sdk.pd-manager": "0.33.1-feature.vcdm2.4+9f634bdb",
20
+ "@sphereon/ssi-sdk.presentation-exchange": "0.33.1-feature.vcdm2.4+9f634bdb",
21
+ "@sphereon/ssi-sdk.siopv2-oid4vp-common": "0.33.1-feature.vcdm2.4+9f634bdb",
22
+ "@sphereon/ssi-sdk.siopv2-oid4vp-rp-auth": "0.33.1-feature.vcdm2.4+9f634bdb",
23
+ "@sphereon/ssi-types": "0.33.1-feature.vcdm2.4+9f634bdb",
24
24
  "@veramo/core": "4.2.0",
25
25
  "@veramo/credential-w3c": "4.2.0",
26
+ "awesome-qr": "^2.1.5-rc.0",
26
27
  "body-parser": "^1.20.2",
27
28
  "cookie-parser": "^1.4.6",
28
29
  "cors": "^2.8.5",
@@ -30,16 +31,18 @@
30
31
  "dotenv-flow": "^3.3.0",
31
32
  "express": "^4.19.2",
32
33
  "short-uuid": "^4.2.2",
34
+ "swagger-ui-express": "^5.0.1",
33
35
  "uuid": "^9.0.1"
34
36
  },
35
37
  "devDependencies": {
36
38
  "@decentralized-identity/ion-sdk": "^0.6.0",
39
+ "@sphereon/did-auth-siop-adapter": "0.17.0",
37
40
  "@sphereon/did-uni-client": "^0.6.3",
38
41
  "@sphereon/pex": "5.0.0-unstable.28",
39
42
  "@sphereon/pex-models": "^2.3.2",
40
- "@sphereon/ssi-sdk-ext.did-provider-jwk": "0.27.0",
41
- "@sphereon/ssi-sdk.data-store": "0.32.1-next.54+3b988a2b",
42
- "@sphereon/ssi-sdk.vc-handler-ld-local": "0.32.1-next.54+3b988a2b",
43
+ "@sphereon/ssi-sdk-ext.did-provider-jwk": "0.28.0",
44
+ "@sphereon/ssi-sdk.data-store": "0.33.1-feature.vcdm2.4+9f634bdb",
45
+ "@sphereon/ssi-sdk.vc-handler-ld-local": "0.33.1-feature.vcdm2.4+9f634bdb",
43
46
  "@types/body-parser": "^1.19.5",
44
47
  "@types/cookie-parser": "^1.4.7",
45
48
  "@types/cors": "^2.8.17",
@@ -51,6 +54,7 @@
51
54
  "@types/node": "^20.17.1",
52
55
  "@types/passport": "^1.0.16",
53
56
  "@types/passport-http-bearer": "^1.0.41",
57
+ "@types/swagger-ui-express": "^4.1.7",
54
58
  "@types/uuid": "^9.0.8",
55
59
  "@veramo/data-store": "4.2.0",
56
60
  "@veramo/did-manager": "4.2.0",
@@ -62,13 +66,14 @@
62
66
  "@veramo/key-manager": "4.2.0",
63
67
  "@veramo/kms-local": "4.2.0",
64
68
  "@veramo/utils": "4.2.0",
69
+ "debug": "^4.4.0",
65
70
  "did-resolver": "^4.1.0",
66
71
  "morgan": "^1.10.0",
67
72
  "nock": "^13.5.4",
68
73
  "passport": "^0.6.0",
69
74
  "passport-http-bearer": "^1.0.1",
70
75
  "ts-node": "^10.9.2",
71
- "typeorm": "^0.3.20"
76
+ "typeorm": "^0.3.21"
72
77
  },
73
78
  "files": [
74
79
  ".yalc/**/*",
@@ -98,5 +103,5 @@
98
103
  "Authenticator"
99
104
  ],
100
105
  "nx": {},
101
- "gitHead": "3b988a2bb62a7c4534a2670ea3a0985fd93d00f2"
106
+ "gitHead": "9f634bdb714061141e277508c124b08d626f6036"
102
107
  }
@@ -71,7 +71,7 @@ export function verifyAuthResponseSIOPv2Endpoint(
71
71
  const authorizationResponse = parseAuthorizationResponse(request)
72
72
  console.log(`URI: ${JSON.stringify(authorizationResponse)}`)
73
73
 
74
- const definition = definitionItems[0].definitionPayload
74
+ const definitionItem = definitionItems[0]
75
75
  const verifiedResponse = await context.agent.siopVerifyAuthResponse({
76
76
  authorizationResponse,
77
77
  correlationId,
@@ -79,9 +79,10 @@ export function verifyAuthResponseSIOPv2Endpoint(
79
79
  presentationDefinitions: [
80
80
  {
81
81
  location: opts?.presentationDefinitionLocation ?? PresentationDefinitionLocation.TOPLEVEL_PRESENTATION_DEF,
82
- definition,
82
+ definition: definitionItem.definitionPayload,
83
83
  },
84
84
  ],
85
+ dcqlQuery: definitionItem.dcqlPayload,
85
86
  })
86
87
 
87
88
  const wrappedPresentation = verifiedResponse?.oid4vpSubmission?.presentations[0]
@@ -91,7 +92,9 @@ export function verifyAuthResponseSIOPv2Endpoint(
91
92
  console.log('PRESENTATION:' + JSON.stringify(wrappedPresentation.presentation, null, 2))
92
93
  response.statusCode = 200
93
94
 
94
- const authorizationChallengeValidationResponse: AuthorizationChallengeValidationResponse = { presentation_during_issuance_session: verifiedResponse.correlationId }
95
+ const authorizationChallengeValidationResponse: AuthorizationChallengeValidationResponse = {
96
+ presentation_during_issuance_session: verifiedResponse.correlationId,
97
+ }
95
98
  if (authorizationResponse.is_first_party) {
96
99
  response.setHeader('Content-Type', 'application/json')
97
100
  return response.send(JSON.stringify(authorizationChallengeValidationResponse))
@@ -3,17 +3,25 @@ import { copyGlobalAuthToEndpoints, ExpressSupport } from '@sphereon/ssi-express
3
3
  import { IPresentationExchange } from '@sphereon/ssi-sdk.presentation-exchange'
4
4
  import { ISIOPv2RP } from '@sphereon/ssi-sdk.siopv2-oid4vp-rp-auth'
5
5
  import { TAgent } from '@veramo/core'
6
- import express, { Express, Router } from 'express'
6
+ import express, { Express, Request, Response, Router } from 'express'
7
7
  import { getAuthRequestSIOPv2Endpoint, verifyAuthResponseSIOPv2Endpoint } from './siop-api-functions'
8
8
  import { IRequiredPlugins, ISIOPv2RPRestAPIOpts } from './types'
9
- import { authStatusWebappEndpoint, createAuthRequestWebappEndpoint, removeAuthRequestStateWebappEndpoint } from './webapp-api-functions'
9
+ import {
10
+ authStatusWebappEndpoint,
11
+ createAuthRequestWebappEndpoint,
12
+ getDefinitionsEndpoint,
13
+ removeAuthRequestStateWebappEndpoint,
14
+ } from './webapp-api-functions'
15
+ import swaggerUi from 'swagger-ui-express'
10
16
 
11
17
  export class SIOPv2RPApiServer {
12
18
  private readonly _express: Express
13
19
  private readonly _router: Router
14
20
  private readonly _agent: TAgent<IPresentationExchange & ISIOPv2RP>
15
21
  private readonly _opts?: ISIOPv2RPRestAPIOpts
22
+ private readonly _basePath: string
16
23
 
24
+ private readonly OID4VP_SWAGGER_URL = 'https://api.swaggerhub.com/apis/SphereonInt/OID4VP/0.1.0'
17
25
  constructor(args: { agent: TAgent<IRequiredPlugins>; expressSupport: ExpressSupport; opts?: ISIOPv2RPRestAPIOpts }) {
18
26
  const { agent, opts } = args
19
27
  this._agent = agent
@@ -35,6 +43,7 @@ export class SIOPv2RPApiServer {
35
43
  createAuthRequestWebappEndpoint(this._router, context, opts?.endpointOpts?.webappCreateAuthRequest)
36
44
  authStatusWebappEndpoint(this._router, context, opts?.endpointOpts?.webappAuthStatus)
37
45
  removeAuthRequestStateWebappEndpoint(this._router, context, opts?.endpointOpts?.webappDeleteAuthRequest)
46
+ getDefinitionsEndpoint(this._router, context, opts?.endpointOpts?.webappGetDefinitions)
38
47
  }
39
48
 
40
49
  // SIOPv2 endpoints
@@ -42,9 +51,39 @@ export class SIOPv2RPApiServer {
42
51
  getAuthRequestSIOPv2Endpoint(this._router, context, opts?.endpointOpts?.siopGetAuthRequest)
43
52
  verifyAuthResponseSIOPv2Endpoint(this._router, context, opts?.endpointOpts?.siopVerifyAuthResponse)
44
53
  }
45
- this._express.use(opts?.endpointOpts?.basePath ?? '', this.router)
54
+ this._basePath = opts?.endpointOpts?.basePath ?? ''
55
+ this._express.use(this._basePath, this.router)
56
+ this._express.set('trust proxy', opts?.endpointOpts?.trustProxy ?? true)
57
+ this.setupSwaggerUi()
46
58
  }
47
59
 
60
+ private setupSwaggerUi() {
61
+ fetch(this.OID4VP_SWAGGER_URL)
62
+ .then((res) => res.json())
63
+ .then((swagger) => {
64
+ const apiDocs = `${this._basePath}/api-docs`
65
+ console.log(`[OID4P] API docs available at ${apiDocs}`)
66
+
67
+ this._router.use(
68
+ '/api-docs',
69
+ (req: Request, res: Response, next: any) => {
70
+ const regex = `${apiDocs.replace(/\//, '\/')}`.replace('/oid4vp', '').replace(/\/api-docs.*/, '')
71
+ swagger.servers = [{ url: `${req.protocol}://${req.get('host')}${regex}`, description: 'This server' }]
72
+ // @ts-ignore
73
+ req.swaggerDoc = swagger
74
+ next()
75
+ },
76
+ swaggerUi.serveFiles(swagger, options),
77
+ swaggerUi.setup(),
78
+ )
79
+ })
80
+ .catch((err) => {
81
+ console.log(`[OID4VP] Unable to fetch swagger document: ${err}. Will not host api-docs on this instance`)
82
+ })
83
+ const options = {
84
+ // customCss: '.swagger-ui .topbar { display: none }',
85
+ }
86
+ }
48
87
  get express(): Express {
49
88
  return this._express
50
89
  }