@fluojs/jwt 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ko.md +2 -0
- package/README.md +2 -0
- package/dist/refresh/refresh-token.d.ts.map +1 -1
- package/dist/refresh/refresh-token.js +6 -1
- package/dist/signing/jwks.d.ts +1 -1
- package/dist/signing/jwks.d.ts.map +1 -1
- package/dist/signing/jwks.js +3 -1
- package/dist/signing/signer.d.ts.map +1 -1
- package/dist/signing/signer.js +6 -1
- package/dist/signing/verifier-internal.d.ts +1 -1
- package/dist/signing/verifier-internal.d.ts.map +1 -1
- package/dist/signing/verifier.d.ts.map +1 -1
- package/dist/signing/verifier.js +11 -5
- package/package.json +3 -3
package/README.ko.md
CHANGED
|
@@ -170,6 +170,8 @@ JWT 서명과 검증에는 `algorithms`에 지원되는 알고리즘이 하나
|
|
|
170
170
|
|
|
171
171
|
검증은 잘못된 시간 정책에 대해 fail closed로 동작합니다. 검증에 참여하는 `exp`, `nbf`, `iat` 클레임은 유한한 JWT NumericDate 숫자여야 하며, `clockSkewSeconds`도 음수가 아닌 유한 숫자여야 합니다. 유한하지 않은 값은 expiration, not-before, age check를 늘리는 대신 거부됩니다. verifier 시간이 `exp` NumericDate에 도달하면 토큰은 만료된 것으로 처리되며, 양수 clock skew가 경계를 덮지 않는 한 equality도 만료로 간주합니다.
|
|
172
172
|
|
|
173
|
+
루트 `@fluojs/jwt` import surface는 runtime-specific 인증 경로를 선택하기 전에도 안전하게 로드할 수 있습니다. Node.js `node:crypto` primitive는 서명, 검증, JWKS key parsing, refresh-token id 생성이 실제로 실행될 때만 lazy load됩니다. 이 방식은 기존 public export를 유지하면서 module import 시점의 Node-specific crypto 작업을 피합니다.
|
|
174
|
+
|
|
173
175
|
## 공개 API 개요
|
|
174
176
|
|
|
175
177
|
### 주요 클래스
|
package/README.md
CHANGED
|
@@ -170,6 +170,8 @@ Access-token TTL must also be a positive finite number. When `accessTokenTtlSeco
|
|
|
170
170
|
|
|
171
171
|
Verification fails closed on malformed time policy. `exp`, `nbf`, and `iat` claims that participate in verification must be finite JWT NumericDate numbers, and `clockSkewSeconds` must be a non-negative finite number. Non-finite values are rejected instead of extending expiration, not-before, or age checks. A token is expired when verifier time reaches its `exp` NumericDate; equality is treated as expired unless positive clock skew still covers the boundary.
|
|
172
172
|
|
|
173
|
+
The root `@fluojs/jwt` import surface is safe to load before selecting a runtime-specific authentication path: Node.js `node:crypto` primitives are loaded lazily only when signing, verification, JWKS key parsing, or refresh-token id generation actually executes. This preserves the existing public exports while avoiding Node-specific crypto work at module import time.
|
|
174
|
+
|
|
173
175
|
## Public API Overview
|
|
174
176
|
|
|
175
177
|
### Core Classes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"refresh-token.d.ts","sourceRoot":"","sources":["../../src/refresh/refresh-token.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"refresh-token.d.ts","sourceRoot":"","sources":["../../src/refresh/refresh-token.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAEjE;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,IAAI,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/C,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,GAAG,SAAS,CAAC,CAAC;IAC/D,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACvC,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAChD,OAAO,CAAC,CAAC,KAAK,EAAE,wBAAwB,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC;IAC9E,MAAM,CAAC,CAAC,KAAK,EAAE,uBAAuB,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC;CAC7E;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,IAAI,CAAC;CACX;AAED;;GAEG;AACH,MAAM,WAAW,uBAAwB,SAAQ,wBAAwB;IACvE,WAAW,EAAE,kBAAkB,CAAC;CACjC;AAED;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG,UAAU,GAAG,cAAc,GAAG,SAAS,GAAG,WAAW,GAAG,UAAU,GAAG,SAAS,CAAC;AAEvH;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,IAAI,CAAC;IAChB,IAAI,EAAE,OAAO,CAAC;IACd,SAAS,EAAE,IAAI,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,gBAAgB,EAAE,MAAM,CAAC;IACzB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,iBAAiB,CAAC;CAC1B;AAED;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,mBAAmB,GAAG,SAAS,GAAG,mBAAmB,CA6B1G;AAQD;;GAEG;AACH,qBAAa,mBAAmB;IAK5B,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAL3B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAsB;gBAG5C,OAAO,EAAE,mBAAmB,EACX,MAAM,EAAE,gBAAgB,EACxB,QAAQ,EAAE,kBAAkB;IAKzC,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAOnD,kBAAkB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,CAAA;KAAE,CAAC;IA0EhG,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIlD,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;YAI3C,2BAA2B;YAQ3B,mBAAmB;YAUnB,4BAA4B;YA+B5B,mBAAmB;CA4BlC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { randomUUID } from 'node:crypto';
|
|
2
1
|
import { JwtConfigurationError, JwtExpiredTokenError, JwtInvalidTokenError } from '../errors.js';
|
|
3
2
|
|
|
4
3
|
/**
|
|
@@ -62,6 +61,9 @@ export class RefreshTokenService {
|
|
|
62
61
|
this.options = normalizeRefreshTokenOptions(options);
|
|
63
62
|
}
|
|
64
63
|
async issueRefreshToken(subject) {
|
|
64
|
+
const {
|
|
65
|
+
randomUUID
|
|
66
|
+
} = await import('node:crypto');
|
|
65
67
|
const family = randomUUID();
|
|
66
68
|
return this.issueRefreshTokenWithFamily(subject, family);
|
|
67
69
|
}
|
|
@@ -152,6 +154,9 @@ export class RefreshTokenService {
|
|
|
152
154
|
}
|
|
153
155
|
async createRefreshTokenWithFamily(subject, family) {
|
|
154
156
|
const now = Math.floor(Date.now() / 1000);
|
|
157
|
+
const {
|
|
158
|
+
randomUUID
|
|
159
|
+
} = await import('node:crypto');
|
|
155
160
|
const tokenId = randomUUID();
|
|
156
161
|
const expiresAt = new Date((now + this.options.expiresInSeconds) * 1000);
|
|
157
162
|
const record = {
|
package/dist/signing/jwks.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jwks.d.ts","sourceRoot":"","sources":["../../src/signing/jwks.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"jwks.d.ts","sourceRoot":"","sources":["../../src/signing/jwks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAiC7C;;GAEG;AACH,qBAAa,UAAU;IAKnB,OAAO,CAAC,QAAQ,CAAC,GAAG;IACpB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IACjC,OAAO,CAAC,QAAQ,CAAC,eAAe;IAPlC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAA4D;IAClF,OAAO,CAAC,mBAAmB,CAAK;gBAGb,GAAG,EAAE,MAAM,EACX,QAAQ,GAAE,MAAgB,EAC1B,gBAAgB,GAAE,MAAc,EAChC,eAAe,GAAE,MAAuC;IAO3E;;;;;OAKG;IACH,OAAO,IAAI,IAAI;IAKf,OAAO,CAAC,YAAY;IAId,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;IA2CpD,OAAO,CAAC,wBAAwB;IAQhC,OAAO,CAAC,uBAAuB;YAYjB,SAAS;CAsCxB"}
|
package/dist/signing/jwks.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { createPublicKey } from 'node:crypto';
|
|
2
1
|
import { JwtConfigurationError, JwtInvalidTokenError } from '../errors.js';
|
|
3
2
|
const DEFAULT_JWKS_CACHE_MAX_ENTRIES = 100;
|
|
4
3
|
function assertNonNegativeFiniteNumber(value, label) {
|
|
@@ -64,6 +63,9 @@ export class JwksClient {
|
|
|
64
63
|
}
|
|
65
64
|
let key;
|
|
66
65
|
try {
|
|
66
|
+
const {
|
|
67
|
+
createPublicKey
|
|
68
|
+
} = await import('node:crypto');
|
|
67
69
|
key = createPublicKey({
|
|
68
70
|
format: 'jwk',
|
|
69
71
|
key: jwk
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signer.d.ts","sourceRoot":"","sources":["../../src/signing/signer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"signer.d.ts","sourceRoot":"","sources":["../../src/signing/signer.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAgB,SAAS,EAAe,kBAAkB,EAAE,MAAM,aAAa,CAAC;AA0D5F;;GAEG;AACH,qBACa,gBAAgB;IAGf,OAAO,CAAC,QAAQ,CAAC,OAAO;IAFpC,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAiB;gBAEtB,OAAO,EAAE,kBAAkB;IAOlD,eAAe,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC;IAInD,gBAAgB,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC;IAK1D,OAAO,CAAC,4BAA4B;YAYtB,SAAS;CAoFxB"}
|
package/dist/signing/signer.js
CHANGED
|
@@ -4,7 +4,6 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
4
4
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
5
5
|
function _setFunctionName(e, t, n) { "symbol" == typeof t && (t = (t = t.description) ? "[" + t + "]" : ""); try { Object.defineProperty(e, "name", { configurable: !0, value: n ? n + " " + t : t }); } catch (e) {} return e; }
|
|
6
6
|
function _checkInRHS(e) { if (Object(e) !== e) throw TypeError("right-hand side of 'in' should be an object, got " + (null !== e ? typeof e : "null")); return e; }
|
|
7
|
-
import { createHmac, createSign } from 'node:crypto';
|
|
8
7
|
import { Inject } from '@fluojs/core';
|
|
9
8
|
import { JwtConfigurationError } from '../errors.js';
|
|
10
9
|
import { normalizeRefreshTokenOptions } from '../refresh/refresh-token.js';
|
|
@@ -121,6 +120,9 @@ class DefaultJwtSigner {
|
|
|
121
120
|
if (!hash) {
|
|
122
121
|
throw new JwtConfigurationError(`No hash mapping for asymmetric algorithm "${algorithm}".`);
|
|
123
122
|
}
|
|
123
|
+
const {
|
|
124
|
+
createSign
|
|
125
|
+
} = await import('node:crypto');
|
|
124
126
|
const signer = createSign(hash);
|
|
125
127
|
signer.update(signingInput);
|
|
126
128
|
const isEc = algorithm.startsWith('ES');
|
|
@@ -137,6 +139,9 @@ class DefaultJwtSigner {
|
|
|
137
139
|
if (!hash) {
|
|
138
140
|
throw new JwtConfigurationError(`No hash mapping for HMAC algorithm "${algorithm}".`);
|
|
139
141
|
}
|
|
142
|
+
const {
|
|
143
|
+
createHmac
|
|
144
|
+
} = await import('node:crypto');
|
|
140
145
|
signatureSegment = encodeBase64Url(createHmac(hash, secret).update(signingInput).digest());
|
|
141
146
|
}
|
|
142
147
|
return `${headerSegment}.${payloadSegment}.${signatureSegment}`;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { JwtPrincipal, JwtVerifierOptions } from '../types.js';
|
|
2
|
-
import { DefaultJwtVerifier } from './verifier.js';
|
|
2
|
+
import type { DefaultJwtVerifier } from './verifier.js';
|
|
3
3
|
type AccessTokenVerificationOverrides = Pick<JwtVerifierOptions, 'algorithms' | 'audience' | 'clockSkewSeconds' | 'issuer' | 'maxAge' | 'requireExp'>;
|
|
4
4
|
/**
|
|
5
5
|
* Applies supported per-call access-token overrides through the verifier's public API.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verifier-internal.d.ts","sourceRoot":"","sources":["../../src/signing/verifier-internal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"verifier-internal.d.ts","sourceRoot":"","sources":["../../src/signing/verifier-internal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEpE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAExD,KAAK,gCAAgC,GAAG,IAAI,CAC1C,kBAAkB,EAClB,YAAY,GAAG,UAAU,GAAG,kBAAkB,GAAG,QAAQ,GAAG,QAAQ,GAAG,YAAY,CACpF,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,8BAA8B,CAC5C,QAAQ,EAAE,kBAAkB,EAC5B,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,OAAO,CAAC,gCAAgC,CAAC,GACnD,OAAO,CAAC,YAAY,CAAC,CAEvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verifier.d.ts","sourceRoot":"","sources":["../../src/signing/verifier.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"verifier.d.ts","sourceRoot":"","sources":["../../src/signing/verifier.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,YAAY,EAA0B,YAAY,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAG1G;;GAEG;AACH,eAAO,MAAM,WAAW,eAAiC,CAAC;AAE1D;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,CAI3D,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,CAOjE,CAAC;AAmDF,KAAK,gCAAgC,GAAG,IAAI,CAC1C,kBAAkB,EAClB,YAAY,GAAG,UAAU,GAAG,kBAAkB,GAAG,QAAQ,GAAG,QAAQ,GAAG,YAAY,CACpF,CAAC;AAiMF;;GAEG;AACH,qBACa,kBAAkB;IAMjB,OAAO,CAAC,QAAQ,CAAC,OAAO;IALpC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAyB;IACpD,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAqB;IACxD,OAAO,CAAC,QAAQ,CAAC,yBAAyB,CAAqB;IAC/D,OAAO,CAAC,QAAQ,CAAC,0BAA0B,CAAiC;gBAE/C,OAAO,EAAE,kBAAkB;IAalD,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAI7D;;;;;;OAMG;IACH,OAAO,IAAI,IAAI;IAIf;;;;;;;;;;OAUG;IACG,8BAA8B,CAClC,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,OAAO,CAAC,gCAAgC,CAAC,GACnD,OAAO,CAAC,YAAY,CAAC;IAqBlB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAQ9D,OAAO,CAAC,gCAAgC;YAsB1B,WAAW;IA+BzB,OAAO,CAAC,kBAAkB;YAUZ,oBAAoB;YAgBpB,wBAAwB;YAsBxB,8BAA8B;YAsB9B,kBAAkB;IAWhC,OAAO,CAAC,mBAAmB;IAwB3B,OAAO,CAAC,oBAAoB;IA2B5B,OAAO,CAAC,yBAAyB;YAiBnB,oBAAoB;CAOnC"}
|
package/dist/signing/verifier.js
CHANGED
|
@@ -4,7 +4,6 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
4
4
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
5
5
|
function _setFunctionName(e, t, n) { "symbol" == typeof t && (t = (t = t.description) ? "[" + t + "]" : ""); try { Object.defineProperty(e, "name", { configurable: !0, value: n ? n + " " + t : t }); } catch (e) {} return e; }
|
|
6
6
|
function _checkInRHS(e) { if (Object(e) !== e) throw TypeError("right-hand side of 'in' should be an object, got " + (null !== e ? typeof e : "null")); return e; }
|
|
7
|
-
import { createHmac, createVerify, timingSafeEqual } from 'node:crypto';
|
|
8
7
|
import { Inject } from '@fluojs/core';
|
|
9
8
|
import { JwtConfigurationError, JwtExpiredTokenError, JwtInvalidTokenError } from '../errors.js';
|
|
10
9
|
import { normalizeRefreshTokenOptions } from '../refresh/refresh-token.js';
|
|
@@ -130,11 +129,15 @@ function resolveStaticPublicKey(options, keyState, kid) {
|
|
|
130
129
|
}
|
|
131
130
|
return keyState.defaultPublicKey ?? options.publicKey;
|
|
132
131
|
}
|
|
133
|
-
function verifyHmacSignature(algorithm, secret, signingInput, signatureSegment) {
|
|
132
|
+
async function verifyHmacSignature(algorithm, secret, signingInput, signatureSegment) {
|
|
134
133
|
const hash = HMAC_HASH[algorithm];
|
|
135
134
|
if (!hash) {
|
|
136
135
|
throw new JwtInvalidTokenError();
|
|
137
136
|
}
|
|
137
|
+
const {
|
|
138
|
+
createHmac,
|
|
139
|
+
timingSafeEqual
|
|
140
|
+
} = await import('node:crypto');
|
|
138
141
|
const expected = encodeBase64Url(createHmac(hash, secret).update(signingInput).digest());
|
|
139
142
|
const expectedBuf = Buffer.from(expected, 'base64url');
|
|
140
143
|
const actualBuf = Buffer.from(signatureSegment, 'base64url');
|
|
@@ -142,11 +145,14 @@ function verifyHmacSignature(algorithm, secret, signingInput, signatureSegment)
|
|
|
142
145
|
throw new JwtInvalidTokenError();
|
|
143
146
|
}
|
|
144
147
|
}
|
|
145
|
-
function verifyAsymmetricSignature(algorithm, publicKey, signingInput, signatureSegment) {
|
|
148
|
+
async function verifyAsymmetricSignature(algorithm, publicKey, signingInput, signatureSegment) {
|
|
146
149
|
const hash = ASYMMETRIC_HASH[algorithm];
|
|
147
150
|
if (!hash) {
|
|
148
151
|
throw new JwtInvalidTokenError();
|
|
149
152
|
}
|
|
153
|
+
const {
|
|
154
|
+
createVerify
|
|
155
|
+
} = await import('node:crypto');
|
|
150
156
|
const verifier = createVerify(hash);
|
|
151
157
|
verifier.update(signingInput);
|
|
152
158
|
const isEc = algorithm.startsWith('ES');
|
|
@@ -310,7 +316,7 @@ class DefaultJwtVerifier {
|
|
|
310
316
|
if (!secret) {
|
|
311
317
|
throw new JwtConfigurationError('JWT secret is not configured.');
|
|
312
318
|
}
|
|
313
|
-
verifyHmacSignature(header.alg, secret, signingInput, signatureSegment);
|
|
319
|
+
await verifyHmacSignature(header.alg, secret, signingInput, signatureSegment);
|
|
314
320
|
}
|
|
315
321
|
async verifyAsymmetricTokenSignature(header, signingInput, signatureSegment, options, keyResolutionState, jwksClient) {
|
|
316
322
|
const providerKey = await this.resolveProviderKey(options, header);
|
|
@@ -318,7 +324,7 @@ class DefaultJwtVerifier {
|
|
|
318
324
|
if (!publicKey) {
|
|
319
325
|
throw new JwtConfigurationError('JWT public key is not configured.');
|
|
320
326
|
}
|
|
321
|
-
verifyAsymmetricSignature(header.alg, publicKey, signingInput, signatureSegment);
|
|
327
|
+
await verifyAsymmetricSignature(header.alg, publicKey, signingInput, signatureSegment);
|
|
322
328
|
}
|
|
323
329
|
async resolveProviderKey(options, header) {
|
|
324
330
|
if (!options.secretOrKeyProvider) {
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"signing",
|
|
10
10
|
"verification"
|
|
11
11
|
],
|
|
12
|
-
"version": "1.0.
|
|
12
|
+
"version": "1.0.2",
|
|
13
13
|
"private": false,
|
|
14
14
|
"license": "MIT",
|
|
15
15
|
"repository": {
|
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
"dist"
|
|
37
37
|
],
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@fluojs/di": "^1.0.3",
|
|
40
39
|
"@fluojs/core": "^1.0.3",
|
|
41
|
-
"@fluojs/
|
|
40
|
+
"@fluojs/di": "^1.1.0",
|
|
41
|
+
"@fluojs/runtime": "^1.1.7"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"vitest": "^3.2.4"
|