@twin.org/identity-cli 0.0.1-next.28 → 0.0.1-next.29
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/cjs/index.cjs +28 -29
- package/dist/esm/index.mjs +30 -31
- package/dist/locales/en.json +71 -25
- package/dist/types/commands/proofCreate.d.ts +1 -1
- package/dist/types/commands/proofVerify.d.ts +4 -7
- package/docs/changelog.md +1 -1
- package/docs/examples.md +4 -4
- package/locales/en.json +16 -20
- package/package.json +4 -4
package/dist/cjs/index.cjs
CHANGED
|
@@ -266,7 +266,7 @@ function buildCommandProofCreate() {
|
|
|
266
266
|
.description(core.I18n.formatMessage("commands.proof-create.description"))
|
|
267
267
|
.requiredOption(core.I18n.formatMessage("commands.proof-create.options.id.param"), core.I18n.formatMessage("commands.proof-create.options.id.description"))
|
|
268
268
|
.requiredOption(core.I18n.formatMessage("commands.proof-create.options.private-key.param"), core.I18n.formatMessage("commands.proof-create.options.private-key.description"))
|
|
269
|
-
.requiredOption(core.I18n.formatMessage("commands.proof-create.options.
|
|
269
|
+
.requiredOption(core.I18n.formatMessage("commands.proof-create.options.document-filename.param"), core.I18n.formatMessage("commands.proof-create.options.document-filename.description"));
|
|
270
270
|
cliCore.CLIOptions.output(command, {
|
|
271
271
|
noConsole: true,
|
|
272
272
|
json: true,
|
|
@@ -296,12 +296,13 @@ function buildCommandProofCreate() {
|
|
|
296
296
|
async function actionCommandProofCreate(opts) {
|
|
297
297
|
const id = cliCore.CLIParam.stringValue("id", opts.id);
|
|
298
298
|
const privateKey = cliCore.CLIParam.hexBase64("private-key", opts.privateKey);
|
|
299
|
-
const
|
|
299
|
+
const documentFilename = path.resolve(cliCore.CLIParam.stringValue("document-filename", opts.documentFilename));
|
|
300
300
|
const nodeEndpoint = cliCore.CLIParam.url("node", opts.node);
|
|
301
301
|
const network = opts.connector === IdentityConnectorTypes.Iota
|
|
302
302
|
? cliCore.CLIParam.stringValue("network", opts.network)
|
|
303
303
|
: undefined;
|
|
304
304
|
cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.proof-create.labels.verificationMethodId"), id);
|
|
305
|
+
cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.proof-create.labels.documentFilename"), documentFilename);
|
|
305
306
|
cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.common.labels.node"), nodeEndpoint);
|
|
306
307
|
if (core.Is.stringValue(network)) {
|
|
307
308
|
cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.common.labels.network"), network);
|
|
@@ -318,17 +319,21 @@ async function actionCommandProofCreate(opts) {
|
|
|
318
319
|
cliCore.CLIDisplay.task(core.I18n.formatMessage("commands.proof-create.progress.creatingProof"));
|
|
319
320
|
cliCore.CLIDisplay.break();
|
|
320
321
|
cliCore.CLIDisplay.spinnerStart();
|
|
321
|
-
const
|
|
322
|
+
const document = await cliCore.CLIUtils.readJsonFile(documentFilename);
|
|
323
|
+
if (core.Is.undefined(document)) {
|
|
324
|
+
throw new core.GeneralError("commands", "commands.proof-create.documentJsonFileNotFound");
|
|
325
|
+
}
|
|
326
|
+
const proof = await identityConnector.createProof(localIdentity, id, standardsW3cDid.ProofTypes.DataIntegrityProof, document);
|
|
322
327
|
cliCore.CLIDisplay.spinnerStop();
|
|
323
328
|
if (opts.console) {
|
|
324
329
|
cliCore.CLIDisplay.json(proof);
|
|
325
330
|
cliCore.CLIDisplay.break();
|
|
326
331
|
}
|
|
327
332
|
if (core.Is.stringValue(opts?.json)) {
|
|
328
|
-
await cliCore.CLIUtils.writeJsonFile(opts.json,
|
|
333
|
+
await cliCore.CLIUtils.writeJsonFile(opts.json, proof, opts.mergeJson);
|
|
329
334
|
}
|
|
330
335
|
if (core.Is.stringValue(opts?.env)) {
|
|
331
|
-
await cliCore.CLIUtils.writeEnvFile(opts.env, [`
|
|
336
|
+
await cliCore.CLIUtils.writeEnvFile(opts.env, [`DID_PROOF='${JSON.stringify(proof)}'`], opts.mergeEnv);
|
|
332
337
|
}
|
|
333
338
|
cliCore.CLIDisplay.done();
|
|
334
339
|
}
|
|
@@ -345,10 +350,8 @@ function buildCommandProofVerify() {
|
|
|
345
350
|
.name("proof-verify")
|
|
346
351
|
.summary(core.I18n.formatMessage("commands.proof-verify.summary"))
|
|
347
352
|
.description(core.I18n.formatMessage("commands.proof-verify.description"))
|
|
348
|
-
.requiredOption(core.I18n.formatMessage("commands.proof-verify.options.
|
|
349
|
-
.requiredOption(core.I18n.formatMessage("commands.proof-verify.options.
|
|
350
|
-
.requiredOption(core.I18n.formatMessage("commands.proof-verify.options.cryptosuite.param"), core.I18n.formatMessage("commands.proof-verify.options.cryptosuite.description"))
|
|
351
|
-
.requiredOption(core.I18n.formatMessage("commands.proof-verify.options.value.param"), core.I18n.formatMessage("commands.proof-verify.options.value.description"));
|
|
353
|
+
.requiredOption(core.I18n.formatMessage("commands.proof-verify.options.document-filename.param"), core.I18n.formatMessage("commands.proof-verify.options.document-filename.description"))
|
|
354
|
+
.requiredOption(core.I18n.formatMessage("commands.proof-verify.options.proof-filename.param"), core.I18n.formatMessage("commands.proof-verify.options.proof-filename.description"));
|
|
352
355
|
cliCore.CLIOptions.output(command, {
|
|
353
356
|
noConsole: true,
|
|
354
357
|
json: true,
|
|
@@ -369,25 +372,21 @@ function buildCommandProofVerify() {
|
|
|
369
372
|
* Action the proof verify command.
|
|
370
373
|
* @param opts The options for the command.
|
|
371
374
|
* @param opts.id The id of the verification method to use for the credential.
|
|
372
|
-
* @param opts.
|
|
373
|
-
* @param opts.
|
|
374
|
-
* @param opts.value The proof value.
|
|
375
|
+
* @param opts.documentFilename The data to verify the proof for.
|
|
376
|
+
* @param opts.proofFilename The proof value.
|
|
375
377
|
* @param opts.connector The connector to perform the operations with.
|
|
376
378
|
* @param opts.node The node URL.
|
|
377
379
|
* @param opts.network The network to use for connector.
|
|
378
380
|
*/
|
|
379
381
|
async function actionCommandProofVerify(opts) {
|
|
380
|
-
const
|
|
381
|
-
const
|
|
382
|
-
const cryptosuite = cliCore.CLIParam.stringValue("cryptosuite", opts.cryptosuite);
|
|
383
|
-
const value = cliCore.CLIParam.stringValue("value", opts.value);
|
|
382
|
+
const documentFilename = path.resolve(cliCore.CLIParam.stringValue("document-filename", opts.documentFilename));
|
|
383
|
+
const proofFilename = path.resolve(cliCore.CLIParam.stringValue("proof-filename", opts.proofFilename));
|
|
384
384
|
const nodeEndpoint = cliCore.CLIParam.url("node", opts.node);
|
|
385
385
|
const network = opts.connector === IdentityConnectorTypes.Iota
|
|
386
386
|
? cliCore.CLIParam.stringValue("network", opts.network)
|
|
387
387
|
: undefined;
|
|
388
|
-
cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.proof-verify.labels.
|
|
389
|
-
cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.proof-verify.labels.
|
|
390
|
-
cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.proof-verify.labels.value"), value);
|
|
388
|
+
cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.proof-verify.labels.documentFilename"), documentFilename);
|
|
389
|
+
cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.proof-verify.labels.proofFilename"), proofFilename);
|
|
391
390
|
cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.common.labels.node"), nodeEndpoint);
|
|
392
391
|
if (core.Is.stringValue(network)) {
|
|
393
392
|
cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.common.labels.network"), network);
|
|
@@ -400,15 +399,15 @@ async function actionCommandProofVerify(opts) {
|
|
|
400
399
|
cliCore.CLIDisplay.task(core.I18n.formatMessage("commands.proof-verify.progress.verifyingProof"));
|
|
401
400
|
cliCore.CLIDisplay.break();
|
|
402
401
|
cliCore.CLIDisplay.spinnerStart();
|
|
403
|
-
const
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
}
|
|
411
|
-
const isVerified = await identityConnector.verifyProof(
|
|
402
|
+
const document = await cliCore.CLIUtils.readJsonFile(documentFilename);
|
|
403
|
+
if (core.Is.undefined(document)) {
|
|
404
|
+
throw new core.GeneralError("commands", "commands.proof-verify.documentJsonFileNotFound");
|
|
405
|
+
}
|
|
406
|
+
const proof = await cliCore.CLIUtils.readJsonFile(proofFilename);
|
|
407
|
+
if (core.Is.undefined(proof)) {
|
|
408
|
+
throw new core.GeneralError("commands", "commands.proof-verify.proofJsonFileNotFound");
|
|
409
|
+
}
|
|
410
|
+
const isVerified = await identityConnector.verifyProof(document, proof);
|
|
412
411
|
cliCore.CLIDisplay.spinnerStop();
|
|
413
412
|
if (opts.console) {
|
|
414
413
|
cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.proof-verify.labels.isVerified"), isVerified);
|
|
@@ -1093,7 +1092,7 @@ class CLI extends cliCore.CLIBase {
|
|
|
1093
1092
|
return this.execute({
|
|
1094
1093
|
title: "TWIN Identity",
|
|
1095
1094
|
appName: "twin-identity",
|
|
1096
|
-
version: "0.0.1-next.
|
|
1095
|
+
version: "0.0.1-next.29",
|
|
1097
1096
|
icon: "🌍",
|
|
1098
1097
|
supportsEnvFiles: true,
|
|
1099
1098
|
overrideOutputWidth: options?.overrideOutputWidth
|
package/dist/esm/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { fileURLToPath } from 'node:url';
|
|
|
3
3
|
import { CLIOptions, CLIParam, CLIDisplay, CLIUtils, CLIBase } from '@twin.org/cli-core';
|
|
4
4
|
import { buildCommandMnemonic, buildCommandAddress } from '@twin.org/crypto-cli';
|
|
5
5
|
import { setupWalletConnector, buildCommandFaucet, buildCommandTransfer } from '@twin.org/wallet-cli';
|
|
6
|
-
import { I18n, Is, Converter, StringHelper,
|
|
6
|
+
import { I18n, Is, Converter, StringHelper, GeneralError, Coerce } from '@twin.org/core';
|
|
7
7
|
import { IotaStardustIdentityConnector, IotaStardustIdentityUtils, IotaStardustIdentityResolverConnector } from '@twin.org/identity-connector-iota-stardust';
|
|
8
8
|
import { VaultConnectorFactory, VaultKeyType } from '@twin.org/vault-models';
|
|
9
9
|
import { WalletConnectorFactory } from '@twin.org/wallet-models';
|
|
@@ -13,7 +13,7 @@ import { EntityStorageConnectorFactory } from '@twin.org/entity-storage-models';
|
|
|
13
13
|
import { IotaIdentityConnector } from '@twin.org/identity-connector-iota';
|
|
14
14
|
import { initSchema, EntityStorageVaultConnector } from '@twin.org/vault-connector-entity-storage';
|
|
15
15
|
import { DocumentHelper } from '@twin.org/identity-models';
|
|
16
|
-
import {
|
|
16
|
+
import { ProofTypes, DidVerificationMethodType } from '@twin.org/standards-w3c-did';
|
|
17
17
|
|
|
18
18
|
// Copyright 2024 IOTA Stiftung.
|
|
19
19
|
// SPDX-License-Identifier: Apache-2.0.
|
|
@@ -263,7 +263,7 @@ function buildCommandProofCreate() {
|
|
|
263
263
|
.description(I18n.formatMessage("commands.proof-create.description"))
|
|
264
264
|
.requiredOption(I18n.formatMessage("commands.proof-create.options.id.param"), I18n.formatMessage("commands.proof-create.options.id.description"))
|
|
265
265
|
.requiredOption(I18n.formatMessage("commands.proof-create.options.private-key.param"), I18n.formatMessage("commands.proof-create.options.private-key.description"))
|
|
266
|
-
.requiredOption(I18n.formatMessage("commands.proof-create.options.
|
|
266
|
+
.requiredOption(I18n.formatMessage("commands.proof-create.options.document-filename.param"), I18n.formatMessage("commands.proof-create.options.document-filename.description"));
|
|
267
267
|
CLIOptions.output(command, {
|
|
268
268
|
noConsole: true,
|
|
269
269
|
json: true,
|
|
@@ -293,12 +293,13 @@ function buildCommandProofCreate() {
|
|
|
293
293
|
async function actionCommandProofCreate(opts) {
|
|
294
294
|
const id = CLIParam.stringValue("id", opts.id);
|
|
295
295
|
const privateKey = CLIParam.hexBase64("private-key", opts.privateKey);
|
|
296
|
-
const
|
|
296
|
+
const documentFilename = path.resolve(CLIParam.stringValue("document-filename", opts.documentFilename));
|
|
297
297
|
const nodeEndpoint = CLIParam.url("node", opts.node);
|
|
298
298
|
const network = opts.connector === IdentityConnectorTypes.Iota
|
|
299
299
|
? CLIParam.stringValue("network", opts.network)
|
|
300
300
|
: undefined;
|
|
301
301
|
CLIDisplay.value(I18n.formatMessage("commands.proof-create.labels.verificationMethodId"), id);
|
|
302
|
+
CLIDisplay.value(I18n.formatMessage("commands.proof-create.labels.documentFilename"), documentFilename);
|
|
302
303
|
CLIDisplay.value(I18n.formatMessage("commands.common.labels.node"), nodeEndpoint);
|
|
303
304
|
if (Is.stringValue(network)) {
|
|
304
305
|
CLIDisplay.value(I18n.formatMessage("commands.common.labels.network"), network);
|
|
@@ -315,17 +316,21 @@ async function actionCommandProofCreate(opts) {
|
|
|
315
316
|
CLIDisplay.task(I18n.formatMessage("commands.proof-create.progress.creatingProof"));
|
|
316
317
|
CLIDisplay.break();
|
|
317
318
|
CLIDisplay.spinnerStart();
|
|
318
|
-
const
|
|
319
|
+
const document = await CLIUtils.readJsonFile(documentFilename);
|
|
320
|
+
if (Is.undefined(document)) {
|
|
321
|
+
throw new GeneralError("commands", "commands.proof-create.documentJsonFileNotFound");
|
|
322
|
+
}
|
|
323
|
+
const proof = await identityConnector.createProof(localIdentity, id, ProofTypes.DataIntegrityProof, document);
|
|
319
324
|
CLIDisplay.spinnerStop();
|
|
320
325
|
if (opts.console) {
|
|
321
326
|
CLIDisplay.json(proof);
|
|
322
327
|
CLIDisplay.break();
|
|
323
328
|
}
|
|
324
329
|
if (Is.stringValue(opts?.json)) {
|
|
325
|
-
await CLIUtils.writeJsonFile(opts.json,
|
|
330
|
+
await CLIUtils.writeJsonFile(opts.json, proof, opts.mergeJson);
|
|
326
331
|
}
|
|
327
332
|
if (Is.stringValue(opts?.env)) {
|
|
328
|
-
await CLIUtils.writeEnvFile(opts.env, [`
|
|
333
|
+
await CLIUtils.writeEnvFile(opts.env, [`DID_PROOF='${JSON.stringify(proof)}'`], opts.mergeEnv);
|
|
329
334
|
}
|
|
330
335
|
CLIDisplay.done();
|
|
331
336
|
}
|
|
@@ -342,10 +347,8 @@ function buildCommandProofVerify() {
|
|
|
342
347
|
.name("proof-verify")
|
|
343
348
|
.summary(I18n.formatMessage("commands.proof-verify.summary"))
|
|
344
349
|
.description(I18n.formatMessage("commands.proof-verify.description"))
|
|
345
|
-
.requiredOption(I18n.formatMessage("commands.proof-verify.options.
|
|
346
|
-
.requiredOption(I18n.formatMessage("commands.proof-verify.options.
|
|
347
|
-
.requiredOption(I18n.formatMessage("commands.proof-verify.options.cryptosuite.param"), I18n.formatMessage("commands.proof-verify.options.cryptosuite.description"))
|
|
348
|
-
.requiredOption(I18n.formatMessage("commands.proof-verify.options.value.param"), I18n.formatMessage("commands.proof-verify.options.value.description"));
|
|
350
|
+
.requiredOption(I18n.formatMessage("commands.proof-verify.options.document-filename.param"), I18n.formatMessage("commands.proof-verify.options.document-filename.description"))
|
|
351
|
+
.requiredOption(I18n.formatMessage("commands.proof-verify.options.proof-filename.param"), I18n.formatMessage("commands.proof-verify.options.proof-filename.description"));
|
|
349
352
|
CLIOptions.output(command, {
|
|
350
353
|
noConsole: true,
|
|
351
354
|
json: true,
|
|
@@ -366,25 +369,21 @@ function buildCommandProofVerify() {
|
|
|
366
369
|
* Action the proof verify command.
|
|
367
370
|
* @param opts The options for the command.
|
|
368
371
|
* @param opts.id The id of the verification method to use for the credential.
|
|
369
|
-
* @param opts.
|
|
370
|
-
* @param opts.
|
|
371
|
-
* @param opts.value The proof value.
|
|
372
|
+
* @param opts.documentFilename The data to verify the proof for.
|
|
373
|
+
* @param opts.proofFilename The proof value.
|
|
372
374
|
* @param opts.connector The connector to perform the operations with.
|
|
373
375
|
* @param opts.node The node URL.
|
|
374
376
|
* @param opts.network The network to use for connector.
|
|
375
377
|
*/
|
|
376
378
|
async function actionCommandProofVerify(opts) {
|
|
377
|
-
const
|
|
378
|
-
const
|
|
379
|
-
const cryptosuite = CLIParam.stringValue("cryptosuite", opts.cryptosuite);
|
|
380
|
-
const value = CLIParam.stringValue("value", opts.value);
|
|
379
|
+
const documentFilename = path.resolve(CLIParam.stringValue("document-filename", opts.documentFilename));
|
|
380
|
+
const proofFilename = path.resolve(CLIParam.stringValue("proof-filename", opts.proofFilename));
|
|
381
381
|
const nodeEndpoint = CLIParam.url("node", opts.node);
|
|
382
382
|
const network = opts.connector === IdentityConnectorTypes.Iota
|
|
383
383
|
? CLIParam.stringValue("network", opts.network)
|
|
384
384
|
: undefined;
|
|
385
|
-
CLIDisplay.value(I18n.formatMessage("commands.proof-verify.labels.
|
|
386
|
-
CLIDisplay.value(I18n.formatMessage("commands.proof-verify.labels.
|
|
387
|
-
CLIDisplay.value(I18n.formatMessage("commands.proof-verify.labels.value"), value);
|
|
385
|
+
CLIDisplay.value(I18n.formatMessage("commands.proof-verify.labels.documentFilename"), documentFilename);
|
|
386
|
+
CLIDisplay.value(I18n.formatMessage("commands.proof-verify.labels.proofFilename"), proofFilename);
|
|
388
387
|
CLIDisplay.value(I18n.formatMessage("commands.common.labels.node"), nodeEndpoint);
|
|
389
388
|
if (Is.stringValue(network)) {
|
|
390
389
|
CLIDisplay.value(I18n.formatMessage("commands.common.labels.network"), network);
|
|
@@ -397,15 +396,15 @@ async function actionCommandProofVerify(opts) {
|
|
|
397
396
|
CLIDisplay.task(I18n.formatMessage("commands.proof-verify.progress.verifyingProof"));
|
|
398
397
|
CLIDisplay.break();
|
|
399
398
|
CLIDisplay.spinnerStart();
|
|
400
|
-
const
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
}
|
|
408
|
-
const isVerified = await identityConnector.verifyProof(
|
|
399
|
+
const document = await CLIUtils.readJsonFile(documentFilename);
|
|
400
|
+
if (Is.undefined(document)) {
|
|
401
|
+
throw new GeneralError("commands", "commands.proof-verify.documentJsonFileNotFound");
|
|
402
|
+
}
|
|
403
|
+
const proof = await CLIUtils.readJsonFile(proofFilename);
|
|
404
|
+
if (Is.undefined(proof)) {
|
|
405
|
+
throw new GeneralError("commands", "commands.proof-verify.proofJsonFileNotFound");
|
|
406
|
+
}
|
|
407
|
+
const isVerified = await identityConnector.verifyProof(document, proof);
|
|
409
408
|
CLIDisplay.spinnerStop();
|
|
410
409
|
if (opts.console) {
|
|
411
410
|
CLIDisplay.value(I18n.formatMessage("commands.proof-verify.labels.isVerified"), isVerified);
|
|
@@ -1090,7 +1089,7 @@ class CLI extends CLIBase {
|
|
|
1090
1089
|
return this.execute({
|
|
1091
1090
|
title: "TWIN Identity",
|
|
1092
1091
|
appName: "twin-identity",
|
|
1093
|
-
version: "0.0.1-next.
|
|
1092
|
+
version: "0.0.1-next.29",
|
|
1094
1093
|
icon: "🌍",
|
|
1095
1094
|
supportsEnvFiles: true,
|
|
1096
1095
|
overrideOutputWidth: options?.overrideOutputWidth
|
package/dist/locales/en.json
CHANGED
|
@@ -181,11 +181,19 @@
|
|
|
181
181
|
},
|
|
182
182
|
"verifiable-credential-create": {
|
|
183
183
|
"subjectJsonFileNotFound": "The subject JSON file was not found."
|
|
184
|
+
},
|
|
185
|
+
"proof-create": {
|
|
186
|
+
"documentJsonFileNotFound": "The document JSON file was not found.",
|
|
187
|
+
"proofJsonFileNotFound": "The proof JSON file was not found."
|
|
184
188
|
}
|
|
185
189
|
},
|
|
186
190
|
"entitySchemaHelper": {
|
|
187
191
|
"noIsPrimary": "Property \"entitySchema.properties\" must contain a value with isPrimary set",
|
|
188
|
-
"multipleIsPrimary": "Property \"entitySchema.properties\" contains more than one property with isPrimary set"
|
|
192
|
+
"multipleIsPrimary": "Property \"entitySchema.properties\" contains more than one property with isPrimary set",
|
|
193
|
+
"invalidEntityProperties": "The schema has no properties defined, but the entity has properties",
|
|
194
|
+
"invalidEntityProperty": "The entity value of \"{value}\" does not match the type \"{type}\" for property \"{property}\"",
|
|
195
|
+
"invalidOptional": "The entity property \"{property}\" of type \"{type}\" is not optional, but no value has been provided",
|
|
196
|
+
"invalidEntityKeys": "The entity had additional properties that are not in the schema, \"{keys}\""
|
|
189
197
|
},
|
|
190
198
|
"fetchHelper": {
|
|
191
199
|
"decodingJSON": "Decoding JSON failed for route \"{route}\"",
|
|
@@ -196,15 +204,57 @@
|
|
|
196
204
|
},
|
|
197
205
|
"jwt": {
|
|
198
206
|
"noKeyOrSigner": "No key or signer was provided for JWT creation",
|
|
199
|
-
"noKeyOrVerifier": "No key or verifier was provided for JWT creation"
|
|
207
|
+
"noKeyOrVerifier": "No key or verifier was provided for JWT creation",
|
|
208
|
+
"verifyFailed": "Failed to verify JWT",
|
|
209
|
+
"invalidTokenParts": "The JSON Web Token could not be parsed, it should contain three parts separated by dots",
|
|
210
|
+
"invalidSigningBytes": "The signing bytes are invalid, it should contain two parts separated by a dot"
|
|
211
|
+
},
|
|
212
|
+
"jwk": {
|
|
213
|
+
"jwkImportFailed": "Failed to import JWK"
|
|
200
214
|
},
|
|
201
|
-
"
|
|
215
|
+
"jws": {
|
|
216
|
+
"createFailed": "Failed to create JWS",
|
|
217
|
+
"verifyFailed": "Failed to verify JWS"
|
|
218
|
+
},
|
|
219
|
+
"verificationHelper": {
|
|
202
220
|
"jwtDecodeFailed": "Decoding the JWT failed",
|
|
203
|
-
"
|
|
221
|
+
"proofTypeNotSupported": "The proof type \"{proofType}\" is not supported",
|
|
222
|
+
"proofMissingVerificationMethod": "The proof is missing the verification method"
|
|
223
|
+
},
|
|
224
|
+
"documentHelper": {
|
|
225
|
+
"verificationMethodNotFound": "The verification method \"{methodName}\" of type \"{methodType}\" could not be found",
|
|
226
|
+
"verificationMethodJwkNotFound": "The verification method \"{methodName}\" of type \"{methodType}\" is missing the JWK"
|
|
227
|
+
},
|
|
228
|
+
"proofHelper": {
|
|
229
|
+
"unsupportedProofType": "Proof type \"{proofType}\" not supported.",
|
|
230
|
+
"proofMissing": "Proof is missing."
|
|
231
|
+
},
|
|
232
|
+
"jsonWebSignature2020SignerVerifier": {
|
|
233
|
+
"missingPrivateKey": "Private key is missing.",
|
|
234
|
+
"missingPublicKey": "Public key is missing.",
|
|
235
|
+
"missingProofValue": "Proof value is missing."
|
|
236
|
+
},
|
|
237
|
+
"dataIntegrityProofSignerVerifier": {
|
|
238
|
+
"cryptosuiteNotSupported": "Cryptosuite \"{cryptosuite}\" is not supported.",
|
|
239
|
+
"missingPrivateKey": "Private key is missing.",
|
|
240
|
+
"missingPublicKey": "Public key is missing.",
|
|
241
|
+
"missingProofValue": "Proof value is missing."
|
|
242
|
+
},
|
|
243
|
+
"multikeyHelper": {
|
|
244
|
+
"invalidPublicKeyMultibase": "Public key multibase \"{publicKeyMultibase}\" is invalid.",
|
|
245
|
+
"invalidSecretKeyMultibase": "Secret key multibase \"{secretKeyMultibase}\" is invalid.",
|
|
246
|
+
"unsupportedCrv": "Curve \"{crv}\" is not supported.",
|
|
247
|
+
"unsupportedKty": "Key type \"{kty}\" is not supported.",
|
|
248
|
+
"publicKeyMultibaseMissingHeader": "Public key multibase \"{publicKeyMultibase}\" is missing the multi codec header",
|
|
249
|
+
"secretKeyMultibaseMissingHeader": "Secret key multibase \"{secretKeyMultibase}\" is missing the multi codec header"
|
|
204
250
|
},
|
|
205
251
|
"iotaIdentityResolverConnector": {
|
|
206
252
|
"documentNotFound": "The document could not be found",
|
|
207
|
-
"resolveDocumentFailed": "Resolving the document failed"
|
|
253
|
+
"resolveDocumentFailed": "Resolving the document failed \"{documentId}\""
|
|
254
|
+
},
|
|
255
|
+
"iotaUniversalResolverConnector": {
|
|
256
|
+
"documentNotFound": "The document could not be found",
|
|
257
|
+
"resolveDocumentFailed": "Resolving the document failed \"{documentId}\""
|
|
208
258
|
},
|
|
209
259
|
"iotaIdentityConnector": {
|
|
210
260
|
"createDocumentFailed": "Creating the document failed",
|
|
@@ -243,6 +293,9 @@
|
|
|
243
293
|
"nftTransactionFailed": "The NFT transaction failed",
|
|
244
294
|
"addressNotFound": "The address is missing could not be found from the seed \"{address}\""
|
|
245
295
|
},
|
|
296
|
+
"vaultConnectorHelper": {
|
|
297
|
+
"invalidSignature": "The JSON Web token signature could not be verified"
|
|
298
|
+
},
|
|
246
299
|
"iotaStardustIdentityResolverConnector": {
|
|
247
300
|
"documentNotFound": "The document could not be found",
|
|
248
301
|
"resolveDocumentFailed": "Resolving the document failed"
|
|
@@ -801,15 +854,16 @@
|
|
|
801
854
|
"param": "--private-key '<'private-key'>'",
|
|
802
855
|
"description": "The private key for the verification method id, in either hex or base64 form, or start with ! to read environment variable."
|
|
803
856
|
},
|
|
804
|
-
"
|
|
805
|
-
"param": "--
|
|
806
|
-
"description": "The
|
|
857
|
+
"document-filename": {
|
|
858
|
+
"param": "--document-filename '<'document-filename'>'",
|
|
859
|
+
"description": "The filename of a JSON-LD document to create the proof for."
|
|
807
860
|
}
|
|
808
861
|
},
|
|
809
862
|
"progress": {
|
|
810
863
|
"creatingProof": "Creating Proof"
|
|
811
864
|
},
|
|
812
865
|
"labels": {
|
|
866
|
+
"documentFilename": "Document Filename",
|
|
813
867
|
"verificationMethodId": "Verification Method Id"
|
|
814
868
|
}
|
|
815
869
|
},
|
|
@@ -817,30 +871,21 @@
|
|
|
817
871
|
"summary": "Verify a proof for some data using a verification method.",
|
|
818
872
|
"description": "Verify a proof for some data using a verification method.",
|
|
819
873
|
"options": {
|
|
820
|
-
"
|
|
821
|
-
"param": "--
|
|
822
|
-
"description": "The
|
|
874
|
+
"document-filename": {
|
|
875
|
+
"param": "--document-filename '<'document-filename'>'",
|
|
876
|
+
"description": "The filename of a JSON-LD document to create the proof for."
|
|
823
877
|
},
|
|
824
|
-
"
|
|
825
|
-
"param": "--
|
|
826
|
-
"description": "The
|
|
827
|
-
},
|
|
828
|
-
"cryptosuite": {
|
|
829
|
-
"param": "--cryptosuite '<'cryptosuite'>'",
|
|
830
|
-
"description": "The cryptosuite of the proof, or start with ! to read environment variable."
|
|
831
|
-
},
|
|
832
|
-
"value": {
|
|
833
|
-
"param": "--value '<'value'>'",
|
|
834
|
-
"description": "The base64 or hex encoded data to use for verifying the proof, or start with ! to read environment variable."
|
|
878
|
+
"proof-filename": {
|
|
879
|
+
"param": "--proof-filename '<'proof-filename'>'",
|
|
880
|
+
"description": "The filename of the proof JSON."
|
|
835
881
|
}
|
|
836
882
|
},
|
|
837
883
|
"progress": {
|
|
838
884
|
"verifyingProof": "Verifying Proof"
|
|
839
885
|
},
|
|
840
886
|
"labels": {
|
|
841
|
-
"
|
|
842
|
-
"
|
|
843
|
-
"value": "Proof Value",
|
|
887
|
+
"documentFilename": "Document Filename",
|
|
888
|
+
"proofFilename": "Proof Filename",
|
|
844
889
|
"isVerified": "Is Verified"
|
|
845
890
|
}
|
|
846
891
|
}
|
|
@@ -848,6 +893,7 @@
|
|
|
848
893
|
"jsonLdProcessor": {
|
|
849
894
|
"compact": "The JSON-LD compaction failed",
|
|
850
895
|
"expand": "The JSON-LD expansion failed",
|
|
896
|
+
"canonize": "The JSON-LD canonization failed",
|
|
851
897
|
"invalidUrl": "The JSON-LD processing failed to retrieve from the following url \"{url}\"",
|
|
852
898
|
"jsonldError": "The JSON-LD processing failed due to the following error: \"{code}\""
|
|
853
899
|
},
|
|
@@ -19,7 +19,7 @@ export declare function buildCommandProofCreate(): Command;
|
|
|
19
19
|
export declare function actionCommandProofCreate(opts: {
|
|
20
20
|
id: string;
|
|
21
21
|
privateKey: string;
|
|
22
|
-
|
|
22
|
+
documentFilename: string;
|
|
23
23
|
connector?: IdentityConnectorTypes;
|
|
24
24
|
node: string;
|
|
25
25
|
network?: string;
|
|
@@ -10,18 +10,15 @@ export declare function buildCommandProofVerify(): Command;
|
|
|
10
10
|
* Action the proof verify command.
|
|
11
11
|
* @param opts The options for the command.
|
|
12
12
|
* @param opts.id The id of the verification method to use for the credential.
|
|
13
|
-
* @param opts.
|
|
14
|
-
* @param opts.
|
|
15
|
-
* @param opts.value The proof value.
|
|
13
|
+
* @param opts.documentFilename The data to verify the proof for.
|
|
14
|
+
* @param opts.proofFilename The proof value.
|
|
16
15
|
* @param opts.connector The connector to perform the operations with.
|
|
17
16
|
* @param opts.node The node URL.
|
|
18
17
|
* @param opts.network The network to use for connector.
|
|
19
18
|
*/
|
|
20
19
|
export declare function actionCommandProofVerify(opts: {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
cryptosuite: string;
|
|
24
|
-
value: string;
|
|
20
|
+
documentFilename: string;
|
|
21
|
+
proofFilename: string;
|
|
25
22
|
connector?: IdentityConnectorTypes;
|
|
26
23
|
node: string;
|
|
27
24
|
network?: string;
|
package/docs/changelog.md
CHANGED
package/docs/examples.md
CHANGED
|
@@ -197,15 +197,15 @@ twin-identity verifiable-credential-unrevoke --load-env config.env wallet.env id
|
|
|
197
197
|
This command will generate a proof using the specified verification method.
|
|
198
198
|
|
|
199
199
|
```shell
|
|
200
|
-
twin-identity proof-create --load-env config.env verification-method.env --id !DID_VERIFICATION_METHOD_ID --private-key !DID_VERIFICATION_METHOD_PRIVATE_KEY --data
|
|
200
|
+
twin-identity proof-create --load-env config.env verification-method.env --id !DID_VERIFICATION_METHOD_ID --private-key !DID_VERIFICATION_METHOD_PRIVATE_KEY --document-filename unsecured.json --json data-proof.json
|
|
201
201
|
```
|
|
202
202
|
|
|
203
|
-
This will output the proof
|
|
203
|
+
This will output the proof.
|
|
204
204
|
|
|
205
205
|
## proof-verify
|
|
206
206
|
|
|
207
|
-
This command will verify a proof
|
|
207
|
+
This command will verify a proof for a document.
|
|
208
208
|
|
|
209
209
|
```shell
|
|
210
|
-
twin-identity proof-verify --load-env config.env verification-method.env --id !DID_VERIFICATION_METHOD_ID --
|
|
210
|
+
twin-identity proof-verify --load-env config.env verification-method.env --id !DID_VERIFICATION_METHOD_ID --document-filename unsecured.json --proof-filename data-proof.json
|
|
211
211
|
```
|
package/locales/en.json
CHANGED
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
"commands": {
|
|
4
4
|
"verifiable-credential-create": {
|
|
5
5
|
"subjectJsonFileNotFound": "The subject JSON file was not found."
|
|
6
|
+
},
|
|
7
|
+
"proof-create": {
|
|
8
|
+
"documentJsonFileNotFound": "The document JSON file was not found.",
|
|
9
|
+
"proofJsonFileNotFound": "The proof JSON file was not found."
|
|
6
10
|
}
|
|
7
11
|
}
|
|
8
12
|
},
|
|
@@ -268,15 +272,16 @@
|
|
|
268
272
|
"param": "--private-key '<'private-key'>'",
|
|
269
273
|
"description": "The private key for the verification method id, in either hex or base64 form, or start with ! to read environment variable."
|
|
270
274
|
},
|
|
271
|
-
"
|
|
272
|
-
"param": "--
|
|
273
|
-
"description": "The
|
|
275
|
+
"document-filename": {
|
|
276
|
+
"param": "--document-filename '<'document-filename'>'",
|
|
277
|
+
"description": "The filename of a JSON-LD document to create the proof for."
|
|
274
278
|
}
|
|
275
279
|
},
|
|
276
280
|
"progress": {
|
|
277
281
|
"creatingProof": "Creating Proof"
|
|
278
282
|
},
|
|
279
283
|
"labels": {
|
|
284
|
+
"documentFilename": "Document Filename",
|
|
280
285
|
"verificationMethodId": "Verification Method Id"
|
|
281
286
|
}
|
|
282
287
|
},
|
|
@@ -284,30 +289,21 @@
|
|
|
284
289
|
"summary": "Verify a proof for some data using a verification method.",
|
|
285
290
|
"description": "Verify a proof for some data using a verification method.",
|
|
286
291
|
"options": {
|
|
287
|
-
"
|
|
288
|
-
"param": "--
|
|
289
|
-
"description": "The
|
|
292
|
+
"document-filename": {
|
|
293
|
+
"param": "--document-filename '<'document-filename'>'",
|
|
294
|
+
"description": "The filename of a JSON-LD document to create the proof for."
|
|
290
295
|
},
|
|
291
|
-
"
|
|
292
|
-
"param": "--
|
|
293
|
-
"description": "The
|
|
294
|
-
},
|
|
295
|
-
"cryptosuite": {
|
|
296
|
-
"param": "--cryptosuite '<'cryptosuite'>'",
|
|
297
|
-
"description": "The cryptosuite of the proof, or start with ! to read environment variable."
|
|
298
|
-
},
|
|
299
|
-
"value": {
|
|
300
|
-
"param": "--value '<'value'>'",
|
|
301
|
-
"description": "The base64 or hex encoded data to use for verifying the proof, or start with ! to read environment variable."
|
|
296
|
+
"proof-filename": {
|
|
297
|
+
"param": "--proof-filename '<'proof-filename'>'",
|
|
298
|
+
"description": "The filename of the proof JSON."
|
|
302
299
|
}
|
|
303
300
|
},
|
|
304
301
|
"progress": {
|
|
305
302
|
"verifyingProof": "Verifying Proof"
|
|
306
303
|
},
|
|
307
304
|
"labels": {
|
|
308
|
-
"
|
|
309
|
-
"
|
|
310
|
-
"value": "Proof Value",
|
|
305
|
+
"documentFilename": "Document Filename",
|
|
306
|
+
"proofFilename": "Proof Filename",
|
|
311
307
|
"isVerified": "Is Verified"
|
|
312
308
|
}
|
|
313
309
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/identity-cli",
|
|
3
|
-
"version": "0.0.1-next.
|
|
3
|
+
"version": "0.0.1-next.29",
|
|
4
4
|
"description": "A command line interface for interacting with the identity connectors",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
"@twin.org/data-json-ld": "next",
|
|
23
23
|
"@twin.org/entity": "next",
|
|
24
24
|
"@twin.org/entity-storage-connector-memory": "next",
|
|
25
|
-
"@twin.org/identity-connector-iota": "0.0.1-next.
|
|
26
|
-
"@twin.org/identity-connector-iota-stardust": "0.0.1-next.
|
|
27
|
-
"@twin.org/identity-models": "0.0.1-next.
|
|
25
|
+
"@twin.org/identity-connector-iota": "0.0.1-next.29",
|
|
26
|
+
"@twin.org/identity-connector-iota-stardust": "0.0.1-next.29",
|
|
27
|
+
"@twin.org/identity-models": "0.0.1-next.29",
|
|
28
28
|
"@twin.org/nameof": "next",
|
|
29
29
|
"@twin.org/standards-w3c-did": "next",
|
|
30
30
|
"@twin.org/vault-connector-entity-storage": "next",
|