@sd-jwt/core 0.3.0 → 2.0.4-next.58
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/LICENSE +201 -0
- package/dist/index.d.mts +106 -0
- package/dist/index.d.ts +106 -0
- package/dist/index.js +606 -0
- package/dist/index.mjs +586 -0
- package/package.json +60 -48
- package/src/decoy.ts +15 -0
- package/src/index.ts +235 -0
- package/src/jwt.ts +107 -0
- package/src/kbjwt.ts +45 -0
- package/src/sdjwt.ts +318 -0
- package/src/test/decoy.spec.ts +30 -0
- package/src/test/index.spec.ts +379 -0
- package/src/test/jwt.spec.ts +141 -0
- package/src/test/kbjwt.spec.ts +275 -0
- package/src/test/pass.spec.ts +6 -0
- package/src/test/sdjwt.spec.ts +382 -0
- package/test/app-e2e.spec.ts +248 -0
- package/test/array_data_types.json +29 -0
- package/test/array_full_sd.json +21 -0
- package/test/array_in_sd.json +13 -0
- package/test/array_nested_in_plain.json +20 -0
- package/test/array_none_disclosed.json +17 -0
- package/test/array_of_nulls.json +15 -0
- package/test/array_of_objects.json +58 -0
- package/test/array_of_scalars.json +15 -0
- package/test/array_recursive_sd.json +35 -0
- package/test/array_recursive_sd_some_disclosed.json +55 -0
- package/test/complex.json +43 -0
- package/test/header_mod.json +44 -0
- package/test/json_serialization.json +44 -0
- package/test/key_binding.json +44 -0
- package/test/no_sd.json +36 -0
- package/test/object_data_types.json +60 -0
- package/test/recursions.json +98 -0
- package/tsconfig.json +7 -0
- package/vitest.config.mts +4 -0
- package/README.md +0 -97
- package/build/index.d.ts +0 -13
- package/build/index.js +0 -20
- package/build/index.js.map +0 -1
- package/build/jwt/error.d.ts +0 -2
- package/build/jwt/error.js +0 -7
- package/build/jwt/error.js.map +0 -1
- package/build/jwt/index.d.ts +0 -2
- package/build/jwt/index.js +0 -19
- package/build/jwt/index.js.map +0 -1
- package/build/jwt/jwt.d.ts +0 -208
- package/build/jwt/jwt.js +0 -325
- package/build/jwt/jwt.js.map +0 -1
- package/build/keyBinding/index.d.ts +0 -1
- package/build/keyBinding/index.js +0 -18
- package/build/keyBinding/index.js.map +0 -1
- package/build/keyBinding/keyBinding.d.ts +0 -64
- package/build/keyBinding/keyBinding.js +0 -119
- package/build/keyBinding/keyBinding.js.map +0 -1
- package/build/sdJwt/decoys.d.ts +0 -3
- package/build/sdJwt/decoys.js +0 -35
- package/build/sdJwt/decoys.js.map +0 -1
- package/build/sdJwt/disclosureFrame.d.ts +0 -8
- package/build/sdJwt/disclosureFrame.js +0 -87
- package/build/sdJwt/disclosureFrame.js.map +0 -1
- package/build/sdJwt/disclosures.d.ts +0 -33
- package/build/sdJwt/disclosures.js +0 -114
- package/build/sdJwt/disclosures.js.map +0 -1
- package/build/sdJwt/error.d.ts +0 -2
- package/build/sdJwt/error.js +0 -7
- package/build/sdJwt/error.js.map +0 -1
- package/build/sdJwt/index.d.ts +0 -6
- package/build/sdJwt/index.js +0 -23
- package/build/sdJwt/index.js.map +0 -1
- package/build/sdJwt/sdJwt.d.ts +0 -206
- package/build/sdJwt/sdJwt.js +0 -442
- package/build/sdJwt/sdJwt.js.map +0 -1
- package/build/sdJwt/types.d.ts +0 -5
- package/build/sdJwt/types.js +0 -3
- package/build/sdJwt/types.js.map +0 -1
- package/build/sdJwtVc/error.d.ts +0 -2
- package/build/sdJwtVc/error.js +0 -7
- package/build/sdJwtVc/error.js.map +0 -1
- package/build/sdJwtVc/index.d.ts +0 -2
- package/build/sdJwtVc/index.js +0 -19
- package/build/sdJwtVc/index.js.map +0 -1
- package/build/sdJwtVc/sdJwtVc.d.ts +0 -47
- package/build/sdJwtVc/sdJwtVc.js +0 -149
- package/build/sdJwtVc/sdJwtVc.js.map +0 -1
- package/build/signatureAndEncryptionAlgorithm.d.ts +0 -105
- package/build/signatureAndEncryptionAlgorithm.js +0 -110
- package/build/signatureAndEncryptionAlgorithm.js.map +0 -1
- package/build/types/disclosure.d.ts +0 -5
- package/build/types/disclosure.js +0 -3
- package/build/types/disclosure.js.map +0 -1
- package/build/types/index.d.ts +0 -5
- package/build/types/index.js +0 -22
- package/build/types/index.js.map +0 -1
- package/build/types/saltGenerator.d.ts +0 -17
- package/build/types/saltGenerator.js +0 -3
- package/build/types/saltGenerator.js.map +0 -1
- package/build/types/signer.d.ts +0 -2
- package/build/types/signer.js +0 -3
- package/build/types/signer.js.map +0 -1
- package/build/types/utils.d.ts +0 -2
- package/build/types/utils.js +0 -3
- package/build/types/utils.js.map +0 -1
- package/build/types/verifier.d.ts +0 -14
- package/build/types/verifier.js +0 -3
- package/build/types/verifier.js.map +0 -1
package/build/index.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export type { SdJwtOptions, SdJwtAdditionalOptions, SdJwtVerificationResult } from './sdJwt';
|
|
2
|
-
export type { KeyBindingHeader, KeyBindingPayload, KeyBindingOptions, KeyBindingAdditionalOptions, KeyBindingVerificationResult } from './keyBinding';
|
|
3
|
-
export type { JwtOptions, JwtAdditionalOptions, JwtVerificationResult } from './jwt';
|
|
4
|
-
export type { Signer, Verifier, VerifyOptions, SaltGenerator, DisclosureItem, DisclosureFrame } from './types';
|
|
5
|
-
export type { SdJwtVcVerificationResult } from './sdJwtVc';
|
|
6
|
-
export { SignatureAndEncryptionAlgorithm } from './signatureAndEncryptionAlgorithm';
|
|
7
|
-
export { SdJwt, Disclosure, SdJwtError } from './sdJwt';
|
|
8
|
-
export { KeyBinding } from './keyBinding';
|
|
9
|
-
export { Jwt, JwtError } from './jwt';
|
|
10
|
-
export { SdJwtVc, SdJwtVcError } from './sdJwtVc';
|
|
11
|
-
export type { Hasher, AsyncHasher, HasherAndAlgorithm } from '@sd-jwt/types';
|
|
12
|
-
export { HasherAlgorithm } from '@sd-jwt/types';
|
|
13
|
-
export type { PresentationFrame } from '@sd-jwt/present';
|
package/build/index.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HasherAlgorithm = exports.SdJwtVcError = exports.SdJwtVc = exports.JwtError = exports.Jwt = exports.KeyBinding = exports.SdJwtError = exports.Disclosure = exports.SdJwt = exports.SignatureAndEncryptionAlgorithm = void 0;
|
|
4
|
-
var signatureAndEncryptionAlgorithm_1 = require("./signatureAndEncryptionAlgorithm");
|
|
5
|
-
Object.defineProperty(exports, "SignatureAndEncryptionAlgorithm", { enumerable: true, get: function () { return signatureAndEncryptionAlgorithm_1.SignatureAndEncryptionAlgorithm; } });
|
|
6
|
-
var sdJwt_1 = require("./sdJwt");
|
|
7
|
-
Object.defineProperty(exports, "SdJwt", { enumerable: true, get: function () { return sdJwt_1.SdJwt; } });
|
|
8
|
-
Object.defineProperty(exports, "Disclosure", { enumerable: true, get: function () { return sdJwt_1.Disclosure; } });
|
|
9
|
-
Object.defineProperty(exports, "SdJwtError", { enumerable: true, get: function () { return sdJwt_1.SdJwtError; } });
|
|
10
|
-
var keyBinding_1 = require("./keyBinding");
|
|
11
|
-
Object.defineProperty(exports, "KeyBinding", { enumerable: true, get: function () { return keyBinding_1.KeyBinding; } });
|
|
12
|
-
var jwt_1 = require("./jwt");
|
|
13
|
-
Object.defineProperty(exports, "Jwt", { enumerable: true, get: function () { return jwt_1.Jwt; } });
|
|
14
|
-
Object.defineProperty(exports, "JwtError", { enumerable: true, get: function () { return jwt_1.JwtError; } });
|
|
15
|
-
var sdJwtVc_1 = require("./sdJwtVc");
|
|
16
|
-
Object.defineProperty(exports, "SdJwtVc", { enumerable: true, get: function () { return sdJwtVc_1.SdJwtVc; } });
|
|
17
|
-
Object.defineProperty(exports, "SdJwtVcError", { enumerable: true, get: function () { return sdJwtVc_1.SdJwtVcError; } });
|
|
18
|
-
var types_1 = require("@sd-jwt/types");
|
|
19
|
-
Object.defineProperty(exports, "HasherAlgorithm", { enumerable: true, get: function () { return types_1.HasherAlgorithm; } });
|
|
20
|
-
//# sourceMappingURL=index.js.map
|
package/build/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AA+BA,qFAAmF;AAA1E,kJAAA,+BAA+B,OAAA;AAExC,iCAAuD;AAA9C,8FAAA,KAAK,OAAA;AAAE,mGAAA,UAAU,OAAA;AAAE,mGAAA,UAAU,OAAA;AACtC,2CAAyC;AAAhC,wGAAA,UAAU,OAAA;AACnB,6BAAqC;AAA5B,0FAAA,GAAG,OAAA;AAAE,+FAAA,QAAQ,OAAA;AACtB,qCAAiD;AAAxC,kGAAA,OAAO,OAAA;AAAE,uGAAA,YAAY,OAAA;AAI9B,uCAA+C;AAAtC,wGAAA,eAAe,OAAA"}
|
package/build/jwt/error.d.ts
DELETED
package/build/jwt/error.js
DELETED
package/build/jwt/error.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"error.js","sourceRoot":"","sources":["../../src/jwt/error.ts"],"names":[],"mappings":";;;AAAA,MAAa,QAAS,SAAQ,KAAK;CAAG;AAAtC,4BAAsC"}
|
package/build/jwt/index.d.ts
DELETED
package/build/jwt/index.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
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);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./jwt"), exports);
|
|
18
|
-
__exportStar(require("./error"), exports);
|
|
19
|
-
//# sourceMappingURL=index.js.map
|
package/build/jwt/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/jwt/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wCAAqB;AACrB,0CAAuB"}
|
package/build/jwt/jwt.d.ts
DELETED
|
@@ -1,208 +0,0 @@
|
|
|
1
|
-
import { MakePropertyRequired, Signer } from '../types';
|
|
2
|
-
import { Verifier } from '../types';
|
|
3
|
-
type ReturnJwtWithHeaderAndPayload<H extends Record<string, unknown>, P extends Record<string, unknown>, T extends Jwt<H, P>> = MakePropertyRequired<T, 'header' | 'payload'>;
|
|
4
|
-
type ReturnJwtWithHeader<H extends Record<string, unknown>, P extends Record<string, unknown>, T extends Jwt<H, P>> = MakePropertyRequired<T, 'header'>;
|
|
5
|
-
type ReturnJwtWithPayload<H extends Record<string, unknown>, P extends Record<string, unknown>, T extends Jwt<H, P>> = MakePropertyRequired<T, 'payload'>;
|
|
6
|
-
type ReturnJwtWithSignature<H extends Record<string, unknown>, P extends Record<string, unknown>, T extends Jwt<H, P>> = MakePropertyRequired<T, 'signature'>;
|
|
7
|
-
export type JwtOptions<H extends Record<string, unknown>, P extends Record<string, unknown>> = {
|
|
8
|
-
header?: H;
|
|
9
|
-
payload?: P;
|
|
10
|
-
signature?: Uint8Array;
|
|
11
|
-
};
|
|
12
|
-
export type JwtAdditionalOptions<Header extends Record<string, unknown> = Record<string, unknown>> = {
|
|
13
|
-
signer?: Signer<Header>;
|
|
14
|
-
};
|
|
15
|
-
export type JwtVerificationResult = {
|
|
16
|
-
isValid: boolean;
|
|
17
|
-
isSignatureValid: boolean;
|
|
18
|
-
isNotBeforeValid?: boolean;
|
|
19
|
-
isExpiryTimeValid?: boolean;
|
|
20
|
-
areRequiredClaimsIncluded?: boolean;
|
|
21
|
-
};
|
|
22
|
-
export declare class Jwt<Header extends Record<string, unknown> = Record<string, unknown>, Payload extends Record<string, unknown> = Record<string, unknown>> {
|
|
23
|
-
/**
|
|
24
|
-
*
|
|
25
|
-
* non-compact structure for a header of a JWT.
|
|
26
|
-
*
|
|
27
|
-
* Defined in: {@link https://datatracker.ietf.org/doc/html/rfc7519#section-5 | RFC 7519}
|
|
28
|
-
*
|
|
29
|
-
*/
|
|
30
|
-
header?: Header;
|
|
31
|
-
/**
|
|
32
|
-
*
|
|
33
|
-
* non-compact structure for a payload of a JWT.
|
|
34
|
-
*
|
|
35
|
-
* Defined in: {@link https://datatracker.ietf.org/doc/html/rfc7519#section-4 | RFC 7519}
|
|
36
|
-
*
|
|
37
|
-
*/
|
|
38
|
-
payload?: Payload;
|
|
39
|
-
/**
|
|
40
|
-
*
|
|
41
|
-
* Signature over the BASE64URL(HEADER) || '.' || BASE64URL(PAYLOAD).
|
|
42
|
-
*
|
|
43
|
-
* Defined in: {@link https://datatracker.ietf.org/doc/html/rfc7515 | RFC 7515}
|
|
44
|
-
*
|
|
45
|
-
*/
|
|
46
|
-
signature?: Uint8Array;
|
|
47
|
-
/**
|
|
48
|
-
* When the JWT was initialized from it's compact variant we store the compact version, so we can use it when needing the encoded version.
|
|
49
|
-
*/
|
|
50
|
-
compact?: string;
|
|
51
|
-
/**
|
|
52
|
-
*
|
|
53
|
-
* Callback that will be used when creating a signature over the JWT.
|
|
54
|
-
*
|
|
55
|
-
*/
|
|
56
|
-
signer?: Signer<Header>;
|
|
57
|
-
constructor(options?: JwtOptions<Header, Payload>, additionalOptions?: JwtAdditionalOptions);
|
|
58
|
-
/**
|
|
59
|
-
*
|
|
60
|
-
* Instantiate a JWT from a compact format.
|
|
61
|
-
*
|
|
62
|
-
* Two generics may be supplied for typing on the Header and Payload. These are not enforced.
|
|
63
|
-
*
|
|
64
|
-
* Defined in: {@link https://datatracker.ietf.org/doc/html/rfc7519#section-3 | RFC 7519 }
|
|
65
|
-
*
|
|
66
|
-
*/
|
|
67
|
-
static fromCompact<Header extends Record<string, unknown> = Record<string, unknown>, Payload extends Record<string, unknown> = Record<string, unknown>>(compact: string): ReturnJwtWithHeaderAndPayload<Header, Payload, Jwt<Header, Payload>>;
|
|
68
|
-
/**
|
|
69
|
-
*
|
|
70
|
-
* Replaces the current Header a new one.
|
|
71
|
-
*
|
|
72
|
-
*/
|
|
73
|
-
withHeader(header: Header): ReturnJwtWithHeader<Header, Payload, this>;
|
|
74
|
-
/**
|
|
75
|
-
*
|
|
76
|
-
* Add a new claim to the Header, overriding the old one if it already is on there.
|
|
77
|
-
*
|
|
78
|
-
*/
|
|
79
|
-
addHeaderClaim(item: keyof Header | string, value: Header[typeof item] | unknown): ReturnJwtWithHeader<Header, Payload, this>;
|
|
80
|
-
/**
|
|
81
|
-
*
|
|
82
|
-
* Replaces the current Payload a new one.
|
|
83
|
-
*
|
|
84
|
-
*/
|
|
85
|
-
withPayload(payload: Payload): ReturnJwtWithPayload<Header, Payload, this>;
|
|
86
|
-
/**
|
|
87
|
-
*
|
|
88
|
-
* Add a new claim to the Payload, overriding the old one if it already is on there.
|
|
89
|
-
*
|
|
90
|
-
*/
|
|
91
|
-
addPayloadClaim(item: keyof Payload | string, value: Payload[typeof item] | unknown): ReturnJwtWithPayload<Header, Payload, this>;
|
|
92
|
-
/**
|
|
93
|
-
*
|
|
94
|
-
* Manually append a signature to the JWT. This signature is not validated.
|
|
95
|
-
*
|
|
96
|
-
* @note Only use this if the supplying a signing callback does not fit your use case.
|
|
97
|
-
*
|
|
98
|
-
*/
|
|
99
|
-
withSignature(signature: Uint8Array): ReturnJwtWithSignature<Header, Payload, this>;
|
|
100
|
-
/**
|
|
101
|
-
*
|
|
102
|
-
* Add a signing callback to the JWT that will be used for creating the signature.
|
|
103
|
-
*
|
|
104
|
-
*/
|
|
105
|
-
withSigner(signer: Signer): this;
|
|
106
|
-
/**
|
|
107
|
-
*
|
|
108
|
-
* Assert that there is a Header on the JWT.
|
|
109
|
-
*
|
|
110
|
-
* @throws when the Header is not defined
|
|
111
|
-
*
|
|
112
|
-
*/
|
|
113
|
-
assertHeader(): void;
|
|
114
|
-
/**
|
|
115
|
-
*
|
|
116
|
-
* Assert that there is a Payload on the JWT.
|
|
117
|
-
*
|
|
118
|
-
* @throws when the Payload is not defined
|
|
119
|
-
*
|
|
120
|
-
*/
|
|
121
|
-
assertPayload(): void;
|
|
122
|
-
/**
|
|
123
|
-
*
|
|
124
|
-
* Assert that there is a Signature on the JWT.
|
|
125
|
-
*
|
|
126
|
-
* @throws when the Signature is not defined
|
|
127
|
-
*
|
|
128
|
-
*/
|
|
129
|
-
assertSignature(): void;
|
|
130
|
-
/**
|
|
131
|
-
*
|
|
132
|
-
* Assert that there is a Signing callback on the JWT.
|
|
133
|
-
*
|
|
134
|
-
* @throws when the Signer is not defined
|
|
135
|
-
*
|
|
136
|
-
*/
|
|
137
|
-
assertSigner(): void;
|
|
138
|
-
/**
|
|
139
|
-
*
|
|
140
|
-
* Assert that there is a specific claim, possibly with value, in the Header.
|
|
141
|
-
*
|
|
142
|
-
*/
|
|
143
|
-
assertClaimInHeader(claimKey: keyof Header | string, claimValue?: Header[typeof claimKey] | unknown): void;
|
|
144
|
-
/**
|
|
145
|
-
*
|
|
146
|
-
* Assert that there is a specific claim, possibly with value, in the Payload.
|
|
147
|
-
*
|
|
148
|
-
*/
|
|
149
|
-
assertClaimInPayload(claimKey: keyof Payload | string, claimValue?: Payload[typeof claimKey] | unknown): void;
|
|
150
|
-
private assertClaimInObject;
|
|
151
|
-
/**
|
|
152
|
-
*
|
|
153
|
-
* Get a claim within the payload.
|
|
154
|
-
*
|
|
155
|
-
* @throws when the payload is not defined
|
|
156
|
-
* @throws when the claim could not be found at any level
|
|
157
|
-
*
|
|
158
|
-
*/
|
|
159
|
-
getClaimInPayload<T>(claimKey: keyof Payload | string): T;
|
|
160
|
-
/**
|
|
161
|
-
*
|
|
162
|
-
* Get a claim within the payload.
|
|
163
|
-
*
|
|
164
|
-
* @throws when the payload is not defined
|
|
165
|
-
* @throws when the claim could not be found at any level
|
|
166
|
-
*
|
|
167
|
-
*/
|
|
168
|
-
getClaimInHeader<T>(claimKey: keyof Header | string): T;
|
|
169
|
-
private getClaimInObject;
|
|
170
|
-
/**
|
|
171
|
-
*
|
|
172
|
-
* Returns a string of what needs to be signed.
|
|
173
|
-
*
|
|
174
|
-
* Defined in: {@link https://datatracker.ietf.org/doc/html/rfc7519#section-3 | RFC 7519}
|
|
175
|
-
*
|
|
176
|
-
*/
|
|
177
|
-
get signableInput(): string;
|
|
178
|
-
/**
|
|
179
|
-
*
|
|
180
|
-
* Sign the Header and Payload and append the signature to the JWT.
|
|
181
|
-
*
|
|
182
|
-
*/
|
|
183
|
-
signAndAdd(): Promise<ReturnJwtWithSignature<Header, Payload, this>>;
|
|
184
|
-
private get compactHeader();
|
|
185
|
-
private get compactPayload();
|
|
186
|
-
/**
|
|
187
|
-
*
|
|
188
|
-
* Create a compact format of the JWT.
|
|
189
|
-
*
|
|
190
|
-
* This will add a signature if there is none.
|
|
191
|
-
*
|
|
192
|
-
* @throws When the signature and signer are not defined
|
|
193
|
-
*
|
|
194
|
-
*/
|
|
195
|
-
toCompact(): Promise<string>;
|
|
196
|
-
/**
|
|
197
|
-
*
|
|
198
|
-
* Verify the JWT.
|
|
199
|
-
*
|
|
200
|
-
* - Check the nbf claim with `now`
|
|
201
|
-
* - Check the exp claim with `now`
|
|
202
|
-
* - Additionally validate any required claims
|
|
203
|
-
* - Additionally pass in a specific publicKeyJwk to validate the signature
|
|
204
|
-
*
|
|
205
|
-
*/
|
|
206
|
-
verify(verifySignature: Verifier<Header>, requiredClaims?: Array<keyof Payload | string>, publicKeyJwk?: Record<string, unknown>): Promise<JwtVerificationResult>;
|
|
207
|
-
}
|
|
208
|
-
export {};
|
package/build/jwt/jwt.js
DELETED
|
@@ -1,325 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.Jwt = void 0;
|
|
13
|
-
const utils_1 = require("@sd-jwt/utils");
|
|
14
|
-
const error_1 = require("./error");
|
|
15
|
-
const utils_2 = require("@sd-jwt/utils");
|
|
16
|
-
const decode_1 = require("@sd-jwt/decode");
|
|
17
|
-
class Jwt {
|
|
18
|
-
constructor(options, additionalOptions) {
|
|
19
|
-
this.header = options === null || options === void 0 ? void 0 : options.header;
|
|
20
|
-
this.payload = options === null || options === void 0 ? void 0 : options.payload;
|
|
21
|
-
this.signature = options === null || options === void 0 ? void 0 : options.signature;
|
|
22
|
-
this.signer = additionalOptions === null || additionalOptions === void 0 ? void 0 : additionalOptions.signer;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
*
|
|
26
|
-
* Instantiate a JWT from a compact format.
|
|
27
|
-
*
|
|
28
|
-
* Two generics may be supplied for typing on the Header and Payload. These are not enforced.
|
|
29
|
-
*
|
|
30
|
-
* Defined in: {@link https://datatracker.ietf.org/doc/html/rfc7519#section-3 | RFC 7519 }
|
|
31
|
-
*
|
|
32
|
-
*/
|
|
33
|
-
static fromCompact(compact) {
|
|
34
|
-
const { header, payload, signature } = (0, decode_1.jwtFromCompact)(compact);
|
|
35
|
-
const jwt = new Jwt({
|
|
36
|
-
header,
|
|
37
|
-
payload,
|
|
38
|
-
signature
|
|
39
|
-
});
|
|
40
|
-
jwt.compact = compact;
|
|
41
|
-
return jwt;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
*
|
|
45
|
-
* Replaces the current Header a new one.
|
|
46
|
-
*
|
|
47
|
-
*/
|
|
48
|
-
withHeader(header) {
|
|
49
|
-
this.header = header;
|
|
50
|
-
return this;
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
*
|
|
54
|
-
* Add a new claim to the Header, overriding the old one if it already is on there.
|
|
55
|
-
*
|
|
56
|
-
*/
|
|
57
|
-
addHeaderClaim(item, value) {
|
|
58
|
-
var _a;
|
|
59
|
-
(_a = this.header) !== null && _a !== void 0 ? _a : (this.header = {});
|
|
60
|
-
if (value !== undefined && item !== null) {
|
|
61
|
-
this.header = Object.assign(Object.assign({}, this.header), { [item]: value });
|
|
62
|
-
}
|
|
63
|
-
return this;
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
*
|
|
67
|
-
* Replaces the current Payload a new one.
|
|
68
|
-
*
|
|
69
|
-
*/
|
|
70
|
-
withPayload(payload) {
|
|
71
|
-
this.payload = payload;
|
|
72
|
-
return this;
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
*
|
|
76
|
-
* Add a new claim to the Payload, overriding the old one if it already is on there.
|
|
77
|
-
*
|
|
78
|
-
*/
|
|
79
|
-
addPayloadClaim(item, value) {
|
|
80
|
-
var _a;
|
|
81
|
-
(_a = this.payload) !== null && _a !== void 0 ? _a : (this.payload = {});
|
|
82
|
-
if (value !== undefined && item !== null) {
|
|
83
|
-
this.payload = Object.assign(Object.assign({}, this.payload), { [item]: value });
|
|
84
|
-
}
|
|
85
|
-
return this;
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
*
|
|
89
|
-
* Manually append a signature to the JWT. This signature is not validated.
|
|
90
|
-
*
|
|
91
|
-
* @note Only use this if the supplying a signing callback does not fit your use case.
|
|
92
|
-
*
|
|
93
|
-
*/
|
|
94
|
-
withSignature(signature) {
|
|
95
|
-
this.signature = signature;
|
|
96
|
-
return this;
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
*
|
|
100
|
-
* Add a signing callback to the JWT that will be used for creating the signature.
|
|
101
|
-
*
|
|
102
|
-
*/
|
|
103
|
-
withSigner(signer) {
|
|
104
|
-
this.signer = signer;
|
|
105
|
-
return this;
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
*
|
|
109
|
-
* Assert that there is a Header on the JWT.
|
|
110
|
-
*
|
|
111
|
-
* @throws when the Header is not defined
|
|
112
|
-
*
|
|
113
|
-
*/
|
|
114
|
-
assertHeader() {
|
|
115
|
-
if (this.header)
|
|
116
|
-
return;
|
|
117
|
-
throw new error_1.JwtError('Header must be defined');
|
|
118
|
-
}
|
|
119
|
-
/**
|
|
120
|
-
*
|
|
121
|
-
* Assert that there is a Payload on the JWT.
|
|
122
|
-
*
|
|
123
|
-
* @throws when the Payload is not defined
|
|
124
|
-
*
|
|
125
|
-
*/
|
|
126
|
-
assertPayload() {
|
|
127
|
-
if (this.payload)
|
|
128
|
-
return;
|
|
129
|
-
throw new error_1.JwtError('Payload must be defined');
|
|
130
|
-
}
|
|
131
|
-
/**
|
|
132
|
-
*
|
|
133
|
-
* Assert that there is a Signature on the JWT.
|
|
134
|
-
*
|
|
135
|
-
* @throws when the Signature is not defined
|
|
136
|
-
*
|
|
137
|
-
*/
|
|
138
|
-
assertSignature() {
|
|
139
|
-
if (this.signature)
|
|
140
|
-
return;
|
|
141
|
-
throw new error_1.JwtError('Signature must be defined');
|
|
142
|
-
}
|
|
143
|
-
/**
|
|
144
|
-
*
|
|
145
|
-
* Assert that there is a Signing callback on the JWT.
|
|
146
|
-
*
|
|
147
|
-
* @throws when the Signer is not defined
|
|
148
|
-
*
|
|
149
|
-
*/
|
|
150
|
-
assertSigner() {
|
|
151
|
-
if (this.signer)
|
|
152
|
-
return;
|
|
153
|
-
throw new error_1.JwtError('A signer must be provided to create a signature. You can set it with this.withSigner()');
|
|
154
|
-
}
|
|
155
|
-
/**
|
|
156
|
-
*
|
|
157
|
-
* Assert that there is a specific claim, possibly with value, in the Header.
|
|
158
|
-
*
|
|
159
|
-
*/
|
|
160
|
-
assertClaimInHeader(claimKey, claimValue) {
|
|
161
|
-
this.assertHeader();
|
|
162
|
-
try {
|
|
163
|
-
this.assertClaimInObject(this.header, claimKey, claimValue);
|
|
164
|
-
}
|
|
165
|
-
catch (e) {
|
|
166
|
-
if (e instanceof error_1.JwtError) {
|
|
167
|
-
e.message += ' within the header';
|
|
168
|
-
}
|
|
169
|
-
throw e;
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
/**
|
|
173
|
-
*
|
|
174
|
-
* Assert that there is a specific claim, possibly with value, in the Payload.
|
|
175
|
-
*
|
|
176
|
-
*/
|
|
177
|
-
assertClaimInPayload(claimKey, claimValue) {
|
|
178
|
-
this.assertPayload();
|
|
179
|
-
try {
|
|
180
|
-
this.assertClaimInObject(this.payload, claimKey, claimValue);
|
|
181
|
-
}
|
|
182
|
-
catch (e) {
|
|
183
|
-
if (e instanceof error_1.JwtError) {
|
|
184
|
-
e.message += ' within the payload';
|
|
185
|
-
}
|
|
186
|
-
throw e;
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
assertClaimInObject(object, claimKey, claimValue) {
|
|
190
|
-
const value = (0, utils_2.getValueByKeyAnyLevel)(object, claimKey);
|
|
191
|
-
if (!value) {
|
|
192
|
-
throw new error_1.JwtError(`Claim key '${claimKey}' not found in any level`);
|
|
193
|
-
}
|
|
194
|
-
if (claimValue && !(0, utils_2.simpleDeepEqual)(value, claimValue)) {
|
|
195
|
-
throw new error_1.JwtError(`Claim key '${claimKey}' was found, but values did not match`);
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
/**
|
|
199
|
-
*
|
|
200
|
-
* Get a claim within the payload.
|
|
201
|
-
*
|
|
202
|
-
* @throws when the payload is not defined
|
|
203
|
-
* @throws when the claim could not be found at any level
|
|
204
|
-
*
|
|
205
|
-
*/
|
|
206
|
-
getClaimInPayload(claimKey) {
|
|
207
|
-
this.assertPayload();
|
|
208
|
-
return this.getClaimInObject(this.payload, claimKey);
|
|
209
|
-
}
|
|
210
|
-
/**
|
|
211
|
-
*
|
|
212
|
-
* Get a claim within the payload.
|
|
213
|
-
*
|
|
214
|
-
* @throws when the payload is not defined
|
|
215
|
-
* @throws when the claim could not be found at any level
|
|
216
|
-
*
|
|
217
|
-
*/
|
|
218
|
-
getClaimInHeader(claimKey) {
|
|
219
|
-
this.assertHeader();
|
|
220
|
-
return this.getClaimInObject(this.header, claimKey);
|
|
221
|
-
}
|
|
222
|
-
getClaimInObject(object, claimKey) {
|
|
223
|
-
const value = (0, utils_2.getValueByKeyAnyLevel)(object, claimKey);
|
|
224
|
-
if (!value) {
|
|
225
|
-
throw new error_1.JwtError(`Claim key '${claimKey}' not found in any level`);
|
|
226
|
-
}
|
|
227
|
-
return value;
|
|
228
|
-
}
|
|
229
|
-
/**
|
|
230
|
-
*
|
|
231
|
-
* Returns a string of what needs to be signed.
|
|
232
|
-
*
|
|
233
|
-
* Defined in: {@link https://datatracker.ietf.org/doc/html/rfc7519#section-3 | RFC 7519}
|
|
234
|
-
*
|
|
235
|
-
*/
|
|
236
|
-
get signableInput() {
|
|
237
|
-
this.assertHeader();
|
|
238
|
-
this.assertPayload();
|
|
239
|
-
return `${this.compactHeader}.${this.compactPayload}`;
|
|
240
|
-
}
|
|
241
|
-
/**
|
|
242
|
-
*
|
|
243
|
-
* Sign the Header and Payload and append the signature to the JWT.
|
|
244
|
-
*
|
|
245
|
-
*/
|
|
246
|
-
signAndAdd() {
|
|
247
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
248
|
-
this.assertSigner();
|
|
249
|
-
const signature = yield this.signer(this.signableInput, this.header);
|
|
250
|
-
this.withSignature(signature);
|
|
251
|
-
return this;
|
|
252
|
-
});
|
|
253
|
-
}
|
|
254
|
-
get compactHeader() {
|
|
255
|
-
this.assertHeader();
|
|
256
|
-
return utils_1.Base64url.encodeFromJson(this.header);
|
|
257
|
-
}
|
|
258
|
-
get compactPayload() {
|
|
259
|
-
this.assertPayload();
|
|
260
|
-
return utils_1.Base64url.encodeFromJson(this.payload);
|
|
261
|
-
}
|
|
262
|
-
/**
|
|
263
|
-
*
|
|
264
|
-
* Create a compact format of the JWT.
|
|
265
|
-
*
|
|
266
|
-
* This will add a signature if there is none.
|
|
267
|
-
*
|
|
268
|
-
* @throws When the signature and signer are not defined
|
|
269
|
-
*
|
|
270
|
-
*/
|
|
271
|
-
toCompact() {
|
|
272
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
273
|
-
this.assertHeader();
|
|
274
|
-
this.assertPayload();
|
|
275
|
-
if (!this.signature) {
|
|
276
|
-
yield this.signAndAdd();
|
|
277
|
-
}
|
|
278
|
-
const encodedSignature = utils_1.Base64url.encode(this.signature);
|
|
279
|
-
return `${this.compactHeader}.${this.compactPayload}.${encodedSignature}`;
|
|
280
|
-
});
|
|
281
|
-
}
|
|
282
|
-
/**
|
|
283
|
-
*
|
|
284
|
-
* Verify the JWT.
|
|
285
|
-
*
|
|
286
|
-
* - Check the nbf claim with `now`
|
|
287
|
-
* - Check the exp claim with `now`
|
|
288
|
-
* - Additionally validate any required claims
|
|
289
|
-
* - Additionally pass in a specific publicKeyJwk to validate the signature
|
|
290
|
-
*
|
|
291
|
-
*/
|
|
292
|
-
verify(verifySignature, requiredClaims, publicKeyJwk) {
|
|
293
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
294
|
-
this.assertHeader();
|
|
295
|
-
this.assertPayload();
|
|
296
|
-
this.assertSignature();
|
|
297
|
-
const ret = {};
|
|
298
|
-
ret.isSignatureValid = yield verifySignature({
|
|
299
|
-
header: this.header,
|
|
300
|
-
signature: this.signature,
|
|
301
|
-
message: this.signableInput,
|
|
302
|
-
publicKeyJwk
|
|
303
|
-
});
|
|
304
|
-
if ('nbf' in this.payload) {
|
|
305
|
-
const now = new Date();
|
|
306
|
-
const notBefore = new Date(this.payload.nbf * 1000);
|
|
307
|
-
ret.isNotBeforeValid = notBefore < now;
|
|
308
|
-
}
|
|
309
|
-
if ('exp' in this.payload) {
|
|
310
|
-
const now = new Date();
|
|
311
|
-
const expiryTime = new Date(this.payload.exp * 1000);
|
|
312
|
-
ret.isExpiryTimeValid = expiryTime > now;
|
|
313
|
-
}
|
|
314
|
-
if (requiredClaims) {
|
|
315
|
-
ret.areRequiredClaimsIncluded = requiredClaims.every((claim) => claim in this.payload);
|
|
316
|
-
}
|
|
317
|
-
ret.isValid = Object.values(ret)
|
|
318
|
-
.filter((i) => typeof i === 'boolean')
|
|
319
|
-
.every((i) => !!i);
|
|
320
|
-
return ret;
|
|
321
|
-
});
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
exports.Jwt = Jwt;
|
|
325
|
-
//# sourceMappingURL=jwt.js.map
|
package/build/jwt/jwt.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"jwt.js","sourceRoot":"","sources":["../../src/jwt/jwt.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yCAAyC;AACzC,mCAAkC;AAGlC,yCAAsE;AACtE,2CAA+C;AAiD/C,MAAa,GAAG;IA2CZ,YACI,OAAqC,EACrC,iBAAwC;QAExC,IAAI,CAAC,MAAM,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,CAAA;QAC7B,IAAI,CAAC,OAAO,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,CAAA;QAC/B,IAAI,CAAC,SAAS,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,SAAS,CAAA;QAEnC,IAAI,CAAC,MAAM,GAAG,iBAAiB,aAAjB,iBAAiB,uBAAjB,iBAAiB,CAAE,MAAM,CAAA;IAC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B,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,SAAS,CAAC;iBACrC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;YAEtB,OAAO,GAA4B,CAAA;QACvC,CAAC;KAAA;CACJ;AAtbD,kBAsbC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './keyBinding';
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
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);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./keyBinding"), exports);
|
|
18
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/keyBinding/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA4B"}
|