@xlt-token/jwt 2.1.1 → 2.4.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/index.cjs +2 -2
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +3 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -76,7 +76,7 @@ function normalizeJwtKey(input) {
|
|
|
76
76
|
};
|
|
77
77
|
}
|
|
78
78
|
function assertStrongHmacSecret(kid, secret) {
|
|
79
|
-
if ((typeof secret === "string" ? Buffer.byteLength(secret) : Buffer.isBuffer(secret) ? secret.byteLength : 0) < 32) throw new Error(`JWT key "${kid}" uses a weak HMAC secret; use at least 32 bytes`);
|
|
79
|
+
if ((typeof secret === "string" ? Buffer.byteLength(secret) : Buffer.isBuffer(secret) ? secret.byteLength : secret instanceof node_crypto.KeyObject && secret.type === "secret" ? secret.symmetricKeySize : 0) < 32) throw new Error(`JWT key "${kid}" uses a weak HMAC secret; use at least 32 bytes`);
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
//#endregion
|
|
@@ -128,7 +128,7 @@ var JwtStrategy = class {
|
|
|
128
128
|
}
|
|
129
129
|
};
|
|
130
130
|
function resolveExpiresIn(timeout) {
|
|
131
|
-
if (
|
|
131
|
+
if (timeout === -1) return;
|
|
132
132
|
return timeout;
|
|
133
133
|
}
|
|
134
134
|
function signingKeyFor(key) {
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/jwt-config.ts","../src/jwt-strategy.ts"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/jwt-config.ts","../src/jwt-strategy.ts"],"mappings":";;;;KAGY,YAAA,GAAe,OAAA,CACzB,WAAA;AAAA,UAIe,WAAA;EACf,GAAA;EACA,SAAA,EAAW,YAAA;EACX,MAAA,GAAS,MAAA;EACT,UAAA,GAAa,MAAA;EACb,eAAA,GAAkB,MAAA;AAAA;AAAA,UAGH,MAAA;EACf,GAAA;EACA,SAAA,EAAW,YAAA;EACX,UAAA,EAAY,MAAA;EACZ,eAAA,EAAiB,MAAA;AAAA;AAAA,KAGP,WAAA;AAAA,UAEK,sBAAA;EACf,SAAA;EACA,IAAA,EAAM,WAAA;EACN,MAAA;EACA,QAAA,GAAW,WAAA;AAAA;AAAA,UAGI,iBAAA;EACf,SAAA;EACA,SAAA,EAAW,MAAA;EACX,IAAA,EAAM,WAAA,SAAoB,MAAA;EAC1B,MAAA;EACA,QAAA,GAAW,WAAA;AAAA;AAAA,iBAeG,uBAAA,CAAwB,KAAA,EAAO,sBAAA,GAAyB,iBAAA;;;KC5C5D,aAAA,GAAgB,UAAA;EAAe,GAAA;EAAa,GAAA;AAAA;AAAA,cAE3C,WAAA,YAAuB,aAAA,CAAc,aAAA;EAAA,iBAGnB,SAAA;EAAA,SAFpB,IAAA;cAEoB,SAAA,EAAW,iBAAA;EAExC,WAAA,CACE,OAAA,UACA,MAAA,EAAQ,cAAA,EACR,OAAA;IAAY,OAAA,GAAU,aAAA;EAAA;EAcxB,aAAA,CAAc,OAAA,EAAS,aAAA;EAIvB,WAAA,CAAY,KAAA,WAAgB,aAAA;EAAA,QAkCpB,WAAA;AAAA"}
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/jwt-config.ts","../src/jwt-strategy.ts"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/jwt-config.ts","../src/jwt-strategy.ts"],"mappings":";;;;KAGY,YAAA,GAAe,OAAA,CACzB,WAAA;AAAA,UAIe,WAAA;EACf,GAAA;EACA,SAAA,EAAW,YAAA;EACX,MAAA,GAAS,MAAA;EACT,UAAA,GAAa,MAAA;EACb,eAAA,GAAkB,MAAA;AAAA;AAAA,UAGH,MAAA;EACf,GAAA;EACA,SAAA,EAAW,YAAA;EACX,UAAA,EAAY,MAAA;EACZ,eAAA,EAAiB,MAAA;AAAA;AAAA,KAGP,WAAA;AAAA,UAEK,sBAAA;EACf,SAAA;EACA,IAAA,EAAM,WAAA;EACN,MAAA;EACA,QAAA,GAAW,WAAA;AAAA;AAAA,UAGI,iBAAA;EACf,SAAA;EACA,SAAA,EAAW,MAAA;EACX,IAAA,EAAM,WAAA,SAAoB,MAAA;EAC1B,MAAA;EACA,QAAA,GAAW,WAAA;AAAA;AAAA,iBAeG,uBAAA,CAAwB,KAAA,EAAO,sBAAA,GAAyB,iBAAA;;;KC5C5D,aAAA,GAAgB,UAAA;EAAe,GAAA;EAAa,GAAA;AAAA;AAAA,cAE3C,WAAA,YAAuB,aAAA,CAAc,aAAA;EAAA,iBAGnB,SAAA;EAAA,SAFpB,IAAA;cAEoB,SAAA,EAAW,iBAAA;EAExC,WAAA,CACE,OAAA,UACA,MAAA,EAAQ,cAAA,EACR,OAAA;IAAY,OAAA,GAAU,aAAA;EAAA;EAcxB,aAAA,CAAc,OAAA,EAAS,aAAA;EAIvB,WAAA,CAAY,KAAA,WAAgB,aAAA;EAAA,QAkCpB,WAAA;AAAA"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { randomUUID } from "node:crypto";
|
|
1
|
+
import { KeyObject, randomUUID } from "node:crypto";
|
|
2
2
|
import jwt from "jsonwebtoken";
|
|
3
3
|
|
|
4
4
|
//#region src/jwt-config.ts
|
|
@@ -47,7 +47,7 @@ function normalizeJwtKey(input) {
|
|
|
47
47
|
};
|
|
48
48
|
}
|
|
49
49
|
function assertStrongHmacSecret(kid, secret) {
|
|
50
|
-
if ((typeof secret === "string" ? Buffer.byteLength(secret) : Buffer.isBuffer(secret) ? secret.byteLength : 0) < 32) throw new Error(`JWT key "${kid}" uses a weak HMAC secret; use at least 32 bytes`);
|
|
50
|
+
if ((typeof secret === "string" ? Buffer.byteLength(secret) : Buffer.isBuffer(secret) ? secret.byteLength : secret instanceof KeyObject && secret.type === "secret" ? secret.symmetricKeySize : 0) < 32) throw new Error(`JWT key "${kid}" uses a weak HMAC secret; use at least 32 bytes`);
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
//#endregion
|
|
@@ -99,7 +99,7 @@ var JwtStrategy = class {
|
|
|
99
99
|
}
|
|
100
100
|
};
|
|
101
101
|
function resolveExpiresIn(timeout) {
|
|
102
|
-
if (
|
|
102
|
+
if (timeout === -1) return;
|
|
103
103
|
return timeout;
|
|
104
104
|
}
|
|
105
105
|
function signingKeyFor(key) {
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../src/jwt-config.ts","../src/jwt-strategy.ts"],"sourcesContent":["import type { Secret, SignOptions } from \"jsonwebtoken\";\n\nexport type JwtAlgorithm = Extract<\n SignOptions[\"algorithm\"],\n \"HS256\" | \"HS384\" | \"HS512\" | \"RS256\" | \"RS384\" | \"RS512\" | \"ES256\" | \"ES384\" | \"ES512\"\n>;\n\nexport interface JwtKeyInput {\n kid: string;\n algorithm: JwtAlgorithm;\n secret?: Secret;\n signingKey?: Secret;\n verificationKey?: Secret;\n}\n\nexport interface JwtKey {\n kid: string;\n algorithm: JwtAlgorithm;\n signingKey: Secret;\n verificationKey: Secret;\n}\n\nexport type JwtAudience = string | [string, ...string[]];\n\nexport interface JwtStrategyConfigInput {\n activeKid: string;\n keys: JwtKeyInput[];\n issuer?: string;\n audience?: JwtAudience;\n}\n\nexport interface JwtStrategyConfig {\n activeKid: string;\n activeKey: JwtKey;\n keys: ReadonlyMap<string, JwtKey>;\n issuer?: string;\n audience?: JwtAudience;\n}\n\nconst supportedAlgorithms = new Set<JwtAlgorithm>([\n \"HS256\",\n \"HS384\",\n \"HS512\",\n \"RS256\",\n \"RS384\",\n \"RS512\",\n \"ES256\",\n \"ES384\",\n \"ES512\",\n]);\n\nexport function createJwtStrategyConfig(input: JwtStrategyConfigInput): JwtStrategyConfig {\n if (!input.activeKid) {\n throw new Error(\"JWT activeKid is required\");\n }\n if (!input.keys.length) {\n throw new Error(\"JWT keys must not be empty\");\n }\n\n const keys = new Map<string, JwtKey>();\n for (const keyInput of input.keys) {\n const key = normalizeJwtKey(keyInput);\n if (keys.has(key.kid)) {\n throw new Error(`JWT key kid \"${key.kid}\" is duplicated`);\n }\n keys.set(key.kid, key);\n }\n\n const activeKey = keys.get(input.activeKid);\n if (!activeKey) {\n throw new Error(`JWT activeKid \"${input.activeKid}\" does not match any configured key`);\n }\n\n return {\n activeKid: input.activeKid,\n activeKey,\n keys,\n issuer: input.issuer,\n audience: input.audience,\n };\n}\n\nfunction normalizeJwtKey(input: JwtKeyInput): JwtKey {\n if (!input.kid) {\n throw new Error(\"JWT key kid is required\");\n }\n if (!supportedAlgorithms.has(input.algorithm)) {\n throw new Error(`JWT algorithm \"${input.algorithm}\" is not supported`);\n }\n\n const signingKey = input.signingKey ?? input.secret;\n const verificationKey = input.verificationKey ?? input.secret ?? input.signingKey;\n if (!signingKey || !verificationKey) {\n throw new Error(`JWT key \"${input.kid}\" requires signing and verification keys`);\n }\n if (input.algorithm.startsWith(\"HS\")) {\n assertStrongHmacSecret(input.kid, signingKey);\n }\n\n return {\n kid: input.kid,\n algorithm: input.algorithm,\n signingKey,\n verificationKey,\n };\n}\n\nfunction assertStrongHmacSecret(kid: string, secret: Secret): void {\n const length =\n typeof secret === \"string\"\n ? Buffer.byteLength(secret)\n : Buffer.isBuffer(secret)\n ? secret.byteLength\n : 0;\n\n if (length < 32) {\n throw new Error(`JWT key \"${kid}\" uses a weak HMAC secret; use at least 32 bytes`);\n }\n}\n","import { randomUUID } from \"node:crypto\";\nimport jwt from \"jsonwebtoken\";\nimport type { JwtPayload, SignOptions } from \"jsonwebtoken\";\nimport type { DurationInput, TokenStrategy, XltTokenConfig } from \"@xlt-token/core\";\nimport type { JwtKey, JwtStrategyConfig } from \"./jwt-config.js\";\n\nconst { decode, sign, verify } = jwt;\n\nexport type XltJwtPayload = JwtPayload & { sub: string; jti: string };\n\nexport class JwtStrategy implements TokenStrategy<XltJwtPayload> {\n readonly kind = \"jwt\" as const;\n\n constructor(private readonly jwtConfig: JwtStrategyConfig) {}\n\n createToken(\n loginId: string,\n config: XltTokenConfig,\n options?: { timeout?: DurationInput },\n ): string {\n const jti = randomUUID();\n const expiresIn = resolveExpiresIn(options?.timeout ?? config.timeout);\n\n return this.signPayload(\n {\n sub: loginId,\n jti,\n },\n expiresIn,\n );\n }\n\n generateToken(payload: XltJwtPayload): string {\n return this.signPayload(payload);\n }\n\n verifyToken(token: string): XltJwtPayload {\n const decoded = decode(token, { complete: true });\n if (!decoded || typeof decoded === \"string\") {\n throw new Error(\"JWT token is malformed\");\n }\n\n const { kid, alg } = decoded.header;\n if (!kid) {\n throw new Error(\"JWT token header is missing kid\");\n }\n\n const key = this.jwtConfig.keys.get(kid);\n if (!key) {\n throw new Error(`JWT key \"${kid}\" is not configured`);\n }\n if (alg !== key.algorithm) {\n throw new Error(`JWT algorithm \"${String(alg)}\" does not match configured key algorithm`);\n }\n\n const payload = verify(token, key.verificationKey, {\n algorithms: [key.algorithm],\n ...(this.jwtConfig.issuer && { issuer: this.jwtConfig.issuer }),\n ...(this.jwtConfig.audience && { audience: this.jwtConfig.audience }),\n });\n if (typeof payload === \"string\") {\n throw new Error(\"JWT payload must be an object\");\n }\n if (typeof payload.sub !== \"string\" || typeof payload.jti !== \"string\") {\n throw new Error(\"JWT payload requires string sub and jti claims\");\n }\n\n return payload as XltJwtPayload;\n }\n\n private signPayload(payload: object, expiresIn?: DurationInput): string {\n const key = this.jwtConfig.activeKey;\n const options: SignOptions = {\n algorithm: key.algorithm,\n keyid: key.kid,\n ...(this.jwtConfig.issuer && { issuer: this.jwtConfig.issuer }),\n ...(this.jwtConfig.audience && { audience: this.jwtConfig.audience }),\n ...(expiresIn !== undefined && { expiresIn }),\n };\n\n return sign(payload, signingKeyFor(key), options);\n }\n}\n\nfunction resolveExpiresIn(timeout: DurationInput): DurationInput | undefined {\n if (
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/jwt-config.ts","../src/jwt-strategy.ts"],"sourcesContent":["import type { Secret, SignOptions } from \"jsonwebtoken\";\nimport { KeyObject } from \"node:crypto\";\n\nexport type JwtAlgorithm = Extract<\n SignOptions[\"algorithm\"],\n \"HS256\" | \"HS384\" | \"HS512\" | \"RS256\" | \"RS384\" | \"RS512\" | \"ES256\" | \"ES384\" | \"ES512\"\n>;\n\nexport interface JwtKeyInput {\n kid: string;\n algorithm: JwtAlgorithm;\n secret?: Secret;\n signingKey?: Secret;\n verificationKey?: Secret;\n}\n\nexport interface JwtKey {\n kid: string;\n algorithm: JwtAlgorithm;\n signingKey: Secret;\n verificationKey: Secret;\n}\n\nexport type JwtAudience = string | [string, ...string[]];\n\nexport interface JwtStrategyConfigInput {\n activeKid: string;\n keys: JwtKeyInput[];\n issuer?: string;\n audience?: JwtAudience;\n}\n\nexport interface JwtStrategyConfig {\n activeKid: string;\n activeKey: JwtKey;\n keys: ReadonlyMap<string, JwtKey>;\n issuer?: string;\n audience?: JwtAudience;\n}\n\nconst supportedAlgorithms = new Set<JwtAlgorithm>([\n \"HS256\",\n \"HS384\",\n \"HS512\",\n \"RS256\",\n \"RS384\",\n \"RS512\",\n \"ES256\",\n \"ES384\",\n \"ES512\",\n]);\n\nexport function createJwtStrategyConfig(input: JwtStrategyConfigInput): JwtStrategyConfig {\n if (!input.activeKid) {\n throw new Error(\"JWT activeKid is required\");\n }\n if (!input.keys.length) {\n throw new Error(\"JWT keys must not be empty\");\n }\n\n const keys = new Map<string, JwtKey>();\n for (const keyInput of input.keys) {\n const key = normalizeJwtKey(keyInput);\n if (keys.has(key.kid)) {\n throw new Error(`JWT key kid \"${key.kid}\" is duplicated`);\n }\n keys.set(key.kid, key);\n }\n\n const activeKey = keys.get(input.activeKid);\n if (!activeKey) {\n throw new Error(`JWT activeKid \"${input.activeKid}\" does not match any configured key`);\n }\n\n return {\n activeKid: input.activeKid,\n activeKey,\n keys,\n issuer: input.issuer,\n audience: input.audience,\n };\n}\n\nfunction normalizeJwtKey(input: JwtKeyInput): JwtKey {\n if (!input.kid) {\n throw new Error(\"JWT key kid is required\");\n }\n if (!supportedAlgorithms.has(input.algorithm)) {\n throw new Error(`JWT algorithm \"${input.algorithm}\" is not supported`);\n }\n\n const signingKey = input.signingKey ?? input.secret;\n const verificationKey = input.verificationKey ?? input.secret ?? input.signingKey;\n if (!signingKey || !verificationKey) {\n throw new Error(`JWT key \"${input.kid}\" requires signing and verification keys`);\n }\n if (input.algorithm.startsWith(\"HS\")) {\n assertStrongHmacSecret(input.kid, signingKey);\n }\n\n return {\n kid: input.kid,\n algorithm: input.algorithm,\n signingKey,\n verificationKey,\n };\n}\n\nfunction assertStrongHmacSecret(kid: string, secret: Secret): void {\n const length =\n typeof secret === \"string\"\n ? Buffer.byteLength(secret)\n : Buffer.isBuffer(secret)\n ? secret.byteLength\n : secret instanceof KeyObject && secret.type === \"secret\" ? secret.symmetricKeySize : 0;\n\n if (length < 32) {\n throw new Error(`JWT key \"${kid}\" uses a weak HMAC secret; use at least 32 bytes`);\n }\n}\n","import { randomUUID } from \"node:crypto\";\nimport jwt from \"jsonwebtoken\";\nimport type { JwtPayload, SignOptions } from \"jsonwebtoken\";\nimport type { DurationInput, TokenStrategy, XltTokenConfig } from \"@xlt-token/core\";\nimport type { JwtKey, JwtStrategyConfig } from \"./jwt-config.js\";\n\nconst { decode, sign, verify } = jwt;\n\nexport type XltJwtPayload = JwtPayload & { sub: string; jti: string };\n\nexport class JwtStrategy implements TokenStrategy<XltJwtPayload> {\n readonly kind = \"jwt\" as const;\n\n constructor(private readonly jwtConfig: JwtStrategyConfig) {}\n\n createToken(\n loginId: string,\n config: XltTokenConfig,\n options?: { timeout?: DurationInput },\n ): string {\n const jti = randomUUID();\n const expiresIn = resolveExpiresIn(options?.timeout ?? config.timeout);\n\n return this.signPayload(\n {\n sub: loginId,\n jti,\n },\n expiresIn,\n );\n }\n\n generateToken(payload: XltJwtPayload): string {\n return this.signPayload(payload);\n }\n\n verifyToken(token: string): XltJwtPayload {\n const decoded = decode(token, { complete: true });\n if (!decoded || typeof decoded === \"string\") {\n throw new Error(\"JWT token is malformed\");\n }\n\n const { kid, alg } = decoded.header;\n if (!kid) {\n throw new Error(\"JWT token header is missing kid\");\n }\n\n const key = this.jwtConfig.keys.get(kid);\n if (!key) {\n throw new Error(`JWT key \"${kid}\" is not configured`);\n }\n if (alg !== key.algorithm) {\n throw new Error(`JWT algorithm \"${String(alg)}\" does not match configured key algorithm`);\n }\n\n const payload = verify(token, key.verificationKey, {\n algorithms: [key.algorithm],\n ...(this.jwtConfig.issuer && { issuer: this.jwtConfig.issuer }),\n ...(this.jwtConfig.audience && { audience: this.jwtConfig.audience }),\n });\n if (typeof payload === \"string\") {\n throw new Error(\"JWT payload must be an object\");\n }\n if (typeof payload.sub !== \"string\" || typeof payload.jti !== \"string\") {\n throw new Error(\"JWT payload requires string sub and jti claims\");\n }\n\n return payload as XltJwtPayload;\n }\n\n private signPayload(payload: object, expiresIn?: DurationInput): string {\n const key = this.jwtConfig.activeKey;\n const options: SignOptions = {\n algorithm: key.algorithm,\n keyid: key.kid,\n ...(this.jwtConfig.issuer && { issuer: this.jwtConfig.issuer }),\n ...(this.jwtConfig.audience && { audience: this.jwtConfig.audience }),\n ...(expiresIn !== undefined && { expiresIn }),\n };\n\n return sign(payload, signingKeyFor(key), options);\n }\n}\n\nfunction resolveExpiresIn(timeout: DurationInput): DurationInput | undefined {\n if (timeout === -1) {\n return undefined;\n }\n return timeout;\n}\n\nfunction signingKeyFor(key: JwtKey) {\n return key.signingKey;\n}\n"],"mappings":";;;;AAwCA,MAAM,sBAAsB,IAAI,IAAkB;CAChD;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD,CAAC;AAEF,SAAgB,wBAAwB,OAAkD;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GAC3B,WAAW,IAAI;GACf,OAAO,IAAI;GACX,GAAI,KAAK,UAAU,UAAU,EAAE,QAAQ,KAAK,UAAU,QAAQ;GAC9D,GAAI,KAAK,UAAU,YAAY,EAAE,UAAU,KAAK,UAAU,UAAU;GACpE,GAAI,cAAc,UAAa,EAAE,WAAW;GAC7C;AAED,SAAO,KAAK,SAAS,cAAc,IAAI,EAAE,QAAQ;;;AAIrD,SAAS,iBAAiB,SAAmD;AAC3E,KAAI,YAAY,GACd;AAEF,QAAO;;AAGT,SAAS,cAAc,KAAa;AAClC,QAAO,IAAI"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xlt-token/jwt",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0",
|
|
4
4
|
"description": "JWT token strategy with key rotation for xlt-token",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"auth",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"access": "public"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@xlt-token/core": "^2.
|
|
49
|
+
"@xlt-token/core": "^2.3.0",
|
|
50
50
|
"jsonwebtoken": "^9.0.3"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|