@sphereon/ssi-sdk.siopv2-oid4vp-rp-rest-api 0.33.0 → 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.
- package/dist/index.js +4 -20
- package/dist/index.js.map +1 -1
- package/dist/siop-api-functions.js +28 -45
- package/dist/siop-api-functions.js.map +1 -1
- package/dist/siopv2-rp-api-server.js +28 -31
- package/dist/siopv2-rp-api-server.js.map +1 -1
- package/dist/types/QRCode.types.js +1 -2
- package/dist/types/index.js +2 -18
- package/dist/types/index.js.map +1 -1
- package/dist/types/types.js +1 -2
- package/dist/webapp-api-functions.js +77 -106
- package/dist/webapp-api-functions.js.map +1 -1
- package/package.json +13 -13
package/dist/index.js
CHANGED
|
@@ -1,24 +1,8 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
1
|
/**
|
|
18
2
|
* @public
|
|
19
3
|
*/
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
4
|
+
export * from './siop-api-functions';
|
|
5
|
+
export * from './webapp-api-functions';
|
|
6
|
+
export * from './types';
|
|
7
|
+
export * from './siopv2-rp-api-server';
|
|
24
8
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,sBAAsB,CAAA;AACpC,cAAc,wBAAwB,CAAA;AACtC,cAAc,SAAS,CAAA;AACvB,cAAc,wBAAwB,CAAA"}
|
|
@@ -1,19 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.verifyAuthResponseSIOPv2Endpoint = verifyAuthResponseSIOPv2Endpoint;
|
|
13
|
-
exports.getAuthRequestSIOPv2Endpoint = getAuthRequestSIOPv2Endpoint;
|
|
14
|
-
const did_auth_siop_1 = require("@sphereon/did-auth-siop");
|
|
15
|
-
const ssi_express_support_1 = require("@sphereon/ssi-express-support");
|
|
16
|
-
const ssi_types_1 = require("@sphereon/ssi-types");
|
|
1
|
+
import { PresentationDefinitionLocation } from '@sphereon/did-auth-siop';
|
|
2
|
+
import { checkAuth, sendErrorResponse } from '@sphereon/ssi-express-support';
|
|
3
|
+
import { CredentialMapper } from '@sphereon/ssi-types';
|
|
17
4
|
const parseAuthorizationResponse = (request) => {
|
|
18
5
|
const contentType = request.header('content-type');
|
|
19
6
|
if (contentType === 'application/json') {
|
|
@@ -32,7 +19,7 @@ const parseAuthorizationResponse = (request) => {
|
|
|
32
19
|
const { vp_token } = payload;
|
|
33
20
|
// The only use case where vp_object is an object is JsonLdAsString atm. For arrays, any objects will be parsed along with the array
|
|
34
21
|
// (Leaving the vp_token JsonLdAsString causes problems because the original credential will remain string and will be interpreted as JWT in some parts of the code)
|
|
35
|
-
if ((vp_token.startsWith('[') && vp_token.endsWith(']')) ||
|
|
22
|
+
if ((vp_token.startsWith('[') && vp_token.endsWith(']')) || CredentialMapper.isJsonLdAsString(vp_token)) {
|
|
36
23
|
payload.vp_token = JSON.parse(vp_token);
|
|
37
24
|
}
|
|
38
25
|
}
|
|
@@ -40,24 +27,22 @@ const parseAuthorizationResponse = (request) => {
|
|
|
40
27
|
}
|
|
41
28
|
throw new Error(`Unsupported content type: ${contentType}. Currently only application/x-www-form-urlencoded and application/json (for direct_post) are supported`);
|
|
42
29
|
};
|
|
43
|
-
function verifyAuthResponseSIOPv2Endpoint(router, context, opts) {
|
|
44
|
-
|
|
45
|
-
if ((opts === null || opts === void 0 ? void 0 : opts.enabled) === false) {
|
|
30
|
+
export function verifyAuthResponseSIOPv2Endpoint(router, context, opts) {
|
|
31
|
+
if (opts?.enabled === false) {
|
|
46
32
|
console.log(`verifyAuthResponse SIOP endpoint is disabled`);
|
|
47
33
|
return;
|
|
48
34
|
}
|
|
49
|
-
const path =
|
|
50
|
-
router.post(path,
|
|
51
|
-
var _a, _b;
|
|
35
|
+
const path = opts?.path ?? '/siop/definitions/:definitionId/auth-responses/:correlationId';
|
|
36
|
+
router.post(path, checkAuth(opts?.endpoint), async (request, response) => {
|
|
52
37
|
try {
|
|
53
38
|
const { correlationId, definitionId, tenantId, version } = request.params;
|
|
54
39
|
if (!correlationId || !definitionId) {
|
|
55
40
|
console.log(`No authorization request could be found for the given url. correlationId: ${correlationId}, definitionId: ${definitionId}`);
|
|
56
|
-
return
|
|
41
|
+
return sendErrorResponse(response, 404, 'No authorization request could be found');
|
|
57
42
|
}
|
|
58
43
|
console.log('Authorization Response (siop-sessions');
|
|
59
44
|
console.log(JSON.stringify(request.body, null, 2));
|
|
60
|
-
const definitionItems =
|
|
45
|
+
const definitionItems = await context.agent.pdmGetDefinitions({ filter: [{ definitionId, tenantId, version }] });
|
|
61
46
|
if (definitionItems.length === 0) {
|
|
62
47
|
console.log(`Could not get definition ${definitionId} from agent. Will return 404`);
|
|
63
48
|
response.statusCode = 404;
|
|
@@ -67,19 +52,19 @@ function verifyAuthResponseSIOPv2Endpoint(router, context, opts) {
|
|
|
67
52
|
const authorizationResponse = parseAuthorizationResponse(request);
|
|
68
53
|
console.log(`URI: ${JSON.stringify(authorizationResponse)}`);
|
|
69
54
|
const definitionItem = definitionItems[0];
|
|
70
|
-
const verifiedResponse =
|
|
55
|
+
const verifiedResponse = await context.agent.siopVerifyAuthResponse({
|
|
71
56
|
authorizationResponse,
|
|
72
57
|
correlationId,
|
|
73
58
|
definitionId,
|
|
74
59
|
presentationDefinitions: [
|
|
75
60
|
{
|
|
76
|
-
location:
|
|
61
|
+
location: opts?.presentationDefinitionLocation ?? PresentationDefinitionLocation.TOPLEVEL_PRESENTATION_DEF,
|
|
77
62
|
definition: definitionItem.definitionPayload,
|
|
78
63
|
},
|
|
79
64
|
],
|
|
80
65
|
dcqlQuery: definitionItem.dcqlPayload,
|
|
81
66
|
});
|
|
82
|
-
const wrappedPresentation =
|
|
67
|
+
const wrappedPresentation = verifiedResponse?.oid4vpSubmission?.presentations[0];
|
|
83
68
|
if (wrappedPresentation) {
|
|
84
69
|
// const credentialSubject = wrappedPresentation.presentation.verifiableCredential[0]?.credential?.credentialSubject
|
|
85
70
|
// console.log(JSON.stringify(credentialSubject, null, 2))
|
|
@@ -92,7 +77,7 @@ function verifyAuthResponseSIOPv2Endpoint(router, context, opts) {
|
|
|
92
77
|
response.setHeader('Content-Type', 'application/json');
|
|
93
78
|
return response.send(JSON.stringify(authorizationChallengeValidationResponse));
|
|
94
79
|
}
|
|
95
|
-
const responseRedirectURI =
|
|
80
|
+
const responseRedirectURI = await context.agent.siopGetRedirectURI({ correlationId, definitionId, state: verifiedResponse.state });
|
|
96
81
|
if (responseRedirectURI) {
|
|
97
82
|
response.setHeader('Content-Type', 'application/json');
|
|
98
83
|
return response.send(JSON.stringify({ redirect_uri: responseRedirectURI }));
|
|
@@ -108,36 +93,34 @@ function verifyAuthResponseSIOPv2Endpoint(router, context, opts) {
|
|
|
108
93
|
}
|
|
109
94
|
catch (error) {
|
|
110
95
|
console.error(error);
|
|
111
|
-
return
|
|
96
|
+
return sendErrorResponse(response, 500, 'Could not verify auth status', error);
|
|
112
97
|
}
|
|
113
|
-
})
|
|
98
|
+
});
|
|
114
99
|
}
|
|
115
|
-
function getAuthRequestSIOPv2Endpoint(router, context, opts) {
|
|
116
|
-
|
|
117
|
-
if ((opts === null || opts === void 0 ? void 0 : opts.enabled) === false) {
|
|
100
|
+
export function getAuthRequestSIOPv2Endpoint(router, context, opts) {
|
|
101
|
+
if (opts?.enabled === false) {
|
|
118
102
|
console.log(`getAuthRequest SIOP endpoint is disabled`);
|
|
119
103
|
return;
|
|
120
104
|
}
|
|
121
|
-
const path =
|
|
122
|
-
router.get(path,
|
|
123
|
-
var _a, _b;
|
|
105
|
+
const path = opts?.path ?? '/siop/definitions/:definitionId/auth-requests/:correlationId';
|
|
106
|
+
router.get(path, checkAuth(opts?.endpoint), async (request, response) => {
|
|
124
107
|
try {
|
|
125
108
|
const correlationId = request.params.correlationId;
|
|
126
109
|
const definitionId = request.params.definitionId;
|
|
127
110
|
if (!correlationId || !definitionId) {
|
|
128
111
|
console.log(`No authorization request could be found for the given url. correlationId: ${correlationId}, definitionId: ${definitionId}`);
|
|
129
|
-
return
|
|
112
|
+
return sendErrorResponse(response, 404, 'No authorization request could be found');
|
|
130
113
|
}
|
|
131
|
-
const requestState =
|
|
114
|
+
const requestState = await context.agent.siopGetAuthRequestState({
|
|
132
115
|
correlationId,
|
|
133
116
|
definitionId,
|
|
134
117
|
errorOnNotFound: false,
|
|
135
118
|
});
|
|
136
119
|
if (!requestState) {
|
|
137
120
|
console.log(`No authorization request could be found for the given url in the state manager. correlationId: ${correlationId}, definitionId: ${definitionId}`);
|
|
138
|
-
return
|
|
121
|
+
return sendErrorResponse(response, 404, `No authorization request could be found`);
|
|
139
122
|
}
|
|
140
|
-
const requestObject =
|
|
123
|
+
const requestObject = await requestState.request?.requestObject?.toJwt();
|
|
141
124
|
console.log('JWT Request object:');
|
|
142
125
|
console.log(requestObject);
|
|
143
126
|
let error;
|
|
@@ -148,10 +131,10 @@ function getAuthRequestSIOPv2Endpoint(router, context, opts) {
|
|
|
148
131
|
}
|
|
149
132
|
catch (e) {
|
|
150
133
|
error = typeof e === 'string' ? e : e instanceof Error ? e.message : undefined;
|
|
151
|
-
return
|
|
134
|
+
return sendErrorResponse(response, 500, 'Could not get authorization request', e);
|
|
152
135
|
}
|
|
153
136
|
finally {
|
|
154
|
-
|
|
137
|
+
await context.agent.siopUpdateAuthRequestState({
|
|
155
138
|
correlationId,
|
|
156
139
|
definitionId,
|
|
157
140
|
state: 'sent',
|
|
@@ -160,8 +143,8 @@ function getAuthRequestSIOPv2Endpoint(router, context, opts) {
|
|
|
160
143
|
}
|
|
161
144
|
}
|
|
162
145
|
catch (error) {
|
|
163
|
-
return
|
|
146
|
+
return sendErrorResponse(response, 500, 'Could not get authorization request', error);
|
|
164
147
|
}
|
|
165
|
-
})
|
|
148
|
+
});
|
|
166
149
|
}
|
|
167
150
|
//# sourceMappingURL=siop-api-functions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"siop-api-functions.js","sourceRoot":"","sources":["../src/siop-api-functions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"siop-api-functions.js","sourceRoot":"","sources":["../src/siop-api-functions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgC,8BAA8B,EAAE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;YAAC,OAAO,CAAC,EAAE,CAAC;gBACX,KAAK,GAAG,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAA;gBAC9E,OAAO,iBAAiB,CAAC,QAAQ,EAAE,GAAG,EAAE,qCAAqC,EAAE,CAAC,CAAC,CAAA;YACnF,CAAC;oBAAS,CAAC;gBACT,MAAM,OAAO,CAAC,KAAK,CAAC,0BAA0B,CAAC;oBAC7C,aAAa;oBACb,YAAY;oBACZ,KAAK,EAAE,MAAM;oBACb,KAAK;iBACN,CAAC,CAAA;YACJ,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,iBAAiB,CAAC,QAAQ,EAAE,GAAG,EAAE,qCAAqC,EAAE,KAAK,CAAC,CAAA;QACvF,CAAC;IACH,CAAC,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -1,46 +1,44 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { agentContext } from '@sphereon/ssi-sdk.core';
|
|
2
|
+
import { copyGlobalAuthToEndpoints } from '@sphereon/ssi-express-support';
|
|
3
|
+
import express from 'express';
|
|
4
|
+
import { getAuthRequestSIOPv2Endpoint, verifyAuthResponseSIOPv2Endpoint } from './siop-api-functions';
|
|
5
|
+
import { authStatusWebappEndpoint, createAuthRequestWebappEndpoint, getDefinitionsEndpoint, removeAuthRequestStateWebappEndpoint, } from './webapp-api-functions';
|
|
6
|
+
import swaggerUi from 'swagger-ui-express';
|
|
7
|
+
export class SIOPv2RPApiServer {
|
|
8
|
+
_express;
|
|
9
|
+
_router;
|
|
10
|
+
_agent;
|
|
11
|
+
_opts;
|
|
12
|
+
_basePath;
|
|
13
|
+
OID4VP_SWAGGER_URL = 'https://api.swaggerhub.com/apis/SphereonInt/OID4VP/0.1.0';
|
|
14
14
|
constructor(args) {
|
|
15
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
16
|
-
this.OID4VP_SWAGGER_URL = 'https://api.swaggerhub.com/apis/SphereonInt/OID4VP/0.1.0';
|
|
17
15
|
const { agent, opts } = args;
|
|
18
16
|
this._agent = agent;
|
|
19
|
-
|
|
20
|
-
if (
|
|
21
|
-
|
|
17
|
+
copyGlobalAuthToEndpoints({ opts, keys: ['webappCreateAuthRequest', 'webappAuthStatus', 'webappDeleteAuthRequest'] });
|
|
18
|
+
if (opts?.endpointOpts?.globalAuth?.secureSiopEndpoints) {
|
|
19
|
+
copyGlobalAuthToEndpoints({ opts, keys: ['siopGetAuthRequest', 'siopVerifyAuthResponse'] });
|
|
22
20
|
}
|
|
23
21
|
this._opts = opts;
|
|
24
22
|
this._express = args.expressSupport.express;
|
|
25
|
-
this._router =
|
|
26
|
-
const context =
|
|
27
|
-
const features =
|
|
23
|
+
this._router = express.Router();
|
|
24
|
+
const context = agentContext(agent);
|
|
25
|
+
const features = opts?.enableFeatures ?? ['rp-status', 'siop'];
|
|
28
26
|
console.log(`SIOPv2 API enabled, with features: ${JSON.stringify(features)}}`);
|
|
29
27
|
// Webapp endpoints
|
|
30
28
|
if (features.includes('rp-status')) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
createAuthRequestWebappEndpoint(this._router, context, opts?.endpointOpts?.webappCreateAuthRequest);
|
|
30
|
+
authStatusWebappEndpoint(this._router, context, opts?.endpointOpts?.webappAuthStatus);
|
|
31
|
+
removeAuthRequestStateWebappEndpoint(this._router, context, opts?.endpointOpts?.webappDeleteAuthRequest);
|
|
32
|
+
getDefinitionsEndpoint(this._router, context, opts?.endpointOpts?.webappGetDefinitions);
|
|
35
33
|
}
|
|
36
34
|
// SIOPv2 endpoints
|
|
37
35
|
if (features.includes('siop')) {
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
getAuthRequestSIOPv2Endpoint(this._router, context, opts?.endpointOpts?.siopGetAuthRequest);
|
|
37
|
+
verifyAuthResponseSIOPv2Endpoint(this._router, context, opts?.endpointOpts?.siopVerifyAuthResponse);
|
|
40
38
|
}
|
|
41
|
-
this._basePath =
|
|
39
|
+
this._basePath = opts?.endpointOpts?.basePath ?? '';
|
|
42
40
|
this._express.use(this._basePath, this.router);
|
|
43
|
-
this._express.set('trust proxy',
|
|
41
|
+
this._express.set('trust proxy', opts?.endpointOpts?.trustProxy ?? true);
|
|
44
42
|
this.setupSwaggerUi();
|
|
45
43
|
}
|
|
46
44
|
setupSwaggerUi() {
|
|
@@ -55,7 +53,7 @@ class SIOPv2RPApiServer {
|
|
|
55
53
|
// @ts-ignore
|
|
56
54
|
req.swaggerDoc = swagger;
|
|
57
55
|
next();
|
|
58
|
-
},
|
|
56
|
+
}, swaggerUi.serveFiles(swagger, options), swaggerUi.setup());
|
|
59
57
|
})
|
|
60
58
|
.catch((err) => {
|
|
61
59
|
console.log(`[OID4VP] Unable to fetch swagger document: ${err}. Will not host api-docs on this instance`);
|
|
@@ -77,5 +75,4 @@ class SIOPv2RPApiServer {
|
|
|
77
75
|
return this._opts;
|
|
78
76
|
}
|
|
79
77
|
}
|
|
80
|
-
exports.SIOPv2RPApiServer = SIOPv2RPApiServer;
|
|
81
78
|
//# sourceMappingURL=siopv2-rp-api-server.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"siopv2-rp-api-server.js","sourceRoot":"","sources":["../src/siopv2-rp-api-server.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"siopv2-rp-api-server.js","sourceRoot":"","sources":["../src/siopv2-rp-api-server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AACrD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I,KAAK;QACP,OAAO,IAAI,CAAC,MAAM,CAAA;IACpB,CAAC;IAED,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,KAAK,CAAA;IACnB,CAAC;CACF"}
|
package/dist/types/index.js
CHANGED
|
@@ -1,19 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./types"), exports);
|
|
18
|
-
__exportStar(require("./QRCode.types"), exports);
|
|
1
|
+
export * from './types';
|
|
2
|
+
export * from './QRCode.types';
|
|
19
3
|
//# sourceMappingURL=index.js.map
|
package/dist/types/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,gBAAgB,CAAA"}
|
package/dist/types/types.js
CHANGED
|
@@ -1,110 +1,77 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
35
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
|
-
};
|
|
37
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
-
exports.createAuthRequestWebappEndpoint = createAuthRequestWebappEndpoint;
|
|
39
|
-
exports.authStatusWebappEndpoint = authStatusWebappEndpoint;
|
|
40
|
-
exports.removeAuthRequestStateWebappEndpoint = removeAuthRequestStateWebappEndpoint;
|
|
41
|
-
exports.getDefinitionsEndpoint = getDefinitionsEndpoint;
|
|
42
|
-
const did_auth_siop_1 = require("@sphereon/did-auth-siop");
|
|
43
|
-
const ssi_express_support_1 = require("@sphereon/ssi-express-support");
|
|
44
|
-
const ssi_sdk_siopv2_oid4vp_common_1 = require("@sphereon/ssi-sdk.siopv2-oid4vp-common");
|
|
45
|
-
const ssi_sdk_siopv2_oid4vp_rp_auth_1 = require("@sphereon/ssi-sdk.siopv2-oid4vp-rp-auth");
|
|
46
|
-
const short_uuid_1 = __importDefault(require("short-uuid"));
|
|
47
|
-
const ssi_sdk_core_1 = require("@sphereon/ssi-sdk.core");
|
|
48
|
-
function createAuthRequestWebappEndpoint(router, context, opts) {
|
|
49
|
-
var _a;
|
|
50
|
-
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) {
|
|
51
9
|
console.log(`createAuthRequest Webapp endpoint is disabled`);
|
|
52
10
|
return;
|
|
53
11
|
}
|
|
54
|
-
const path =
|
|
55
|
-
router.post(path,
|
|
56
|
-
var _a, _b, _c, _d, _e;
|
|
12
|
+
const path = opts?.path ?? '/webapp/definitions/:definitionId/auth-requests';
|
|
13
|
+
router.post(path, checkAuth(opts?.endpoint), async (request, response) => {
|
|
57
14
|
try {
|
|
58
15
|
// if (!request.agent) throw Error('No agent configured')
|
|
59
16
|
const definitionId = request.params.definitionId;
|
|
60
17
|
if (!definitionId) {
|
|
61
|
-
return
|
|
18
|
+
return sendErrorResponse(response, 400, 'No definitionId query parameter provided');
|
|
62
19
|
}
|
|
63
|
-
const state =
|
|
64
|
-
const correlationId =
|
|
65
|
-
const qrCodeOpts =
|
|
66
|
-
const requestByReferenceURI =
|
|
67
|
-
baseURI: opts
|
|
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,
|
|
68
25
|
});
|
|
69
|
-
const responseURI =
|
|
26
|
+
const responseURI = uriWithBase(`/siop/definitions/${definitionId}/auth-responses/${state}`, { baseURI: opts?.siopBaseURI });
|
|
70
27
|
// first version is for backwards compat
|
|
71
|
-
const responseRedirectURI = (
|
|
72
|
-
|
|
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,
|
|
73
32
|
correlationId,
|
|
74
|
-
state,
|
|
33
|
+
state,
|
|
34
|
+
nonce: uuid.uuid(),
|
|
35
|
+
requestByReferenceURI,
|
|
36
|
+
responseURIType: 'response_uri',
|
|
37
|
+
responseURI,
|
|
38
|
+
...(responseRedirectURI && { responseRedirectURI }),
|
|
39
|
+
});
|
|
75
40
|
let qrCodeDataUri;
|
|
76
41
|
if (qrCodeOpts) {
|
|
77
|
-
const { AwesomeQR } =
|
|
78
|
-
const qrCode = new AwesomeQR(
|
|
79
|
-
qrCodeDataUri = `data:image/png;base64,${(
|
|
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')}`;
|
|
80
45
|
}
|
|
81
|
-
const authRequestBody =
|
|
46
|
+
const authRequestBody = {
|
|
47
|
+
correlationId,
|
|
82
48
|
state,
|
|
83
49
|
definitionId,
|
|
84
|
-
authRequestURI,
|
|
50
|
+
authRequestURI,
|
|
51
|
+
authStatusURI: `${uriWithBase(opts?.webappAuthStatusPath ?? '/webapp/auth-status', { baseURI: opts?.webappBaseURI })}`,
|
|
52
|
+
...(qrCodeDataUri && { qrCodeDataUri }),
|
|
53
|
+
};
|
|
85
54
|
console.log(`Auth Request URI data to send back: ${JSON.stringify(authRequestBody)}`);
|
|
86
55
|
return response.json(authRequestBody);
|
|
87
56
|
}
|
|
88
57
|
catch (error) {
|
|
89
|
-
return
|
|
58
|
+
return sendErrorResponse(response, 500, 'Could not create an authorization request URI', error);
|
|
90
59
|
}
|
|
91
|
-
})
|
|
60
|
+
});
|
|
92
61
|
}
|
|
93
|
-
function authStatusWebappEndpoint(router, context, opts) {
|
|
94
|
-
|
|
95
|
-
if ((opts === null || opts === void 0 ? void 0 : opts.enabled) === false) {
|
|
62
|
+
export function authStatusWebappEndpoint(router, context, opts) {
|
|
63
|
+
if (opts?.enabled === false) {
|
|
96
64
|
console.log(`authStatus Webapp endpoint is disabled`);
|
|
97
65
|
return;
|
|
98
66
|
}
|
|
99
|
-
const path =
|
|
100
|
-
router.post(path,
|
|
101
|
-
var _a;
|
|
67
|
+
const path = opts?.path ?? '/webapp/auth-status';
|
|
68
|
+
router.post(path, checkAuth(opts?.endpoint), async (request, response) => {
|
|
102
69
|
try {
|
|
103
70
|
console.log('Received auth-status request...');
|
|
104
71
|
const correlationId = request.body.correlationId;
|
|
105
72
|
const definitionId = request.body.definitionId;
|
|
106
73
|
const requestState = correlationId && definitionId
|
|
107
|
-
?
|
|
74
|
+
? await context.agent.siopGetAuthRequestState({
|
|
108
75
|
correlationId,
|
|
109
76
|
definitionId,
|
|
110
77
|
errorOnNotFound: false,
|
|
@@ -122,27 +89,33 @@ function authStatusWebappEndpoint(router, context, opts) {
|
|
|
122
89
|
};
|
|
123
90
|
return response.json(statusBody);
|
|
124
91
|
}
|
|
125
|
-
let includeVerifiedData =
|
|
92
|
+
let includeVerifiedData = VerifiedDataMode.NONE;
|
|
126
93
|
if ('includeVerifiedData' in request.body) {
|
|
127
94
|
includeVerifiedData = request.body.includeVerifiedData;
|
|
128
95
|
}
|
|
129
96
|
let responseState;
|
|
130
97
|
if (requestState.status === 'sent') {
|
|
131
|
-
responseState = (
|
|
98
|
+
responseState = (await context.agent.siopGetAuthResponseState({
|
|
132
99
|
correlationId,
|
|
133
100
|
definitionId,
|
|
134
101
|
includeVerifiedData: includeVerifiedData,
|
|
135
102
|
errorOnNotFound: false,
|
|
136
103
|
}));
|
|
137
104
|
}
|
|
138
|
-
const overallState = responseState
|
|
139
|
-
const statusBody =
|
|
140
|
-
|
|
141
|
-
? {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
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
|
+
};
|
|
146
119
|
console.debug(`Will send auth status: ${JSON.stringify(statusBody)}`);
|
|
147
120
|
if (overallState.status === 'error') {
|
|
148
121
|
response.statusCode = 500;
|
|
@@ -152,49 +125,47 @@ function authStatusWebappEndpoint(router, context, opts) {
|
|
|
152
125
|
return response.json(statusBody);
|
|
153
126
|
}
|
|
154
127
|
catch (error) {
|
|
155
|
-
return
|
|
128
|
+
return sendErrorResponse(response, 500, error.message, error);
|
|
156
129
|
}
|
|
157
|
-
})
|
|
130
|
+
});
|
|
158
131
|
}
|
|
159
|
-
function removeAuthRequestStateWebappEndpoint(router, context, opts) {
|
|
160
|
-
|
|
161
|
-
if ((opts === null || opts === void 0 ? void 0 : opts.enabled) === false) {
|
|
132
|
+
export function removeAuthRequestStateWebappEndpoint(router, context, opts) {
|
|
133
|
+
if (opts?.enabled === false) {
|
|
162
134
|
console.log(`removeAuthStatus Webapp endpoint is disabled`);
|
|
163
135
|
return;
|
|
164
136
|
}
|
|
165
|
-
const path =
|
|
166
|
-
router.delete(path,
|
|
137
|
+
const path = opts?.path ?? '/webapp/definitions/:definitionId/auth-requests/:correlationId';
|
|
138
|
+
router.delete(path, checkAuth(opts?.endpoint), async (request, response) => {
|
|
167
139
|
try {
|
|
168
140
|
const correlationId = request.params.correlationId;
|
|
169
141
|
const definitionId = request.params.definitionId;
|
|
170
142
|
if (!correlationId || !definitionId) {
|
|
171
143
|
console.log(`No authorization request could be found for the given url. correlationId: ${correlationId}, definitionId: ${definitionId}`);
|
|
172
|
-
return
|
|
144
|
+
return sendErrorResponse(response, 404, 'No authorization request could be found');
|
|
173
145
|
}
|
|
174
146
|
response.statusCode = 200;
|
|
175
|
-
return response.json(
|
|
147
|
+
return response.json(await context.agent.siopDeleteAuthState({ definitionId, correlationId }));
|
|
176
148
|
}
|
|
177
149
|
catch (error) {
|
|
178
|
-
return
|
|
150
|
+
return sendErrorResponse(response, 500, error.message, error);
|
|
179
151
|
}
|
|
180
|
-
})
|
|
152
|
+
});
|
|
181
153
|
}
|
|
182
|
-
function getDefinitionsEndpoint(router, context, opts) {
|
|
183
|
-
|
|
184
|
-
if ((opts === null || opts === void 0 ? void 0 : opts.enabled) === false) {
|
|
154
|
+
export function getDefinitionsEndpoint(router, context, opts) {
|
|
155
|
+
if (opts?.enabled === false) {
|
|
185
156
|
console.log(`getDefinitions Webapp endpoint is disabled`);
|
|
186
157
|
return;
|
|
187
158
|
}
|
|
188
|
-
const path =
|
|
189
|
-
router.get(path,
|
|
159
|
+
const path = opts?.path ?? '/webapp/definitions';
|
|
160
|
+
router.get(path, checkAuth(opts?.endpoint), async (request, response) => {
|
|
190
161
|
try {
|
|
191
|
-
const definitions =
|
|
162
|
+
const definitions = await context.agent.pdmGetDefinitions();
|
|
192
163
|
response.statusCode = 200;
|
|
193
164
|
return response.json(definitions);
|
|
194
165
|
}
|
|
195
166
|
catch (error) {
|
|
196
|
-
return
|
|
167
|
+
return sendErrorResponse(response, 500, error.message, error);
|
|
197
168
|
}
|
|
198
|
-
})
|
|
169
|
+
});
|
|
199
170
|
}
|
|
200
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":"
|
|
1
|
+
{"version":3,"file":"webapp-api-functions.js","sourceRoot":"","sources":["../src/webapp-api-functions.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6B,gCAAgC,EAAE,MAAM,yBAAyB,CAAA;AACrG,OAAO,EAAE,SAAS,EAAuB,iBAAiB,EAAE,MAAM,+BAA+B,CAAA;AACjG,OAAO,EAAsD,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACxH,OAAO,EAA8C,gBAAgB,EAAE,MAAM,yCAAyC,CAAA;AAEtH,OAAO,IAAI,MAAM,YAAY,CAAA;AAE7B,OAAO,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,wBAAwB,CAAA;AAEnE,MAAM,UAAU,+BAA+B,CAAC,MAAc,EAAE,OAAyB,EAAE,IAA2C;IACpI,IAAI,IAAI,EAAE,OAAO,KAAK,KAAK,EAAE,CAAC;QAC5B,OAAO,CAAC,GAAG,CAAC,+CAA+C,CAAC,CAAA;QAC5D,OAAM;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6
6
|
"types": "dist/index.d.ts",
|
|
@@ -12,15 +12,15 @@
|
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"@sphereon/did-auth-siop": "0.17.0",
|
|
15
|
-
"@sphereon/ssi-express-support": "0.33.
|
|
16
|
-
"@sphereon/ssi-sdk.core": "0.33.
|
|
17
|
-
"@sphereon/ssi-sdk.credential-validation": "0.33.
|
|
18
|
-
"@sphereon/ssi-sdk.kv-store-temp": "0.33.
|
|
19
|
-
"@sphereon/ssi-sdk.pd-manager": "0.33.
|
|
20
|
-
"@sphereon/ssi-sdk.presentation-exchange": "0.33.
|
|
21
|
-
"@sphereon/ssi-sdk.siopv2-oid4vp-common": "0.33.
|
|
22
|
-
"@sphereon/ssi-sdk.siopv2-oid4vp-rp-auth": "0.33.
|
|
23
|
-
"@sphereon/ssi-types": "0.33.
|
|
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
26
|
"awesome-qr": "^2.1.5-rc.0",
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
"@sphereon/pex": "5.0.0-unstable.28",
|
|
42
42
|
"@sphereon/pex-models": "^2.3.2",
|
|
43
43
|
"@sphereon/ssi-sdk-ext.did-provider-jwk": "0.28.0",
|
|
44
|
-
"@sphereon/ssi-sdk.data-store": "0.33.
|
|
45
|
-
"@sphereon/ssi-sdk.vc-handler-ld-local": "0.33.
|
|
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",
|
|
46
46
|
"@types/body-parser": "^1.19.5",
|
|
47
47
|
"@types/cookie-parser": "^1.4.7",
|
|
48
48
|
"@types/cors": "^2.8.17",
|
|
@@ -103,5 +103,5 @@
|
|
|
103
103
|
"Authenticator"
|
|
104
104
|
],
|
|
105
105
|
"nx": {},
|
|
106
|
-
"gitHead": "
|
|
106
|
+
"gitHead": "9f634bdb714061141e277508c124b08d626f6036"
|
|
107
107
|
}
|