@verii/verii-issuing 1.1.0-pre.1765745740 → 1.1.0-pre.1766527968
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/package.json +13 -13
- package/src/domain/prepare-jwt-vcs.js +17 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@verii/verii-issuing",
|
|
3
|
-
"version": "1.1.0-pre.
|
|
3
|
+
"version": "1.1.0-pre.1766527968",
|
|
4
4
|
"description": "Verii Issuing Package",
|
|
5
5
|
"repository": "https://github.com/LFDT-Verii/core",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -18,23 +18,23 @@
|
|
|
18
18
|
"author": "Andres Olave",
|
|
19
19
|
"license": "Apache-2.0",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@verii/blockchain-functions": "1.1.0-pre.
|
|
22
|
-
"@verii/common-functions": "1.1.0-pre.
|
|
23
|
-
"@verii/crypto": "1.1.0-pre.
|
|
24
|
-
"@verii/did-doc": "1.1.0-pre.
|
|
25
|
-
"@verii/jwt": "1.1.0-pre.
|
|
26
|
-
"@verii/metadata-registration": "1.1.0-pre.
|
|
27
|
-
"@verii/vc-checks": "1.1.0-pre.
|
|
21
|
+
"@verii/blockchain-functions": "1.1.0-pre.1766527968",
|
|
22
|
+
"@verii/common-functions": "1.1.0-pre.1766527968",
|
|
23
|
+
"@verii/crypto": "1.1.0-pre.1766527968",
|
|
24
|
+
"@verii/did-doc": "1.1.0-pre.1766527968",
|
|
25
|
+
"@verii/jwt": "1.1.0-pre.1766527968",
|
|
26
|
+
"@verii/metadata-registration": "1.1.0-pre.1766527968",
|
|
27
|
+
"@verii/vc-checks": "1.1.0-pre.1766527968",
|
|
28
28
|
"canonicalize": "2.1.0",
|
|
29
29
|
"eth-url-parser": "1.0.4",
|
|
30
30
|
"fast-shuffle": "6.1.1",
|
|
31
31
|
"lodash": "^4.17.21"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@verii/contract-permissions": "1.1.0-pre.
|
|
35
|
-
"@verii/http-client": "1.1.0-pre.
|
|
36
|
-
"@verii/test-regexes": "1.1.0-pre.
|
|
37
|
-
"@verii/tests-helpers": "1.1.0-pre.
|
|
34
|
+
"@verii/contract-permissions": "1.1.0-pre.1766527968",
|
|
35
|
+
"@verii/http-client": "1.1.0-pre.1766527968",
|
|
36
|
+
"@verii/test-regexes": "1.1.0-pre.1766527968",
|
|
37
|
+
"@verii/tests-helpers": "1.1.0-pre.1766527968",
|
|
38
38
|
"eslint": "8.57.1",
|
|
39
39
|
"eslint-config-airbnb-base": "14.2.1",
|
|
40
40
|
"eslint-config-prettier": "8.10.2",
|
|
@@ -56,5 +56,5 @@
|
|
|
56
56
|
"lib"
|
|
57
57
|
]
|
|
58
58
|
},
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "43751c2c4d41fb77c29feff29fdc5436d27fb49e"
|
|
60
60
|
}
|
|
@@ -72,7 +72,8 @@ const prepareJwtVcs = async (
|
|
|
72
72
|
const credentialId = buildVelocityCredentialMetadataDID(
|
|
73
73
|
metadataEntry,
|
|
74
74
|
issuer,
|
|
75
|
-
metadata.contentHash
|
|
75
|
+
metadata.contentHash,
|
|
76
|
+
context.config.includeContentHashInCredentialId
|
|
76
77
|
);
|
|
77
78
|
const revocationUrl = buildRevocationUrl(
|
|
78
79
|
revocationListEntries[i],
|
|
@@ -107,11 +108,22 @@ const prepareJwtVcs = async (
|
|
|
107
108
|
* @param {AllocationListEntry} entry the list entry
|
|
108
109
|
* @param {Issuer} issuer the issuer
|
|
109
110
|
* @param {string} contentHash the content hash of the credential
|
|
111
|
+
* @param {boolean} includeContentHashInCredentialId whether to include the content hash in the id
|
|
110
112
|
* @returns {string} the DID URI for the location on the credential metadata list
|
|
111
113
|
*/
|
|
112
|
-
const buildVelocityCredentialMetadataDID = (
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
114
|
+
const buildVelocityCredentialMetadataDID = (
|
|
115
|
+
entry,
|
|
116
|
+
issuer,
|
|
117
|
+
contentHash,
|
|
118
|
+
includeContentHashInCredentialId
|
|
119
|
+
) => {
|
|
120
|
+
const id = `did:velocity:v2:${toLower(issuer.dltPrimaryAddress)}:${
|
|
121
|
+
entry.listId
|
|
122
|
+
}:${entry.index}`;
|
|
123
|
+
if (includeContentHashInCredentialId) {
|
|
124
|
+
return `${id}:${contentHash}`;
|
|
125
|
+
}
|
|
126
|
+
return id;
|
|
127
|
+
};
|
|
116
128
|
|
|
117
129
|
module.exports = { prepareJwtVcs };
|