@sd-jwt/core 0.3.2-next.64 → 0.3.2-next.65
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 +6 -6
- package/src/sdjwt.ts +17 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sd-jwt/core",
|
|
3
|
-
"version": "0.3.2-next.
|
|
3
|
+
"version": "0.3.2-next.65+622c8dc",
|
|
4
4
|
"description": "sd-jwt draft 7 implementation in typescript",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -36,12 +36,12 @@
|
|
|
36
36
|
},
|
|
37
37
|
"license": "Apache-2.0",
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@sd-jwt/crypto-nodejs": "0.3.2-next.
|
|
39
|
+
"@sd-jwt/crypto-nodejs": "0.3.2-next.65+622c8dc"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@sd-jwt/decode": "0.3.2-next.
|
|
43
|
-
"@sd-jwt/types": "0.3.2-next.
|
|
44
|
-
"@sd-jwt/utils": "0.3.2-next.
|
|
42
|
+
"@sd-jwt/decode": "0.3.2-next.65+622c8dc",
|
|
43
|
+
"@sd-jwt/types": "0.3.2-next.65+622c8dc",
|
|
44
|
+
"@sd-jwt/utils": "0.3.2-next.65+622c8dc"
|
|
45
45
|
},
|
|
46
46
|
"publishConfig": {
|
|
47
47
|
"access": "public"
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"esm"
|
|
60
60
|
]
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "622c8dc2001c4ca6cc3e6da75f7516d4c70a73db"
|
|
63
63
|
}
|
package/src/sdjwt.ts
CHANGED
|
@@ -250,7 +250,23 @@ export const pack = async <T extends Record<string, unknown>>(
|
|
|
250
250
|
const claim = recursivePackedClaims[i]
|
|
251
251
|
? recursivePackedClaims[i]
|
|
252
252
|
: claims[i];
|
|
253
|
-
|
|
253
|
+
/** This part is set discloure for array items.
|
|
254
|
+
* The example of disclosureFrame of an Array is
|
|
255
|
+
*
|
|
256
|
+
* const claims = {
|
|
257
|
+
* array: ['a', 'b', 'c']
|
|
258
|
+
* }
|
|
259
|
+
*
|
|
260
|
+
* diclosureFrame: DisclosureFrame<typeof claims> = {
|
|
261
|
+
* array: {
|
|
262
|
+
* _sd: [0, 2]
|
|
263
|
+
* }
|
|
264
|
+
* }
|
|
265
|
+
*
|
|
266
|
+
* It means that we want to disclose the first and the third item of the array
|
|
267
|
+
*
|
|
268
|
+
* So If the index `i` is in the disclosure list(sd), then we create a disclosure for the claim
|
|
269
|
+
*/
|
|
254
270
|
// @ts-ignore
|
|
255
271
|
if (sd.includes(i)) {
|
|
256
272
|
const salt = await saltGenerator(16);
|