@sd-jwt/core 0.6.1 → 0.6.2-next.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +7 -7
- package/src/test/index.spec.ts +21 -17
- package/test/app-e2e.spec.ts +5 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sd-jwt/core",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.2-next.2+2e92cb3",
|
|
4
4
|
"description": "sd-jwt draft 7 implementation in typescript",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -38,13 +38,13 @@
|
|
|
38
38
|
},
|
|
39
39
|
"license": "Apache-2.0",
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@sd-jwt/crypto-nodejs": "0.6.
|
|
41
|
+
"@sd-jwt/crypto-nodejs": "0.6.2-next.2+2e92cb3"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@sd-jwt/decode": "0.6.
|
|
45
|
-
"@sd-jwt/present": "0.6.
|
|
46
|
-
"@sd-jwt/types": "0.6.
|
|
47
|
-
"@sd-jwt/utils": "0.6.
|
|
44
|
+
"@sd-jwt/decode": "0.6.2-next.2+2e92cb3",
|
|
45
|
+
"@sd-jwt/present": "0.6.2-next.2+2e92cb3",
|
|
46
|
+
"@sd-jwt/types": "0.6.2-next.2+2e92cb3",
|
|
47
|
+
"@sd-jwt/utils": "0.6.2-next.2+2e92cb3"
|
|
48
48
|
},
|
|
49
49
|
"publishConfig": {
|
|
50
50
|
"access": "public"
|
|
@@ -62,5 +62,5 @@
|
|
|
62
62
|
"esm"
|
|
63
63
|
]
|
|
64
64
|
},
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "2e92cb3abc27f6dbde19c7c016bc1f8ba60f9ff6"
|
|
66
66
|
}
|
package/src/test/index.spec.ts
CHANGED
|
@@ -59,7 +59,7 @@ describe('index', () => {
|
|
|
59
59
|
|
|
60
60
|
expect(credential).toBeDefined();
|
|
61
61
|
|
|
62
|
-
const presentation = await sdjwt.present(
|
|
62
|
+
const presentation = await sdjwt.present<typeof claims>(
|
|
63
63
|
credential,
|
|
64
64
|
{ foo: true },
|
|
65
65
|
{
|
|
@@ -173,7 +173,7 @@ describe('index', () => {
|
|
|
173
173
|
},
|
|
174
174
|
);
|
|
175
175
|
|
|
176
|
-
const presentation = await sdjwt.present(
|
|
176
|
+
const presentation = await sdjwt.present<typeof claims>(
|
|
177
177
|
credential,
|
|
178
178
|
{ foo: true },
|
|
179
179
|
{
|
|
@@ -249,7 +249,7 @@ describe('index', () => {
|
|
|
249
249
|
},
|
|
250
250
|
);
|
|
251
251
|
|
|
252
|
-
const presentation = await sdjwt.present(
|
|
252
|
+
const presentation = await sdjwt.present<typeof claims>(
|
|
253
253
|
credential,
|
|
254
254
|
{ foo: true },
|
|
255
255
|
{
|
|
@@ -359,7 +359,7 @@ describe('index', () => {
|
|
|
359
359
|
},
|
|
360
360
|
);
|
|
361
361
|
|
|
362
|
-
const presentation = await sdjwt.present(
|
|
362
|
+
const presentation = await sdjwt.present<typeof claims>(
|
|
363
363
|
credential,
|
|
364
364
|
{ foo: true },
|
|
365
365
|
{
|
|
@@ -403,7 +403,7 @@ describe('index', () => {
|
|
|
403
403
|
},
|
|
404
404
|
);
|
|
405
405
|
try {
|
|
406
|
-
const presentation = await sdjwt.present(
|
|
406
|
+
const presentation = await sdjwt.present<typeof claims>(
|
|
407
407
|
credential,
|
|
408
408
|
{ foo: true },
|
|
409
409
|
{
|
|
@@ -445,7 +445,7 @@ describe('index', () => {
|
|
|
445
445
|
},
|
|
446
446
|
);
|
|
447
447
|
|
|
448
|
-
const presentation = await sdjwt.present(
|
|
448
|
+
const presentation = await sdjwt.present<typeof claims>(
|
|
449
449
|
credential,
|
|
450
450
|
{ foo: true },
|
|
451
451
|
{
|
|
@@ -488,7 +488,7 @@ describe('index', () => {
|
|
|
488
488
|
},
|
|
489
489
|
);
|
|
490
490
|
|
|
491
|
-
const presentation = sdjwt.present(
|
|
491
|
+
const presentation = sdjwt.present<typeof claims>(
|
|
492
492
|
credential,
|
|
493
493
|
{ foo: true },
|
|
494
494
|
{
|
|
@@ -530,9 +530,9 @@ describe('index', () => {
|
|
|
530
530
|
expect(sdjwt.presentableKeys('')).rejects.toThrow('Hasher not found');
|
|
531
531
|
expect(sdjwt.getClaims('')).rejects.toThrow('Hasher not found');
|
|
532
532
|
expect(() => sdjwt.decode('')).toThrowError('Hasher not found');
|
|
533
|
-
expect(
|
|
534
|
-
|
|
535
|
-
);
|
|
533
|
+
expect(
|
|
534
|
+
sdjwt.present<typeof claims>(credential, { foo: true }),
|
|
535
|
+
).rejects.toThrow('Hasher not found');
|
|
536
536
|
});
|
|
537
537
|
|
|
538
538
|
test('presentableKeys', async () => {
|
|
@@ -581,15 +581,19 @@ describe('index', () => {
|
|
|
581
581
|
},
|
|
582
582
|
);
|
|
583
583
|
|
|
584
|
-
const presentation = await sdjwt.present(
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
584
|
+
const presentation = await sdjwt.present<typeof claims>(
|
|
585
|
+
credential,
|
|
586
|
+
undefined,
|
|
587
|
+
{
|
|
588
|
+
kb: {
|
|
589
|
+
payload: {
|
|
590
|
+
aud: '1',
|
|
591
|
+
iat: 1,
|
|
592
|
+
nonce: '342',
|
|
593
|
+
},
|
|
590
594
|
},
|
|
591
595
|
},
|
|
592
|
-
|
|
596
|
+
);
|
|
593
597
|
|
|
594
598
|
const decoded = await sdjwt.decode(presentation);
|
|
595
599
|
expect(decoded.jwt).toBeDefined();
|
package/test/app-e2e.spec.ts
CHANGED
|
@@ -114,7 +114,10 @@ describe('App', () => {
|
|
|
114
114
|
firstname: true,
|
|
115
115
|
id: true,
|
|
116
116
|
};
|
|
117
|
-
const presentedSDJwt = await sdjwt.present(
|
|
117
|
+
const presentedSDJwt = await sdjwt.present<typeof claims>(
|
|
118
|
+
encodedSdjwt,
|
|
119
|
+
presentationFrame,
|
|
120
|
+
);
|
|
118
121
|
expect(presentedSDJwt).toBeDefined();
|
|
119
122
|
|
|
120
123
|
const presentationClaims = await sdjwt.getClaims(presentedSDJwt);
|
|
@@ -221,7 +224,7 @@ async function JSONtest(filename: string) {
|
|
|
221
224
|
payload: test.claims,
|
|
222
225
|
});
|
|
223
226
|
|
|
224
|
-
const presentedSDJwt = await sdjwt.present(
|
|
227
|
+
const presentedSDJwt = await sdjwt.present<typeof claims>(
|
|
225
228
|
encodedSdjwt,
|
|
226
229
|
test.presentationFrames,
|
|
227
230
|
);
|