@veramo/cli 3.1.2-next.97 → 3.1.2
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/build/credential.js +5 -95
- package/build/credential.js.map +1 -1
- package/build/dev.js +1 -5
- package/build/dev.js.map +1 -1
- package/build/explore/credentials.d.ts.map +1 -1
- package/build/explore/credentials.js +2 -3
- package/build/explore/credentials.js.map +1 -1
- package/build/explore/presentations.d.ts.map +1 -1
- package/build/explore/presentations.js +2 -3
- package/build/explore/presentations.js.map +1 -1
- package/build/presentation.js +1 -71
- package/build/presentation.js.map +1 -1
- package/build/sdr.js +5 -8
- package/build/sdr.js.map +1 -1
- package/build/setup.d.ts +2 -1
- package/build/setup.d.ts.map +1 -1
- package/build/setup.js +1 -1
- package/build/setup.js.map +1 -1
- package/default/client.yml +1 -3
- package/default/default.yml +1 -17
- package/package.json +49 -50
- package/src/credential.ts +7 -68
- package/src/explore/credentials.ts +3 -4
- package/src/explore/presentations.ts +3 -4
- package/src/presentation.ts +2 -45
- package/src/sdr.ts +5 -9
- package/src/setup.ts +3 -10
- package/build/util.d.ts +0 -2
- package/build/util.d.ts.map +0 -1
- package/build/util.js +0 -36
- package/build/util.js.map +0 -1
- package/src/util.ts +0 -23
package/build/credential.js
CHANGED
|
@@ -1,27 +1,4 @@
|
|
|
1
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 __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
2
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
3
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
4
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -39,15 +16,11 @@ const setup_1 = require("./setup");
|
|
|
39
16
|
const commander_1 = require("commander");
|
|
40
17
|
const inquirer_1 = __importDefault(require("inquirer"));
|
|
41
18
|
const qrcode_terminal_1 = __importDefault(require("qrcode-terminal"));
|
|
42
|
-
const fs = __importStar(require("fs"));
|
|
43
|
-
const json5 = __importStar(require("json5"));
|
|
44
|
-
const util_1 = require("./util");
|
|
45
19
|
const credential = commander_1.program.command('credential').description('W3C Verifiable Credential');
|
|
46
20
|
credential
|
|
47
21
|
.command('create', { isDefault: true })
|
|
48
22
|
.description('Create W3C Verifiable Credential')
|
|
49
23
|
.option('-s, --send', 'Send')
|
|
50
|
-
.option('-j, --json', 'Output in JSON')
|
|
51
24
|
.option('-q, --qrcode', 'Show qrcode')
|
|
52
25
|
.action((cmd) => __awaiter(void 0, void 0, void 0, function* () {
|
|
53
26
|
const agent = (0, setup_1.getAgent)(commander_1.program.opts().config);
|
|
@@ -57,12 +30,6 @@ credential
|
|
|
57
30
|
process.exit();
|
|
58
31
|
}
|
|
59
32
|
const answers = yield inquirer_1.default.prompt([
|
|
60
|
-
{
|
|
61
|
-
type: 'list',
|
|
62
|
-
name: 'proofFormat',
|
|
63
|
-
choices: ['jwt', 'lds'],
|
|
64
|
-
message: 'Credential proofFormat',
|
|
65
|
-
},
|
|
66
33
|
{
|
|
67
34
|
type: 'list',
|
|
68
35
|
name: 'iss',
|
|
@@ -112,7 +79,7 @@ credential
|
|
|
112
79
|
credentialSubject[type] = answers.claimValue;
|
|
113
80
|
const credential = {
|
|
114
81
|
issuer: { id: answers.iss },
|
|
115
|
-
'@context': ['https://www.w3.org/2018/credentials/v1'
|
|
82
|
+
'@context': ['https://www.w3.org/2018/credentials/v1'],
|
|
116
83
|
type: answers.type.split(','),
|
|
117
84
|
issuanceDate: new Date().toISOString(),
|
|
118
85
|
credentialSubject,
|
|
@@ -140,27 +107,17 @@ credential
|
|
|
140
107
|
const verifiableCredential = yield agent.createVerifiableCredential({
|
|
141
108
|
save: true,
|
|
142
109
|
credential,
|
|
143
|
-
proofFormat:
|
|
110
|
+
proofFormat: 'jwt',
|
|
144
111
|
});
|
|
145
112
|
if (cmd.send) {
|
|
146
|
-
let body;
|
|
147
|
-
let type;
|
|
148
|
-
if (answers.proofFormat == 'jwt') {
|
|
149
|
-
body = verifiableCredential.proof.jwt;
|
|
150
|
-
type = 'jwt';
|
|
151
|
-
}
|
|
152
|
-
else {
|
|
153
|
-
body = verifiableCredential;
|
|
154
|
-
type = 'w3c.vc';
|
|
155
|
-
}
|
|
156
113
|
try {
|
|
157
114
|
const message = yield agent.sendMessageDIDCommAlpha1({
|
|
158
115
|
save: true,
|
|
159
116
|
data: {
|
|
160
117
|
from: answers.iss,
|
|
161
118
|
to: answers.sub,
|
|
162
|
-
type,
|
|
163
|
-
body,
|
|
119
|
+
type: 'jwt',
|
|
120
|
+
body: verifiableCredential.proof.jwt,
|
|
164
121
|
},
|
|
165
122
|
});
|
|
166
123
|
console.dir(message, { depth: 10 });
|
|
@@ -173,54 +130,7 @@ credential
|
|
|
173
130
|
qrcode_terminal_1.default.generate(verifiableCredential.proof.jwt);
|
|
174
131
|
}
|
|
175
132
|
else {
|
|
176
|
-
|
|
177
|
-
console.log(JSON.stringify(verifiableCredential, null, 2));
|
|
178
|
-
}
|
|
179
|
-
else {
|
|
180
|
-
console.dir(verifiableCredential, { depth: 10 });
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
}));
|
|
184
|
-
credential
|
|
185
|
-
.command('verify')
|
|
186
|
-
.description('Verify a W3C Verifiable Credential provided as raw string, file or stdin')
|
|
187
|
-
.option('-f, --filename <string>', 'Optional. Read the credential from a file instead of stdin')
|
|
188
|
-
.option('-r, --raw <string>', 'Optional. Specify the credential as a parameter instead of file or stdin')
|
|
189
|
-
.action((options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
190
|
-
const agent = (0, setup_1.getAgent)(commander_1.program.opts().config);
|
|
191
|
-
let raw = '';
|
|
192
|
-
if (options.raw) {
|
|
193
|
-
raw = options.raw;
|
|
194
|
-
}
|
|
195
|
-
else if (options.filename) {
|
|
196
|
-
raw = yield fs.promises.readFile(options.filename, 'utf-8');
|
|
197
|
-
}
|
|
198
|
-
else {
|
|
199
|
-
raw = yield (0, util_1.readStdin)();
|
|
200
|
-
}
|
|
201
|
-
let credentialAsJSON;
|
|
202
|
-
try {
|
|
203
|
-
credentialAsJSON = json5.parse(raw);
|
|
204
|
-
}
|
|
205
|
-
catch (e) {
|
|
206
|
-
credentialAsJSON = {
|
|
207
|
-
proof: {
|
|
208
|
-
type: 'JwtProof2020',
|
|
209
|
-
jwt: raw,
|
|
210
|
-
},
|
|
211
|
-
};
|
|
212
|
-
}
|
|
213
|
-
try {
|
|
214
|
-
const result = yield agent.verifyCredential({ credential: credentialAsJSON });
|
|
215
|
-
if (result === true) {
|
|
216
|
-
console.log('Credential was verified successfully.');
|
|
217
|
-
}
|
|
218
|
-
else {
|
|
219
|
-
console.error('Credential could not be verified.');
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
catch (e) {
|
|
223
|
-
console.error(e.message);
|
|
133
|
+
console.dir(verifiableCredential, { depth: 10 });
|
|
224
134
|
}
|
|
225
135
|
}));
|
|
226
136
|
//# sourceMappingURL=credential.js.map
|
package/build/credential.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credential.js","sourceRoot":"","sources":["../src/credential.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"credential.js","sourceRoot":"","sources":["../src/credential.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,mCAAkC;AAClC,yCAAmC;AACnC,wDAA+B;AAC/B,sEAAoC;AAEpC,MAAM,UAAU,GAAG,mBAAO,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,WAAW,CAAC,2BAA2B,CAAC,CAAA;AAEzF,UAAU;KACP,OAAO,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;KACtC,WAAW,CAAC,kCAAkC,CAAC;KAC/C,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC;KAC5B,MAAM,CAAC,cAAc,EAAE,aAAa,CAAC;KACrC,MAAM,CAAC,CAAO,GAAG,EAAE,EAAE;IACpB,MAAM,KAAK,GAAG,IAAA,gBAAQ,EAAC,mBAAO,CAAC,IAAI,EAAE,CAAC,MAAM,CAAC,CAAA;IAC7C,MAAM,WAAW,GAAG,MAAM,KAAK,CAAC,cAAc,EAAE,CAAA;IAChD,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE;QAC5B,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,CAAA;QACxB,OAAO,CAAC,IAAI,EAAE,CAAA;KACf;IACD,MAAM,OAAO,GAAG,MAAM,kBAAQ,CAAC,MAAM,CAAC;QACpC;YACE,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,KAAK;YACX,OAAO,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;gBAClC,IAAI,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AAM,CAAC,QAAQ,CAAC,oBAAoB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;KAChD;SAAM;QACL,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAA;KACjD;AACH,CAAC,CAAA,CAAC,CAAA"}
|
package/build/dev.js
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
|
|
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);
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
9
5
|
}) : (function(o, m, k, k2) {
|
|
10
6
|
if (k2 === undefined) k2 = k;
|
|
11
7
|
o[k2] = m[k];
|
package/build/dev.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev.js","sourceRoot":"","sources":["../src/dev.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dev.js","sourceRoot":"","sources":["../src/dev.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4DAAsF;AACtF,wEAKuC;AACvC,yCAAmC;AACnC,2BAAkC;AAElC,+BAA8B;AAC9B,8DAA+C;AAC/C,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;AAUxB,MAAM,YAAY,GAAG,CAAC,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,eAAe,CAAC,CAAA;AAE5E,SAAS,YAAY,CAAC,SAA8B,EAAE,MAAc;IAClE,IAAI,YAAY,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;QAC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3,"file":"credentials.d.ts","sourceRoot":"","sources":["../../src/explore/credentials.ts"],"names":[],"mappings":"AAAA,OAAgB,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAG1C,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAG1C,eAAO,MAAM,mBAAmB,UAAiB,eAAe,UAAU,cAAc,sCAsEvF,CAAA"}
|
|
@@ -16,7 +16,6 @@ exports.getCredentialsTable = void 0;
|
|
|
16
16
|
const blessed_1 = __importDefault(require("blessed"));
|
|
17
17
|
const utils_1 = require("./utils");
|
|
18
18
|
const styles_1 = require("./styles");
|
|
19
|
-
const utils_2 = require("@veramo/utils");
|
|
20
19
|
const getCredentialsTable = (agent, screen) => __awaiter(void 0, void 0, void 0, function* () {
|
|
21
20
|
screen.title = 'Credentials';
|
|
22
21
|
const credentialsTable = blessed_1.default.listtable({
|
|
@@ -34,8 +33,8 @@ const getCredentialsTable = (agent, screen) => __awaiter(void 0, void 0, void 0,
|
|
|
34
33
|
const credentials = yield agent.dataStoreORMGetVerifiableCredentials();
|
|
35
34
|
credentialsTable.setData([['Created', 'Type', 'From', 'To']].concat(credentials.map(({ verifiableCredential: m }) => [
|
|
36
35
|
(0, utils_1.shortDate)(m.issuanceDate),
|
|
37
|
-
|
|
38
|
-
(0, utils_1.shortDid)(
|
|
36
|
+
m.type.join(','),
|
|
37
|
+
(0, utils_1.shortDid)(m.issuer.id),
|
|
39
38
|
(0, utils_1.shortDid)(m.credentialSubject.id),
|
|
40
39
|
])));
|
|
41
40
|
credentialsTable.on('select', function (data) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credentials.js","sourceRoot":"","sources":["../../src/explore/credentials.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,sDAA0C;AAE1C,mCAA6C;AAE7C,qCAAiC;
|
|
1
|
+
{"version":3,"file":"credentials.js","sourceRoot":"","sources":["../../src/explore/credentials.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAA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,UAAsC;QAC5D,MAAM,aAAa,GAAG,iBAAO,CAAC,GAAG,CAAC;YAChC,KAAK,EAAE,YAAY;YACnB,GAAG,EAAE,QAAQ;YACb,IAAI,EAAE,QAAQ;YACd,MAAM,EAAE,KAAK;YACb,KAAK,EAAE,KAAK;YACZ,MAAM,EAAE,MAAM;YACd,MAAM,EAAE,IAAI;YACZ,KAAK,EAAE,IAAI;YACX,IAAI,EAAE,IAAI;YACV,UAAU,EAAE,IAAI;YAChB,EAAE,EAAE,IAAI;YACR,YAAY,EAAE,IAAI;YAClB,SAAS,EAAE;gBACT,EAAE,EAAE,GAAG;gBACP,KAAK,EAAE;oBACL,EAAE,EAAE,MAAM;iBACX;gBACD,KAAK,EAAE;oBACL,OAAO,EAAE,KAAK;iBACf;aACF;YAED,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;SAC7C,CAAC,CAAA;QACF,aAAa,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,EAAE,UAAU,EAAE,EAAE,GAAG;YAC7C,aAAa,CAAC,OAAO,EAAE,CAAA;YACvB,MAAM,CAAC,MAAM,EAAE,CAAA;QACjB,CAAC,CAAC,CAAA;QAEF,aAAa,CAAC,KAAK,EAAE,CAAA;QACrB,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,CAAA;QAC5B,MAAM,CAAC,MAAM,EAAE,CAAA;IACjB,CAAC;IAED,OAAO,gBAAgB,CAAA;AACzB,CAAC,CAAA,CAAA;AAtEY,QAAA,mBAAmB,uBAsE/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presentations.d.ts","sourceRoot":"","sources":["../../src/explore/presentations.ts"],"names":[],"mappings":"AAAA,OAAgB,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAG1C,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"presentations.d.ts","sourceRoot":"","sources":["../../src/explore/presentations.ts"],"names":[],"mappings":"AAAA,OAAgB,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAG1C,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAG1C,eAAO,MAAM,qBAAqB,UAAiB,eAAe,UAAU,cAAc,sCAsEzF,CAAA"}
|
|
@@ -16,7 +16,6 @@ exports.getPresentationsTable = void 0;
|
|
|
16
16
|
const blessed_1 = __importDefault(require("blessed"));
|
|
17
17
|
const utils_1 = require("./utils");
|
|
18
18
|
const styles_1 = require("./styles");
|
|
19
|
-
const utils_2 = require("@veramo/utils");
|
|
20
19
|
const getPresentationsTable = (agent, screen) => __awaiter(void 0, void 0, void 0, function* () {
|
|
21
20
|
screen.title = 'Presentations';
|
|
22
21
|
const presentationsTable = blessed_1.default.listtable({
|
|
@@ -34,9 +33,9 @@ const getPresentationsTable = (agent, screen) => __awaiter(void 0, void 0, void
|
|
|
34
33
|
const presentations = yield agent.dataStoreORMGetVerifiablePresentations({});
|
|
35
34
|
presentationsTable.setData([['Created', 'Type', 'Holder', 'Verifier']].concat(presentations.map(({ verifiablePresentation: m }) => [
|
|
36
35
|
(0, utils_1.shortDate)(m.issuanceDate),
|
|
37
|
-
|
|
36
|
+
m.type.join(','),
|
|
38
37
|
(0, utils_1.shortDid)(m.holder),
|
|
39
|
-
(0, utils_1.shortDid)(
|
|
38
|
+
(0, utils_1.shortDid)(m.verifier.join(',')),
|
|
40
39
|
])));
|
|
41
40
|
presentationsTable.on('select', function (data) {
|
|
42
41
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presentations.js","sourceRoot":"","sources":["../../src/explore/presentations.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,sDAA0C;AAE1C,mCAA6C;AAE7C,qCAAiC;
|
|
1
|
+
{"version":3,"file":"presentations.js","sourceRoot":"","sources":["../../src/explore/presentations.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AA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;IAEF,SAAS,gBAAgB,CAAC,YAA0C;QAClE,MAAM,eAAe,GAAG,iBAAO,CAAC,GAAG,CAAC;YAClC,KAAK,EAAE,cAAc;YACrB,GAAG,EAAE,QAAQ;YACb,IAAI,EAAE,QAAQ;YACd,MAAM,EAAE,KAAK;YACb,KAAK,EAAE,KAAK;YACZ,MAAM,EAAE,MAAM;YACd,MAAM,EAAE,IAAI;YACZ,KAAK,EAAE,IAAI;YACX,IAAI,EAAE,IAAI;YACV,UAAU,EAAE,IAAI;YAChB,EAAE,EAAE,IAAI;YACR,YAAY,EAAE,IAAI;YAClB,SAAS,EAAE;gBACT,EAAE,EAAE,GAAG;gBACP,KAAK,EAAE;oBACL,EAAE,EAAE,MAAM;iBACX;gBACD,KAAK,EAAE;oBACL,OAAO,EAAE,KAAK;iBACf;aACF;YAED,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC;SAC/C,CAAC,CAAA;QACF,eAAe,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,EAAE,UAAU,EAAE,EAAE,GAAG;YAC/C,eAAe,CAAC,OAAO,EAAE,CAAA;YACzB,MAAM,CAAC,MAAM,EAAE,CAAA;QACjB,CAAC,CAAC,CAAA;QAEF,eAAe,CAAC,KAAK,EAAE,CAAA;QACvB,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,CAAA;QAC9B,MAAM,CAAC,MAAM,EAAE,CAAA;IACjB,CAAC;IAED,OAAO,kBAAkB,CAAA;AAC3B,CAAC,CAAA,CAAA;AAtEY,QAAA,qBAAqB,yBAsEjC"}
|
package/build/presentation.js
CHANGED
|
@@ -1,27 +1,4 @@
|
|
|
1
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 __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
2
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
3
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
4
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -39,10 +16,6 @@ const setup_1 = require("./setup");
|
|
|
39
16
|
const commander_1 = require("commander");
|
|
40
17
|
const inquirer_1 = __importDefault(require("inquirer"));
|
|
41
18
|
const qrcode_terminal_1 = __importDefault(require("qrcode-terminal"));
|
|
42
|
-
const util_1 = require("./util");
|
|
43
|
-
const fs = __importStar(require("fs"));
|
|
44
|
-
const json5 = __importStar(require("json5"));
|
|
45
|
-
const utils_1 = require("@veramo/utils");
|
|
46
19
|
const presentation = commander_1.program.command('presentation').description('W3C Verifiable Presentation');
|
|
47
20
|
presentation
|
|
48
21
|
.command('create', { isDefault: true })
|
|
@@ -116,7 +89,7 @@ presentation
|
|
|
116
89
|
list.push({
|
|
117
90
|
name: JSON.stringify(credential.verifiableCredential.credentialSubject) +
|
|
118
91
|
' | Issuer: ' +
|
|
119
|
-
|
|
92
|
+
credential.verifiableCredential.issuer.id,
|
|
120
93
|
value: credential.verifiableCredential,
|
|
121
94
|
});
|
|
122
95
|
}
|
|
@@ -181,47 +154,4 @@ presentation
|
|
|
181
154
|
}
|
|
182
155
|
}
|
|
183
156
|
}));
|
|
184
|
-
presentation
|
|
185
|
-
.command('verify')
|
|
186
|
-
.description('Verify a W3C Verifiable Presentation provided as a string param or a file or from stdin')
|
|
187
|
-
.option('-c, --challenge <string>', 'Optional. Specify a challenge that the presentation should match.')
|
|
188
|
-
.option('-d, --domain <string>', 'Optional. Specify a domain that the presentation should match.')
|
|
189
|
-
.option('-f, --filename <string>', 'Optional. Read the presentation from a file instead of stdin')
|
|
190
|
-
.option('-r, --raw <string>', 'Optional. Presentation as a parameter string instead of a file or stdin.')
|
|
191
|
-
.action((options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
192
|
-
const agent = (0, setup_1.getAgent)(commander_1.program.opts().config);
|
|
193
|
-
let raw = '';
|
|
194
|
-
if (options.raw) {
|
|
195
|
-
raw = options.raw;
|
|
196
|
-
}
|
|
197
|
-
else if (options.filename) {
|
|
198
|
-
raw = yield fs.promises.readFile(options.filename, 'utf-8');
|
|
199
|
-
}
|
|
200
|
-
else {
|
|
201
|
-
raw = yield (0, util_1.readStdin)();
|
|
202
|
-
}
|
|
203
|
-
let presentationAsJSON;
|
|
204
|
-
try {
|
|
205
|
-
presentationAsJSON = json5.parse(raw);
|
|
206
|
-
}
|
|
207
|
-
catch (e) {
|
|
208
|
-
presentationAsJSON = {
|
|
209
|
-
proof: {
|
|
210
|
-
type: 'JwtProof2020',
|
|
211
|
-
jwt: raw,
|
|
212
|
-
},
|
|
213
|
-
};
|
|
214
|
-
}
|
|
215
|
-
const result = yield agent.verifyPresentation({
|
|
216
|
-
presentation: presentationAsJSON,
|
|
217
|
-
challenge: options.challenge,
|
|
218
|
-
domain: options.domain,
|
|
219
|
-
});
|
|
220
|
-
if (result === true) {
|
|
221
|
-
console.log('Presentation was verified successfully.');
|
|
222
|
-
}
|
|
223
|
-
else {
|
|
224
|
-
console.error('Presentation could not be verified.');
|
|
225
|
-
}
|
|
226
|
-
}));
|
|
227
157
|
//# sourceMappingURL=presentation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presentation.js","sourceRoot":"","sources":["../src/presentation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"presentation.js","sourceRoot":"","sources":["../src/presentation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,mCAAkC;AAClC,yCAAmC;AACnC,wDAA+B;AAC/B,sEAAoC;AAEpC,MAAM,YAAY,GAAG,mBAAO,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,WAAW,CAAC,6BAA6B,CAAC,CAAA;AAE/F,YAAY;KACT,OAAO,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;KACtC,WAAW,CAAC,oCAAoC,CAAC;KACjD,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC;KAC5B,MAAM,CAAC,cAAc,EAAE,aAAa,CAAC;KACrC,MAAM,CAAC,CAAO,GAAG,EAAE,EAAE;IACpB,MAAM,KAAK,GAAG,IAAA,gBAAQ,EAAC,mBAAO,CAAC,IAAI,EAAE,CAAC,MAAM,CAAC,CAAA;IAC7C,MAAM,aAAa,GAAG,MAAM,KAAK,CAAC,cAAc,EAAE,CAAA;IAClD,IAAI,aAAa,CAAC,MAAM,KAAK,CAAC,EAAE;QAC9B,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,CAAA;QACxB,OAAO,CAAC,IAAI,EAAE,CAAA;KACf;IAED,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,0BAA0B,EAAE,CAAA;IAEpD,MAAM,WAAW,GAAG;QAClB;YACE,IAAI,EAAE,gBAAgB;YACtB,KAAK,EAAE,QAAQ;S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AC,GAAG;gBACnB,QAAQ,EAAE,CAAC,GAAG,CAAC;gBACf,GAAG,EAAE,OAAO,CAAC,GAAG;gBAChB,UAAU,EAAE,CAAC,wCAAwC,CAAC;gBACtD,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC;gBAC7B,YAAY,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;gBACtC,oBAAoB;aACrB;YACD,WAAW,EAAE,KAAK;SACnB,CAAC,CAAA;QAEF,IAAI,GAAG,CAAC,IAAI,EAAE;YACZ,IAAI;gBACF,MAAM,OAAO,GAAG,MAAM,KAAK,CAAC,wBAAwB,CAAC;oBACnD,IAAI,EAAE,IAAI;oBACV,IAAI,EAAE;wBACJ,IAAI,EAAE,OAAO,CAAC,GAAG;wBACjB,EAAE,EAAE,GAAG;wBACP,IAAI,EAAE,KAAK;wBACX,IAAI,EAAE,sBAAsB,CAAC,KAAK,CAAC,GAAG;qBACvC;iBACF,CAAC,CAAA;gBACF,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAA;aACpC;YAAC,OAAO,CAAC,EAAE;gBACV,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;aACjB;SACF;QAED,IAAI,GAAG,CAAC,MAAM,EAAE;YACd,yBAAM,CAAC,QAAQ,CAAC,sBAAsB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;SAClD;aAAM;YACL,OAAO,CAAC,GAAG,CAAC,sBAAsB,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAA;SACnD;KACF;AACH,CAAC,CAAA,CAAC,CAAA"}
|
package/build/sdr.js
CHANGED
|
@@ -17,7 +17,6 @@ const commander_1 = require("commander");
|
|
|
17
17
|
const inquirer_1 = __importDefault(require("inquirer"));
|
|
18
18
|
const qrcode_terminal_1 = __importDefault(require("qrcode-terminal"));
|
|
19
19
|
const utils_1 = require("./explore/utils");
|
|
20
|
-
const utils_2 = require("@veramo/utils");
|
|
21
20
|
const fuzzy = require('fuzzy');
|
|
22
21
|
const sdr = commander_1.program.command('sdr').description('Selective Disclosure Request');
|
|
23
22
|
sdr
|
|
@@ -44,16 +43,14 @@ sdr
|
|
|
44
43
|
message: 'Subject DID',
|
|
45
44
|
type: 'autocomplete',
|
|
46
45
|
pageSize: 15,
|
|
46
|
+
suggestOnly: true,
|
|
47
47
|
source: (answers, input) => __awaiter(void 0, void 0, void 0, function* () {
|
|
48
48
|
const res = fuzzy
|
|
49
49
|
.filter(input, subjects)
|
|
50
50
|
.map((el) => (typeof el === 'string' ? el : el.original));
|
|
51
51
|
return res;
|
|
52
52
|
}),
|
|
53
|
-
validate
|
|
54
|
-
if (val && typeof val !== 'string') {
|
|
55
|
-
val = val.value;
|
|
56
|
-
}
|
|
53
|
+
validate(val) {
|
|
57
54
|
if (!val || !val.startsWith('did:')) {
|
|
58
55
|
return "Subject DID does not start with 'did:'...";
|
|
59
56
|
}
|
|
@@ -174,7 +171,7 @@ sdr
|
|
|
174
171
|
list.push({
|
|
175
172
|
name: JSON.stringify(credential.verifiableCredential.credentialSubject) +
|
|
176
173
|
' | Issuer: ' +
|
|
177
|
-
|
|
174
|
+
credential.verifiableCredential.issuer.id,
|
|
178
175
|
value: credential.verifiableCredential.proof.jwt,
|
|
179
176
|
});
|
|
180
177
|
}
|
|
@@ -300,9 +297,9 @@ sdr
|
|
|
300
297
|
choices: item.credentials.map((c) => ({
|
|
301
298
|
name: c.verifiableCredential.credentialSubject[item.claimType] +
|
|
302
299
|
' (' +
|
|
303
|
-
|
|
300
|
+
c.verifiableCredential.type.join(',') +
|
|
304
301
|
') issued by: ' +
|
|
305
|
-
|
|
302
|
+
c.verifiableCredential.issuer.id +
|
|
306
303
|
' ' +
|
|
307
304
|
(0, utils_1.shortDate)(c.verifiableCredential.issuanceDate) +
|
|
308
305
|
' ago',
|
package/build/sdr.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdr.js","sourceRoot":"","sources":["../src/sdr.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,mCAAkC;AAClC,yCAAmC;AACnC,wDAA+B;AAC/B,sEAAoC;AACpC,2CAAqD;AAErD,
|
|
1
|
+
{"version":3,"file":"sdr.js","sourceRoot":"","sources":["../src/sdr.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,mCAAkC;AAClC,yCAAmC;AACnC,wDAA+B;AAC/B,sEAAoC;AACpC,2CAAqD;AAErD,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;AAE9B,MAAM,GAAG,GAAG,mBAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,WAAW,CAAC,8BAA8B,CAAC,CAAA;AAE9E,GAAG;KACA,OAAO,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;KACtC,WAAW,CAAC,qCAAqC,CAAC;KAClD,MAAM,CAAC,CAAO,GAAG,EAAE,EAAE;IACpB,MAAM,KAAK,GAAG,IAAA,gBAAQ,EAAC,mBAAO,CAAC,IAAI,EAAE,CAAC,MAAM,CAAC,CAAA;IAC7C,MAAM,WAAW,GAAG,MAAM,KAAK,CAAC,cAAc,EAAE,CAAA;IAEhD,MAAM,SAAS,GAAG,MAAM,KAAK,CAAC,0BAA0B,EAAE,CAAA;IAE1D,MAAM,QAAQ,GAAG,CAAC,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAA;IAEnD,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE;QAC5B,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,CAAA;QACxB,OAAO,CAAC,IAAI,EAAE,CAAA;KACf;IACD,MAAM,OAAO,GAAG,MAAM,kBAAQ,CAAC,MAAM,CAAC;QACpC;YACE,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,KAAK;YACX,O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,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAA;KACxE;IAED,MAAM,sBAAsB,GAAG,MAAM,KAAK,CAAC,4BAA4B,CAAC;QACtE,IAAI,EAAE,KAAK;QACX,YAAY,EAAE;YACZ,MAAM,EAAE,OAAO,CAAC,EAAE;YAClB,QAAQ,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;YACxB,GAAG,EAAE,OAAO,CAAC,GAAG;YAChB,UAAU,EAAE,CAAC,wCAAwC,CAAC;YACtD,IAAI,EAAE,CAAC,wBAAwB,CAAC;YAChC,YAAY,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACtC,oBAAoB,EAAE,mBAAmB;SAC1C;QACD,WAAW,EAAE,KAAK;KACnB,CAAC,CAAA;IAEF,MAAM,KAAK,CAAC,wBAAwB,CAAC;QACnC,IAAI,EAAE,IAAI;QACV,IAAI,EAAE;YACJ,IAAI,EAAE,OAAO,CAAC,EAAE;YAChB,EAAE,EAAE,OAAO,CAAC,IAAI;YAChB,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,sBAAsB,CAAC,KAAK,CAAC,GAAG;SACvC;KACF,CAAC,CAAA;IAEF,OAAO,CAAC,GAAG,CAAC,sBAAsB,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAA;AACpD,CAAC,CAAA,CAAC,CAAA"}
|
package/build/setup.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import 'cross-fetch/polyfill';
|
|
2
|
-
import { IDataStore,
|
|
2
|
+
import { IDataStore, IDIDManager, IMessageHandler, IKeyManager, IResolver, TAgent } from '@veramo/core';
|
|
3
3
|
import { ICredentialIssuer } from '@veramo/credential-w3c';
|
|
4
4
|
import { ISelectiveDisclosure } from '@veramo/selective-disclosure';
|
|
5
5
|
import { IDIDComm } from '@veramo/did-comm';
|
|
6
|
+
import { IDataStoreORM } from '@veramo/data-store';
|
|
6
7
|
import { IDIDDiscovery } from '@veramo/did-discovery';
|
|
7
8
|
export declare const getConfig: (fileName: string) => any;
|
|
8
9
|
export declare type EnabledInterfaces = IDIDManager & IKeyManager & IDataStore & IDataStoreORM & IResolver & IMessageHandler & IDIDComm & ICredentialIssuer & ISelectiveDisclosure & IDIDDiscovery;
|
package/build/setup.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../src/setup.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAA;AAE7B,OAAO,
|
|
1
|
+
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../src/setup.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAA;AAE7B,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,eAAe,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACvG,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAA;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAKrD,eAAO,MAAM,SAAS,aAAc,MAAM,KAAG,GAc5C,CAAA;AAED,oBAAY,iBAAiB,GAAG,WAAW,GACzC,WAAW,GACX,UAAU,GACV,aAAa,GACb,SAAS,GACT,eAAe,GACf,QAAQ,GACR,iBAAiB,GACjB,oBAAoB,GACpB,aAAa,CAAA;AAEf,oBAAY,eAAe,GAAG,MAAM,CAAC,iBAAiB,CAAC,CAAA;AAEvD,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,MAAM,6BAOxC"}
|
package/build/setup.js
CHANGED
|
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.getAgent = exports.getConfig = void 0;
|
|
7
7
|
require("cross-fetch/polyfill");
|
|
8
8
|
const yaml_1 = __importDefault(require("yaml"));
|
|
9
|
-
const agentCreator_1 = require("./lib/agentCreator");
|
|
10
9
|
const fs = require('fs');
|
|
10
|
+
const agentCreator_1 = require("./lib/agentCreator");
|
|
11
11
|
const getConfig = (fileName) => {
|
|
12
12
|
if (!fs.existsSync(fileName)) {
|
|
13
13
|
console.log('Config file not found: ' + fileName);
|
package/build/setup.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup.js","sourceRoot":"","sources":["../src/setup.ts"],"names":[],"mappings":";;;;;;AAAA,gCAA6B;AAC7B,gDAAuB;
|
|
1
|
+
{"version":3,"file":"setup.js","sourceRoot":"","sources":["../src/setup.ts"],"names":[],"mappings":";;;;;;AAAA,gCAA6B;AAC7B,gDAAuB;AAQvB,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;AACxB,qDAA0D;AAEnD,MAAM,SAAS,GAAG,CAAC,QAAgB,EAAO,EAAE;IACjD,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE;QAC5B,OAAO,CAAC,GAAG,CAAC,yBAAyB,GAAG,QAAQ,CAAC,CAAA;QACjD,OAAO,CAAC,GAAG,CAAC,0CAA0C,CAAC,CAAA;QACvD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;KAChB;IAED,MAAM,MAAM,GAAG,cAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,QAAQ,EAAE,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAA;IAEvF,IAAI,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO,KAAI,CAAC,EAAE;QACxB,OAAO,CAAC,GAAG,CAAC,yCAAyC,EAAE,MAAM,CAAC,OAAO,CAAC,CAAA;QACtE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;KAChB;IACD,OAAO,MAAM,CAAA;AACf,CAAC,CAAA;AAdY,QAAA,SAAS,aAcrB;AAeD,SAAgB,QAAQ,CAAC,QAAgB;IACvC,IAAI;QACF,OAAO,IAAA,oCAAqB,EAAoB,IAAA,iBAAS,EAAC,QAAQ,CAAC,CAAC,CAAA;KACrE;IAAC,OAAO,CAAM,EAAE;QACf,OAAO,CAAC,GAAG,CAAC,8BAA8B,GAAG,QAAQ,GAAG,GAAG,EAAE,CAAC,CAAC,OAAO,CAAC,CAAA;QACvE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;KAChB;AACH,CAAC;AAPD,4BAOC"}
|
package/default/client.yml
CHANGED
|
@@ -57,10 +57,8 @@ agent:
|
|
|
57
57
|
- unpackDIDCommMessage
|
|
58
58
|
- sendDIDCommMessage
|
|
59
59
|
- sendMessageDIDCommAlpha1
|
|
60
|
-
- createVerifiableCredential
|
|
61
60
|
- createVerifiablePresentation
|
|
62
|
-
-
|
|
63
|
-
- verifyPresentation
|
|
61
|
+
- createVerifiableCredential
|
|
64
62
|
- createSelectiveDisclosureRequest
|
|
65
63
|
- getVerifiableCredentialsForSdr
|
|
66
64
|
- validatePresentationAgainstSdr
|
package/default/default.yml
CHANGED
|
@@ -54,10 +54,8 @@ constants:
|
|
|
54
54
|
- unpackDIDCommMessage
|
|
55
55
|
- sendDIDCommMessage
|
|
56
56
|
- sendMessageDIDCommAlpha1
|
|
57
|
-
- createVerifiableCredential
|
|
58
57
|
- createVerifiablePresentation
|
|
59
|
-
-
|
|
60
|
-
- verifyPresentation
|
|
58
|
+
- createVerifiableCredential
|
|
61
59
|
- createSelectiveDisclosureRequest
|
|
62
60
|
- getVerifiableCredentialsForSdr
|
|
63
61
|
- validatePresentationAgainstSdr
|
|
@@ -277,19 +275,6 @@ didDiscovery:
|
|
|
277
275
|
- $require: '@veramo/did-manager#AliasDiscoveryProvider'
|
|
278
276
|
- $require: '@veramo/data-store#ProfileDiscoveryProvider'
|
|
279
277
|
|
|
280
|
-
# W3C credentialPlugin
|
|
281
|
-
credentialIssuerLD:
|
|
282
|
-
$require: '@veramo/credential-ld#CredentialIssuerLD'
|
|
283
|
-
$args:
|
|
284
|
-
- suites:
|
|
285
|
-
- $require: '@veramo/credential-ld#VeramoEd25519Signature2018'
|
|
286
|
-
- $require: '@veramo/credential-ld#VeramoEcdsaSecp256k1RecoverySignature2020'
|
|
287
|
-
contextMaps:
|
|
288
|
-
# The LdDefaultContext is a "catch-all" for now.
|
|
289
|
-
- $require: '@veramo/credential-ld?t=object#LdDefaultContexts'
|
|
290
|
-
- $require: '@transmute/credentials-context?t=object#contexts'
|
|
291
|
-
# others should be included here
|
|
292
|
-
|
|
293
278
|
# Agent
|
|
294
279
|
agent:
|
|
295
280
|
$require: '@veramo/core#Agent'
|
|
@@ -303,7 +288,6 @@ agent:
|
|
|
303
288
|
- $ref: /messageHandler
|
|
304
289
|
- $require: '@veramo/did-comm#DIDComm'
|
|
305
290
|
- $require: '@veramo/credential-w3c#CredentialIssuer'
|
|
306
|
-
- $ref: /credentialIssuerLD
|
|
307
291
|
- $require: '@veramo/selective-disclosure#SelectiveDisclosure'
|
|
308
292
|
- $require: '@veramo/data-store#DataStore'
|
|
309
293
|
$args:
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@veramo/cli",
|
|
3
3
|
"description": "Veramo command line application.",
|
|
4
|
-
"version": "3.1.2
|
|
4
|
+
"version": "3.1.2",
|
|
5
5
|
"main": "build/cli.js",
|
|
6
6
|
"types": "build/cli.d.ts",
|
|
7
7
|
"bin": {
|
|
@@ -14,69 +14,68 @@
|
|
|
14
14
|
"update-veramo-latest": "yarn add @veramo/core@latest @veramo/discovery@latest @veramo/remote-client@latest @veramo/remote-server@latest @veramo/did-provider-key@latest @veramo/did-resolver@latest @veramo/did-jwt@latest @veramo/credential-w3c@latest @veramo/did-provider-ethr@latest @veramo/did-provider-web@latest @veramo/did-comm@latest @veramo/kms-local@latest @veramo/selective-disclosure@latest @veramo/data-store@latest @veramo/key-manager@latest @veramo/message-handler@latest @veramo/did-manager@latest @veramo/url-handler@latest"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@microsoft/api-extractor": "7.
|
|
18
|
-
"@microsoft/api-extractor-model": "7.
|
|
17
|
+
"@microsoft/api-extractor": "7.18.19",
|
|
18
|
+
"@microsoft/api-extractor-model": "7.13.16",
|
|
19
19
|
"@types/blessed": "^0.1.17",
|
|
20
|
-
"@types/swagger-ui-express": "^4.1.
|
|
21
|
-
"@veramo/core": "^3.1.
|
|
22
|
-
"@veramo/credential-w3c": "^3.1.
|
|
23
|
-
"@veramo/data-store": "^3.1.
|
|
24
|
-
"@veramo/did-comm": "^3.1.
|
|
25
|
-
"@veramo/did-discovery": "^3.1.
|
|
26
|
-
"@veramo/did-jwt": "^3.1.
|
|
27
|
-
"@veramo/did-manager": "^3.1.
|
|
28
|
-
"@veramo/did-provider-ethr": "^3.1.
|
|
29
|
-
"@veramo/did-provider-key": "^3.1.
|
|
30
|
-
"@veramo/did-provider-web": "^3.1.
|
|
31
|
-
"@veramo/did-resolver": "^3.1.
|
|
32
|
-
"@veramo/key-manager": "^3.1.
|
|
33
|
-
"@veramo/kms-local": "^3.1.
|
|
34
|
-
"@veramo/message-handler": "^3.1.
|
|
35
|
-
"@veramo/remote-client": "^3.1.
|
|
36
|
-
"@veramo/remote-server": "^3.1.2
|
|
37
|
-
"@veramo/selective-disclosure": "^3.1.
|
|
38
|
-
"@veramo/url-handler": "^3.1.
|
|
20
|
+
"@types/swagger-ui-express": "^4.1.2",
|
|
21
|
+
"@veramo/core": "^3.1.0",
|
|
22
|
+
"@veramo/credential-w3c": "^3.1.0",
|
|
23
|
+
"@veramo/data-store": "^3.1.0",
|
|
24
|
+
"@veramo/did-comm": "^3.1.0",
|
|
25
|
+
"@veramo/did-discovery": "^3.1.0",
|
|
26
|
+
"@veramo/did-jwt": "^3.1.0",
|
|
27
|
+
"@veramo/did-manager": "^3.1.0",
|
|
28
|
+
"@veramo/did-provider-ethr": "^3.1.0",
|
|
29
|
+
"@veramo/did-provider-key": "^3.1.0",
|
|
30
|
+
"@veramo/did-provider-web": "^3.1.0",
|
|
31
|
+
"@veramo/did-resolver": "^3.1.0",
|
|
32
|
+
"@veramo/key-manager": "^3.1.0",
|
|
33
|
+
"@veramo/kms-local": "^3.1.0",
|
|
34
|
+
"@veramo/message-handler": "^3.1.0",
|
|
35
|
+
"@veramo/remote-client": "^3.1.0",
|
|
36
|
+
"@veramo/remote-server": "^3.1.2",
|
|
37
|
+
"@veramo/selective-disclosure": "^3.1.0",
|
|
38
|
+
"@veramo/url-handler": "^3.1.0",
|
|
39
39
|
"blessed": "^0.1.81",
|
|
40
|
-
"commander": "^
|
|
41
|
-
"console-table-printer": "^2.
|
|
40
|
+
"commander": "^8.0.0",
|
|
41
|
+
"console-table-printer": "^2.8.2",
|
|
42
42
|
"cors": "^2.8.5",
|
|
43
43
|
"cross-fetch": "^3.1.4",
|
|
44
|
-
"date-fns": "^2.
|
|
45
|
-
"debug": "^4.
|
|
46
|
-
"did-resolver": "
|
|
47
|
-
"dotenv": "^
|
|
48
|
-
"ethr-did-resolver": "
|
|
49
|
-
"express": "^4.17.
|
|
50
|
-
"express-handlebars": "^
|
|
44
|
+
"date-fns": "^2.16.1",
|
|
45
|
+
"debug": "^4.1.1",
|
|
46
|
+
"did-resolver": "3.1.3",
|
|
47
|
+
"dotenv": "^10.0.0",
|
|
48
|
+
"ethr-did-resolver": "5.0.2",
|
|
49
|
+
"express": "^4.17.1",
|
|
50
|
+
"express-handlebars": "^5.2.0",
|
|
51
51
|
"fuzzy": "^0.1.3",
|
|
52
52
|
"handlebars": "^4.7.6",
|
|
53
|
-
"inquirer": "^8.
|
|
54
|
-
"inquirer-autocomplete-prompt": "^2.0
|
|
55
|
-
"json-schema": "^0.
|
|
56
|
-
"json5": "^2.2.0",
|
|
53
|
+
"inquirer": "^8.0.0",
|
|
54
|
+
"inquirer-autocomplete-prompt": "^1.2.0",
|
|
55
|
+
"json-schema": "^0.3.0",
|
|
57
56
|
"jsonpointer": "^5.0.0",
|
|
58
57
|
"oas-resolver": "^2.5.3",
|
|
59
|
-
"openapi-types": "
|
|
60
|
-
"passport": "^0.5.
|
|
58
|
+
"openapi-types": "^9.0.0",
|
|
59
|
+
"passport": "^0.5.0",
|
|
61
60
|
"passport-http-bearer": "^1.0.1",
|
|
62
|
-
"pg": "^8.
|
|
61
|
+
"pg": "^8.6.0",
|
|
63
62
|
"qrcode-terminal": "^0.12.0",
|
|
64
63
|
"sqlite3": "^5.0.0",
|
|
65
|
-
"swagger-ui-express": "^4.
|
|
66
|
-
"ts-json-schema-generator": "^
|
|
67
|
-
"typeorm": "0.2.
|
|
68
|
-
"url-parse": "^1.5.
|
|
69
|
-
"web-did-resolver": "
|
|
70
|
-
"ws": "^8.
|
|
71
|
-
"yaml": "^
|
|
64
|
+
"swagger-ui-express": "^4.1.5",
|
|
65
|
+
"ts-json-schema-generator": "^0.97.0",
|
|
66
|
+
"typeorm": "0.2.38",
|
|
67
|
+
"url-parse": "^1.5.1",
|
|
68
|
+
"web-did-resolver": "2.0.8",
|
|
69
|
+
"ws": "^8.0.0",
|
|
70
|
+
"yaml": "^1.10.0"
|
|
72
71
|
},
|
|
73
72
|
"devDependencies": {
|
|
74
73
|
"@types/debug": "4.1.7",
|
|
75
|
-
"@types/inquirer": "8.
|
|
76
|
-
"@types/node-fetch": "3.0.
|
|
74
|
+
"@types/inquirer": "8.1.3",
|
|
75
|
+
"@types/node-fetch": "3.0.2",
|
|
77
76
|
"@types/passport-http-bearer": "1.0.37",
|
|
78
|
-
"@types/ws": "8.
|
|
79
|
-
"typescript": "4.
|
|
77
|
+
"@types/ws": "8.2.0",
|
|
78
|
+
"typescript": "4.4.4"
|
|
80
79
|
},
|
|
81
80
|
"files": [
|
|
82
81
|
"bin/**/*",
|
|
@@ -100,5 +99,5 @@
|
|
|
100
99
|
],
|
|
101
100
|
"license": "Apache-2.0",
|
|
102
101
|
"keywords": [],
|
|
103
|
-
"gitHead": "
|
|
102
|
+
"gitHead": "7cdeec0f7c58f3ca4a58460a5d7dd70868550859"
|
|
104
103
|
}
|
package/src/credential.ts
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
|
+
import { W3CCredential } from '@veramo/core'
|
|
1
2
|
import { getAgent } from './setup'
|
|
2
3
|
import { program } from 'commander'
|
|
3
4
|
import inquirer from 'inquirer'
|
|
4
5
|
import qrcode from 'qrcode-terminal'
|
|
5
|
-
import * as fs from 'fs'
|
|
6
|
-
import * as json5 from 'json5'
|
|
7
|
-
import { readStdin } from './util'
|
|
8
|
-
import { CredentialPayload } from '@veramo/core'
|
|
9
6
|
|
|
10
7
|
const credential = program.command('credential').description('W3C Verifiable Credential')
|
|
11
8
|
|
|
@@ -13,7 +10,6 @@ credential
|
|
|
13
10
|
.command('create', { isDefault: true })
|
|
14
11
|
.description('Create W3C Verifiable Credential')
|
|
15
12
|
.option('-s, --send', 'Send')
|
|
16
|
-
.option('-j, --json', 'Output in JSON')
|
|
17
13
|
.option('-q, --qrcode', 'Show qrcode')
|
|
18
14
|
.action(async (cmd) => {
|
|
19
15
|
const agent = getAgent(program.opts().config)
|
|
@@ -23,12 +19,6 @@ credential
|
|
|
23
19
|
process.exit()
|
|
24
20
|
}
|
|
25
21
|
const answers = await inquirer.prompt([
|
|
26
|
-
{
|
|
27
|
-
type: 'list',
|
|
28
|
-
name: 'proofFormat',
|
|
29
|
-
choices: ['jwt', 'lds'],
|
|
30
|
-
message: 'Credential proofFormat',
|
|
31
|
-
},
|
|
32
22
|
{
|
|
33
23
|
type: 'list',
|
|
34
24
|
name: 'iss',
|
|
@@ -78,9 +68,9 @@ credential
|
|
|
78
68
|
const type: string = answers.claimType
|
|
79
69
|
credentialSubject[type] = answers.claimValue
|
|
80
70
|
|
|
81
|
-
const credential:
|
|
71
|
+
const credential: W3CCredential = {
|
|
82
72
|
issuer: { id: answers.iss },
|
|
83
|
-
'@context': ['https://www.w3.org/2018/credentials/v1'
|
|
73
|
+
'@context': ['https://www.w3.org/2018/credentials/v1'],
|
|
84
74
|
type: answers.type.split(','),
|
|
85
75
|
issuanceDate: new Date().toISOString(),
|
|
86
76
|
credentialSubject,
|
|
@@ -111,27 +101,18 @@ credential
|
|
|
111
101
|
const verifiableCredential = await agent.createVerifiableCredential({
|
|
112
102
|
save: true,
|
|
113
103
|
credential,
|
|
114
|
-
proofFormat:
|
|
104
|
+
proofFormat: 'jwt',
|
|
115
105
|
})
|
|
116
106
|
|
|
117
107
|
if (cmd.send) {
|
|
118
|
-
let body
|
|
119
|
-
let type
|
|
120
|
-
if (answers.proofFormat == 'jwt') {
|
|
121
|
-
body = verifiableCredential.proof.jwt
|
|
122
|
-
type = 'jwt'
|
|
123
|
-
} else {
|
|
124
|
-
body = verifiableCredential
|
|
125
|
-
type = 'w3c.vc'
|
|
126
|
-
}
|
|
127
108
|
try {
|
|
128
109
|
const message = await agent.sendMessageDIDCommAlpha1({
|
|
129
110
|
save: true,
|
|
130
111
|
data: {
|
|
131
112
|
from: answers.iss,
|
|
132
113
|
to: answers.sub,
|
|
133
|
-
type,
|
|
134
|
-
body,
|
|
114
|
+
type: 'jwt',
|
|
115
|
+
body: verifiableCredential.proof.jwt,
|
|
135
116
|
},
|
|
136
117
|
})
|
|
137
118
|
console.dir(message, { depth: 10 })
|
|
@@ -143,48 +124,6 @@ credential
|
|
|
143
124
|
if (cmd.qrcode) {
|
|
144
125
|
qrcode.generate(verifiableCredential.proof.jwt)
|
|
145
126
|
} else {
|
|
146
|
-
|
|
147
|
-
console.log(JSON.stringify(verifiableCredential, null, 2))
|
|
148
|
-
} else {
|
|
149
|
-
console.dir(verifiableCredential, { depth: 10 })
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
})
|
|
153
|
-
|
|
154
|
-
credential
|
|
155
|
-
.command('verify')
|
|
156
|
-
.description('Verify a W3C Verifiable Credential provided as raw string, file or stdin')
|
|
157
|
-
.option('-f, --filename <string>', 'Optional. Read the credential from a file instead of stdin')
|
|
158
|
-
.option('-r, --raw <string>', 'Optional. Specify the credential as a parameter instead of file or stdin')
|
|
159
|
-
.action(async (options) => {
|
|
160
|
-
const agent = getAgent(program.opts().config)
|
|
161
|
-
let raw: string = ''
|
|
162
|
-
if (options.raw) {
|
|
163
|
-
raw = options.raw
|
|
164
|
-
} else if (options.filename) {
|
|
165
|
-
raw = await fs.promises.readFile(options.filename, 'utf-8')
|
|
166
|
-
} else {
|
|
167
|
-
raw = await readStdin()
|
|
168
|
-
}
|
|
169
|
-
let credentialAsJSON: any
|
|
170
|
-
try {
|
|
171
|
-
credentialAsJSON = json5.parse(raw)
|
|
172
|
-
} catch (e: any) {
|
|
173
|
-
credentialAsJSON = {
|
|
174
|
-
proof: {
|
|
175
|
-
type: 'JwtProof2020',
|
|
176
|
-
jwt: raw,
|
|
177
|
-
},
|
|
178
|
-
} as any
|
|
179
|
-
}
|
|
180
|
-
try {
|
|
181
|
-
const result = await agent.verifyCredential({ credential: credentialAsJSON })
|
|
182
|
-
if (result === true) {
|
|
183
|
-
console.log('Credential was verified successfully.')
|
|
184
|
-
} else {
|
|
185
|
-
console.error('Credential could not be verified.')
|
|
186
|
-
}
|
|
187
|
-
} catch (e) {
|
|
188
|
-
console.error(e.message)
|
|
127
|
+
console.dir(verifiableCredential, { depth: 10 })
|
|
189
128
|
}
|
|
190
129
|
})
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import blessed, { Widgets } from 'blessed'
|
|
2
|
-
import { UniqueVerifiableCredential } from '@veramo/
|
|
2
|
+
import { UniqueVerifiableCredential } from '@veramo/data-store'
|
|
3
3
|
import { shortDate, shortDid } from './utils'
|
|
4
4
|
import { ConfiguredAgent } from '../setup'
|
|
5
5
|
import { styles } from './styles'
|
|
6
|
-
import { asArray, extractIssuer } from '@veramo/utils'
|
|
7
6
|
|
|
8
7
|
export const getCredentialsTable = async (agent: ConfiguredAgent, screen: Widgets.Screen) => {
|
|
9
8
|
screen.title = 'Credentials'
|
|
@@ -26,8 +25,8 @@ export const getCredentialsTable = async (agent: ConfiguredAgent, screen: Widget
|
|
|
26
25
|
[['Created', 'Type', 'From', 'To']].concat(
|
|
27
26
|
credentials.map(({ verifiableCredential: m }) => [
|
|
28
27
|
shortDate(m.issuanceDate),
|
|
29
|
-
|
|
30
|
-
shortDid(
|
|
28
|
+
m.type.join(','),
|
|
29
|
+
shortDid(m.issuer.id),
|
|
31
30
|
shortDid(m.credentialSubject.id),
|
|
32
31
|
]),
|
|
33
32
|
),
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import blessed, { Widgets } from 'blessed'
|
|
2
|
-
import { UniqueVerifiablePresentation } from '@veramo/
|
|
2
|
+
import { UniqueVerifiablePresentation } from '@veramo/data-store'
|
|
3
3
|
import { shortDate, shortDid } from './utils'
|
|
4
4
|
import { ConfiguredAgent } from '../setup'
|
|
5
5
|
import { styles } from './styles'
|
|
6
|
-
import { asArray } from '@veramo/utils'
|
|
7
6
|
|
|
8
7
|
export const getPresentationsTable = async (agent: ConfiguredAgent, screen: Widgets.Screen) => {
|
|
9
8
|
screen.title = 'Presentations'
|
|
@@ -26,9 +25,9 @@ export const getPresentationsTable = async (agent: ConfiguredAgent, screen: Widg
|
|
|
26
25
|
[['Created', 'Type', 'Holder', 'Verifier']].concat(
|
|
27
26
|
presentations.map(({ verifiablePresentation: m }) => [
|
|
28
27
|
shortDate(m.issuanceDate),
|
|
29
|
-
|
|
28
|
+
m.type.join(','),
|
|
30
29
|
shortDid(m.holder),
|
|
31
|
-
shortDid(
|
|
30
|
+
shortDid(m.verifier.join(',')),
|
|
32
31
|
]),
|
|
33
32
|
),
|
|
34
33
|
)
|
package/src/presentation.ts
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
|
+
import { W3CCredential } from '@veramo/core'
|
|
1
2
|
import { getAgent } from './setup'
|
|
2
3
|
import { program } from 'commander'
|
|
3
4
|
import inquirer from 'inquirer'
|
|
4
5
|
import qrcode from 'qrcode-terminal'
|
|
5
|
-
import { readStdin } from './util'
|
|
6
|
-
import * as fs from 'fs'
|
|
7
|
-
import * as json5 from 'json5'
|
|
8
|
-
import { extractIssuer } from '@veramo/utils'
|
|
9
6
|
|
|
10
7
|
const presentation = program.command('presentation').description('W3C Verifiable Presentation')
|
|
11
8
|
|
|
@@ -88,7 +85,7 @@ presentation
|
|
|
88
85
|
name:
|
|
89
86
|
JSON.stringify(credential.verifiableCredential.credentialSubject) +
|
|
90
87
|
' | Issuer: ' +
|
|
91
|
-
|
|
88
|
+
credential.verifiableCredential.issuer.id,
|
|
92
89
|
value: credential.verifiableCredential,
|
|
93
90
|
})
|
|
94
91
|
}
|
|
@@ -156,43 +153,3 @@ presentation
|
|
|
156
153
|
}
|
|
157
154
|
}
|
|
158
155
|
})
|
|
159
|
-
|
|
160
|
-
presentation
|
|
161
|
-
.command('verify')
|
|
162
|
-
.description('Verify a W3C Verifiable Presentation provided as a string param or a file or from stdin')
|
|
163
|
-
.option('-c, --challenge <string>', 'Optional. Specify a challenge that the presentation should match.')
|
|
164
|
-
.option('-d, --domain <string>', 'Optional. Specify a domain that the presentation should match.')
|
|
165
|
-
.option('-f, --filename <string>', 'Optional. Read the presentation from a file instead of stdin')
|
|
166
|
-
.option('-r, --raw <string>', 'Optional. Presentation as a parameter string instead of a file or stdin.')
|
|
167
|
-
.action(async (options) => {
|
|
168
|
-
const agent = getAgent(program.opts().config)
|
|
169
|
-
let raw: string = ''
|
|
170
|
-
if (options.raw) {
|
|
171
|
-
raw = options.raw
|
|
172
|
-
} else if (options.filename) {
|
|
173
|
-
raw = await fs.promises.readFile(options.filename, 'utf-8')
|
|
174
|
-
} else {
|
|
175
|
-
raw = await readStdin()
|
|
176
|
-
}
|
|
177
|
-
let presentationAsJSON: any
|
|
178
|
-
try {
|
|
179
|
-
presentationAsJSON = json5.parse(raw)
|
|
180
|
-
} catch (e: any) {
|
|
181
|
-
presentationAsJSON = {
|
|
182
|
-
proof: {
|
|
183
|
-
type: 'JwtProof2020',
|
|
184
|
-
jwt: raw,
|
|
185
|
-
},
|
|
186
|
-
} as any
|
|
187
|
-
}
|
|
188
|
-
const result = await agent.verifyPresentation({
|
|
189
|
-
presentation: presentationAsJSON,
|
|
190
|
-
challenge: options.challenge,
|
|
191
|
-
domain: options.domain,
|
|
192
|
-
})
|
|
193
|
-
if (result === true) {
|
|
194
|
-
console.log('Presentation was verified successfully.')
|
|
195
|
-
} else {
|
|
196
|
-
console.error('Presentation could not be verified.')
|
|
197
|
-
}
|
|
198
|
-
})
|
package/src/sdr.ts
CHANGED
|
@@ -5,8 +5,6 @@ import inquirer from 'inquirer'
|
|
|
5
5
|
import qrcode from 'qrcode-terminal'
|
|
6
6
|
import { shortDate, shortDid } from './explore/utils'
|
|
7
7
|
import { VerifiableCredential } from '@veramo/core'
|
|
8
|
-
import { asArray, extractIssuer } from '@veramo/utils'
|
|
9
|
-
|
|
10
8
|
const fuzzy = require('fuzzy')
|
|
11
9
|
|
|
12
10
|
const sdr = program.command('sdr').description('Selective Disclosure Request')
|
|
@@ -38,16 +36,14 @@ sdr
|
|
|
38
36
|
message: 'Subject DID',
|
|
39
37
|
type: 'autocomplete',
|
|
40
38
|
pageSize: 15,
|
|
39
|
+
suggestOnly: true,
|
|
41
40
|
source: async (answers: any, input: string) => {
|
|
42
41
|
const res = fuzzy
|
|
43
42
|
.filter(input, subjects)
|
|
44
43
|
.map((el: any) => (typeof el === 'string' ? el : el.original))
|
|
45
44
|
return res
|
|
46
45
|
},
|
|
47
|
-
validate
|
|
48
|
-
if (val && typeof val !== 'string') {
|
|
49
|
-
val = val.value
|
|
50
|
-
}
|
|
46
|
+
validate(val) {
|
|
51
47
|
if (!val || !val.startsWith('did:')) {
|
|
52
48
|
return "Subject DID does not start with 'did:'..."
|
|
53
49
|
}
|
|
@@ -177,7 +173,7 @@ sdr
|
|
|
177
173
|
name:
|
|
178
174
|
JSON.stringify(credential.verifiableCredential.credentialSubject) +
|
|
179
175
|
' | Issuer: ' +
|
|
180
|
-
|
|
176
|
+
credential.verifiableCredential.issuer.id,
|
|
181
177
|
value: credential.verifiableCredential.proof.jwt,
|
|
182
178
|
})
|
|
183
179
|
}
|
|
@@ -309,9 +305,9 @@ sdr
|
|
|
309
305
|
name:
|
|
310
306
|
c.verifiableCredential.credentialSubject[item.claimType] +
|
|
311
307
|
' (' +
|
|
312
|
-
|
|
308
|
+
c.verifiableCredential.type.join(',') +
|
|
313
309
|
') issued by: ' +
|
|
314
|
-
|
|
310
|
+
c.verifiableCredential.issuer.id +
|
|
315
311
|
' ' +
|
|
316
312
|
shortDate(c.verifiableCredential.issuanceDate) +
|
|
317
313
|
' ago',
|
package/src/setup.ts
CHANGED
|
@@ -1,21 +1,14 @@
|
|
|
1
1
|
import 'cross-fetch/polyfill'
|
|
2
2
|
import yaml from 'yaml'
|
|
3
|
-
import {
|
|
4
|
-
IDataStore,
|
|
5
|
-
IDataStoreORM,
|
|
6
|
-
IDIDManager,
|
|
7
|
-
IKeyManager,
|
|
8
|
-
IMessageHandler,
|
|
9
|
-
IResolver,
|
|
10
|
-
TAgent,
|
|
11
|
-
} from '@veramo/core'
|
|
3
|
+
import { IDataStore, IDIDManager, IMessageHandler, IKeyManager, IResolver, TAgent } from '@veramo/core'
|
|
12
4
|
import { ICredentialIssuer } from '@veramo/credential-w3c'
|
|
13
5
|
import { ISelectiveDisclosure } from '@veramo/selective-disclosure'
|
|
14
6
|
import { IDIDComm } from '@veramo/did-comm'
|
|
7
|
+
import { IDataStoreORM } from '@veramo/data-store'
|
|
15
8
|
import { IDIDDiscovery } from '@veramo/did-discovery'
|
|
16
|
-
import { createAgentFromConfig } from './lib/agentCreator'
|
|
17
9
|
|
|
18
10
|
const fs = require('fs')
|
|
11
|
+
import { createAgentFromConfig } from './lib/agentCreator'
|
|
19
12
|
|
|
20
13
|
export const getConfig = (fileName: string): any => {
|
|
21
14
|
if (!fs.existsSync(fileName)) {
|
package/build/util.d.ts
DELETED
package/build/util.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":"AAAA,wBAAsB,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC,CAsBjD"}
|
package/build/util.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.readStdin = void 0;
|
|
13
|
-
function readStdin() {
|
|
14
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
15
|
-
return new Promise((resolve, reject) => {
|
|
16
|
-
let data = '';
|
|
17
|
-
process.stdin.setEncoding('utf-8');
|
|
18
|
-
process.stdin.on('readable', () => {
|
|
19
|
-
let chunk;
|
|
20
|
-
while ((chunk = process.stdin.read())) {
|
|
21
|
-
data += chunk;
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
process.stdin.on('end', () => {
|
|
25
|
-
// There will be a trailing \n from the user hitting enter. Get rid of it.
|
|
26
|
-
data = data.replace(/\n$/, '');
|
|
27
|
-
resolve(data);
|
|
28
|
-
});
|
|
29
|
-
process.stdin.on('error', (error) => {
|
|
30
|
-
reject(error);
|
|
31
|
-
});
|
|
32
|
-
});
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
exports.readStdin = readStdin;
|
|
36
|
-
//# sourceMappingURL=util.js.map
|
package/build/util.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"util.js","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,SAAsB,SAAS;;QAC7B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACrC,IAAI,IAAI,GAAG,EAAE,CAAA;YACb,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,CAAA;YAElC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,UAAU,EAAE,GAAG,EAAE;gBAChC,IAAI,KAAa,CAAA;gBACjB,OAAO,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,EAAE;oBACrC,IAAI,IAAI,KAAK,CAAA;iBACd;YACH,CAAC,CAAC,CAAA;YAEF,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE;gBAC3B,0EAA0E;gBAC1E,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAA;gBAC9B,OAAO,CAAC,IAAI,CAAC,CAAA;YACf,CAAC,CAAC,CAAA;YAEF,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;gBAClC,MAAM,CAAC,KAAK,CAAC,CAAA;YACf,CAAC,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;IACJ,CAAC;CAAA;AAtBD,8BAsBC"}
|
package/src/util.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export async function readStdin(): Promise<string> {
|
|
2
|
-
return new Promise((resolve, reject) => {
|
|
3
|
-
let data = ''
|
|
4
|
-
process.stdin.setEncoding('utf-8')
|
|
5
|
-
|
|
6
|
-
process.stdin.on('readable', () => {
|
|
7
|
-
let chunk: string
|
|
8
|
-
while ((chunk = process.stdin.read())) {
|
|
9
|
-
data += chunk
|
|
10
|
-
}
|
|
11
|
-
})
|
|
12
|
-
|
|
13
|
-
process.stdin.on('end', () => {
|
|
14
|
-
// There will be a trailing \n from the user hitting enter. Get rid of it.
|
|
15
|
-
data = data.replace(/\n$/, '')
|
|
16
|
-
resolve(data)
|
|
17
|
-
})
|
|
18
|
-
|
|
19
|
-
process.stdin.on('error', (error) => {
|
|
20
|
-
reject(error)
|
|
21
|
-
})
|
|
22
|
-
})
|
|
23
|
-
}
|