@veramo/credential-ld 3.1.1-next.9 → 3.1.2-next.100
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/action-handler.d.ts.map +1 -1
- package/build/action-handler.js +2 -2
- package/build/action-handler.js.map +1 -1
- package/build/index.js +5 -1
- package/build/index.js.map +1 -1
- package/build/ld-context-loader.d.ts +2 -2
- package/build/ld-context-loader.d.ts.map +1 -1
- package/build/ld-context-loader.js +9 -2
- package/build/ld-context-loader.js.map +1 -1
- package/build/ld-credential-module.d.ts +3 -3
- package/build/ld-credential-module.d.ts.map +1 -1
- package/build/ld-credential-module.js +41 -8
- package/build/ld-credential-module.js.map +1 -1
- package/build/ld-default-contexts.d.ts +5 -1
- package/build/ld-default-contexts.d.ts.map +1 -1
- package/build/ld-default-contexts.js +30 -13
- package/build/ld-default-contexts.js.map +1 -1
- package/build/suites/EcdsaSecp256k1RecoverySignature2020.js +5 -1
- package/build/suites/EcdsaSecp256k1RecoverySignature2020.js.map +1 -1
- package/build/suites/Ed25519Signature2018.js +5 -1
- package/build/suites/Ed25519Signature2018.js.map +1 -1
- package/build/tsdoc-metadata.json +1 -1
- package/build/types.d.ts +12 -0
- package/build/types.d.ts.map +1 -1
- package/contexts/{X25519KeyAgreementKey2019.jsonld → X25519KeyAgreementKey2019.json} +0 -0
- package/contexts/{did_v0.11.jsonld → did_v0.11.json} +0 -0
- package/contexts/{ed25519-signature-2018-v1.jsonld → ed25519-signature-2018-v1.json} +0 -0
- package/contexts/{kyc-v1.jsonld → kyc-v1.json} +0 -0
- package/contexts/{lds-ecdsa-secp256k1-recovery2020-0.0.jsonld → lds-ecdsa-secp256k1-recovery2020-0.0.json} +0 -0
- package/contexts/{profile-v1.jsonld → profile-v1.json} +0 -0
- package/contexts/{security_context_v1.jsonld → security_context_v1.json} +0 -0
- package/contexts/{socialmedia-v1.jsonld → socialmedia-v1.json} +0 -0
- package/contexts/{transmute_v1.jsonld → transmute_v1.json} +0 -0
- package/contexts/w3_2018_credentials_v1.json +237 -0
- package/package.json +14 -14
- package/plugin.schema.json +10 -0
- package/src/__tests__/context.loader.test.ts +39 -0
- package/src/__tests__/issue-verify-flow.test.ts +84 -0
- package/src/action-handler.ts +8 -2
- package/src/ld-context-loader.ts +7 -6
- package/src/ld-credential-module.ts +38 -5
- package/src/ld-default-contexts.ts +17 -13
- package/src/types.ts +14 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action-handler.d.ts","sourceRoot":"","sources":["../src/action-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,YAAY,EAKZ,oBAAoB,EACpB,sBAAsB,EACvB,MAAM,cAAc,CAAA;AACrB,OAAO,EAAU,iBAAiB,EAAE,MAAM,IAAI,CAAA;AAG9C,OAAO,EAML,SAAS,EAET,UAAU,EACX,MAAM,eAAe,CAAA;AAItB,OAAO,EACL,UAAU,EACV,iCAAiC,EACjC,mCAAmC,EACnC,mBAAmB,EACnB,gBAAgB,EAChB,uBAAuB,EACvB,yBAAyB,EAC1B,MAAM,SAAS,CAAA;AAIhB;;;;GAIG;AACH,qBAAa,kBAAmB,YAAW,YAAY;IACrD,QAAQ,CAAC,OAAO,EAAE,mBAAmB,CAAA;IACrC,QAAQ,CAAC,MAAM,MAA2B;IAE1C,OAAO,CAAC,kBAAkB,CAAoB;gBAElC,OAAO,EAAE;QAAE,WAAW,EAAE,UAAU,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC;QAAC,MAAM,EAAE,iBAAiB,EAAE,CAAA;KAAE;IActG,uEAAuE;IAC1D,8BAA8B,CACzC,IAAI,EAAE,mCAAmC,EACzC,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,sBAAsB,CAAC;IA2DlC,qEAAqE;IACxD,4BAA4B,CACvC,IAAI,EAAE,iCAAiC,EACvC,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,oBAAoB,CAAC;IAgDhC,2DAA2D;IAC9C,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,OAAO,CAAC,OAAO,CAAC;IAKnB,6DAA6D;IAChD,oBAAoB,CAC/B,IAAI,EAAE,yBAAyB,EAC/B,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,OAAO,CAAC;YAWL,oBAAoB;CA+BnC"}
|
package/build/action-handler.js
CHANGED
|
@@ -115,14 +115,14 @@ class CredentialIssuerLD {
|
|
|
115
115
|
verifyCredentialLD(args, context) {
|
|
116
116
|
return __awaiter(this, void 0, void 0, function* () {
|
|
117
117
|
const credential = args.credential;
|
|
118
|
-
return this.ldCredentialModule.verifyCredential(credential, context);
|
|
118
|
+
return this.ldCredentialModule.verifyCredential(credential, args.fetchRemoteContexts || false, context);
|
|
119
119
|
});
|
|
120
120
|
}
|
|
121
121
|
/** {@inheritdoc ICredentialIssuerLD.verifyPresentationLD} */
|
|
122
122
|
verifyPresentationLD(args, context) {
|
|
123
123
|
return __awaiter(this, void 0, void 0, function* () {
|
|
124
124
|
const presentation = args.presentation;
|
|
125
|
-
return this.ldCredentialModule.verifyPresentation(presentation, args.challenge, args.domain, context);
|
|
125
|
+
return this.ldCredentialModule.verifyPresentation(presentation, args.challenge, args.domain, args.fetchRemoteContexts || false, context);
|
|
126
126
|
});
|
|
127
127
|
}
|
|
128
128
|
findSigningKeyWithId(context, identifier, keyRef) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action-handler.js","sourceRoot":"","sources":["../src/action-handler.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAWA,yBAA8C;AAC9C,kDAAyB;AACzB,2DAAqD;AACrD,yCASsB;AAEtB,iEAA2D;AAC3D,uDAAiD;AAWjD,MAAM,KAAK,GAAG,IAAA,eAAK,EAAC,2BAA2B,CAAC,CAAA;AAEhD;;;;GAIG;AACH,MAAa,kBAAkB;IAM7B,YAAY,OAA0F;QAJ7F,WAAM,GAAG,SAAM,CAAC,iBAAiB,CAAA;QAKxC,IAAI,CAAC,kBAAkB,GAAG,IAAI,yCAAkB,CAAC;Y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AkB,CAAC,EAAE,CAAA;YAC5D,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,CAAA;QAC7C,CAAC;KAAA;CACF;AA9LD,gDA8LC"}
|
package/build/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
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
|
-
Object.
|
|
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);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
package/build/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;;;;;GAKG;AACH,mDAAqD;AAA5C,oHAAA,kBAAkB,OAAA;AAC3B,0CAAuB;AACvB,6DAAyD;AAAhD,wHAAA,iBAAiB,OAAA;AAC1B,yCAA+C;AAAtC,8GAAA,iBAAiB,OAAA;AAC1B,+EAA4D;AAC5D,gEAA6C;AAC7C,MAAM,MAAM,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAA;AACtC,wBAAM"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The LdContextLoader is initialized with a List of Map<string, ContextDoc
|
|
2
|
+
* The LdContextLoader is initialized with a List of Map<string, ContextDoc | Promise<ContextDoc>>
|
|
3
3
|
* that it unifies into a single Map to provide to the documentLoader within
|
|
4
4
|
* the w3c credential module.
|
|
5
5
|
*/
|
|
6
6
|
import { OrPromise, RecordLike } from '@veramo/utils';
|
|
7
7
|
import { ContextDoc } from './types';
|
|
8
8
|
export declare class LdContextLoader {
|
|
9
|
-
private contexts;
|
|
9
|
+
private readonly contexts;
|
|
10
10
|
constructor(options: {
|
|
11
11
|
contextsPaths: RecordLike<OrPromise<ContextDoc>>[];
|
|
12
12
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ld-context-loader.d.ts","sourceRoot":"","sources":["../src/ld-context-loader.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,
|
|
1
|
+
{"version":3,"file":"ld-context-loader.d.ts","sourceRoot":"","sources":["../src/ld-context-loader.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAc,SAAS,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAEpC,qBAAa,eAAe;IAC1B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAuC;gBAEpD,OAAO,EAAE;QAAE,aAAa,EAAE,UAAU,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,EAAE,CAAA;KAAE;IAW3E,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAInB,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;CAG5C"}
|
|
@@ -10,12 +10,19 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.LdContextLoader = void 0;
|
|
13
|
+
/**
|
|
14
|
+
* The LdContextLoader is initialized with a List of Map<string, ContextDoc | Promise<ContextDoc>>
|
|
15
|
+
* that it unifies into a single Map to provide to the documentLoader within
|
|
16
|
+
* the w3c credential module.
|
|
17
|
+
*/
|
|
18
|
+
const utils_1 = require("@veramo/utils");
|
|
13
19
|
class LdContextLoader {
|
|
14
20
|
constructor(options) {
|
|
15
21
|
this.contexts = {};
|
|
16
|
-
// generate-plugin-schema is failing unless we use the cast to `any[]`
|
|
17
22
|
Array.from(options.contextsPaths, (mapItem) => {
|
|
18
|
-
|
|
23
|
+
const map = (0, utils_1.isIterable)(mapItem) ? mapItem : Object.entries(mapItem);
|
|
24
|
+
// generate-plugin-schema is failing unless we use the cast to `any[]`
|
|
25
|
+
for (const [key, value] of map) {
|
|
19
26
|
this.contexts[key] = value;
|
|
20
27
|
}
|
|
21
28
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ld-context-loader.js","sourceRoot":"","sources":["../src/ld-context-loader.ts"],"names":[],"mappings":";;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"ld-context-loader.js","sourceRoot":"","sources":["../src/ld-context-loader.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;GAIG;AACH,yCAAiE;AAGjE,MAAa,eAAe;IAG1B,YAAY,OAA+D;QACzE,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAA;QAClB,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,CAAC,OAAO,EAAE,EAAE;YAC5C,MAAM,GAAG,GAAG,IAAA,kBAAU,EAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;YACnE,sEAAsE;YACtE,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,GAAY,EAAE;gBACvC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,KAAK,CAAA;aAC3B;QACH,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,GAAG,CAAC,GAAW;QACb,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,IAAI,IAAI,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,WAAW,CAAA;IACjF,CAAC;IAEK,GAAG,CAAC,GAAW;;YACnB,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;QAC3B,CAAC;KAAA;CACF;AArBD,0CAqBC"}
|
|
@@ -16,10 +16,10 @@ export declare class LdCredentialModule {
|
|
|
16
16
|
ldContextLoader: LdContextLoader;
|
|
17
17
|
ldSuiteLoader: LdSuiteLoader;
|
|
18
18
|
});
|
|
19
|
-
getDocumentLoader(context: IAgentContext<IResolver
|
|
19
|
+
getDocumentLoader(context: IAgentContext<IResolver>, attemptToFetchContexts?: boolean): any;
|
|
20
20
|
issueLDVerifiableCredential(credential: CredentialPayload, issuerDid: string, key: IKey, verificationMethodId: string, context: IAgentContext<RequiredAgentMethods>): Promise<VerifiableCredential>;
|
|
21
21
|
signLDVerifiablePresentation(presentation: PresentationPayload, holderDid: string, key: IKey, verificationMethodId: string, challenge: string | undefined, domain: string | undefined, context: IAgentContext<RequiredAgentMethods>): Promise<VerifiablePresentation>;
|
|
22
|
-
verifyCredential(credential: VerifiableCredential, context: IAgentContext<IResolver>): Promise<boolean>;
|
|
23
|
-
verifyPresentation(presentation: VerifiablePresentation, challenge: string | undefined, domain: string | undefined, context: IAgentContext<IResolver>): Promise<boolean>;
|
|
22
|
+
verifyCredential(credential: VerifiableCredential, fetchRemoteContexts: boolean | undefined, context: IAgentContext<IResolver>): Promise<boolean>;
|
|
23
|
+
verifyPresentation(presentation: VerifiablePresentation, challenge: string | undefined, domain: string | undefined, fetchRemoteContexts: boolean | undefined, context: IAgentContext<IResolver>): Promise<boolean>;
|
|
24
24
|
}
|
|
25
25
|
//# sourceMappingURL=ld-credential-module.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ld-credential-module.d.ts","sourceRoot":"","sources":["../src/ld-credential-module.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,IAAI,EACJ,SAAS,EACT,mBAAmB,EAC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AAO,EAAE,aAAa,CAAC,SAAS,CAAC,GAChC,OAAO,CAAC,OAAO,CAAC;IA8Bb,kBAAkB,CACtB,YAAY,EAAE,sBAAsB,EACpC,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,mBAAmB,qBAAiB,EACpC,OAAO,EAAE,aAAa,CAAC,SAAS,CAAC,GAChC,OAAO,CAAC,OAAO,CAAC;CAoBpB"}
|
|
@@ -1,7 +1,11 @@
|
|
|
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
|
-
Object.
|
|
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);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -32,6 +36,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
32
36
|
};
|
|
33
37
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
34
38
|
exports.LdCredentialModule = void 0;
|
|
39
|
+
const cross_fetch_1 = __importDefault(require("cross-fetch"));
|
|
35
40
|
const debug_1 = __importDefault(require("debug"));
|
|
36
41
|
const jsonld_signatures_1 = require("jsonld-signatures");
|
|
37
42
|
const vc = __importStar(require("vc-js"));
|
|
@@ -42,7 +47,7 @@ class LdCredentialModule {
|
|
|
42
47
|
this.ldContextLoader = options.ldContextLoader;
|
|
43
48
|
this.ldSuiteLoader = options.ldSuiteLoader;
|
|
44
49
|
}
|
|
45
|
-
getDocumentLoader(context) {
|
|
50
|
+
getDocumentLoader(context, attemptToFetchContexts = false) {
|
|
46
51
|
return (0, jsonld_signatures_1.extendContextLoader)((url) => __awaiter(this, void 0, void 0, function* () {
|
|
47
52
|
// console.log(`resolving context for: ${url}`)
|
|
48
53
|
// did resolution
|
|
@@ -70,8 +75,27 @@ class LdCredentialModule {
|
|
|
70
75
|
document: contextDoc,
|
|
71
76
|
};
|
|
72
77
|
}
|
|
73
|
-
|
|
74
|
-
|
|
78
|
+
else {
|
|
79
|
+
if (attemptToFetchContexts) {
|
|
80
|
+
// attempt to fetch the remote context!!!! MEGA FAIL for JSON-LD.
|
|
81
|
+
debug('WARNING: attempting to fetch the doc directly for ', url);
|
|
82
|
+
try {
|
|
83
|
+
const response = yield (0, cross_fetch_1.default)(url);
|
|
84
|
+
if (response.status === 200) {
|
|
85
|
+
const document = yield response.json();
|
|
86
|
+
return {
|
|
87
|
+
contextUrl: null,
|
|
88
|
+
documentUrl: url,
|
|
89
|
+
document,
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
catch (e) {
|
|
94
|
+
debug('WARNING: unable to fetch the doc or interpret it as JSON', e);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
debug(`WARNING: Possible unknown context/identifier for ${url} \n falling back to default documentLoader`);
|
|
75
99
|
return vc.defaultDocumentLoader(url);
|
|
76
100
|
}));
|
|
77
101
|
}
|
|
@@ -105,14 +129,23 @@ class LdCredentialModule {
|
|
|
105
129
|
});
|
|
106
130
|
});
|
|
107
131
|
}
|
|
108
|
-
verifyCredential(credential, context) {
|
|
132
|
+
verifyCredential(credential, fetchRemoteContexts = false, context) {
|
|
109
133
|
return __awaiter(this, void 0, void 0, function* () {
|
|
134
|
+
const checkStatusFn = typeof context.agent.checkCredentialStatus === 'function'
|
|
135
|
+
? ({ credential }) => __awaiter(this, void 0, void 0, function* () {
|
|
136
|
+
const result = yield context.agent.checkCredentialStatus({
|
|
137
|
+
credential,
|
|
138
|
+
});
|
|
139
|
+
return { verified: !result.revoked };
|
|
140
|
+
})
|
|
141
|
+
: void 0;
|
|
110
142
|
const result = yield vc.verifyCredential({
|
|
111
143
|
credential,
|
|
112
144
|
suite: this.ldSuiteLoader.getAllSignatureSuites().map((x) => x.getSuiteForVerification()),
|
|
113
|
-
documentLoader: this.getDocumentLoader(context),
|
|
145
|
+
documentLoader: this.getDocumentLoader(context, fetchRemoteContexts),
|
|
114
146
|
purpose: new AssertionProofPurpose(),
|
|
115
147
|
compactProof: false,
|
|
148
|
+
checkStatus: checkStatusFn,
|
|
116
149
|
});
|
|
117
150
|
if (result.verified)
|
|
118
151
|
return true;
|
|
@@ -123,12 +156,12 @@ class LdCredentialModule {
|
|
|
123
156
|
throw Error('Error verifying LD Verifiable Credential');
|
|
124
157
|
});
|
|
125
158
|
}
|
|
126
|
-
verifyPresentation(presentation, challenge, domain, context) {
|
|
159
|
+
verifyPresentation(presentation, challenge, domain, fetchRemoteContexts = false, context) {
|
|
127
160
|
return __awaiter(this, void 0, void 0, function* () {
|
|
128
161
|
const result = yield vc.verify({
|
|
129
162
|
presentation,
|
|
130
163
|
suite: this.ldSuiteLoader.getAllSignatureSuites().map((x) => x.getSuiteForVerification()),
|
|
131
|
-
documentLoader: this.getDocumentLoader(context),
|
|
164
|
+
documentLoader: this.getDocumentLoader(context, fetchRemoteContexts),
|
|
132
165
|
challenge,
|
|
133
166
|
domain,
|
|
134
167
|
purpose: new AssertionProofPurpose(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ld-credential-module.js","sourceRoot":"","sources":["../src/ld-credential-module.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ld-credential-module.js","sourceRoot":"","sources":["../src/ld-credential-module.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,8DAA+B;AAC/B,kDAAyB;AACzB,yDAAiE;AACjE,0CAA2B;AAK3B,MAAM,qBAAqB,GAAG,4BAAQ,CAAC,qBAAqB,CAAA;AAE5D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6 @@
|
|
|
1
|
-
|
|
1
|
+
import { ContextDoc } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Provides a hardcoded map of common context definitions
|
|
4
|
+
*/
|
|
5
|
+
export declare const LdDefaultContexts: Map<string, Promise<ContextDoc>>;
|
|
2
6
|
//# sourceMappingURL=ld-default-contexts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ld-default-contexts.d.ts","sourceRoot":"","sources":["../src/ld-default-contexts.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ld-default-contexts.d.ts","sourceRoot":"","sources":["../src/ld-default-contexts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAMpC;;GAEG;AACH,eAAO,MAAM,iBAAiB,kCAe5B,CAAA"}
|
|
@@ -1,7 +1,11 @@
|
|
|
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
|
-
Object.
|
|
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);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -18,25 +22,38 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
18
22
|
__setModuleDefault(result, mod);
|
|
19
23
|
return result;
|
|
20
24
|
};
|
|
25
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
+
});
|
|
33
|
+
};
|
|
21
34
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
35
|
exports.LdDefaultContexts = void 0;
|
|
23
|
-
const fs = __importStar(require("fs"));
|
|
24
|
-
const path = __importStar(require("path"));
|
|
25
36
|
function _read(_path) {
|
|
26
|
-
return
|
|
37
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
38
|
+
return yield Promise.resolve().then(() => __importStar(require('../contexts/' + _path)));
|
|
39
|
+
});
|
|
27
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* Provides a hardcoded map of common context definitions
|
|
43
|
+
*/
|
|
28
44
|
exports.LdDefaultContexts = new Map([
|
|
29
|
-
['https://
|
|
30
|
-
['https://
|
|
31
|
-
['https://
|
|
32
|
-
['https://
|
|
33
|
-
['https://
|
|
34
|
-
['https://
|
|
45
|
+
['https://www.w3.org/2018/credentials/v1', _read('w3_2018_credentials_v1.json')],
|
|
46
|
+
['https://www.w3.org/ns/did/v1', _read('security_context_v1.json')],
|
|
47
|
+
['https://w3id.org/did/v0.11', _read('did_v0.11.json')],
|
|
48
|
+
['https://veramo.io/contexts/socialmedia/v1', _read('socialmedia-v1.json')],
|
|
49
|
+
['https://veramo.io/contexts/kyc/v1', _read('kyc-v1.json')],
|
|
50
|
+
['https://veramo.io/contexts/profile/v1', _read('profile-v1.json')],
|
|
51
|
+
['https://ns.did.ai/transmute/v1', _read('transmute_v1.json')],
|
|
35
52
|
[
|
|
36
53
|
'https://identity.foundation/EcdsaSecp256k1RecoverySignature2020/lds-ecdsa-secp256k1-recovery2020-0.0.jsonld',
|
|
37
|
-
_read('lds-ecdsa-secp256k1-recovery2020-0.0.
|
|
54
|
+
_read('lds-ecdsa-secp256k1-recovery2020-0.0.json'),
|
|
38
55
|
],
|
|
39
|
-
['https://w3id.org/security/suites/ed25519-2018/v1', _read('ed25519-signature-2018-v1.
|
|
40
|
-
['https://w3id.org/security/suites/x25519-2019/v1', _read('X25519KeyAgreementKey2019.
|
|
56
|
+
['https://w3id.org/security/suites/ed25519-2018/v1', _read('ed25519-signature-2018-v1.json')],
|
|
57
|
+
['https://w3id.org/security/suites/x25519-2019/v1', _read('X25519KeyAgreementKey2019.json')],
|
|
41
58
|
]);
|
|
42
59
|
//# sourceMappingURL=ld-default-contexts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ld-default-contexts.js","sourceRoot":"","sources":["../src/ld-default-contexts.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ld-default-contexts.js","sourceRoot":"","sources":["../src/ld-default-contexts.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,SAAe,KAAK,CAAC,KAAa;;QAChC,OAAO,wDAAa,cAAc,GAAG,KAAK,GAAC,CAAC;IAC9C,CAAC;CAAA;AAED;;GAEG;AACU,QAAA,iBAAiB,GAAG,IAAI,GAAG,CAAC;IACvC,CAAC,wCAAwC,EAAE,KAAK,CAAC,6BAA6B,CAAC,CAAC;IAChF,CAAC,8BAA8B,EAAE,KAAK,CAAC,0BAA0B,CAAC,CAAC;IACnE,CAAC,4BAA4B,EAAE,KAAK,CAAC,gBAAgB,CAAC,CAAC;IAEvD,CAAC,2CAA2C,EAAE,KAAK,CAAC,qBAAqB,CAAC,CAAC;IAC3E,CAAC,mCAAmC,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC;IAC3D,CAAC,uCAAuC,EAAE,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACnE,CAAC,gCAAgC,EAAE,KAAK,CAAC,mBAAmB,CAAC,CAAC;IAC9D;QACE,6GAA6G;QAC7G,KAAK,CAAC,2CAA2C,CAAC;KACnD;IACD,CAAC,kDAAkD,EAAE,KAAK,CAAC,gCAAgC,CAAC,CAAC;IAC7F,CAAC,iDAAiD,EAAE,KAAK,CAAC,gCAAgC,CAAC,CAAC;CAC7F,CAAC,CAAA"}
|
|
@@ -1,7 +1,11 @@
|
|
|
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
|
-
Object.
|
|
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);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EcdsaSecp256k1RecoverySignature2020.js","sourceRoot":"","sources":["../../src/suites/EcdsaSecp256k1RecoverySignature2020.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"EcdsaSecp256k1RecoverySignature2020.js","sourceRoot":"","sources":["../../src/suites/EcdsaSecp256k1RecoverySignature2020.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAAsE;AAEtE,kGAGoD;AAEpD,iDAAkC;AAClC,yCAAuD;AAEvD,MAAa,yCAA0C,SAAQ,6BAAiB;IAC9E,4BAA4B;QAC1B,OAAO,kCAAkC,CAAA;IAC3C,CAAC;IAED,yBAAyB;QACvB,OAAO,WAAW,CAAA;IACpB,CAAC;IAED,kBAAkB,CAChB,GAAS,EACT,GAAW,EACX,kBAA0B,EAC1B,OAA4C;QAE5C,MAAM,UAAU,GAAG,GAAG,CAAA;QACtB,MA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AAC,UAAU,CAAC,IAAI,EAAE,CAAC;YACxC,6GAA6G;SAC9G,CAAA;IACH,CAAC;IAED,4BAA4B,CAAC,MAAc,EAAE,MAAmB;;QAC9D,WAAW;QACX,IAAI,MAAM,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE;YAC/C,8EAA8E;YAC9E,yCAAyC;YACzC,MAAA,MAAM,CAAC,kBAAkB,0CAAE,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE;gBACvC,IAAI,CAAC,CAAC,mBAAmB,EAAE;oBACzB,CAAC,CAAC,eAAe,GAAG,CAAC,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,mBAAmB,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAA;iBAC/F;YACH,CAAC,CAAC,CAAA;SACH;IACH,CAAC;CACF;AAxED,8FAwEC"}
|
|
@@ -1,7 +1,11 @@
|
|
|
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
|
-
Object.
|
|
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);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Ed25519Signature2018.js","sourceRoot":"","sources":["../../src/suites/Ed25519Signature2018.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Ed25519Signature2018.js","sourceRoot":"","sources":["../../src/suites/Ed25519Signature2018.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;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,SAAS,EAAE,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,YAAY,EAAE,QAAQ,CAAC;YACrD,MAAM,EAAE,GAAG,EAAE,CAAC,MAAM;YACpB,IAAI,EAAE,IAAI,CAAC,4BAA4B,EAAE;SAC1C,CAAC,CAAA;QACF,2GAA2G;QAC3G,eAAe,CAAC,MAAM,GAAG,GAAG,EAAE,CAAC,MAAa,CAAA;QAE5C,OAAO,IAAI,6CAAoB,CAAC;YAC9B,GAAG,EAAE,eAAe;YACpB,MAAM,EAAE,MAAM;SACf,CAAC,CAAA;IACJ,CAAC;IAED,uBAAuB;QACrB,OAAO,IAAI,6CAAoB,EAAE,CAAA;IACnC,CAAC;IAED,0BAA0B,CAAC,UAA6B;QACtD,qBAAqB;IACvB,CAAC;IAED,4BAA4B,CAAC,MAAc,EAAE,MAAmB;QAC9D,qBAAqB;IACvB,CAAC;CACF;AApED,gEAoEC"}
|
package/build/types.d.ts
CHANGED
|
@@ -133,6 +133,12 @@ export interface IVerifyCredentialLDArgs {
|
|
|
133
133
|
*
|
|
134
134
|
*/
|
|
135
135
|
credential: VerifiableCredential;
|
|
136
|
+
/**
|
|
137
|
+
* Set this to true if you want the '@context' URLs to be fetched in case they are not pre-loaded.
|
|
138
|
+
*
|
|
139
|
+
* @default false
|
|
140
|
+
*/
|
|
141
|
+
fetchRemoteContexts?: boolean;
|
|
136
142
|
}
|
|
137
143
|
/**
|
|
138
144
|
* Encapsulates the parameters required to verify a
|
|
@@ -158,6 +164,12 @@ export interface IVerifyPresentationLDArgs {
|
|
|
158
164
|
* Optional (only for JWT) string domain parameter to verify the verifiable presentation against
|
|
159
165
|
*/
|
|
160
166
|
domain?: string;
|
|
167
|
+
/**
|
|
168
|
+
* Set this to true if you want the '@context' URLs to be fetched in case they are not pre-loaded.
|
|
169
|
+
*
|
|
170
|
+
* @default false
|
|
171
|
+
*/
|
|
172
|
+
fetchRemoteContexts?: boolean;
|
|
161
173
|
}
|
|
162
174
|
/**
|
|
163
175
|
* Represents the requirements that this plugin has.
|
package/build/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,WAAW,EAEX,WAAW,EACX,gBAAgB,EAChB,SAAS,EACT,mBAAmB,EACnB,oBAAoB,EACpB,sBAAsB,EACvB,MAAM,cAAc,CAAA;AAErB;;;;;;;GAOG;AACH,MAAM,WAAW,mBAAoB,SAAQ,gBAAgB;IAC3D;;;;;;;;;;;;;OAaG;IACH,8BAA8B,CAC5B,IAAI,EAAE,mCAAmC,EACzC,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,sBAAsB,CAAC,CAAA;IAElC;;;;;;;;;;;;;OAaG;IACH,4BAA4B,CAC1B,IAAI,EAAE,iCAAiC,EACvC,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,oBAAoB,CAAC,CAAA;IAEhC;;;;;;;;;;;OAWG;IACH,kBAAkB,CAAC,IAAI,EAAE,uBAAuB,EAAE,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;IAE9F;;;;;;;;;;;OAWG;IACH,oBAAoB,CAAC,IAAI,EAAE,yBAAyB,EAAE,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;CACnG;AAED;;;;;GAKG;AACH,MAAM,WAAW,mCAAmC;IAClD;;;;;;;;OAQG;IACH,YAAY,EAAE,mBAAmB,CAAA;IAEjC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IAEf;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED;;;;;GAKG;AACH,MAAM,WAAW,iCAAiC;IAChD;;;;;;;;OAQG;IACH,UAAU,EAAE,iBAAiB,CAAA;IAE7B;;OAEG;I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D;;;;;;;;OAQG;IACH,UAAU,EAAE,iBAAiB,CAAA;IAE7B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED;;;;;GAKG;AACH,MAAM,WAAW,uBAAuB;IACtC;;;;;;;OAOG;IACH,UAAU,EAAE,oBAAoB,CAAA;IAEhC;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAA;CAC9B;AAED;;;;;GAKG;AACH,MAAM,WAAW,yBAAyB;IACxC;;;;;;;OAOG;IACH,YAAY,EAAE,sBAAsB,CAAA;IAEpC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IAEf;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAA;CAC9B;AAED;;;;;;;GAOG;AACH,oBAAY,gBAAgB,GAAG,aAAa,CAC1C,SAAS,GAAG,IAAI,CAAC,WAAW,EAAE,eAAe,CAAC,GAAG,IAAI,CAAC,WAAW,EAAE,eAAe,GAAG,gBAAgB,CAAC,CACvG,CAAA;AAED,oBAAY,UAAU,GAAG;IACvB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAChC,CAAA"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
{
|
|
2
|
+
"@context": {
|
|
3
|
+
"@version": 1.1,
|
|
4
|
+
"@protected": true,
|
|
5
|
+
|
|
6
|
+
"id": "@id",
|
|
7
|
+
"type": "@type",
|
|
8
|
+
|
|
9
|
+
"VerifiableCredential": {
|
|
10
|
+
"@id": "https://www.w3.org/2018/credentials#VerifiableCredential",
|
|
11
|
+
"@context": {
|
|
12
|
+
"@version": 1.1,
|
|
13
|
+
"@protected": true,
|
|
14
|
+
|
|
15
|
+
"id": "@id",
|
|
16
|
+
"type": "@type",
|
|
17
|
+
|
|
18
|
+
"cred": "https://www.w3.org/2018/credentials#",
|
|
19
|
+
"sec": "https://w3id.org/security#",
|
|
20
|
+
"xsd": "http://www.w3.org/2001/XMLSchema#",
|
|
21
|
+
|
|
22
|
+
"credentialSchema": {
|
|
23
|
+
"@id": "cred:credentialSchema",
|
|
24
|
+
"@type": "@id",
|
|
25
|
+
"@context": {
|
|
26
|
+
"@version": 1.1,
|
|
27
|
+
"@protected": true,
|
|
28
|
+
|
|
29
|
+
"id": "@id",
|
|
30
|
+
"type": "@type",
|
|
31
|
+
|
|
32
|
+
"cred": "https://www.w3.org/2018/credentials#",
|
|
33
|
+
|
|
34
|
+
"JsonSchemaValidator2018": "cred:JsonSchemaValidator2018"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"credentialStatus": {"@id": "cred:credentialStatus", "@type": "@id"},
|
|
38
|
+
"credentialSubject": {"@id": "cred:credentialSubject", "@type": "@id"},
|
|
39
|
+
"evidence": {"@id": "cred:evidence", "@type": "@id"},
|
|
40
|
+
"expirationDate": {"@id": "cred:expirationDate", "@type": "xsd:dateTime"},
|
|
41
|
+
"holder": {"@id": "cred:holder", "@type": "@id"},
|
|
42
|
+
"issued": {"@id": "cred:issued", "@type": "xsd:dateTime"},
|
|
43
|
+
"issuer": {"@id": "cred:issuer", "@type": "@id"},
|
|
44
|
+
"issuanceDate": {"@id": "cred:issuanceDate", "@type": "xsd:dateTime"},
|
|
45
|
+
"proof": {"@id": "sec:proof", "@type": "@id", "@container": "@graph"},
|
|
46
|
+
"refreshService": {
|
|
47
|
+
"@id": "cred:refreshService",
|
|
48
|
+
"@type": "@id",
|
|
49
|
+
"@context": {
|
|
50
|
+
"@version": 1.1,
|
|
51
|
+
"@protected": true,
|
|
52
|
+
|
|
53
|
+
"id": "@id",
|
|
54
|
+
"type": "@type",
|
|
55
|
+
|
|
56
|
+
"cred": "https://www.w3.org/2018/credentials#",
|
|
57
|
+
|
|
58
|
+
"ManualRefreshService2018": "cred:ManualRefreshService2018"
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"termsOfUse": {"@id": "cred:termsOfUse", "@type": "@id"},
|
|
62
|
+
"validFrom": {"@id": "cred:validFrom", "@type": "xsd:dateTime"},
|
|
63
|
+
"validUntil": {"@id": "cred:validUntil", "@type": "xsd:dateTime"}
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
|
|
67
|
+
"VerifiablePresentation": {
|
|
68
|
+
"@id": "https://www.w3.org/2018/credentials#VerifiablePresentation",
|
|
69
|
+
"@context": {
|
|
70
|
+
"@version": 1.1,
|
|
71
|
+
"@protected": true,
|
|
72
|
+
|
|
73
|
+
"id": "@id",
|
|
74
|
+
"type": "@type",
|
|
75
|
+
|
|
76
|
+
"cred": "https://www.w3.org/2018/credentials#",
|
|
77
|
+
"sec": "https://w3id.org/security#",
|
|
78
|
+
|
|
79
|
+
"holder": {"@id": "cred:holder", "@type": "@id"},
|
|
80
|
+
"proof": {"@id": "sec:proof", "@type": "@id", "@container": "@graph"},
|
|
81
|
+
"verifiableCredential": {"@id": "cred:verifiableCredential", "@type": "@id", "@container": "@graph"}
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
|
|
85
|
+
"EcdsaSecp256k1Signature2019": {
|
|
86
|
+
"@id": "https://w3id.org/security#EcdsaSecp256k1Signature2019",
|
|
87
|
+
"@context": {
|
|
88
|
+
"@version": 1.1,
|
|
89
|
+
"@protected": true,
|
|
90
|
+
|
|
91
|
+
"id": "@id",
|
|
92
|
+
"type": "@type",
|
|
93
|
+
|
|
94
|
+
"sec": "https://w3id.org/security#",
|
|
95
|
+
"xsd": "http://www.w3.org/2001/XMLSchema#",
|
|
96
|
+
|
|
97
|
+
"challenge": "sec:challenge",
|
|
98
|
+
"created": {"@id": "http://purl.org/dc/terms/created", "@type": "xsd:dateTime"},
|
|
99
|
+
"domain": "sec:domain",
|
|
100
|
+
"expires": {"@id": "sec:expiration", "@type": "xsd:dateTime"},
|
|
101
|
+
"jws": "sec:jws",
|
|
102
|
+
"nonce": "sec:nonce",
|
|
103
|
+
"proofPurpose": {
|
|
104
|
+
"@id": "sec:proofPurpose",
|
|
105
|
+
"@type": "@vocab",
|
|
106
|
+
"@context": {
|
|
107
|
+
"@version": 1.1,
|
|
108
|
+
"@protected": true,
|
|
109
|
+
|
|
110
|
+
"id": "@id",
|
|
111
|
+
"type": "@type",
|
|
112
|
+
|
|
113
|
+
"sec": "https://w3id.org/security#",
|
|
114
|
+
|
|
115
|
+
"assertionMethod": {"@id": "sec:assertionMethod", "@type": "@id", "@container": "@set"},
|
|
116
|
+
"authentication": {"@id": "sec:authenticationMethod", "@type": "@id", "@container": "@set"}
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
"proofValue": "sec:proofValue",
|
|
120
|
+
"verificationMethod": {"@id": "sec:verificationMethod", "@type": "@id"}
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
|
|
124
|
+
"EcdsaSecp256r1Signature2019": {
|
|
125
|
+
"@id": "https://w3id.org/security#EcdsaSecp256r1Signature2019",
|
|
126
|
+
"@context": {
|
|
127
|
+
"@version": 1.1,
|
|
128
|
+
"@protected": true,
|
|
129
|
+
|
|
130
|
+
"id": "@id",
|
|
131
|
+
"type": "@type",
|
|
132
|
+
|
|
133
|
+
"sec": "https://w3id.org/security#",
|
|
134
|
+
"xsd": "http://www.w3.org/2001/XMLSchema#",
|
|
135
|
+
|
|
136
|
+
"challenge": "sec:challenge",
|
|
137
|
+
"created": {"@id": "http://purl.org/dc/terms/created", "@type": "xsd:dateTime"},
|
|
138
|
+
"domain": "sec:domain",
|
|
139
|
+
"expires": {"@id": "sec:expiration", "@type": "xsd:dateTime"},
|
|
140
|
+
"jws": "sec:jws",
|
|
141
|
+
"nonce": "sec:nonce",
|
|
142
|
+
"proofPurpose": {
|
|
143
|
+
"@id": "sec:proofPurpose",
|
|
144
|
+
"@type": "@vocab",
|
|
145
|
+
"@context": {
|
|
146
|
+
"@version": 1.1,
|
|
147
|
+
"@protected": true,
|
|
148
|
+
|
|
149
|
+
"id": "@id",
|
|
150
|
+
"type": "@type",
|
|
151
|
+
|
|
152
|
+
"sec": "https://w3id.org/security#",
|
|
153
|
+
|
|
154
|
+
"assertionMethod": {"@id": "sec:assertionMethod", "@type": "@id", "@container": "@set"},
|
|
155
|
+
"authentication": {"@id": "sec:authenticationMethod", "@type": "@id", "@container": "@set"}
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
"proofValue": "sec:proofValue",
|
|
159
|
+
"verificationMethod": {"@id": "sec:verificationMethod", "@type": "@id"}
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
|
|
163
|
+
"Ed25519Signature2018": {
|
|
164
|
+
"@id": "https://w3id.org/security#Ed25519Signature2018",
|
|
165
|
+
"@context": {
|
|
166
|
+
"@version": 1.1,
|
|
167
|
+
"@protected": true,
|
|
168
|
+
|
|
169
|
+
"id": "@id",
|
|
170
|
+
"type": "@type",
|
|
171
|
+
|
|
172
|
+
"sec": "https://w3id.org/security#",
|
|
173
|
+
"xsd": "http://www.w3.org/2001/XMLSchema#",
|
|
174
|
+
|
|
175
|
+
"challenge": "sec:challenge",
|
|
176
|
+
"created": {"@id": "http://purl.org/dc/terms/created", "@type": "xsd:dateTime"},
|
|
177
|
+
"domain": "sec:domain",
|
|
178
|
+
"expires": {"@id": "sec:expiration", "@type": "xsd:dateTime"},
|
|
179
|
+
"jws": "sec:jws",
|
|
180
|
+
"nonce": "sec:nonce",
|
|
181
|
+
"proofPurpose": {
|
|
182
|
+
"@id": "sec:proofPurpose",
|
|
183
|
+
"@type": "@vocab",
|
|
184
|
+
"@context": {
|
|
185
|
+
"@version": 1.1,
|
|
186
|
+
"@protected": true,
|
|
187
|
+
|
|
188
|
+
"id": "@id",
|
|
189
|
+
"type": "@type",
|
|
190
|
+
|
|
191
|
+
"sec": "https://w3id.org/security#",
|
|
192
|
+
|
|
193
|
+
"assertionMethod": {"@id": "sec:assertionMethod", "@type": "@id", "@container": "@set"},
|
|
194
|
+
"authentication": {"@id": "sec:authenticationMethod", "@type": "@id", "@container": "@set"}
|
|
195
|
+
}
|
|
196
|
+
},
|
|
197
|
+
"proofValue": "sec:proofValue",
|
|
198
|
+
"verificationMethod": {"@id": "sec:verificationMethod", "@type": "@id"}
|
|
199
|
+
}
|
|
200
|
+
},
|
|
201
|
+
|
|
202
|
+
"RsaSignature2018": {
|
|
203
|
+
"@id": "https://w3id.org/security#RsaSignature2018",
|
|
204
|
+
"@context": {
|
|
205
|
+
"@version": 1.1,
|
|
206
|
+
"@protected": true,
|
|
207
|
+
|
|
208
|
+
"challenge": "sec:challenge",
|
|
209
|
+
"created": {"@id": "http://purl.org/dc/terms/created", "@type": "xsd:dateTime"},
|
|
210
|
+
"domain": "sec:domain",
|
|
211
|
+
"expires": {"@id": "sec:expiration", "@type": "xsd:dateTime"},
|
|
212
|
+
"jws": "sec:jws",
|
|
213
|
+
"nonce": "sec:nonce",
|
|
214
|
+
"proofPurpose": {
|
|
215
|
+
"@id": "sec:proofPurpose",
|
|
216
|
+
"@type": "@vocab",
|
|
217
|
+
"@context": {
|
|
218
|
+
"@version": 1.1,
|
|
219
|
+
"@protected": true,
|
|
220
|
+
|
|
221
|
+
"id": "@id",
|
|
222
|
+
"type": "@type",
|
|
223
|
+
|
|
224
|
+
"sec": "https://w3id.org/security#",
|
|
225
|
+
|
|
226
|
+
"assertionMethod": {"@id": "sec:assertionMethod", "@type": "@id", "@container": "@set"},
|
|
227
|
+
"authentication": {"@id": "sec:authenticationMethod", "@type": "@id", "@container": "@set"}
|
|
228
|
+
}
|
|
229
|
+
},
|
|
230
|
+
"proofValue": "sec:proofValue",
|
|
231
|
+
"verificationMethod": {"@id": "sec:verificationMethod", "@type": "@id"}
|
|
232
|
+
}
|
|
233
|
+
},
|
|
234
|
+
|
|
235
|
+
"proof": {"@id": "https://w3id.org/security#proof", "@type": "@id", "@container": "@graph"}
|
|
236
|
+
}
|
|
237
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@veramo/credential-ld",
|
|
3
3
|
"description": "Veramo plugin for working with W3C JSON-LD Verifiable Credentials & Presentations.",
|
|
4
|
-
"version": "3.1.
|
|
4
|
+
"version": "3.1.2-next.100+b96ded68",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
7
7
|
"scripts": {
|
|
@@ -14,28 +14,28 @@
|
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@transmute/credentials-context": "^0.7.0-unstable.
|
|
18
|
-
"@transmute/ed25519-signature-2018": "^0.7.0-unstable.
|
|
17
|
+
"@transmute/credentials-context": "^0.7.0-unstable.34",
|
|
18
|
+
"@transmute/ed25519-signature-2018": "^0.7.0-unstable.34",
|
|
19
19
|
"@transmute/lds-ecdsa-secp256k1-recovery2020": "^0.0.7",
|
|
20
|
-
"@veramo/core": "^3.1.
|
|
21
|
-
"@veramo/did-resolver": "^3.1.
|
|
22
|
-
"@veramo/utils": "^3.1.
|
|
23
|
-
"debug": "^4.
|
|
24
|
-
"did-resolver": "3.1.
|
|
20
|
+
"@veramo/core": "^3.1.2-next.100+b96ded68",
|
|
21
|
+
"@veramo/did-resolver": "^3.1.2-next.100+b96ded68",
|
|
22
|
+
"@veramo/utils": "^3.1.2-next.100+b96ded68",
|
|
23
|
+
"debug": "^4.3.3",
|
|
24
|
+
"did-resolver": "^3.1.5",
|
|
25
25
|
"jsonld": "^5.2.0",
|
|
26
|
-
"jsonld-signatures": "^9.
|
|
27
|
-
"uint8arrays": "^
|
|
26
|
+
"jsonld-signatures": "^9.3.1",
|
|
27
|
+
"uint8arrays": "^3.0.0",
|
|
28
28
|
"vc-js": "^0.6.4"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/debug": "4.1.7",
|
|
32
|
-
"borc": "
|
|
33
|
-
"typescript": "4.
|
|
32
|
+
"borc": "3.0.0",
|
|
33
|
+
"typescript": "4.6.4"
|
|
34
34
|
},
|
|
35
35
|
"files": [
|
|
36
36
|
"build/**/*",
|
|
37
37
|
"src/**/*",
|
|
38
|
-
"contexts/**/*.
|
|
38
|
+
"contexts/**/*.json",
|
|
39
39
|
"plugin.schema.json",
|
|
40
40
|
"README.md",
|
|
41
41
|
"LICENSE"
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"author": "Mircea Nistor <mircea.nistor@mesh.xyz>",
|
|
48
48
|
"license": "Apache-2.0",
|
|
49
49
|
"keywords": [],
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "b96ded6837ad8fd355958ce56bb0d56fbc0b2157"
|
|
51
51
|
}
|
package/plugin.schema.json
CHANGED
|
@@ -326,6 +326,11 @@
|
|
|
326
326
|
"credential": {
|
|
327
327
|
"$ref": "#/components/schemas/VerifiableCredential",
|
|
328
328
|
"description": "The json payload of the Credential according to the\n {@link https://www.w3.org/TR/vc-data-model/#credentials | canonical model } \n\nThe signer of the Credential is chosen based on the `issuer.id` property of the `credential`"
|
|
329
|
+
},
|
|
330
|
+
"fetchRemoteContexts": {
|
|
331
|
+
"type": "boolean",
|
|
332
|
+
"description": "Set this to true if you want the '@context' URLs to be fetched in case they are not pre-loaded.",
|
|
333
|
+
"default": false
|
|
329
334
|
}
|
|
330
335
|
},
|
|
331
336
|
"required": [
|
|
@@ -347,6 +352,11 @@
|
|
|
347
352
|
"domain": {
|
|
348
353
|
"type": "string",
|
|
349
354
|
"description": "Optional (only for JWT) string domain parameter to verify the verifiable presentation against"
|
|
355
|
+
},
|
|
356
|
+
"fetchRemoteContexts": {
|
|
357
|
+
"type": "boolean",
|
|
358
|
+
"description": "Set this to true if you want the '@context' URLs to be fetched in case they are not pre-loaded.",
|
|
359
|
+
"default": false
|
|
350
360
|
}
|
|
351
361
|
},
|
|
352
362
|
"required": [
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ContextDoc } from '../types'
|
|
2
|
+
import { LdContextLoader } from '../ld-context-loader'
|
|
3
|
+
import { LdDefaultContexts } from '../ld-default-contexts'
|
|
4
|
+
|
|
5
|
+
describe('credential-ld context loader', () => {
|
|
6
|
+
const customContext: Record<string, ContextDoc> = {
|
|
7
|
+
'https://example.com/custom/context': {
|
|
8
|
+
'@context': {
|
|
9
|
+
'@version': 1.1,
|
|
10
|
+
id: '@id',
|
|
11
|
+
type: '@type',
|
|
12
|
+
nothing: 'https://example.com/nothing',
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
it('loads custom context from record', async () => {
|
|
18
|
+
expect.assertions(2)
|
|
19
|
+
const loader = new LdContextLoader({ contextsPaths: [customContext] })
|
|
20
|
+
expect(loader.has('https://example.com/custom/context')).toBe(true)
|
|
21
|
+
await expect(loader.get('https://example.com/custom/context')).resolves.toEqual({
|
|
22
|
+
'@context': {
|
|
23
|
+
'@version': 1.1,
|
|
24
|
+
id: '@id',
|
|
25
|
+
type: '@type',
|
|
26
|
+
nothing: 'https://example.com/nothing',
|
|
27
|
+
},
|
|
28
|
+
})
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
it('loads context from default map', async () => {
|
|
32
|
+
expect.assertions(2)
|
|
33
|
+
const loader = new LdContextLoader({ contextsPaths: [LdDefaultContexts] })
|
|
34
|
+
expect(loader.has('https://www.w3.org/2018/credentials/v1')).toBe(true)
|
|
35
|
+
|
|
36
|
+
const credsContext = await loader.get('https://www.w3.org/2018/credentials/v1')
|
|
37
|
+
expect(credsContext['@context']).toBeDefined()
|
|
38
|
+
})
|
|
39
|
+
})
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createAgent,
|
|
3
|
+
CredentialPayload,
|
|
4
|
+
IDIDManager,
|
|
5
|
+
IIdentifier,
|
|
6
|
+
IKeyManager,
|
|
7
|
+
IResolver,
|
|
8
|
+
TAgent,
|
|
9
|
+
} from '../../../core/src'
|
|
10
|
+
import { CredentialIssuer, ICredentialIssuer } from '../../../credential-w3c/src'
|
|
11
|
+
import { DIDManager, MemoryDIDStore } from '../../../did-manager/src'
|
|
12
|
+
import { KeyManager, MemoryKeyStore, MemoryPrivateKeyStore } from '../../../key-manager/src'
|
|
13
|
+
import { KeyManagementSystem } from '../../../kms-local/src'
|
|
14
|
+
import { getDidKeyResolver, KeyDIDProvider } from '../../../did-provider-key/src'
|
|
15
|
+
import { DIDResolverPlugin } from '../../../did-resolver/src'
|
|
16
|
+
import { ContextDoc } from '../types'
|
|
17
|
+
import { CredentialIssuerLD } from '../action-handler'
|
|
18
|
+
import { LdDefaultContexts } from '../ld-default-contexts'
|
|
19
|
+
import { VeramoEd25519Signature2018 } from '../suites/Ed25519Signature2018'
|
|
20
|
+
import { Resolver } from 'did-resolver'
|
|
21
|
+
|
|
22
|
+
const customContext: Record<string, ContextDoc> = {
|
|
23
|
+
'custom:example.context': {
|
|
24
|
+
'@context': {
|
|
25
|
+
nothing: 'custom:example.context#blank',
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
describe('credential-LD full flow', () => {
|
|
31
|
+
let didKeyIdentifier: IIdentifier
|
|
32
|
+
let agent: TAgent<IResolver & IKeyManager & IDIDManager & ICredentialIssuer>
|
|
33
|
+
|
|
34
|
+
beforeAll(async () => {
|
|
35
|
+
agent = createAgent({
|
|
36
|
+
plugins: [
|
|
37
|
+
new KeyManager({
|
|
38
|
+
store: new MemoryKeyStore(),
|
|
39
|
+
kms: {
|
|
40
|
+
local: new KeyManagementSystem(new MemoryPrivateKeyStore()),
|
|
41
|
+
},
|
|
42
|
+
}),
|
|
43
|
+
new DIDManager({
|
|
44
|
+
providers: {
|
|
45
|
+
'did:key': new KeyDIDProvider({ defaultKms: 'local' }),
|
|
46
|
+
},
|
|
47
|
+
store: new MemoryDIDStore(),
|
|
48
|
+
defaultProvider: 'did:key',
|
|
49
|
+
}),
|
|
50
|
+
new DIDResolverPlugin({
|
|
51
|
+
resolver: new Resolver({ ...getDidKeyResolver() }),
|
|
52
|
+
}),
|
|
53
|
+
new CredentialIssuer(),
|
|
54
|
+
new CredentialIssuerLD({
|
|
55
|
+
contextMaps: [LdDefaultContexts, customContext],
|
|
56
|
+
suites: [new VeramoEd25519Signature2018()],
|
|
57
|
+
}),
|
|
58
|
+
],
|
|
59
|
+
})
|
|
60
|
+
didKeyIdentifier = await agent.didManagerCreate()
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
it('works with Ed25519Signature2018', async () => {
|
|
64
|
+
const credential: CredentialPayload = {
|
|
65
|
+
issuer: didKeyIdentifier.did,
|
|
66
|
+
'@context': ['custom:example.context'],
|
|
67
|
+
credentialSubject: {
|
|
68
|
+
nothing: 'else matters',
|
|
69
|
+
},
|
|
70
|
+
}
|
|
71
|
+
const verifiableCredential = await agent.createVerifiableCredential({
|
|
72
|
+
credential,
|
|
73
|
+
proofFormat: 'lds',
|
|
74
|
+
})
|
|
75
|
+
|
|
76
|
+
expect(verifiableCredential).toBeDefined()
|
|
77
|
+
|
|
78
|
+
const verified = await agent.verifyCredential({
|
|
79
|
+
credential: verifiableCredential,
|
|
80
|
+
})
|
|
81
|
+
|
|
82
|
+
expect(verified).toBe(true)
|
|
83
|
+
})
|
|
84
|
+
})
|
package/src/action-handler.ts
CHANGED
|
@@ -183,7 +183,7 @@ export class CredentialIssuerLD implements IAgentPlugin {
|
|
|
183
183
|
context: IRequiredContext,
|
|
184
184
|
): Promise<boolean> {
|
|
185
185
|
const credential = args.credential
|
|
186
|
-
return this.ldCredentialModule.verifyCredential(credential, context)
|
|
186
|
+
return this.ldCredentialModule.verifyCredential(credential, args.fetchRemoteContexts || false, context)
|
|
187
187
|
}
|
|
188
188
|
|
|
189
189
|
/** {@inheritdoc ICredentialIssuerLD.verifyPresentationLD} */
|
|
@@ -192,7 +192,13 @@ export class CredentialIssuerLD implements IAgentPlugin {
|
|
|
192
192
|
context: IRequiredContext,
|
|
193
193
|
): Promise<boolean> {
|
|
194
194
|
const presentation = args.presentation
|
|
195
|
-
return this.ldCredentialModule.verifyPresentation(
|
|
195
|
+
return this.ldCredentialModule.verifyPresentation(
|
|
196
|
+
presentation,
|
|
197
|
+
args.challenge,
|
|
198
|
+
args.domain,
|
|
199
|
+
args.fetchRemoteContexts || false,
|
|
200
|
+
context,
|
|
201
|
+
)
|
|
196
202
|
}
|
|
197
203
|
|
|
198
204
|
private async findSigningKeyWithId(
|
package/src/ld-context-loader.ts
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The LdContextLoader is initialized with a List of Map<string, ContextDoc
|
|
2
|
+
* The LdContextLoader is initialized with a List of Map<string, ContextDoc | Promise<ContextDoc>>
|
|
3
3
|
* that it unifies into a single Map to provide to the documentLoader within
|
|
4
4
|
* the w3c credential module.
|
|
5
5
|
*/
|
|
6
|
-
import { OrPromise, RecordLike } from '@veramo/utils'
|
|
6
|
+
import { isIterable, OrPromise, RecordLike } from '@veramo/utils'
|
|
7
7
|
import { ContextDoc } from './types'
|
|
8
8
|
|
|
9
9
|
export class LdContextLoader {
|
|
10
|
-
private contexts: Record<string, OrPromise<ContextDoc>>
|
|
10
|
+
private readonly contexts: Record<string, OrPromise<ContextDoc>>
|
|
11
11
|
|
|
12
12
|
constructor(options: { contextsPaths: RecordLike<OrPromise<ContextDoc>>[] }) {
|
|
13
13
|
this.contexts = {}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
Array.from(options.contextsPaths, (mapItem) => {
|
|
15
|
+
const map = isIterable(mapItem) ? mapItem : Object.entries(mapItem)
|
|
16
|
+
// generate-plugin-schema is failing unless we use the cast to `any[]`
|
|
17
|
+
for (const [key, value] of map as any[]) {
|
|
17
18
|
this.contexts[key] = value
|
|
18
19
|
}
|
|
19
20
|
})
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
VerifiableCredential,
|
|
8
8
|
VerifiablePresentation,
|
|
9
9
|
} from '@veramo/core'
|
|
10
|
+
import fetch from 'cross-fetch'
|
|
10
11
|
import Debug from 'debug'
|
|
11
12
|
import { extendContextLoader, purposes } from 'jsonld-signatures'
|
|
12
13
|
import * as vc from 'vc-js'
|
|
@@ -34,7 +35,7 @@ export class LdCredentialModule {
|
|
|
34
35
|
this.ldSuiteLoader = options.ldSuiteLoader
|
|
35
36
|
}
|
|
36
37
|
|
|
37
|
-
getDocumentLoader(context: IAgentContext<IResolver
|
|
38
|
+
getDocumentLoader(context: IAgentContext<IResolver>, attemptToFetchContexts: boolean = false) {
|
|
38
39
|
return extendContextLoader(async (url: string) => {
|
|
39
40
|
// console.log(`resolving context for: ${url}`)
|
|
40
41
|
|
|
@@ -65,10 +66,29 @@ export class LdCredentialModule {
|
|
|
65
66
|
documentUrl: url,
|
|
66
67
|
document: contextDoc,
|
|
67
68
|
}
|
|
69
|
+
} else {
|
|
70
|
+
if (attemptToFetchContexts) {
|
|
71
|
+
// attempt to fetch the remote context!!!! MEGA FAIL for JSON-LD.
|
|
72
|
+
debug('WARNING: attempting to fetch the doc directly for ', url)
|
|
73
|
+
try {
|
|
74
|
+
const response = await fetch(url)
|
|
75
|
+
if (response.status === 200) {
|
|
76
|
+
const document = await response.json()
|
|
77
|
+
return {
|
|
78
|
+
contextUrl: null,
|
|
79
|
+
documentUrl: url,
|
|
80
|
+
document,
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
} catch (e) {
|
|
84
|
+
debug('WARNING: unable to fetch the doc or interpret it as JSON', e)
|
|
85
|
+
}
|
|
86
|
+
}
|
|
68
87
|
}
|
|
69
88
|
|
|
70
|
-
debug(
|
|
71
|
-
|
|
89
|
+
debug(
|
|
90
|
+
`WARNING: Possible unknown context/identifier for ${url} \n falling back to default documentLoader`,
|
|
91
|
+
)
|
|
72
92
|
|
|
73
93
|
return vc.defaultDocumentLoader(url)
|
|
74
94
|
})
|
|
@@ -122,14 +142,26 @@ export class LdCredentialModule {
|
|
|
122
142
|
|
|
123
143
|
async verifyCredential(
|
|
124
144
|
credential: VerifiableCredential,
|
|
145
|
+
fetchRemoteContexts: boolean = false,
|
|
125
146
|
context: IAgentContext<IResolver>,
|
|
126
147
|
): Promise<boolean> {
|
|
148
|
+
const checkStatusFn =
|
|
149
|
+
typeof context.agent.checkCredentialStatus === 'function'
|
|
150
|
+
? async ({ credential }: any) => {
|
|
151
|
+
const result = await context.agent.checkCredentialStatus({
|
|
152
|
+
credential,
|
|
153
|
+
})
|
|
154
|
+
return { verified: !result.revoked }
|
|
155
|
+
}
|
|
156
|
+
: void 0
|
|
157
|
+
|
|
127
158
|
const result = await vc.verifyCredential({
|
|
128
159
|
credential,
|
|
129
160
|
suite: this.ldSuiteLoader.getAllSignatureSuites().map((x) => x.getSuiteForVerification()),
|
|
130
|
-
documentLoader: this.getDocumentLoader(context),
|
|
161
|
+
documentLoader: this.getDocumentLoader(context, fetchRemoteContexts),
|
|
131
162
|
purpose: new AssertionProofPurpose(),
|
|
132
163
|
compactProof: false,
|
|
164
|
+
checkStatus: checkStatusFn,
|
|
133
165
|
})
|
|
134
166
|
|
|
135
167
|
if (result.verified) return true
|
|
@@ -146,12 +178,13 @@ export class LdCredentialModule {
|
|
|
146
178
|
presentation: VerifiablePresentation,
|
|
147
179
|
challenge: string | undefined,
|
|
148
180
|
domain: string | undefined,
|
|
181
|
+
fetchRemoteContexts: boolean = false,
|
|
149
182
|
context: IAgentContext<IResolver>,
|
|
150
183
|
): Promise<boolean> {
|
|
151
184
|
const result = await vc.verify({
|
|
152
185
|
presentation,
|
|
153
186
|
suite: this.ldSuiteLoader.getAllSignatureSuites().map((x) => x.getSuiteForVerification()),
|
|
154
|
-
documentLoader: this.getDocumentLoader(context),
|
|
187
|
+
documentLoader: this.getDocumentLoader(context, fetchRemoteContexts),
|
|
155
188
|
challenge,
|
|
156
189
|
domain,
|
|
157
190
|
purpose: new AssertionProofPurpose(),
|
|
@@ -1,21 +1,25 @@
|
|
|
1
|
-
import
|
|
2
|
-
import * as path from 'path'
|
|
1
|
+
import { ContextDoc } from './types'
|
|
3
2
|
|
|
4
|
-
function _read(_path: string) {
|
|
5
|
-
return
|
|
3
|
+
async function _read(_path: string): Promise<ContextDoc> {
|
|
4
|
+
return await import('../contexts/' + _path);
|
|
6
5
|
}
|
|
7
6
|
|
|
7
|
+
/**
|
|
8
|
+
* Provides a hardcoded map of common context definitions
|
|
9
|
+
*/
|
|
8
10
|
export const LdDefaultContexts = new Map([
|
|
9
|
-
['https://
|
|
10
|
-
['https://
|
|
11
|
-
['https://
|
|
12
|
-
|
|
13
|
-
['https://
|
|
14
|
-
['https://
|
|
11
|
+
['https://www.w3.org/2018/credentials/v1', _read('w3_2018_credentials_v1.json')],
|
|
12
|
+
['https://www.w3.org/ns/did/v1', _read('security_context_v1.json')],
|
|
13
|
+
['https://w3id.org/did/v0.11', _read('did_v0.11.json')],
|
|
14
|
+
|
|
15
|
+
['https://veramo.io/contexts/socialmedia/v1', _read('socialmedia-v1.json')],
|
|
16
|
+
['https://veramo.io/contexts/kyc/v1', _read('kyc-v1.json')],
|
|
17
|
+
['https://veramo.io/contexts/profile/v1', _read('profile-v1.json')],
|
|
18
|
+
['https://ns.did.ai/transmute/v1', _read('transmute_v1.json')],
|
|
15
19
|
[
|
|
16
20
|
'https://identity.foundation/EcdsaSecp256k1RecoverySignature2020/lds-ecdsa-secp256k1-recovery2020-0.0.jsonld',
|
|
17
|
-
_read('lds-ecdsa-secp256k1-recovery2020-0.0.
|
|
21
|
+
_read('lds-ecdsa-secp256k1-recovery2020-0.0.json'),
|
|
18
22
|
],
|
|
19
|
-
['https://w3id.org/security/suites/ed25519-2018/v1', _read('ed25519-signature-2018-v1.
|
|
20
|
-
['https://w3id.org/security/suites/x25519-2019/v1', _read('X25519KeyAgreementKey2019.
|
|
23
|
+
['https://w3id.org/security/suites/ed25519-2018/v1', _read('ed25519-signature-2018-v1.json')],
|
|
24
|
+
['https://w3id.org/security/suites/x25519-2019/v1', _read('X25519KeyAgreementKey2019.json')],
|
|
21
25
|
])
|
package/src/types.ts
CHANGED
|
@@ -161,6 +161,13 @@ export interface IVerifyCredentialLDArgs {
|
|
|
161
161
|
*
|
|
162
162
|
*/
|
|
163
163
|
credential: VerifiableCredential
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Set this to true if you want the '@context' URLs to be fetched in case they are not pre-loaded.
|
|
167
|
+
*
|
|
168
|
+
* @default false
|
|
169
|
+
*/
|
|
170
|
+
fetchRemoteContexts?: boolean
|
|
164
171
|
}
|
|
165
172
|
|
|
166
173
|
/**
|
|
@@ -189,6 +196,13 @@ export interface IVerifyPresentationLDArgs {
|
|
|
189
196
|
* Optional (only for JWT) string domain parameter to verify the verifiable presentation against
|
|
190
197
|
*/
|
|
191
198
|
domain?: string
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Set this to true if you want the '@context' URLs to be fetched in case they are not pre-loaded.
|
|
202
|
+
*
|
|
203
|
+
* @default false
|
|
204
|
+
*/
|
|
205
|
+
fetchRemoteContexts?: boolean
|
|
192
206
|
}
|
|
193
207
|
|
|
194
208
|
/**
|