@cfworker/jwt 5.2.0 → 6.0.0
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/dist/cjs/algs.js +9 -0
- package/dist/cjs/decode.js +14 -0
- package/dist/cjs/discovery.js +15 -0
- package/dist/cjs/index.js +28 -0
- package/dist/cjs/jwks.js +51 -0
- package/dist/cjs/parse.js +190 -0
- package/dist/{types.d.ts → cjs/types.d.ts} +1 -1
- package/dist/cjs/types.js +8 -0
- package/dist/cjs/verify.js +8 -0
- package/dist/esm/algs.d.ts +2 -0
- package/dist/esm/decode.d.ts +2 -0
- package/dist/esm/discovery.d.ts +2 -0
- package/dist/{index.d.ts → esm/index.d.ts} +0 -1
- package/dist/esm/index.js +5 -0
- package/dist/esm/jwks.d.ts +4 -0
- package/dist/esm/parse.d.ts +9 -0
- package/dist/{parse.js → esm/parse.js} +19 -18
- package/dist/esm/types.d.ts +71 -0
- package/dist/esm/types.js +5 -0
- package/dist/esm/verify.d.ts +2 -0
- package/dist/tsconfig-cjs.tsbuildinfo +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +10 -6
- package/src/algs.ts +1 -1
- package/src/index.ts +0 -1
- package/src/jwks.ts +1 -1
- package/src/types.ts +1 -1
- package/src/verify.ts +4 -1
- package/dist/types.js +0 -1
- /package/dist/{algs.d.ts → cjs/algs.d.ts} +0 -0
- /package/dist/{decode.d.ts → cjs/decode.d.ts} +0 -0
- /package/dist/{discovery.d.ts → cjs/discovery.d.ts} +0 -0
- /package/dist/{index.js → cjs/index.d.ts} +0 -0
- /package/dist/{jwks.d.ts → cjs/jwks.d.ts} +0 -0
- /package/dist/{parse.d.ts → cjs/parse.d.ts} +0 -0
- /package/dist/{verify.d.ts → cjs/verify.d.ts} +0 -0
- /package/dist/{algs.js → esm/algs.js} +0 -0
- /package/dist/{decode.js → esm/decode.js} +0 -0
- /package/dist/{discovery.js → esm/discovery.js} +0 -0
- /package/dist/{jwks.js → esm/jwks.js} +0 -0
- /package/dist/{verify.js → esm/verify.js} +0 -0
package/dist/cjs/algs.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.decodeJwt = decodeJwt;
|
|
4
|
+
const rfc4648_1 = require("rfc4648");
|
|
5
|
+
function decodeJwt(token) {
|
|
6
|
+
const [header, payload, signature] = token.split('.');
|
|
7
|
+
const decoder = new TextDecoder();
|
|
8
|
+
return {
|
|
9
|
+
header: JSON.parse(decoder.decode(rfc4648_1.base64url.parse(header, { loose: true }))),
|
|
10
|
+
payload: JSON.parse(decoder.decode(rfc4648_1.base64url.parse(payload, { loose: true }))),
|
|
11
|
+
signature: rfc4648_1.base64url.parse(signature, { loose: true }),
|
|
12
|
+
raw: { header, payload, signature }
|
|
13
|
+
};
|
|
14
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getIssuerMetadata = getIssuerMetadata;
|
|
4
|
+
async function getIssuerMetadata(issuer) {
|
|
5
|
+
const url = new URL(issuer);
|
|
6
|
+
if (!url.pathname.endsWith('/')) {
|
|
7
|
+
url.pathname += '/';
|
|
8
|
+
}
|
|
9
|
+
url.pathname += '.well-known/openid-configuration';
|
|
10
|
+
const response = await fetch(url.href);
|
|
11
|
+
if (!response.ok) {
|
|
12
|
+
throw new Error(`Error loading OpenID discovery document at ${url.href}. ${response.status} ${response.statusText}`);
|
|
13
|
+
}
|
|
14
|
+
return response.json();
|
|
15
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
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
|
+
exports.verifyJwtSignature = exports.parseJwt = exports.importKey = exports.getKey = exports.getJwks = exports.decodeJwt = void 0;
|
|
18
|
+
var decode_js_1 = require("./decode.js");
|
|
19
|
+
Object.defineProperty(exports, "decodeJwt", { enumerable: true, get: function () { return decode_js_1.decodeJwt; } });
|
|
20
|
+
var jwks_js_1 = require("./jwks.js");
|
|
21
|
+
Object.defineProperty(exports, "getJwks", { enumerable: true, get: function () { return jwks_js_1.getJwks; } });
|
|
22
|
+
Object.defineProperty(exports, "getKey", { enumerable: true, get: function () { return jwks_js_1.getKey; } });
|
|
23
|
+
Object.defineProperty(exports, "importKey", { enumerable: true, get: function () { return jwks_js_1.importKey; } });
|
|
24
|
+
var parse_js_1 = require("./parse.js");
|
|
25
|
+
Object.defineProperty(exports, "parseJwt", { enumerable: true, get: function () { return parse_js_1.parseJwt; } });
|
|
26
|
+
__exportStar(require("./types.js"), exports);
|
|
27
|
+
var verify_js_1 = require("./verify.js");
|
|
28
|
+
Object.defineProperty(exports, "verifyJwtSignature", { enumerable: true, get: function () { return verify_js_1.verifyJwtSignature; } });
|
package/dist/cjs/jwks.js
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getJwks = getJwks;
|
|
4
|
+
exports.importKey = importKey;
|
|
5
|
+
exports.getKey = getKey;
|
|
6
|
+
const algs_js_1 = require("./algs.js");
|
|
7
|
+
const discovery_js_1 = require("./discovery.js");
|
|
8
|
+
async function getJwks(issuer) {
|
|
9
|
+
const issuerMetadata = await (0, discovery_js_1.getIssuerMetadata)(issuer);
|
|
10
|
+
let url;
|
|
11
|
+
if (issuerMetadata.jwks_uri) {
|
|
12
|
+
url = new URL(issuerMetadata.jwks_uri);
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
url = new URL(issuer);
|
|
16
|
+
if (!url.pathname.endsWith('/')) {
|
|
17
|
+
url.pathname += '/';
|
|
18
|
+
}
|
|
19
|
+
url.pathname += '.well-known/jwks.json';
|
|
20
|
+
}
|
|
21
|
+
const response = await fetch(url.href);
|
|
22
|
+
if (!response.ok) {
|
|
23
|
+
throw new Error(`Error loading jwks at ${url.href}. ${response.status} ${response.statusText}`);
|
|
24
|
+
}
|
|
25
|
+
return response.json();
|
|
26
|
+
}
|
|
27
|
+
const importedKeys = {};
|
|
28
|
+
async function importKey(iss, jwk) {
|
|
29
|
+
if (jwk.kty !== 'RSA') {
|
|
30
|
+
throw new Error(`Unsupported jwk key type (kty) "${jwk.kty}": Full JWK was ${JSON.stringify(jwk)}`);
|
|
31
|
+
}
|
|
32
|
+
const hash = jwk.alg ? algs_js_1.algToHash[jwk.alg] : 'SHA-256';
|
|
33
|
+
if (!hash) {
|
|
34
|
+
throw new Error(`Unsupported jwk Algorithm (alg) "${jwk.alg}": Full JWK was ${JSON.stringify(jwk)}`);
|
|
35
|
+
}
|
|
36
|
+
const key = await crypto.subtle.importKey('jwk', jwk, { name: 'RSASSA-PKCS1-v1_5', hash }, false, ['verify']);
|
|
37
|
+
importedKeys[iss] = importedKeys[iss] || {};
|
|
38
|
+
importedKeys[iss][jwk.kid ?? 'default'] = key;
|
|
39
|
+
}
|
|
40
|
+
async function getKey(decoded) {
|
|
41
|
+
const { header: { kid = 'default' }, payload: { iss } } = decoded;
|
|
42
|
+
if (!importedKeys[iss]) {
|
|
43
|
+
const jwks = await getJwks(iss);
|
|
44
|
+
await Promise.all(jwks.keys.map(jwk => importKey(iss, jwk)));
|
|
45
|
+
}
|
|
46
|
+
const key = importedKeys[iss][kid];
|
|
47
|
+
if (!key) {
|
|
48
|
+
throw new Error(`Error jwk not found. iss: ${iss}; kid: ${kid};`);
|
|
49
|
+
}
|
|
50
|
+
return key;
|
|
51
|
+
}
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseJwt = parseJwt;
|
|
4
|
+
const algs_js_1 = require("./algs.js");
|
|
5
|
+
const decode_js_1 = require("./decode.js");
|
|
6
|
+
const jwks_js_1 = require("./jwks.js");
|
|
7
|
+
const types_js_1 = require("./types.js");
|
|
8
|
+
const verify_js_1 = require("./verify.js");
|
|
9
|
+
const defaultSkewMs = 60 * 1000;
|
|
10
|
+
async function parseJwt({ jwt, issuer, audience, resolveKey = jwks_js_1.getKey, skewMs = defaultSkewMs }) {
|
|
11
|
+
let decoded;
|
|
12
|
+
try {
|
|
13
|
+
decoded = (0, decode_js_1.decodeJwt)(jwt);
|
|
14
|
+
}
|
|
15
|
+
catch {
|
|
16
|
+
return {
|
|
17
|
+
valid: false,
|
|
18
|
+
reason: `Unable to decode JWT.`,
|
|
19
|
+
reasonCode: types_js_1.InvalidJwtReasonCode.Other
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
const { typ, alg } = decoded.header;
|
|
23
|
+
if (typeof typ !== 'undefined' && typ !== 'JWT') {
|
|
24
|
+
return {
|
|
25
|
+
valid: false,
|
|
26
|
+
reason: `Invalid JWT type ${JSON.stringify(typ)}. Expected "JWT".`,
|
|
27
|
+
reasonCode: types_js_1.InvalidJwtReasonCode.Other,
|
|
28
|
+
decoded
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
if (!algs_js_1.algToHash[alg]) {
|
|
32
|
+
return {
|
|
33
|
+
valid: false,
|
|
34
|
+
reason: `Invalid JWT algorithm ${JSON.stringify(alg)}. Supported: ${algs_js_1.algs}.`,
|
|
35
|
+
reasonCode: types_js_1.InvalidJwtReasonCode.Other,
|
|
36
|
+
decoded
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
const { sub, aud, iss, iat, exp, nbf } = decoded.payload;
|
|
40
|
+
if (typeof sub !== 'string') {
|
|
41
|
+
return {
|
|
42
|
+
valid: false,
|
|
43
|
+
reason: `Subject claim (sub) is required and must be a string. Received ${JSON.stringify(sub)}.`,
|
|
44
|
+
reasonCode: types_js_1.InvalidJwtReasonCode.Other,
|
|
45
|
+
decoded
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
if (typeof aud === 'string') {
|
|
49
|
+
if (aud !== audience) {
|
|
50
|
+
return {
|
|
51
|
+
valid: false,
|
|
52
|
+
reason: `Invalid JWT audience claim (aud) ${JSON.stringify(aud)}. Expected "${audience}".`,
|
|
53
|
+
reasonCode: types_js_1.InvalidJwtReasonCode.Other,
|
|
54
|
+
decoded
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
else if (Array.isArray(aud) &&
|
|
59
|
+
aud.length > 0 &&
|
|
60
|
+
aud.every(a => typeof a === 'string')) {
|
|
61
|
+
if (!aud.includes(audience)) {
|
|
62
|
+
return {
|
|
63
|
+
valid: false,
|
|
64
|
+
reason: `Invalid JWT audience claim array (aud) ${JSON.stringify(aud)}. Does not include "${audience}".`,
|
|
65
|
+
reasonCode: types_js_1.InvalidJwtReasonCode.Other,
|
|
66
|
+
decoded
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
return {
|
|
72
|
+
valid: false,
|
|
73
|
+
reason: `Invalid JWT audience claim (aud) ${JSON.stringify(aud)}. Expected a string or a non-empty array of strings.`,
|
|
74
|
+
reasonCode: types_js_1.InvalidJwtReasonCode.Other,
|
|
75
|
+
decoded
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
if (!(iss === issuer || (Array.isArray(issuer) && issuer.includes(iss)))) {
|
|
79
|
+
return {
|
|
80
|
+
valid: false,
|
|
81
|
+
reason: `Invalid JWT issuer claim (iss) ${JSON.stringify(decoded.payload.iss)}. Expected ${JSON.stringify(issuer)}.`,
|
|
82
|
+
reasonCode: types_js_1.InvalidJwtReasonCode.Other,
|
|
83
|
+
decoded
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
if (typeof exp !== 'number') {
|
|
87
|
+
return {
|
|
88
|
+
valid: false,
|
|
89
|
+
reason: `Invalid JWT expiry date claim (exp) ${JSON.stringify(exp)}. Expected number.`,
|
|
90
|
+
reasonCode: types_js_1.InvalidJwtReasonCode.Other,
|
|
91
|
+
decoded
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
const currentDate = new Date(Date.now());
|
|
95
|
+
const expiryDate = new Date(0);
|
|
96
|
+
expiryDate.setUTCSeconds(exp);
|
|
97
|
+
const expired = expiryDate.getTime() <= currentDate.getTime() - skewMs;
|
|
98
|
+
if (expired) {
|
|
99
|
+
return {
|
|
100
|
+
valid: false,
|
|
101
|
+
reason: `JWT is expired. Expiry date: ${expiryDate}; Current date: ${currentDate};`,
|
|
102
|
+
reasonCode: types_js_1.InvalidJwtReasonCode.Expired,
|
|
103
|
+
decoded
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
if (nbf !== undefined) {
|
|
107
|
+
if (typeof nbf !== 'number') {
|
|
108
|
+
return {
|
|
109
|
+
valid: false,
|
|
110
|
+
reason: `Invalid JWT not before date claim (nbf) ${JSON.stringify(nbf)}. Expected number.`,
|
|
111
|
+
reasonCode: types_js_1.InvalidJwtReasonCode.Other,
|
|
112
|
+
decoded
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
const notBeforeDate = new Date(0);
|
|
116
|
+
notBeforeDate.setUTCSeconds(nbf);
|
|
117
|
+
const early = notBeforeDate.getTime() > currentDate.getTime() + skewMs;
|
|
118
|
+
if (early) {
|
|
119
|
+
return {
|
|
120
|
+
valid: false,
|
|
121
|
+
reason: `JWT cannot be used prior to not before date claim (nbf). Not before date: ${notBeforeDate}; Current date: ${currentDate};`,
|
|
122
|
+
reasonCode: types_js_1.InvalidJwtReasonCode.Other,
|
|
123
|
+
decoded
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
if (iat !== undefined) {
|
|
128
|
+
if (typeof iat !== 'number') {
|
|
129
|
+
return {
|
|
130
|
+
valid: false,
|
|
131
|
+
reason: `Invalid JWT issued at date claim (iat) ${JSON.stringify(iat)}. Expected number.`,
|
|
132
|
+
reasonCode: types_js_1.InvalidJwtReasonCode.Other,
|
|
133
|
+
decoded
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
const issuedAtDate = new Date(0);
|
|
137
|
+
issuedAtDate.setUTCSeconds(iat);
|
|
138
|
+
const postIssued = issuedAtDate.getTime() > currentDate.getTime() + skewMs;
|
|
139
|
+
if (postIssued) {
|
|
140
|
+
return {
|
|
141
|
+
valid: false,
|
|
142
|
+
reason: `JWT issued at date claim (iat) is in the future. Issued at date: ${issuedAtDate}; Current date: ${currentDate};`,
|
|
143
|
+
reasonCode: types_js_1.InvalidJwtReasonCode.Other,
|
|
144
|
+
decoded
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
let key;
|
|
149
|
+
try {
|
|
150
|
+
key = await resolveKey(decoded);
|
|
151
|
+
}
|
|
152
|
+
catch (e) {
|
|
153
|
+
return {
|
|
154
|
+
valid: false,
|
|
155
|
+
reason: `Error retrieving public key to verify JWT signature: ${e instanceof Error ? e.message : e}`,
|
|
156
|
+
reasonCode: types_js_1.InvalidJwtReasonCode.Other,
|
|
157
|
+
decoded
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
if (!key) {
|
|
161
|
+
return {
|
|
162
|
+
valid: false,
|
|
163
|
+
reason: `Unable to resolve public key to verify JWT signature.`,
|
|
164
|
+
reasonCode: types_js_1.InvalidJwtReasonCode.Other,
|
|
165
|
+
decoded
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
let signatureValid;
|
|
169
|
+
try {
|
|
170
|
+
signatureValid = await (0, verify_js_1.verifyJwtSignature)(decoded, key);
|
|
171
|
+
}
|
|
172
|
+
catch {
|
|
173
|
+
return {
|
|
174
|
+
valid: false,
|
|
175
|
+
reason: `Error verifying JWT signature.`,
|
|
176
|
+
reasonCode: types_js_1.InvalidJwtReasonCode.Other,
|
|
177
|
+
decoded
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
if (!signatureValid) {
|
|
181
|
+
return {
|
|
182
|
+
valid: false,
|
|
183
|
+
reason: `JWT signature is invalid.`,
|
|
184
|
+
reasonCode: types_js_1.InvalidJwtReasonCode.Other,
|
|
185
|
+
decoded
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
const { header, payload } = decoded;
|
|
189
|
+
return { valid: true, header, payload };
|
|
190
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InvalidJwtReasonCode = void 0;
|
|
4
|
+
var InvalidJwtReasonCode;
|
|
5
|
+
(function (InvalidJwtReasonCode) {
|
|
6
|
+
InvalidJwtReasonCode[InvalidJwtReasonCode["Other"] = 0] = "Other";
|
|
7
|
+
InvalidJwtReasonCode[InvalidJwtReasonCode["Expired"] = 1] = "Expired";
|
|
8
|
+
})(InvalidJwtReasonCode || (exports.InvalidJwtReasonCode = InvalidJwtReasonCode = {}));
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.verifyJwtSignature = verifyJwtSignature;
|
|
4
|
+
async function verifyJwtSignature(decoded, key) {
|
|
5
|
+
const encoder = new TextEncoder();
|
|
6
|
+
const data = encoder.encode(`${decoded.raw.header}.${decoded.raw.payload}`);
|
|
7
|
+
return crypto.subtle.verify('RSASSA-PKCS1-v1_5', key, decoded.signature, data);
|
|
8
|
+
}
|
|
@@ -2,5 +2,4 @@ export { decodeJwt } from './decode.js';
|
|
|
2
2
|
export { getJwks, getKey, importKey } from './jwks.js';
|
|
3
3
|
export { parseJwt } from './parse.js';
|
|
4
4
|
export * from './types.js';
|
|
5
|
-
export { InvalidJwtReasonCode } from './types.js';
|
|
6
5
|
export { verifyJwtSignature } from './verify.js';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { DecodedJwt, JsonWebKeyset } from './types.js';
|
|
2
|
+
export declare function getJwks(issuer: string): Promise<JsonWebKeyset>;
|
|
3
|
+
export declare function importKey(iss: string, jwk: JsonWebKey): Promise<void>;
|
|
4
|
+
export declare function getKey(decoded: DecodedJwt): Promise<CryptoKey>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DecodedJwt, JwtParseResult } from './types.js';
|
|
2
|
+
export interface JwtParseOptions {
|
|
3
|
+
jwt: string;
|
|
4
|
+
issuer: string | string[];
|
|
5
|
+
audience: string;
|
|
6
|
+
resolveKey?: (decoded: DecodedJwt) => Promise<CryptoKey | null>;
|
|
7
|
+
skewMs?: number;
|
|
8
|
+
}
|
|
9
|
+
export declare function parseJwt({ jwt, issuer, audience, resolveKey, skewMs }: JwtParseOptions): Promise<JwtParseResult>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { algs, algToHash } from './algs.js';
|
|
2
2
|
import { decodeJwt } from './decode.js';
|
|
3
3
|
import { getKey } from './jwks.js';
|
|
4
|
+
import { InvalidJwtReasonCode } from './types.js';
|
|
4
5
|
import { verifyJwtSignature } from './verify.js';
|
|
5
6
|
const defaultSkewMs = 60 * 1000;
|
|
6
7
|
export async function parseJwt({ jwt, issuer, audience, resolveKey = getKey, skewMs = defaultSkewMs }) {
|
|
@@ -12,7 +13,7 @@ export async function parseJwt({ jwt, issuer, audience, resolveKey = getKey, ske
|
|
|
12
13
|
return {
|
|
13
14
|
valid: false,
|
|
14
15
|
reason: `Unable to decode JWT.`,
|
|
15
|
-
reasonCode:
|
|
16
|
+
reasonCode: InvalidJwtReasonCode.Other
|
|
16
17
|
};
|
|
17
18
|
}
|
|
18
19
|
const { typ, alg } = decoded.header;
|
|
@@ -20,7 +21,7 @@ export async function parseJwt({ jwt, issuer, audience, resolveKey = getKey, ske
|
|
|
20
21
|
return {
|
|
21
22
|
valid: false,
|
|
22
23
|
reason: `Invalid JWT type ${JSON.stringify(typ)}. Expected "JWT".`,
|
|
23
|
-
reasonCode:
|
|
24
|
+
reasonCode: InvalidJwtReasonCode.Other,
|
|
24
25
|
decoded
|
|
25
26
|
};
|
|
26
27
|
}
|
|
@@ -28,7 +29,7 @@ export async function parseJwt({ jwt, issuer, audience, resolveKey = getKey, ske
|
|
|
28
29
|
return {
|
|
29
30
|
valid: false,
|
|
30
31
|
reason: `Invalid JWT algorithm ${JSON.stringify(alg)}. Supported: ${algs}.`,
|
|
31
|
-
reasonCode:
|
|
32
|
+
reasonCode: InvalidJwtReasonCode.Other,
|
|
32
33
|
decoded
|
|
33
34
|
};
|
|
34
35
|
}
|
|
@@ -37,7 +38,7 @@ export async function parseJwt({ jwt, issuer, audience, resolveKey = getKey, ske
|
|
|
37
38
|
return {
|
|
38
39
|
valid: false,
|
|
39
40
|
reason: `Subject claim (sub) is required and must be a string. Received ${JSON.stringify(sub)}.`,
|
|
40
|
-
reasonCode:
|
|
41
|
+
reasonCode: InvalidJwtReasonCode.Other,
|
|
41
42
|
decoded
|
|
42
43
|
};
|
|
43
44
|
}
|
|
@@ -46,7 +47,7 @@ export async function parseJwt({ jwt, issuer, audience, resolveKey = getKey, ske
|
|
|
46
47
|
return {
|
|
47
48
|
valid: false,
|
|
48
49
|
reason: `Invalid JWT audience claim (aud) ${JSON.stringify(aud)}. Expected "${audience}".`,
|
|
49
|
-
reasonCode:
|
|
50
|
+
reasonCode: InvalidJwtReasonCode.Other,
|
|
50
51
|
decoded
|
|
51
52
|
};
|
|
52
53
|
}
|
|
@@ -58,7 +59,7 @@ export async function parseJwt({ jwt, issuer, audience, resolveKey = getKey, ske
|
|
|
58
59
|
return {
|
|
59
60
|
valid: false,
|
|
60
61
|
reason: `Invalid JWT audience claim array (aud) ${JSON.stringify(aud)}. Does not include "${audience}".`,
|
|
61
|
-
reasonCode:
|
|
62
|
+
reasonCode: InvalidJwtReasonCode.Other,
|
|
62
63
|
decoded
|
|
63
64
|
};
|
|
64
65
|
}
|
|
@@ -67,7 +68,7 @@ export async function parseJwt({ jwt, issuer, audience, resolveKey = getKey, ske
|
|
|
67
68
|
return {
|
|
68
69
|
valid: false,
|
|
69
70
|
reason: `Invalid JWT audience claim (aud) ${JSON.stringify(aud)}. Expected a string or a non-empty array of strings.`,
|
|
70
|
-
reasonCode:
|
|
71
|
+
reasonCode: InvalidJwtReasonCode.Other,
|
|
71
72
|
decoded
|
|
72
73
|
};
|
|
73
74
|
}
|
|
@@ -75,7 +76,7 @@ export async function parseJwt({ jwt, issuer, audience, resolveKey = getKey, ske
|
|
|
75
76
|
return {
|
|
76
77
|
valid: false,
|
|
77
78
|
reason: `Invalid JWT issuer claim (iss) ${JSON.stringify(decoded.payload.iss)}. Expected ${JSON.stringify(issuer)}.`,
|
|
78
|
-
reasonCode:
|
|
79
|
+
reasonCode: InvalidJwtReasonCode.Other,
|
|
79
80
|
decoded
|
|
80
81
|
};
|
|
81
82
|
}
|
|
@@ -83,7 +84,7 @@ export async function parseJwt({ jwt, issuer, audience, resolveKey = getKey, ske
|
|
|
83
84
|
return {
|
|
84
85
|
valid: false,
|
|
85
86
|
reason: `Invalid JWT expiry date claim (exp) ${JSON.stringify(exp)}. Expected number.`,
|
|
86
|
-
reasonCode:
|
|
87
|
+
reasonCode: InvalidJwtReasonCode.Other,
|
|
87
88
|
decoded
|
|
88
89
|
};
|
|
89
90
|
}
|
|
@@ -95,7 +96,7 @@ export async function parseJwt({ jwt, issuer, audience, resolveKey = getKey, ske
|
|
|
95
96
|
return {
|
|
96
97
|
valid: false,
|
|
97
98
|
reason: `JWT is expired. Expiry date: ${expiryDate}; Current date: ${currentDate};`,
|
|
98
|
-
reasonCode:
|
|
99
|
+
reasonCode: InvalidJwtReasonCode.Expired,
|
|
99
100
|
decoded
|
|
100
101
|
};
|
|
101
102
|
}
|
|
@@ -104,7 +105,7 @@ export async function parseJwt({ jwt, issuer, audience, resolveKey = getKey, ske
|
|
|
104
105
|
return {
|
|
105
106
|
valid: false,
|
|
106
107
|
reason: `Invalid JWT not before date claim (nbf) ${JSON.stringify(nbf)}. Expected number.`,
|
|
107
|
-
reasonCode:
|
|
108
|
+
reasonCode: InvalidJwtReasonCode.Other,
|
|
108
109
|
decoded
|
|
109
110
|
};
|
|
110
111
|
}
|
|
@@ -115,7 +116,7 @@ export async function parseJwt({ jwt, issuer, audience, resolveKey = getKey, ske
|
|
|
115
116
|
return {
|
|
116
117
|
valid: false,
|
|
117
118
|
reason: `JWT cannot be used prior to not before date claim (nbf). Not before date: ${notBeforeDate}; Current date: ${currentDate};`,
|
|
118
|
-
reasonCode:
|
|
119
|
+
reasonCode: InvalidJwtReasonCode.Other,
|
|
119
120
|
decoded
|
|
120
121
|
};
|
|
121
122
|
}
|
|
@@ -125,7 +126,7 @@ export async function parseJwt({ jwt, issuer, audience, resolveKey = getKey, ske
|
|
|
125
126
|
return {
|
|
126
127
|
valid: false,
|
|
127
128
|
reason: `Invalid JWT issued at date claim (iat) ${JSON.stringify(iat)}. Expected number.`,
|
|
128
|
-
reasonCode:
|
|
129
|
+
reasonCode: InvalidJwtReasonCode.Other,
|
|
129
130
|
decoded
|
|
130
131
|
};
|
|
131
132
|
}
|
|
@@ -136,7 +137,7 @@ export async function parseJwt({ jwt, issuer, audience, resolveKey = getKey, ske
|
|
|
136
137
|
return {
|
|
137
138
|
valid: false,
|
|
138
139
|
reason: `JWT issued at date claim (iat) is in the future. Issued at date: ${issuedAtDate}; Current date: ${currentDate};`,
|
|
139
|
-
reasonCode:
|
|
140
|
+
reasonCode: InvalidJwtReasonCode.Other,
|
|
140
141
|
decoded
|
|
141
142
|
};
|
|
142
143
|
}
|
|
@@ -149,7 +150,7 @@ export async function parseJwt({ jwt, issuer, audience, resolveKey = getKey, ske
|
|
|
149
150
|
return {
|
|
150
151
|
valid: false,
|
|
151
152
|
reason: `Error retrieving public key to verify JWT signature: ${e instanceof Error ? e.message : e}`,
|
|
152
|
-
reasonCode:
|
|
153
|
+
reasonCode: InvalidJwtReasonCode.Other,
|
|
153
154
|
decoded
|
|
154
155
|
};
|
|
155
156
|
}
|
|
@@ -157,7 +158,7 @@ export async function parseJwt({ jwt, issuer, audience, resolveKey = getKey, ske
|
|
|
157
158
|
return {
|
|
158
159
|
valid: false,
|
|
159
160
|
reason: `Unable to resolve public key to verify JWT signature.`,
|
|
160
|
-
reasonCode:
|
|
161
|
+
reasonCode: InvalidJwtReasonCode.Other,
|
|
161
162
|
decoded
|
|
162
163
|
};
|
|
163
164
|
}
|
|
@@ -169,7 +170,7 @@ export async function parseJwt({ jwt, issuer, audience, resolveKey = getKey, ske
|
|
|
169
170
|
return {
|
|
170
171
|
valid: false,
|
|
171
172
|
reason: `Error verifying JWT signature.`,
|
|
172
|
-
reasonCode:
|
|
173
|
+
reasonCode: InvalidJwtReasonCode.Other,
|
|
173
174
|
decoded
|
|
174
175
|
};
|
|
175
176
|
}
|
|
@@ -177,7 +178,7 @@ export async function parseJwt({ jwt, issuer, audience, resolveKey = getKey, ske
|
|
|
177
178
|
return {
|
|
178
179
|
valid: false,
|
|
179
180
|
reason: `JWT signature is invalid.`,
|
|
180
|
-
reasonCode:
|
|
181
|
+
reasonCode: InvalidJwtReasonCode.Other,
|
|
181
182
|
decoded
|
|
182
183
|
};
|
|
183
184
|
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
export interface JwtPayload {
|
|
2
|
+
iss: string;
|
|
3
|
+
sub: string;
|
|
4
|
+
aud: string | Array<string>;
|
|
5
|
+
iat: number;
|
|
6
|
+
exp: number;
|
|
7
|
+
nbf?: number;
|
|
8
|
+
jti?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface JwtHeader {
|
|
11
|
+
typ?: string;
|
|
12
|
+
alg: string;
|
|
13
|
+
kid: string;
|
|
14
|
+
jku?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface RawJwt {
|
|
17
|
+
header: string;
|
|
18
|
+
payload: string;
|
|
19
|
+
signature: string;
|
|
20
|
+
}
|
|
21
|
+
export interface DecodedJwt {
|
|
22
|
+
header: JwtHeader;
|
|
23
|
+
payload: JwtPayload;
|
|
24
|
+
signature: Uint8Array;
|
|
25
|
+
raw: RawJwt;
|
|
26
|
+
}
|
|
27
|
+
export interface JsonWebKeyset {
|
|
28
|
+
keys: JsonWebKey[];
|
|
29
|
+
}
|
|
30
|
+
export interface ValidJwtParseResult {
|
|
31
|
+
valid: true;
|
|
32
|
+
header: JwtHeader;
|
|
33
|
+
payload: JwtPayload;
|
|
34
|
+
}
|
|
35
|
+
export interface InvalidJwtParseResult {
|
|
36
|
+
valid: false;
|
|
37
|
+
reason: string;
|
|
38
|
+
reasonCode: InvalidJwtReasonCode;
|
|
39
|
+
decoded?: DecodedJwt;
|
|
40
|
+
}
|
|
41
|
+
export declare enum InvalidJwtReasonCode {
|
|
42
|
+
Other = 0,
|
|
43
|
+
Expired = 1
|
|
44
|
+
}
|
|
45
|
+
export interface IssuerMetadata {
|
|
46
|
+
issuer: string;
|
|
47
|
+
authorization_endpoint?: string;
|
|
48
|
+
token_endpoint?: string;
|
|
49
|
+
jwks_uri?: string;
|
|
50
|
+
userinfo_endpoint?: string;
|
|
51
|
+
revocation_endpoint?: string;
|
|
52
|
+
end_session_endpoint?: string;
|
|
53
|
+
registration_endpoint?: string;
|
|
54
|
+
token_endpoint_auth_methods_supported?: string[];
|
|
55
|
+
token_endpoint_auth_signing_alg_values_supported?: string[];
|
|
56
|
+
introspection_endpoint_auth_methods_supported?: string[];
|
|
57
|
+
introspection_endpoint_auth_signing_alg_values_supported?: string[];
|
|
58
|
+
revocation_endpoint_auth_methods_supported?: string[];
|
|
59
|
+
revocation_endpoint_auth_signing_alg_values_supported?: string[];
|
|
60
|
+
request_object_signing_alg_values_supported?: string[];
|
|
61
|
+
mtls_endpoint_aliases?: MtlsEndpointAliases;
|
|
62
|
+
[key: string]: unknown;
|
|
63
|
+
}
|
|
64
|
+
export interface MtlsEndpointAliases {
|
|
65
|
+
token_endpoint?: string;
|
|
66
|
+
userinfo_endpoint?: string;
|
|
67
|
+
revocation_endpoint?: string;
|
|
68
|
+
introspection_endpoint?: string;
|
|
69
|
+
device_authorization_endpoint?: string;
|
|
70
|
+
}
|
|
71
|
+
export type JwtParseResult = ValidJwtParseResult | InvalidJwtParseResult;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"program":{"fileNames":["../../../node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/typescript/lib/lib.es2021.d.ts","../../../node_modules/typescript/lib/lib.es2022.d.ts","../../../node_modules/typescript/lib/lib.es2023.d.ts","../../../node_modules/typescript/lib/lib.esnext.d.ts","../../../node_modules/typescript/lib/lib.webworker.d.ts","../../../node_modules/typescript/lib/lib.webworker.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/typescript/lib/lib.es2016.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../node_modules/typescript/lib/lib.es2022.array.d.ts","../../../node_modules/typescript/lib/lib.es2022.error.d.ts","../../../node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../node_modules/typescript/lib/lib.es2022.object.d.ts","../../../node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2022.string.d.ts","../../../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2023.array.d.ts","../../../node_modules/typescript/lib/lib.es2023.collection.d.ts","../../../node_modules/typescript/lib/lib.es2023.intl.d.ts","../../../node_modules/typescript/lib/lib.esnext.array.d.ts","../../../node_modules/typescript/lib/lib.esnext.collection.d.ts","../../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../node_modules/typescript/lib/lib.esnext.disposable.d.ts","../../../node_modules/typescript/lib/lib.esnext.string.d.ts","../../../node_modules/typescript/lib/lib.esnext.promise.d.ts","../../../node_modules/typescript/lib/lib.esnext.decorators.d.ts","../../../node_modules/typescript/lib/lib.esnext.object.d.ts","../../../node_modules/typescript/lib/lib.esnext.regexp.d.ts","../../../node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../src/algs.ts","../src/declarations.d.ts","../../../node_modules/rfc4648/lib/src/codec.d.ts","../../../node_modules/rfc4648/lib/src/index.d.ts","../src/types.ts","../src/decode.ts","../src/discovery.ts","../src/jwks.ts","../src/verify.ts","../src/parse.ts","../src/index.ts"],"fileInfos":[{"version":"44e584d4f6444f58791784f1d530875970993129442a847597db702a073ca68c","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","9a68c0c07ae2fa71b44384a839b7b8d81662a236d4b9ac30916718f7510b1b2d","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","5514e54f17d6d74ecefedc73c504eadffdeda79c7ea205cf9febead32d45c4bc","27bdc30a0e32783366a5abeda841bc22757c1797de8681bbe81fbc735eeb1c10","17edc026abf73c5c2dd508652d63f68ec4efd9d4856e3469890d27598209feb5",{"version":"7ad342d4d126c62920de283dffe88f5c06f81b496bb47613df59f4506a1ef074","affectsGlobalScope":true},{"version":"3c01508aed780c01c623a8015b1668744f573b7ba3153f4431cf67b9a4e026ac","affectsGlobalScope":true},{"version":"6920e1448680767498a0b77c6a00a8e77d14d62c3da8967b171f1ddffa3c18e4","affectsGlobalScope":true},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"bc47685641087c015972a3f072480889f0d6c65515f12bd85222f49a98952ed7","affectsGlobalScope":true},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true},{"version":"93495ff27b8746f55d19fcbcdbaccc99fd95f19d057aed1bd2c0cafe1335fbf0","affectsGlobalScope":true},{"version":"6fc23bb8c3965964be8c597310a2878b53a0306edb71d4b5a4dfe760186bcc01","affectsGlobalScope":true},{"version":"ea011c76963fb15ef1cdd7ce6a6808b46322c527de2077b6cfdf23ae6f5f9ec7","affectsGlobalScope":true},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true},{"version":"bb42a7797d996412ecdc5b2787720de477103a0b2e53058569069a0e2bae6c7e","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"b541a838a13f9234aba650a825393ffc2292dc0fc87681a5d81ef0c96d281e7a","affectsGlobalScope":true},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true},{"version":"ae37d6ccd1560b0203ab88d46987393adaaa78c919e51acf32fb82c86502e98c","affectsGlobalScope":true},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"5e07ed3809d48205d5b985642a59f2eba47c402374a7cf8006b686f79efadcbd","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"479553e3779be7d4f68e9f40cdb82d038e5ef7592010100410723ceced22a0f7","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true},{"version":"d3d7b04b45033f57351c8434f60b6be1ea71a2dfec2d0a0c3c83badbb0e3e693","affectsGlobalScope":true},{"version":"956d27abdea9652e8368ce029bb1e0b9174e9678a273529f426df4b3d90abd60","affectsGlobalScope":true},{"version":"4fa6ed14e98aa80b91f61b9805c653ee82af3502dc21c9da5268d3857772ca05","affectsGlobalScope":true},{"version":"e6633e05da3ff36e6da2ec170d0d03ccf33de50ca4dc6f5aeecb572cedd162fb","affectsGlobalScope":true},{"version":"d8670852241d4c6e03f2b89d67497a4bbefe29ecaa5a444e2c11a9b05e6fccc6","affectsGlobalScope":true},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true},{"version":"caccc56c72713969e1cfe5c3d44e5bab151544d9d2b373d7dbe5a1e4166652be","affectsGlobalScope":true},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true},{"version":"b4b67b1a91182421f5df999988c690f14d813b9850b40acd06ed44691f6727ad","affectsGlobalScope":true},{"version":"9d540251809289a05349b70ab5f4b7b99f922af66ab3c39ba56a475dcf95d5ff","affectsGlobalScope":true},{"version":"436aaf437562f276ec2ddbee2f2cdedac7664c1e4c1d2c36839ddd582eeb3d0a","affectsGlobalScope":true},{"version":"8e3c06ea092138bf9fa5e874a1fdbc9d54805d074bee1de31b99a11e2fec239d","affectsGlobalScope":true},{"version":"0b11f3ca66aa33124202c80b70cd203219c3d4460cfc165e0707aa9ec710fc53","affectsGlobalScope":true},{"version":"6a3f5a0129cc80cf439ab71164334d649b47059a4f5afca90282362407d0c87f","affectsGlobalScope":true},{"version":"811c71eee4aa0ac5f7adf713323a5c41b0cf6c4e17367a34fbce379e12bbf0a4","affectsGlobalScope":true},{"version":"15b98a533864d324e5f57cd3cfc0579b231df58c1c0f6063ea0fcb13c3c74ff9","affectsGlobalScope":true},{"version":"0a6282c8827e4b9a95f4bf4f5c205673ada31b982f50572d27103df8ceb8013c","affectsGlobalScope":true},{"version":"ac77cb3e8c6d3565793eb90a8373ee8033146315a3dbead3bde8db5eaf5e5ec6","affectsGlobalScope":true},{"version":"d4b1d2c51d058fc21ec2629fff7a76249dec2e36e12960ea056e3ef89174080f","affectsGlobalScope":true},{"version":"2fef54945a13095fdb9b84f705f2b5994597640c46afeb2ce78352fab4cb3279","affectsGlobalScope":true},{"version":"56e4ed5aab5f5920980066a9409bfaf53e6d21d3f8d020c17e4de584d29600ad","affectsGlobalScope":true},{"version":"33358442698bb565130f52ba79bfd3d4d484ac85fe33f3cb1759c54d18201393","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},{"version":"338a4664a1baf17d437ac4b8a0db384ffdf70f6a01a278030f7ca30e12724ab1","signature":"92a65026787db3de09e45fec4233f1c43dec71f63d1ce46a6e0e356c22a9d7ca"},{"version":"ae1d9741986f7803e21916a3b91866c3e039f4f5a0063c04ab0250efdf9ddff2","affectsGlobalScope":true},"b85e0cacbcbddaeaed7497fc24c779c06dbe9e1f7e16e1979c120831c92f0c0e","3f7413da40595a5149d55455ba7c80c95eaca631d62b886b0e42c2bcbdf0ff27",{"version":"e963efaceea653c1b2585ce1b85d4ca7b332a3bac9cff7157f56e41da09936aa","signature":"4302d32ef02c7cf08c7e3eca785667d5cc6688f8d4a5f0ac3c4175de1a7d2940"},{"version":"afcd7c8411c5f422c945e183b55b847c5cfa6ee62663d538b8d1b747e4f8e21b","signature":"75d40806d946050d89f474acf28066f26973f30e28a7f93c5300ea1decb0eefb"},{"version":"1b98bc2983d8c549b04517b788687817bad44a0592af1604128ab405078c0625","signature":"ce9006220f02a0f6acc093c788dbdcc62ace8bdebb482d0d64da3fc4a1297252"},{"version":"5d34e95e25a3edeb254e0ccf16419fef6549af5846e1140dfe5c0d92a1528292","signature":"2a7b39121b5a5ae14492e4bbe4d606b08e435422cb94fab427d3e092f71b96f4"},{"version":"d85f0062f68d39bb96120a892c71dd20830ba88d55fb4a2d73073bcf2867c3ae","signature":"a447a8efafff8d56fef76075b314e74a4094b7e0b9a27160a524f885782e526b"},{"version":"8c1fa50be5f0bef04350f0ab7e1b2467978e00d8bf4ccef1fe52242451252a6c","signature":"f71975db80858947889874100265eda412c01171e43477b31a288bf077615276"},"c0b55c29abe9d07ee39379de20db2650c46dbf903e242f21150b69a11c06ae36"],"root":[74,75,[78,84]],"options":{"composite":true,"esModuleInterop":true,"isolatedDeclarations":true,"module":1,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./cjs","removeComments":true,"rootDir":"../src","strict":true,"target":99},"fileIdsList":[[76],[77,78],[78],[78,79,81,82,83],[74,78,80],[74,78,79,81,82]],"referencedMap":[[77,1],[79,2],[80,3],[84,4],[81,5],[83,6],[82,3]],"latestChangedDtsFile":"./cjs/index.d.ts"},"version":"5.5.4"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"program":{"fileNames":["../../../node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/typescript/lib/lib.es2021.d.ts","../../../node_modules/typescript/lib/lib.es2022.d.ts","../../../node_modules/typescript/lib/lib.es2023.d.ts","../../../node_modules/typescript/lib/lib.esnext.d.ts","../../../node_modules/typescript/lib/lib.webworker.d.ts","../../../node_modules/typescript/lib/lib.webworker.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/typescript/lib/lib.es2016.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../node_modules/typescript/lib/lib.es2022.array.d.ts","../../../node_modules/typescript/lib/lib.es2022.error.d.ts","../../../node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../node_modules/typescript/lib/lib.es2022.object.d.ts","../../../node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2022.string.d.ts","../../../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2023.array.d.ts","../../../node_modules/typescript/lib/lib.es2023.collection.d.ts","../../../node_modules/typescript/lib/lib.es2023.intl.d.ts","../../../node_modules/typescript/lib/lib.esnext.array.d.ts","../../../node_modules/typescript/lib/lib.esnext.collection.d.ts","../../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../node_modules/typescript/lib/lib.esnext.disposable.d.ts","../../../node_modules/typescript/lib/lib.esnext.string.d.ts","../../../node_modules/typescript/lib/lib.esnext.promise.d.ts","../../../node_modules/typescript/lib/lib.esnext.decorators.d.ts","../../../node_modules/typescript/lib/lib.esnext.object.d.ts","../../../node_modules/typescript/lib/lib.esnext.regexp.d.ts","../../../node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../src/algs.ts","../src/declarations.d.ts","../../../node_modules/rfc4648/lib/src/codec.d.ts","../../../node_modules/rfc4648/lib/src/index.d.ts","../src/types.ts","../src/decode.ts","../src/discovery.ts","../src/jwks.ts","../src/verify.ts","../src/parse.ts","../src/index.ts"],"fileInfos":[{"version":"44e584d4f6444f58791784f1d530875970993129442a847597db702a073ca68c","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","9a68c0c07ae2fa71b44384a839b7b8d81662a236d4b9ac30916718f7510b1b2d","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","5514e54f17d6d74ecefedc73c504eadffdeda79c7ea205cf9febead32d45c4bc","27bdc30a0e32783366a5abeda841bc22757c1797de8681bbe81fbc735eeb1c10","17edc026abf73c5c2dd508652d63f68ec4efd9d4856e3469890d27598209feb5",{"version":"7ad342d4d126c62920de283dffe88f5c06f81b496bb47613df59f4506a1ef074","affectsGlobalScope":true},{"version":"3c01508aed780c01c623a8015b1668744f573b7ba3153f4431cf67b9a4e026ac","affectsGlobalScope":true},{"version":"6920e1448680767498a0b77c6a00a8e77d14d62c3da8967b171f1ddffa3c18e4","affectsGlobalScope":true},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"bc47685641087c015972a3f072480889f0d6c65515f12bd85222f49a98952ed7","affectsGlobalScope":true},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true},{"version":"93495ff27b8746f55d19fcbcdbaccc99fd95f19d057aed1bd2c0cafe1335fbf0","affectsGlobalScope":true},{"version":"6fc23bb8c3965964be8c597310a2878b53a0306edb71d4b5a4dfe760186bcc01","affectsGlobalScope":true},{"version":"ea011c76963fb15ef1cdd7ce6a6808b46322c527de2077b6cfdf23ae6f5f9ec7","affectsGlobalScope":true},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true},{"version":"bb42a7797d996412ecdc5b2787720de477103a0b2e53058569069a0e2bae6c7e","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"b541a838a13f9234aba650a825393ffc2292dc0fc87681a5d81ef0c96d281e7a","affectsGlobalScope":true},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true},{"version":"ae37d6ccd1560b0203ab88d46987393adaaa78c919e51acf32fb82c86502e98c","affectsGlobalScope":true},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"5e07ed3809d48205d5b985642a59f2eba47c402374a7cf8006b686f79efadcbd","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"479553e3779be7d4f68e9f40cdb82d038e5ef7592010100410723ceced22a0f7","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true},{"version":"d3d7b04b45033f57351c8434f60b6be1ea71a2dfec2d0a0c3c83badbb0e3e693","affectsGlobalScope":true},{"version":"956d27abdea9652e8368ce029bb1e0b9174e9678a273529f426df4b3d90abd60","affectsGlobalScope":true},{"version":"4fa6ed14e98aa80b91f61b9805c653ee82af3502dc21c9da5268d3857772ca05","affectsGlobalScope":true},{"version":"e6633e05da3ff36e6da2ec170d0d03ccf33de50ca4dc6f5aeecb572cedd162fb","affectsGlobalScope":true},{"version":"d8670852241d4c6e03f2b89d67497a4bbefe29ecaa5a444e2c11a9b05e6fccc6","affectsGlobalScope":true},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true},{"version":"caccc56c72713969e1cfe5c3d44e5bab151544d9d2b373d7dbe5a1e4166652be","affectsGlobalScope":true},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true},{"version":"b4b67b1a91182421f5df999988c690f14d813b9850b40acd06ed44691f6727ad","affectsGlobalScope":true},{"version":"9d540251809289a05349b70ab5f4b7b99f922af66ab3c39ba56a475dcf95d5ff","affectsGlobalScope":true},{"version":"436aaf437562f276ec2ddbee2f2cdedac7664c1e4c1d2c36839ddd582eeb3d0a","affectsGlobalScope":true},{"version":"8e3c06ea092138bf9fa5e874a1fdbc9d54805d074bee1de31b99a11e2fec239d","affectsGlobalScope":true},{"version":"0b11f3ca66aa33124202c80b70cd203219c3d4460cfc165e0707aa9ec710fc53","affectsGlobalScope":true},{"version":"6a3f5a0129cc80cf439ab71164334d649b47059a4f5afca90282362407d0c87f","affectsGlobalScope":true},{"version":"811c71eee4aa0ac5f7adf713323a5c41b0cf6c4e17367a34fbce379e12bbf0a4","affectsGlobalScope":true},{"version":"15b98a533864d324e5f57cd3cfc0579b231df58c1c0f6063ea0fcb13c3c74ff9","affectsGlobalScope":true},{"version":"0a6282c8827e4b9a95f4bf4f5c205673ada31b982f50572d27103df8ceb8013c","affectsGlobalScope":true},{"version":"ac77cb3e8c6d3565793eb90a8373ee8033146315a3dbead3bde8db5eaf5e5ec6","affectsGlobalScope":true},{"version":"d4b1d2c51d058fc21ec2629fff7a76249dec2e36e12960ea056e3ef89174080f","affectsGlobalScope":true},{"version":"2fef54945a13095fdb9b84f705f2b5994597640c46afeb2ce78352fab4cb3279","affectsGlobalScope":true},{"version":"56e4ed5aab5f5920980066a9409bfaf53e6d21d3f8d020c17e4de584d29600ad","affectsGlobalScope":true},{"version":"33358442698bb565130f52ba79bfd3d4d484ac85fe33f3cb1759c54d18201393","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},{"version":"338a4664a1baf17d437ac4b8a0db384ffdf70f6a01a278030f7ca30e12724ab1","signature":"92a65026787db3de09e45fec4233f1c43dec71f63d1ce46a6e0e356c22a9d7ca"},{"version":"ae1d9741986f7803e21916a3b91866c3e039f4f5a0063c04ab0250efdf9ddff2","affectsGlobalScope":true},"b85e0cacbcbddaeaed7497fc24c779c06dbe9e1f7e16e1979c120831c92f0c0e","3f7413da40595a5149d55455ba7c80c95eaca631d62b886b0e42c2bcbdf0ff27",{"version":"e963efaceea653c1b2585ce1b85d4ca7b332a3bac9cff7157f56e41da09936aa","signature":"4302d32ef02c7cf08c7e3eca785667d5cc6688f8d4a5f0ac3c4175de1a7d2940"},{"version":"afcd7c8411c5f422c945e183b55b847c5cfa6ee62663d538b8d1b747e4f8e21b","signature":"75d40806d946050d89f474acf28066f26973f30e28a7f93c5300ea1decb0eefb"},{"version":"1b98bc2983d8c549b04517b788687817bad44a0592af1604128ab405078c0625","signature":"ce9006220f02a0f6acc093c788dbdcc62ace8bdebb482d0d64da3fc4a1297252"},{"version":"5d34e95e25a3edeb254e0ccf16419fef6549af5846e1140dfe5c0d92a1528292","signature":"2a7b39121b5a5ae14492e4bbe4d606b08e435422cb94fab427d3e092f71b96f4"},{"version":"d85f0062f68d39bb96120a892c71dd20830ba88d55fb4a2d73073bcf2867c3ae","signature":"a447a8efafff8d56fef76075b314e74a4094b7e0b9a27160a524f885782e526b"},{"version":"8c1fa50be5f0bef04350f0ab7e1b2467978e00d8bf4ccef1fe52242451252a6c","signature":"f71975db80858947889874100265eda412c01171e43477b31a288bf077615276"},"c0b55c29abe9d07ee39379de20db2650c46dbf903e242f21150b69a11c06ae36"],"root":[74,75,[78,84]],"options":{"composite":true,"esModuleInterop":true,"isolatedDeclarations":true,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./esm","removeComments":true,"rootDir":"../src","strict":true,"target":99},"fileIdsList":[[76],[77,78],[78],[78,79,81,82,83],[74,78,80],[74,78,79,81,82]],"referencedMap":[[77,1],[79,2],[80,3],[84,4],[81,5],[83,6],[82,3]],"latestChangedDtsFile":"./esm/index.d.ts"},"version":"5.5.4"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cfworker/jwt",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "6.0.0",
|
|
5
5
|
"description": "Tiny lib for decoding JWTs and verifying signatures, using native crypto APIs",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"jwt",
|
|
@@ -11,16 +11,20 @@
|
|
|
11
11
|
"workers",
|
|
12
12
|
"service-worker"
|
|
13
13
|
],
|
|
14
|
-
"main": "dist/index.js",
|
|
15
|
-
"module": "dist/index.js",
|
|
14
|
+
"main": "dist/cjs/index.js",
|
|
15
|
+
"module": "dist/cjs/index.js",
|
|
16
16
|
"source": "src/index.ts",
|
|
17
|
-
"types": "dist/index.d.ts",
|
|
17
|
+
"types": "dist/cjs/index.d.ts",
|
|
18
18
|
"files": [
|
|
19
19
|
"dist/**/*",
|
|
20
20
|
"src/**/*",
|
|
21
21
|
"README.md",
|
|
22
22
|
"package.json"
|
|
23
23
|
],
|
|
24
|
+
"exports": {
|
|
25
|
+
"import": "./dist/esm/index.js",
|
|
26
|
+
"require": "./dist/cjs/index.js"
|
|
27
|
+
},
|
|
24
28
|
"repository": "https://github.com/cfworker/cfworker",
|
|
25
29
|
"author": "Jeremy Danyow <jdanyow@gmail.com>",
|
|
26
30
|
"homepage": "https://github.com/cfworker/cfworker/tree/master/packages/jwt/README.md",
|
|
@@ -29,7 +33,7 @@
|
|
|
29
33
|
"access": "public"
|
|
30
34
|
},
|
|
31
35
|
"scripts": {
|
|
32
|
-
"build": "tsc --build",
|
|
36
|
+
"build": "tsc --build & tsc --build tsconfig-cjs.json",
|
|
33
37
|
"clean": "tsc --build --clean",
|
|
34
38
|
"pretest": "esbuild test/test.ts --target=esnext --bundle --format=esm --conditions=worker,browser --outdir=dist-test --ignore-annotations",
|
|
35
39
|
"test": "node ../../test.mjs"
|
|
@@ -44,6 +48,6 @@
|
|
|
44
48
|
"esbuild": "^0.23.1",
|
|
45
49
|
"mocha": "^10.7.3",
|
|
46
50
|
"typescript": "^5.5.4",
|
|
47
|
-
"wrangler": "^3.72.
|
|
51
|
+
"wrangler": "^3.72.1"
|
|
48
52
|
}
|
|
49
53
|
}
|
package/src/algs.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -2,5 +2,4 @@ export { decodeJwt } from './decode.js';
|
|
|
2
2
|
export { getJwks, getKey, importKey } from './jwks.js';
|
|
3
3
|
export { parseJwt } from './parse.js';
|
|
4
4
|
export * from './types.js';
|
|
5
|
-
export { InvalidJwtReasonCode } from './types.js';
|
|
6
5
|
export { verifyJwtSignature } from './verify.js';
|
package/src/jwks.ts
CHANGED
|
@@ -35,7 +35,7 @@ const importedKeys: Record<string, Record<string, CryptoKey>> = {};
|
|
|
35
35
|
* @param iss The issuer. Serves as the first-level cache key.
|
|
36
36
|
* @param jwks The JsonWebKeyset to import.
|
|
37
37
|
*/
|
|
38
|
-
export async function importKey(iss: string, jwk: JsonWebKey) {
|
|
38
|
+
export async function importKey(iss: string, jwk: JsonWebKey): Promise<void> {
|
|
39
39
|
if (jwk.kty !== 'RSA') {
|
|
40
40
|
throw new Error(
|
|
41
41
|
`Unsupported jwk key type (kty) "${
|
package/src/types.ts
CHANGED
package/src/verify.ts
CHANGED
|
@@ -4,7 +4,10 @@ import { DecodedJwt } from './types.js';
|
|
|
4
4
|
* Verify the JWT's signature.
|
|
5
5
|
* @param {DecodedJwt} decoded
|
|
6
6
|
*/
|
|
7
|
-
export async function verifyJwtSignature(
|
|
7
|
+
export async function verifyJwtSignature(
|
|
8
|
+
decoded: DecodedJwt,
|
|
9
|
+
key: CryptoKey
|
|
10
|
+
): Promise<boolean> {
|
|
8
11
|
const encoder = new TextEncoder();
|
|
9
12
|
const data = encoder.encode(`${decoded.raw.header}.${decoded.raw.payload}`);
|
|
10
13
|
|
package/dist/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|