@sphereon/ssi-sdk.w3c-vc-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.
- package/dist/api-functions.js +70 -95
- package/dist/api-functions.js.map +1 -1
- package/dist/index.js +3 -19
- package/dist/index.js.map +1 -1
- package/dist/types.js +1 -2
- package/dist/vc-api-server.js +30 -26
- package/dist/vc-api-server.js.map +1 -1
- package/package.json +20 -20
- package/src/api-functions.ts +1 -1
package/dist/api-functions.js
CHANGED
|
@@ -1,44 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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.issueCredentialEndpoint = issueCredentialEndpoint;
|
|
16
|
-
exports.getCredentialsEndpoint = getCredentialsEndpoint;
|
|
17
|
-
exports.getCredentialEndpoint = getCredentialEndpoint;
|
|
18
|
-
exports.verifyCredentialEndpoint = verifyCredentialEndpoint;
|
|
19
|
-
exports.deleteCredentialEndpoint = deleteCredentialEndpoint;
|
|
20
|
-
const ssi_express_support_1 = require("@sphereon/ssi-express-support");
|
|
21
|
-
const ssi_sdk_agent_config_1 = require("@sphereon/ssi-sdk.agent-config");
|
|
22
|
-
const uuid_1 = require("uuid");
|
|
23
|
-
const debug_1 = __importDefault(require("debug"));
|
|
24
|
-
const ssi_sdk_credential_store_1 = require("@sphereon/ssi-sdk.credential-store");
|
|
25
|
-
const ssi_sdk_data_store_1 = require("@sphereon/ssi-sdk.data-store");
|
|
26
|
-
const debug = (0, debug_1.default)('sphereon:ssi-sdk:w3c-vc-api');
|
|
27
|
-
function issueCredentialEndpoint(router, context, opts) {
|
|
28
|
-
var _a;
|
|
29
|
-
if ((opts === null || opts === void 0 ? void 0 : opts.enabled) === false) {
|
|
1
|
+
import { checkAuth, sendErrorResponse } from '@sphereon/ssi-express-support';
|
|
2
|
+
import { contextHasPlugin } from '@sphereon/ssi-sdk.agent-config';
|
|
3
|
+
import { v4 } from 'uuid';
|
|
4
|
+
import Debug from 'debug';
|
|
5
|
+
import { DocumentType } from '@sphereon/ssi-sdk.credential-store';
|
|
6
|
+
import { CredentialRole } from '@sphereon/ssi-sdk.data-store';
|
|
7
|
+
const debug = Debug('sphereon:ssi-sdk:w3c-vc-api');
|
|
8
|
+
export function issueCredentialEndpoint(router, context, opts) {
|
|
9
|
+
if (opts?.enabled === false) {
|
|
30
10
|
console.log(`Issue credential endpoint is disabled`);
|
|
31
11
|
return;
|
|
32
12
|
}
|
|
33
|
-
const path =
|
|
34
|
-
router.post(path,
|
|
35
|
-
var _a, _b, _c;
|
|
13
|
+
const path = opts?.path ?? '/credentials/issue';
|
|
14
|
+
router.post(path, checkAuth(opts?.endpoint), async (request, response) => {
|
|
36
15
|
try {
|
|
37
16
|
const credential = request.body.credential;
|
|
38
|
-
const reqOpts =
|
|
17
|
+
const reqOpts = request.body.options ?? {};
|
|
39
18
|
let reqProofFormat;
|
|
40
19
|
if (reqOpts.proofFormat) {
|
|
41
|
-
if (
|
|
20
|
+
if (reqOpts?.proofFormat?.includes('ld')) {
|
|
42
21
|
reqProofFormat = 'lds';
|
|
43
22
|
}
|
|
44
23
|
else {
|
|
@@ -46,49 +25,48 @@ function issueCredentialEndpoint(router, context, opts) {
|
|
|
46
25
|
}
|
|
47
26
|
}
|
|
48
27
|
if (!credential) {
|
|
49
|
-
return
|
|
28
|
+
return sendErrorResponse(response, 400, 'No credential supplied');
|
|
50
29
|
}
|
|
51
30
|
if (!credential.id) {
|
|
52
|
-
credential.id = `urn:uuid:${
|
|
31
|
+
credential.id = `urn:uuid:${v4()}`;
|
|
53
32
|
}
|
|
54
|
-
if (
|
|
33
|
+
if (contextHasPlugin(context, 'slAddStatusToCredential')) {
|
|
55
34
|
// Add status list if enabled (and when the input has a credentialStatus object (can be empty))
|
|
56
|
-
const credentialStatusVC =
|
|
35
|
+
const credentialStatusVC = await context.agent.slAddStatusToCredential({ credential });
|
|
57
36
|
if (credential.credentialStatus && !credential.credentialStatus.statusListCredential) {
|
|
58
37
|
credential.credentialStatus = credentialStatusVC.credentialStatus;
|
|
59
38
|
}
|
|
60
39
|
}
|
|
61
|
-
const issueOpts = opts
|
|
62
|
-
const vc =
|
|
40
|
+
const issueOpts = opts?.issueCredentialOpts;
|
|
41
|
+
const vc = await context.agent.createVerifiableCredential({
|
|
63
42
|
credential,
|
|
64
|
-
save:
|
|
65
|
-
proofFormat:
|
|
66
|
-
fetchRemoteContexts:
|
|
43
|
+
save: opts?.persistIssuedCredentials !== false,
|
|
44
|
+
proofFormat: reqProofFormat ?? issueOpts?.proofFormat ?? 'lds',
|
|
45
|
+
fetchRemoteContexts: issueOpts?.fetchRemoteContexts !== false,
|
|
67
46
|
});
|
|
68
47
|
response.statusCode = 201;
|
|
69
48
|
return response.send({ verifiableCredential: vc });
|
|
70
49
|
}
|
|
71
50
|
catch (e) {
|
|
72
|
-
return
|
|
51
|
+
return sendErrorResponse(response, 500, e.message, e);
|
|
73
52
|
}
|
|
74
|
-
})
|
|
53
|
+
});
|
|
75
54
|
}
|
|
76
|
-
function getCredentialsEndpoint(router, context, opts) {
|
|
77
|
-
|
|
78
|
-
if ((opts === null || opts === void 0 ? void 0 : opts.enabled) === false) {
|
|
55
|
+
export function getCredentialsEndpoint(router, context, opts) {
|
|
56
|
+
if (opts?.enabled === false) {
|
|
79
57
|
console.log(`Get credentials endpoint is disabled`);
|
|
80
58
|
return;
|
|
81
59
|
}
|
|
82
|
-
const path =
|
|
83
|
-
router.get(path,
|
|
60
|
+
const path = opts?.path ?? '/credentials';
|
|
61
|
+
router.get(path, checkAuth(opts?.endpoint), async (request, response) => {
|
|
84
62
|
try {
|
|
85
|
-
const credentialRole = request.query.credentialRole ||
|
|
86
|
-
if (!Object.values(
|
|
87
|
-
return
|
|
63
|
+
const credentialRole = request.query.credentialRole || CredentialRole.HOLDER;
|
|
64
|
+
if (!Object.values(CredentialRole).includes(credentialRole)) {
|
|
65
|
+
return sendErrorResponse(response, 400, `Invalid credentialRole: ${credentialRole}`);
|
|
88
66
|
}
|
|
89
|
-
const documentType = request.query.documentType ||
|
|
90
|
-
if (!Object.values(
|
|
91
|
-
return
|
|
67
|
+
const documentType = request.query.documentType || DocumentType.VC;
|
|
68
|
+
if (!Object.values(DocumentType).includes(documentType)) {
|
|
69
|
+
return sendErrorResponse(response, 400, `Invalid documentType: ${documentType}`);
|
|
92
70
|
}
|
|
93
71
|
const filter = [
|
|
94
72
|
{
|
|
@@ -96,112 +74,109 @@ function getCredentialsEndpoint(router, context, opts) {
|
|
|
96
74
|
credentialRole: credentialRole,
|
|
97
75
|
},
|
|
98
76
|
];
|
|
99
|
-
const uniqueVCs =
|
|
77
|
+
const uniqueVCs = await context.agent.crsGetUniqueCredentials({ filter });
|
|
100
78
|
response.statusCode = 202;
|
|
101
79
|
return response.send(uniqueVCs.map((uVC) => uVC.uniformVerifiableCredential));
|
|
102
80
|
}
|
|
103
81
|
catch (e) {
|
|
104
|
-
return
|
|
82
|
+
return sendErrorResponse(response, 500, e.message, e);
|
|
105
83
|
}
|
|
106
|
-
})
|
|
84
|
+
});
|
|
107
85
|
}
|
|
108
|
-
function getCredentialEndpoint(router, context, opts) {
|
|
109
|
-
|
|
110
|
-
if ((opts === null || opts === void 0 ? void 0 : opts.enabled) === false) {
|
|
86
|
+
export function getCredentialEndpoint(router, context, opts) {
|
|
87
|
+
if (opts?.enabled === false) {
|
|
111
88
|
console.log(`Get credential endpoint is disabled`);
|
|
112
89
|
return;
|
|
113
90
|
}
|
|
114
|
-
const path =
|
|
115
|
-
router.get(path,
|
|
91
|
+
const path = opts?.path ?? '/credentials/:id';
|
|
92
|
+
router.get(path, checkAuth(opts?.endpoint), async (request, response) => {
|
|
116
93
|
try {
|
|
117
94
|
const id = request.params.id;
|
|
118
95
|
if (!id) {
|
|
119
|
-
return
|
|
96
|
+
return sendErrorResponse(response, 400, 'no id provided');
|
|
120
97
|
}
|
|
121
|
-
const credentialRole = request.query.credentialRole ||
|
|
122
|
-
if (!Object.values(
|
|
123
|
-
return
|
|
98
|
+
const credentialRole = request.query.credentialRole || CredentialRole.HOLDER;
|
|
99
|
+
if (!Object.values(CredentialRole).includes(credentialRole)) {
|
|
100
|
+
return sendErrorResponse(response, 400, `Invalid credentialRole: ${credentialRole}`);
|
|
124
101
|
}
|
|
125
|
-
const vcInfo =
|
|
102
|
+
const vcInfo = await context.agent.crsGetUniqueCredentialByIdOrHash({
|
|
126
103
|
credentialRole: credentialRole,
|
|
127
104
|
idOrHash: id,
|
|
128
105
|
});
|
|
129
106
|
if (!vcInfo) {
|
|
130
|
-
return
|
|
107
|
+
return sendErrorResponse(response, 403, `id ${id} not found`);
|
|
131
108
|
}
|
|
132
109
|
response.statusCode = 200;
|
|
133
110
|
return response.send(vcInfo.uniformVerifiableCredential);
|
|
134
111
|
}
|
|
135
112
|
catch (e) {
|
|
136
|
-
return
|
|
113
|
+
return sendErrorResponse(response, 500, e.message, e);
|
|
137
114
|
}
|
|
138
|
-
})
|
|
115
|
+
});
|
|
139
116
|
}
|
|
140
|
-
function verifyCredentialEndpoint(router, context, opts) {
|
|
141
|
-
|
|
142
|
-
if ((opts === null || opts === void 0 ? void 0 : opts.enabled) === false) {
|
|
117
|
+
export function verifyCredentialEndpoint(router, context, opts) {
|
|
118
|
+
if (opts?.enabled === false) {
|
|
143
119
|
console.log(`Verify credential endpoint is disabled`);
|
|
144
120
|
return;
|
|
145
121
|
}
|
|
146
|
-
router.post(
|
|
122
|
+
router.post(opts?.path ?? '/credentials/verify', checkAuth(opts?.endpoint), async (request, response) => {
|
|
147
123
|
try {
|
|
148
124
|
debug(JSON.stringify(request.body, null, 2));
|
|
149
125
|
const credential = request.body.verifiableCredential;
|
|
150
126
|
// const options: IIssueOptionsPayload = request.body.options
|
|
151
127
|
if (!credential) {
|
|
152
|
-
return
|
|
128
|
+
return sendErrorResponse(response, 400, 'No verifiable credential supplied');
|
|
153
129
|
}
|
|
154
|
-
const verifyResult =
|
|
130
|
+
const verifyResult = await context.agent.verifyCredential({
|
|
155
131
|
credential,
|
|
156
132
|
policies: {
|
|
157
133
|
credentialStatus: false, // Do not use built-in. We have our own statusList implementations
|
|
158
134
|
},
|
|
159
|
-
fetchRemoteContexts:
|
|
135
|
+
fetchRemoteContexts: opts?.fetchRemoteContexts !== false,
|
|
160
136
|
});
|
|
161
137
|
response.statusCode = 200;
|
|
162
138
|
return response.send(verifyResult);
|
|
163
139
|
}
|
|
164
140
|
catch (e) {
|
|
165
|
-
return
|
|
141
|
+
return sendErrorResponse(response, 500, e.message, e);
|
|
166
142
|
}
|
|
167
|
-
})
|
|
143
|
+
});
|
|
168
144
|
}
|
|
169
|
-
function deleteCredentialEndpoint(router, context, opts) {
|
|
170
|
-
|
|
171
|
-
if ((opts === null || opts === void 0 ? void 0 : opts.enabled) === false) {
|
|
145
|
+
export function deleteCredentialEndpoint(router, context, opts) {
|
|
146
|
+
if (opts?.enabled === false) {
|
|
172
147
|
console.log(`Delete credential endpoint is disabled`);
|
|
173
148
|
return;
|
|
174
149
|
}
|
|
175
|
-
router.delete(
|
|
150
|
+
router.delete(opts?.path ?? '/credentials/:id', checkAuth(opts?.endpoint), async (request, response) => {
|
|
176
151
|
try {
|
|
177
152
|
const id = request.params.id;
|
|
178
153
|
if (!id) {
|
|
179
|
-
return
|
|
154
|
+
return sendErrorResponse(response, 400, 'no id provided');
|
|
180
155
|
}
|
|
181
156
|
const credentialRole = request.query.credentialRole;
|
|
182
157
|
if (credentialRole === undefined) {
|
|
183
|
-
return
|
|
158
|
+
return sendErrorResponse(response, 400, 'credentialRole query parameter is missing');
|
|
184
159
|
}
|
|
185
|
-
if (!Object.values(
|
|
186
|
-
return
|
|
160
|
+
if (!Object.values(CredentialRole).includes(credentialRole)) {
|
|
161
|
+
return sendErrorResponse(response, 400, `Invalid credentialRole: ${credentialRole}`);
|
|
187
162
|
}
|
|
188
|
-
const vcInfo =
|
|
163
|
+
const vcInfo = await context.agent.crsGetUniqueCredentialByIdOrHash({
|
|
189
164
|
credentialRole: credentialRole,
|
|
190
165
|
idOrHash: id,
|
|
191
166
|
});
|
|
192
167
|
if (!vcInfo) {
|
|
193
|
-
return
|
|
168
|
+
return sendErrorResponse(response, 404, `id ${id} not found`);
|
|
194
169
|
}
|
|
195
|
-
const success =
|
|
170
|
+
const success = await context.agent.crsDeleteCredentials({ filter: [{ hash: vcInfo.hash }] });
|
|
196
171
|
if (success === 0) {
|
|
197
|
-
return
|
|
172
|
+
return sendErrorResponse(response, 400, `Could not delete Verifiable Credential with id ${id}`);
|
|
198
173
|
}
|
|
199
174
|
response.statusCode = 200;
|
|
200
175
|
return response.send();
|
|
201
176
|
}
|
|
202
177
|
catch (e) {
|
|
203
|
-
return
|
|
178
|
+
return sendErrorResponse(response, 500, e.message, e);
|
|
204
179
|
}
|
|
205
|
-
})
|
|
180
|
+
});
|
|
206
181
|
}
|
|
207
182
|
//# sourceMappingURL=api-functions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-functions.js","sourceRoot":"","sources":["../src/api-functions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"api-functions.js","sourceRoot":"","sources":["../src/api-functions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAuB,iBAAiB,EAAE,MAAM,+BAA+B,CAAA;AACjG,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AAKjE,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAA;AAEzB,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,YAAY,EAA6B,MAAM,oCAAoC,CAAA;AAE5F,OAAO,E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AAE,MAAM,EAAE,YAAY,CAAC,CAAA;YAC/D,CAAC;YACD,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,KAAK,CAAC,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAA;YAC7F,IAAI,OAAO,KAAK,CAAC,EAAE,CAAC;gBAClB,OAAO,iBAAiB,CAAC,QAAQ,EAAE,GAAG,EAAE,kDAAkD,EAAE,EAAE,CAAC,CAAA;YACjG,CAAC;YACD,QAAQ,CAAC,UAAU,GAAG,GAAG,CAAA;YACzB,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAA;QACxB,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO,iBAAiB,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAC,OAAiB,EAAE,CAAC,CAAC,CAAA;QACjE,CAAC;IACH,CAAC,CAAC,CAAA;AACJ,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,23 +1,7 @@
|
|
|
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
|
-
|
|
4
|
+
export * from './vc-api-server';
|
|
5
|
+
export * from './types';
|
|
6
|
+
export * from './api-functions';
|
|
23
7
|
//# 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,iBAAiB,CAAA;AAC/B,cAAc,SAAS,CAAA;AACvB,cAAc,iBAAiB,CAAA"}
|
package/dist/types.js
CHANGED
package/dist/vc-api-server.js
CHANGED
|
@@ -1,21 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.VcApiServer = void 0;
|
|
7
|
-
const ssi_sdk_core_1 = require("@sphereon/ssi-sdk.core");
|
|
8
|
-
const express_1 = __importDefault(require("express"));
|
|
9
|
-
const api_functions_1 = require("./api-functions");
|
|
10
|
-
class VcApiServer {
|
|
1
|
+
import { agentContext } from '@sphereon/ssi-sdk.core';
|
|
2
|
+
import express from 'express';
|
|
3
|
+
import { deleteCredentialEndpoint, getCredentialEndpoint, getCredentialsEndpoint, issueCredentialEndpoint, verifyCredentialEndpoint, } from './api-functions';
|
|
4
|
+
export class VcApiServer {
|
|
11
5
|
get router() {
|
|
12
6
|
return this._router;
|
|
13
7
|
}
|
|
8
|
+
_express;
|
|
9
|
+
_agent;
|
|
10
|
+
_opts;
|
|
11
|
+
_router;
|
|
14
12
|
constructor(args) {
|
|
15
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
16
13
|
const { agent, opts } = args;
|
|
17
14
|
this._agent = agent;
|
|
18
|
-
if (
|
|
15
|
+
if (opts?.endpointOpts?.globalAuth) {
|
|
19
16
|
copyGlobalAuthToEndpoint(opts, 'issueCredential');
|
|
20
17
|
copyGlobalAuthToEndpoint(opts, 'getCredential');
|
|
21
18
|
copyGlobalAuthToEndpoint(opts, 'getCredentials');
|
|
@@ -24,23 +21,29 @@ class VcApiServer {
|
|
|
24
21
|
}
|
|
25
22
|
this._opts = opts;
|
|
26
23
|
this._express = args.expressSupport.express;
|
|
27
|
-
this._router =
|
|
28
|
-
const context =
|
|
29
|
-
const features =
|
|
24
|
+
this._router = express.Router();
|
|
25
|
+
const context = agentContext(agent);
|
|
26
|
+
const features = opts?.issueCredentialOpts?.enableFeatures ?? ['vc-issue', 'vc-persist', 'vc-verify'];
|
|
30
27
|
console.log(`VC API enabled, with features: ${JSON.stringify(features)}`);
|
|
31
28
|
// Credential endpoints
|
|
32
29
|
if (features.includes('vc-issue')) {
|
|
33
|
-
|
|
30
|
+
issueCredentialEndpoint(this.router, context, {
|
|
31
|
+
...opts?.endpointOpts?.issueCredential,
|
|
32
|
+
issueCredentialOpts: opts?.issueCredentialOpts,
|
|
33
|
+
});
|
|
34
34
|
}
|
|
35
35
|
if (features.includes('vc-persist')) {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
getCredentialEndpoint(this.router, context, opts?.endpointOpts?.getCredential);
|
|
37
|
+
getCredentialsEndpoint(this.router, context, opts?.endpointOpts?.getCredentials);
|
|
38
|
+
deleteCredentialEndpoint(this.router, context, opts?.endpointOpts?.deleteCredential); // not in spec.
|
|
39
39
|
}
|
|
40
40
|
if (features.includes('vc-verify')) {
|
|
41
|
-
|
|
41
|
+
verifyCredentialEndpoint(this.router, context, {
|
|
42
|
+
...opts?.endpointOpts?.verifyCredential,
|
|
43
|
+
fetchRemoteContexts: opts?.issueCredentialOpts?.fetchRemoteContexts,
|
|
44
|
+
});
|
|
42
45
|
}
|
|
43
|
-
this._express.use(
|
|
46
|
+
this._express.use(opts?.endpointOpts?.basePath ?? '', this.router);
|
|
44
47
|
}
|
|
45
48
|
get agent() {
|
|
46
49
|
return this._agent;
|
|
@@ -52,14 +55,15 @@ class VcApiServer {
|
|
|
52
55
|
return this._express;
|
|
53
56
|
}
|
|
54
57
|
}
|
|
55
|
-
exports.VcApiServer = VcApiServer;
|
|
56
58
|
function copyGlobalAuthToEndpoint(opts, key) {
|
|
57
|
-
|
|
58
|
-
if ((_a = opts === null || opts === void 0 ? void 0 : opts.endpointOpts) === null || _a === void 0 ? void 0 : _a.globalAuth) {
|
|
59
|
+
if (opts?.endpointOpts?.globalAuth) {
|
|
59
60
|
// @ts-ignore
|
|
60
|
-
opts.endpointOpts[key] =
|
|
61
|
+
opts.endpointOpts[key] = {
|
|
61
62
|
// @ts-ignore
|
|
62
|
-
|
|
63
|
+
...opts.endpointOpts[key],
|
|
64
|
+
// @ts-ignore
|
|
65
|
+
endpoint: { ...opts.endpointOpts.globalAuth, ...opts.endpointOpts[key]?.endpoint },
|
|
66
|
+
};
|
|
63
67
|
}
|
|
64
68
|
}
|
|
65
69
|
//# sourceMappingURL=vc-api-server.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vc-api-server.js","sourceRoot":"","sources":["../src/vc-api-server.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"vc-api-server.js","sourceRoot":"","sources":["../src/vc-api-server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAIrD,OAAO,OAA4B,MAAM,SAAS,CAAA;AAClD,OAAO,EACL,wBAAwB,EACxB,qBAAqB,EACrB,sBAAsB,EACtB,uBAAuB,EACvB,wBAAwB,GACzB,MAAM,iBAAiB,CAAA;AAGxB,MAAM,OAAO,WAAW;IACtB,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,OAAO,CAAA;IACrB,CAAC;IAEgB,QAAQ,CAAS;IACjB,MAAM,CAA0B;IAChC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GAAG,CAAC,EAAE,QAAQ,EAAE;SACnF,CAAA;IACH,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sphereon/ssi-sdk.w3c-vc-api",
|
|
3
|
-
"version": "0.
|
|
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,16 +11,16 @@
|
|
|
11
11
|
"start:dev": "ts-node __tests__/agent.ts"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@sphereon/did-auth-siop": "0.
|
|
15
|
-
"@sphereon/ssi-express-support": "0.
|
|
16
|
-
"@sphereon/ssi-sdk.agent-config": "0.
|
|
17
|
-
"@sphereon/ssi-sdk.core": "0.
|
|
18
|
-
"@sphereon/ssi-sdk.credential-store": "0.
|
|
19
|
-
"@sphereon/ssi-sdk.kv-store-temp": "0.
|
|
20
|
-
"@sphereon/ssi-sdk.presentation-exchange": "0.
|
|
21
|
-
"@sphereon/ssi-sdk.vc-status-list": "0.
|
|
22
|
-
"@sphereon/ssi-sdk.vc-status-list-issuer": "0.
|
|
23
|
-
"@sphereon/ssi-types": "0.
|
|
14
|
+
"@sphereon/did-auth-siop": "0.17.0",
|
|
15
|
+
"@sphereon/ssi-express-support": "0.33.1-feature.vcdm2.4+9f634bdb",
|
|
16
|
+
"@sphereon/ssi-sdk.agent-config": "0.33.1-feature.vcdm2.4+9f634bdb",
|
|
17
|
+
"@sphereon/ssi-sdk.core": "0.33.1-feature.vcdm2.4+9f634bdb",
|
|
18
|
+
"@sphereon/ssi-sdk.credential-store": "0.33.1-feature.vcdm2.4+9f634bdb",
|
|
19
|
+
"@sphereon/ssi-sdk.kv-store-temp": "0.33.1-feature.vcdm2.4+9f634bdb",
|
|
20
|
+
"@sphereon/ssi-sdk.presentation-exchange": "0.33.1-feature.vcdm2.4+9f634bdb",
|
|
21
|
+
"@sphereon/ssi-sdk.vc-status-list": "0.33.1-feature.vcdm2.4+9f634bdb",
|
|
22
|
+
"@sphereon/ssi-sdk.vc-status-list-issuer": "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
|
"body-parser": "^1.20.2",
|
|
@@ -35,15 +35,15 @@
|
|
|
35
35
|
"uuid": "^9.0.1"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@sphereon/did-provider-oyd": "0.
|
|
38
|
+
"@sphereon/did-provider-oyd": "0.28.0",
|
|
39
39
|
"@sphereon/did-uni-client": "^0.6.3",
|
|
40
|
-
"@sphereon/ssi-sdk-ext.did-provider-jwk": "0.
|
|
41
|
-
"@sphereon/ssi-sdk-ext.did-resolver-jwk": "0.
|
|
42
|
-
"@sphereon/ssi-sdk-ext.key-manager": "0.
|
|
43
|
-
"@sphereon/ssi-sdk-ext.kms-local": "0.
|
|
40
|
+
"@sphereon/ssi-sdk-ext.did-provider-jwk": "0.28.0",
|
|
41
|
+
"@sphereon/ssi-sdk-ext.did-resolver-jwk": "0.28.0",
|
|
42
|
+
"@sphereon/ssi-sdk-ext.key-manager": "0.28.0",
|
|
43
|
+
"@sphereon/ssi-sdk-ext.kms-local": "0.28.0",
|
|
44
44
|
"@sphereon/ssi-sdk.agent-config": "workspace:*",
|
|
45
|
-
"@sphereon/ssi-sdk.data-store": "0.
|
|
46
|
-
"@sphereon/ssi-sdk.vc-handler-ld-local": "0.
|
|
45
|
+
"@sphereon/ssi-sdk.data-store": "0.33.1-feature.vcdm2.4+9f634bdb",
|
|
46
|
+
"@sphereon/ssi-sdk.vc-handler-ld-local": "0.33.1-feature.vcdm2.4+9f634bdb",
|
|
47
47
|
"@types/body-parser": "^1.19.5",
|
|
48
48
|
"@types/cookie-parser": "^1.4.7",
|
|
49
49
|
"@types/cors": "^2.8.17",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"passport": "^0.6.0",
|
|
74
74
|
"passport-azure-ad": "^4.3.5",
|
|
75
75
|
"ts-node": "^10.9.2",
|
|
76
|
-
"typeorm": "^0.3.
|
|
76
|
+
"typeorm": "^0.3.21"
|
|
77
77
|
},
|
|
78
78
|
"files": [
|
|
79
79
|
".yalc/**/*",
|
|
@@ -97,5 +97,5 @@
|
|
|
97
97
|
"VC API"
|
|
98
98
|
],
|
|
99
99
|
"nx": {},
|
|
100
|
-
"gitHead": "
|
|
100
|
+
"gitHead": "9f634bdb714061141e277508c124b08d626f6036"
|
|
101
101
|
}
|
package/src/api-functions.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { checkAuth, ISingleEndpointOpts, sendErrorResponse } from '@sphereon/ssi
|
|
|
2
2
|
import { contextHasPlugin } from '@sphereon/ssi-sdk.agent-config'
|
|
3
3
|
import { CredentialPayload } from '@veramo/core'
|
|
4
4
|
import { ProofFormat } from '@veramo/core'
|
|
5
|
-
import { W3CVerifiableCredential } from '@veramo/core
|
|
5
|
+
import { W3CVerifiableCredential } from '@veramo/core'
|
|
6
6
|
import { Request, Response, Router } from 'express'
|
|
7
7
|
import { v4 } from 'uuid'
|
|
8
8
|
import { IIssueCredentialEndpointOpts, IRequiredContext, IVCAPIIssueOpts, IVerifyCredentialEndpointOpts } from './types'
|