@fluojs/jwt 1.0.0-beta.1 → 1.0.0-beta.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 +11 -0
- package/README.md +11 -0
- package/dist/module.d.ts.map +1 -1
- package/dist/module.js +9 -17
- package/dist/refresh/refresh-token.d.ts +24 -0
- package/dist/refresh/refresh-token.d.ts.map +1 -1
- package/dist/refresh/refresh-token.js +30 -0
- package/dist/service.d.ts +1 -2
- package/dist/service.d.ts.map +1 -1
- package/dist/service.js +2 -12
- package/dist/signing/jwks.d.ts +3 -0
- package/dist/signing/jwks.d.ts.map +1 -1
- package/dist/signing/jwks.js +3 -0
- package/dist/signing/signer.d.ts.map +1 -1
- package/dist/signing/signer.js +30 -6
- package/dist/signing/verifier-internal.d.ts +14 -0
- package/dist/signing/verifier-internal.d.ts.map +1 -0
- package/dist/signing/verifier-internal.js +11 -0
- package/dist/signing/verifier.d.ts +14 -0
- package/dist/signing/verifier.d.ts.map +1 -1
- package/dist/signing/verifier.js +47 -4
- package/dist/status.d.ts +18 -0
- package/dist/status.d.ts.map +1 -1
- package/dist/status.js +22 -0
- package/dist/types.d.ts +21 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +4 -4
package/README.ko.md
CHANGED
|
@@ -10,6 +10,7 @@ HTTP에 독립적인 JWT 토큰 코어로, 액세스 토큰의 서명 및 검증
|
|
|
10
10
|
- [사용 시점](#사용-시점)
|
|
11
11
|
- [빠른 시작](#빠른-시작)
|
|
12
12
|
- [일반적인 패턴](#일반적인-패턴)
|
|
13
|
+
- [설정 가드레일](#설정-가드레일)
|
|
13
14
|
- [공개 API 개요](#공개-api-개요)
|
|
14
15
|
- [관련 패키지](#관련-패키지)
|
|
15
16
|
- [예제 소스](#예제-소스)
|
|
@@ -56,6 +57,8 @@ export class AuthModule {}
|
|
|
56
57
|
|
|
57
58
|
JWT 설정이 다른 provider에서 와야 한다면, `JwtModule.forRootAsync(...)`를 사용해도 표준 module contract 안에서 안전하게 등록할 수 있습니다.
|
|
58
59
|
|
|
60
|
+
비동기 등록도 동기 경로와 동일한 JWT provider surface를 export하며, 여기에는 `RefreshTokenService`가 포함됩니다. 단, 이 서비스를 실제로 resolve하려면 `refreshToken` 옵션이 구성되어 있어야 합니다.
|
|
61
|
+
|
|
59
62
|
```typescript
|
|
60
63
|
import { Module, type Token } from '@fluojs/core';
|
|
61
64
|
import { JwtModule } from '@fluojs/jwt';
|
|
@@ -145,6 +148,14 @@ const verifier = new DefaultJwtVerifier({
|
|
|
145
148
|
|
|
146
149
|
`jwksRequestTimeoutMs`의 기본값은 `5_000`이며, 예산을 넘기면 진행 중인 JWKS fetch를 abort합니다.
|
|
147
150
|
|
|
151
|
+
`JwtService.verify(token, options)`는 호출 단위의 알고리즘/클레임 정책 재정의(`issuer`, `audience`, `clockSkewSeconds`, `maxAge`, `requireExp`)를 적용하더라도, 내부 JWKS client나 정적 key-resolution cache를 다시 만들지 않습니다. 호출 단위 검증은 `jwksUri`, `keys[]`, `publicKey`, `secret`, `secretOrKeyProvider` 같은 구성된 key source 자체를 교체하지는 않습니다.
|
|
152
|
+
|
|
153
|
+
## 설정 가드레일
|
|
154
|
+
|
|
155
|
+
JWT 서명과 검증에는 `algorithms`에 지원되는 알고리즘이 하나 이상 필요합니다. 기본 signer는 `HS256`, `HS384`, `HS512`, `RS256`, `RS384`, `RS512`, `ES256`, `ES384`, `ES512`를 지원하며, 빈 알고리즘 목록은 모호한 토큰을 발행하거나 수락하지 않도록 즉시 실패합니다.
|
|
156
|
+
|
|
157
|
+
액세스 토큰 TTL도 양의 유한 숫자여야 합니다. `accessTokenTtlSeconds`를 생략하면 `DefaultJwtSigner`는 문서화된 기본값인 `3600`초를 사용합니다. 소수 초는 JWT NumericDate `exp` 클레임에 그대로 보존됩니다. `0`, 음수 또는 유한하지 않은 값이 제공되면 토큰을 발행하기 전에 `JwtConfigurationError`로 실패합니다.
|
|
158
|
+
|
|
148
159
|
## 공개 API 개요
|
|
149
160
|
|
|
150
161
|
### 주요 클래스
|
package/README.md
CHANGED
|
@@ -10,6 +10,7 @@ HTTP-agnostic JWT token core that handles signing access tokens and verifying th
|
|
|
10
10
|
- [When to use](#when-to-use)
|
|
11
11
|
- [Quick Start](#quick-start)
|
|
12
12
|
- [Common Patterns](#common-patterns)
|
|
13
|
+
- [Configuration Guardrails](#configuration-guardrails)
|
|
13
14
|
- [Public API](#public-api)
|
|
14
15
|
- [Related Packages](#related-packages)
|
|
15
16
|
- [Example Sources](#example-sources)
|
|
@@ -56,6 +57,8 @@ export class AuthModule {}
|
|
|
56
57
|
|
|
57
58
|
Use `JwtModule.forRootAsync(...)` when your JWT settings must come from another provider and still need to resolve into the standard module contract.
|
|
58
59
|
|
|
60
|
+
Async registration exports the same JWT provider surface as the synchronous path, including `RefreshTokenService`; resolving that service still requires `refreshToken` options to be configured.
|
|
61
|
+
|
|
59
62
|
```typescript
|
|
60
63
|
import { Module, type Token } from '@fluojs/core';
|
|
61
64
|
import { JwtModule } from '@fluojs/jwt';
|
|
@@ -145,6 +148,14 @@ const verifier = new DefaultJwtVerifier({
|
|
|
145
148
|
|
|
146
149
|
`jwksRequestTimeoutMs` defaults to `5_000` and aborts the outbound JWKS fetch once that budget is exceeded.
|
|
147
150
|
|
|
151
|
+
`JwtService.verify(token, options)` applies per-call algorithm and claim-policy overrides (`issuer`, `audience`, `clockSkewSeconds`, `maxAge`, `requireExp`) without rebuilding the underlying JWKS client or static key-resolution cache. Per-call verification does not replace configured key sources such as `jwksUri`, `keys[]`, `publicKey`, `secret`, or `secretOrKeyProvider`.
|
|
152
|
+
|
|
153
|
+
## Configuration Guardrails
|
|
154
|
+
|
|
155
|
+
JWT signing and verification require at least one supported algorithm in `algorithms`. The built-in signer supports `HS256`, `HS384`, `HS512`, `RS256`, `RS384`, `RS512`, `ES256`, `ES384`, and `ES512`; configuration with an empty algorithm list fails fast instead of issuing or accepting ambiguous tokens.
|
|
156
|
+
|
|
157
|
+
Access-token TTL must also be a positive finite number. When `accessTokenTtlSeconds` is omitted, `DefaultJwtSigner` uses the documented `3600` second default. Fractional seconds are preserved in the JWT NumericDate `exp` claim; when the option is provided as `0`, a negative number, or a non-finite value, signing fails with `JwtConfigurationError` before a token is issued.
|
|
158
|
+
|
|
148
159
|
## Public API Overview
|
|
149
160
|
|
|
150
161
|
### Core Classes
|
package/dist/module.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,kBAAkB,EAAE,KAAK,WAAW,EAAiC,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,kBAAkB,EAAE,KAAK,WAAW,EAAiC,MAAM,cAAc,CAAC;AAOhH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAIrD,KAAK,UAAU,GAAG,WAAW,CAAC;AAyE9B;;GAEG;AACH,qBAAa,SAAS;IACpB,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,kBAAkB,GAAG,UAAU;IAQvD,MAAM,CAAC,YAAY,CAAC,OAAO,EAAE,kBAAkB,CAAC,kBAAkB,CAAC,GAAG,UAAU;IAShF,OAAO,CAAC,MAAM,CAAC,YAAY;CAgB5B"}
|
package/dist/module.js
CHANGED
|
@@ -6,7 +6,6 @@ function _setFunctionName(e, t, n) { "symbol" == typeof t && (t = (t = t.descrip
|
|
|
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
7
|
import { Inject } from '@fluojs/core';
|
|
8
8
|
import { defineModuleMetadata } from '@fluojs/core/internal';
|
|
9
|
-
import { RUNTIME_CONTAINER } from '@fluojs/runtime/internal';
|
|
10
9
|
import { JwtConfigurationError } from './errors.js';
|
|
11
10
|
import { normalizeRefreshTokenOptions, RefreshTokenService } from './refresh/refresh-token.js';
|
|
12
11
|
import { JwtService } from './service.js';
|
|
@@ -21,26 +20,16 @@ function resolveRefreshTokenOptions(value) {
|
|
|
21
20
|
let _AsyncRefreshTokenSer;
|
|
22
21
|
class AsyncRefreshTokenServiceRegistrar {
|
|
23
22
|
static {
|
|
24
|
-
[_AsyncRefreshTokenSer, _initClass] = _applyDecs(this, [Inject(JWT_OPTIONS, DefaultJwtSigner, DefaultJwtVerifier
|
|
23
|
+
[_AsyncRefreshTokenSer, _initClass] = _applyDecs(this, [Inject(JWT_OPTIONS, DefaultJwtSigner, DefaultJwtVerifier)], []).c;
|
|
25
24
|
}
|
|
26
|
-
|
|
27
|
-
constructor(options, signer, verifier, container) {
|
|
25
|
+
constructor(options, _signer, _verifier) {
|
|
28
26
|
this.options = options;
|
|
29
|
-
this.signer = signer;
|
|
30
|
-
this.verifier = verifier;
|
|
31
|
-
this.container = container;
|
|
32
27
|
}
|
|
33
28
|
onModuleInit() {
|
|
34
|
-
if (!this.options.refreshToken
|
|
29
|
+
if (!this.options.refreshToken) {
|
|
35
30
|
return;
|
|
36
31
|
}
|
|
37
|
-
|
|
38
|
-
this.container.register({
|
|
39
|
-
provide: RefreshTokenService,
|
|
40
|
-
scope: 'transient',
|
|
41
|
-
useFactory: () => new RefreshTokenService(refreshTokenOptions, this.signer, this.verifier)
|
|
42
|
-
});
|
|
43
|
-
this.registered = true;
|
|
32
|
+
resolveRefreshTokenOptions(this.options);
|
|
44
33
|
}
|
|
45
34
|
static {
|
|
46
35
|
_initClass();
|
|
@@ -49,7 +38,7 @@ class AsyncRefreshTokenServiceRegistrar {
|
|
|
49
38
|
function createJwtModuleProviders(optionsProvider, includeRefreshTokenService, refreshTokenServiceScope, deferRefreshTokenServiceRegistration = false) {
|
|
50
39
|
const providers = [optionsProvider, DefaultJwtVerifier, DefaultJwtSigner, JwtService];
|
|
51
40
|
if (includeRefreshTokenService) {
|
|
52
|
-
providers.push(
|
|
41
|
+
providers.push({
|
|
53
42
|
inject: [JWT_OPTIONS, DefaultJwtSigner, DefaultJwtVerifier],
|
|
54
43
|
provide: RefreshTokenService,
|
|
55
44
|
scope: refreshTokenServiceScope,
|
|
@@ -59,6 +48,9 @@ function createJwtModuleProviders(optionsProvider, includeRefreshTokenService, r
|
|
|
59
48
|
return new RefreshTokenService(refreshTokenOptions, signer, verifier);
|
|
60
49
|
}
|
|
61
50
|
});
|
|
51
|
+
if (deferRefreshTokenServiceRegistration) {
|
|
52
|
+
providers.push(_AsyncRefreshTokenSer);
|
|
53
|
+
}
|
|
62
54
|
}
|
|
63
55
|
return providers;
|
|
64
56
|
}
|
|
@@ -80,7 +72,7 @@ export class JwtModule {
|
|
|
80
72
|
provide: JWT_OPTIONS,
|
|
81
73
|
scope: 'singleton',
|
|
82
74
|
useFactory: options.useFactory
|
|
83
|
-
}, true,
|
|
75
|
+
}, true, true, 'transient', true);
|
|
84
76
|
}
|
|
85
77
|
static createModule(optionsProvider, includeRefreshTokenProvider, includeRefreshTokenExport, refreshTokenServiceScope, deferRefreshTokenServiceRegistration = false) {
|
|
86
78
|
class JwtRuntimeModule {}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type { DefaultJwtSigner } from '../signing/signer.js';
|
|
2
2
|
import type { DefaultJwtVerifier } from '../signing/verifier.js';
|
|
3
|
+
/**
|
|
4
|
+
* Describes the refresh token store contract.
|
|
5
|
+
*/
|
|
3
6
|
export interface RefreshTokenStore {
|
|
4
7
|
save(token: RefreshTokenRecord): Promise<void>;
|
|
5
8
|
find(tokenId: string): Promise<RefreshTokenRecord | undefined>;
|
|
@@ -7,13 +10,22 @@ export interface RefreshTokenStore {
|
|
|
7
10
|
revokeBySubject(subject: string): Promise<void>;
|
|
8
11
|
consume?(input: RefreshTokenConsumeInput): Promise<RefreshTokenConsumeResult>;
|
|
9
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* Describes the refresh token consume input contract.
|
|
15
|
+
*/
|
|
10
16
|
export interface RefreshTokenConsumeInput {
|
|
11
17
|
tokenId: string;
|
|
12
18
|
subject: string;
|
|
13
19
|
family: string;
|
|
14
20
|
now: Date;
|
|
15
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* Defines the refresh token consume result type.
|
|
24
|
+
*/
|
|
16
25
|
export type RefreshTokenConsumeResult = 'consumed' | 'already_used' | 'expired' | 'not_found' | 'mismatch' | 'invalid';
|
|
26
|
+
/**
|
|
27
|
+
* Describes the refresh token record contract.
|
|
28
|
+
*/
|
|
17
29
|
export interface RefreshTokenRecord {
|
|
18
30
|
id: string;
|
|
19
31
|
subject: string;
|
|
@@ -22,6 +34,9 @@ export interface RefreshTokenRecord {
|
|
|
22
34
|
used: boolean;
|
|
23
35
|
createdAt: Date;
|
|
24
36
|
}
|
|
37
|
+
/**
|
|
38
|
+
* Describes the refresh token options contract.
|
|
39
|
+
*/
|
|
25
40
|
export interface RefreshTokenOptions {
|
|
26
41
|
secret: string;
|
|
27
42
|
expiresInSeconds: number;
|
|
@@ -29,7 +44,16 @@ export interface RefreshTokenOptions {
|
|
|
29
44
|
rotation: boolean;
|
|
30
45
|
store: RefreshTokenStore;
|
|
31
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* Normalize refresh token options.
|
|
49
|
+
*
|
|
50
|
+
* @param options The options.
|
|
51
|
+
* @returns The normalize refresh token options result.
|
|
52
|
+
*/
|
|
32
53
|
export declare function normalizeRefreshTokenOptions(options: RefreshTokenOptions | undefined): RefreshTokenOptions;
|
|
54
|
+
/**
|
|
55
|
+
* Represents the refresh token service.
|
|
56
|
+
*/
|
|
33
57
|
export declare class RefreshTokenService {
|
|
34
58
|
private readonly signer;
|
|
35
59
|
private readonly verifier;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"refresh-token.d.ts","sourceRoot":"","sources":["../../src/refresh/refresh-token.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAA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AW,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,CAAA;KAAE,CAAC;IA+DhG,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIlD,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;YAI3C,2BAA2B;YA6B3B,mBAAmB;CA4BlC"}
|
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
import { randomUUID } from 'node:crypto';
|
|
2
2
|
import { JwtConfigurationError, JwtExpiredTokenError, JwtInvalidTokenError } from '../errors.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Describes the refresh token store contract.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Describes the refresh token consume input contract.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Defines the refresh token consume result type.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Describes the refresh token record contract.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Describes the refresh token options contract.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Normalize refresh token options.
|
|
26
|
+
*
|
|
27
|
+
* @param options The options.
|
|
28
|
+
* @returns The normalize refresh token options result.
|
|
29
|
+
*/
|
|
3
30
|
export function normalizeRefreshTokenOptions(options) {
|
|
4
31
|
if (!options) {
|
|
5
32
|
throw new JwtConfigurationError('JWT refresh token options are not configured.');
|
|
@@ -20,6 +47,9 @@ export function normalizeRefreshTokenOptions(options) {
|
|
|
20
47
|
...options
|
|
21
48
|
};
|
|
22
49
|
}
|
|
50
|
+
/**
|
|
51
|
+
* Represents the refresh token service.
|
|
52
|
+
*/
|
|
23
53
|
export class RefreshTokenService {
|
|
24
54
|
options;
|
|
25
55
|
constructor(options, signer, verifier) {
|
package/dist/service.d.ts
CHANGED
|
@@ -92,10 +92,9 @@ export interface VerifyOptions {
|
|
|
92
92
|
* patterns.
|
|
93
93
|
*/
|
|
94
94
|
export declare class JwtService {
|
|
95
|
-
private readonly options;
|
|
96
95
|
private readonly signer;
|
|
97
96
|
private readonly verifier;
|
|
98
|
-
constructor(
|
|
97
|
+
constructor(_options: JwtVerifierOptions, signer: DefaultJwtSigner, verifier: DefaultJwtVerifier);
|
|
99
98
|
/**
|
|
100
99
|
* Signs a JWT access token from arbitrary claim payload plus optional claim overrides.
|
|
101
100
|
*
|
package/dist/service.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../src/service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAa,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAe,MAAM,uBAAuB,CAAC;AAExE,KAAK,YAAY,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;AAoD1C;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC1B;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,kBAAkB,CAAC,UAAU,CAAC,CAAC;IAC1C;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,GAAG,MAAM,GAAG,YAAY,EAAE,CAAC;IAChD;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,UAAU,CAAC,EAAE,kBAAkB,CAAC,YAAY,CAAC,CAAC;IAC9C;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,kBAAkB,CAAC,UAAU,CAAC,CAAC;IAC1C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E,MAAM,CAAC;IAChB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;;;;;;;GAQG;AACH,qBACa,UAAU;IAGnB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,QAAQ;gBAFzB,QAAQ,EAAE,kBAAkB,EACX,MAAM,EAAE,gBAAgB,EACxB,QAAQ,EAAE,kBAAkB;IAG/C;;;;;;;;;;;;;;;OAeG;IACG,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC;IAkBnE;;;;;;;;;;;;;;;;;;OAkBG;IACG,MAAM,CAAC,CAAC,GAAG,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,CAAC,CAAC;IAQ7E;;;;;;;;;OASG;IACH,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;CAmB/B"}
|
package/dist/service.js
CHANGED
|
@@ -74,8 +74,7 @@ class JwtService {
|
|
|
74
74
|
static {
|
|
75
75
|
[_JwtService, _initClass] = _applyDecs(this, [Inject(JWT_OPTIONS, DefaultJwtSigner, DefaultJwtVerifier)], []).c;
|
|
76
76
|
}
|
|
77
|
-
constructor(
|
|
78
|
-
this.options = options;
|
|
77
|
+
constructor(_options, signer, verifier) {
|
|
79
78
|
this.signer = signer;
|
|
80
79
|
this.verifier = verifier;
|
|
81
80
|
}
|
|
@@ -130,16 +129,7 @@ class JwtService {
|
|
|
130
129
|
* @throws {JwtConfigurationError} When the active verifier configuration cannot validate the token.
|
|
131
130
|
*/
|
|
132
131
|
async verify(token, options) {
|
|
133
|
-
const
|
|
134
|
-
...this.options,
|
|
135
|
-
algorithms: options.algorithms ?? this.options.algorithms,
|
|
136
|
-
audience: options.audience ?? this.options.audience,
|
|
137
|
-
clockSkewSeconds: options.clockSkewSeconds ?? this.options.clockSkewSeconds,
|
|
138
|
-
issuer: options.issuer ?? this.options.issuer,
|
|
139
|
-
maxAge: options.maxAge ?? this.options.maxAge,
|
|
140
|
-
requireExp: options.requireExp ?? this.options.requireExp
|
|
141
|
-
}) : this.verifier;
|
|
142
|
-
const principal = await verifier.verifyAccessToken(token);
|
|
132
|
+
const principal = options ? await this.verifier.verifyAccessTokenWithOverrides(token, options) : await this.verifier.verifyAccessToken(token);
|
|
143
133
|
return principal.claims;
|
|
144
134
|
}
|
|
145
135
|
|
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,EAAmB,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AAa9D,qBAAa,UAAU;IAInB,OAAO,CAAC,QAAQ,CAAC,GAAG;IACpB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IALnC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAA4D;gBAG/D,GAAG,EAAE,MAAM,EACX,QAAQ,GAAE,MAAgB,EAC1B,gBAAgB,GAAE,MAAc;IAGnD,OAAO,CAAC,YAAY;IAId,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;YA+BtC,SAAS;CAqCxB"}
|
|
1
|
+
{"version":3,"file":"jwks.d.ts","sourceRoot":"","sources":["../../src/signing/jwks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AAa9D;;GAEG;AACH,qBAAa,UAAU;IAInB,OAAO,CAAC,QAAQ,CAAC,GAAG;IACpB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IALnC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAA4D;gBAG/D,GAAG,EAAE,MAAM,EACX,QAAQ,GAAE,MAAgB,EAC1B,gBAAgB,GAAE,MAAc;IAGnD,OAAO,CAAC,YAAY;IAId,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;YA+BtC,SAAS;CAqCxB"}
|
package/dist/signing/jwks.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { createPublicKey } from 'node:crypto';
|
|
2
2
|
import { JwtConfigurationError, JwtInvalidTokenError } from '../errors.js';
|
|
3
|
+
/**
|
|
4
|
+
* Represents the jwks client.
|
|
5
|
+
*/
|
|
3
6
|
export class JwksClient {
|
|
4
7
|
cache = new Map();
|
|
5
8
|
constructor(uri, cacheTtl = 600_000, requestTimeoutMs = 5_000) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signer.d.ts","sourceRoot":"","sources":["../../src/signing/signer.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAgB,SAAS,EAAe,kBAAkB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"signer.d.ts","sourceRoot":"","sources":["../../src/signing/signer.ts"],"names":[],"mappings":"AAMA,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;CAkFxB"}
|
package/dist/signing/signer.js
CHANGED
|
@@ -17,11 +17,34 @@ function resolveSigningKeyEntry(options, algorithm) {
|
|
|
17
17
|
if (!Array.isArray(keys) || keys.length === 0) {
|
|
18
18
|
return undefined;
|
|
19
19
|
}
|
|
20
|
-
if (algorithm
|
|
20
|
+
if (hasOwnAlgorithmMapping(HMAC_HASH, algorithm)) {
|
|
21
21
|
return keys.find(entry => typeof entry.secret === 'string' && entry.secret.length > 0);
|
|
22
22
|
}
|
|
23
23
|
return keys.find(entry => entry.privateKey !== undefined);
|
|
24
24
|
}
|
|
25
|
+
function hasOwnAlgorithmMapping(mappings, algorithm) {
|
|
26
|
+
return typeof algorithm === 'string' && Object.hasOwn(mappings, algorithm);
|
|
27
|
+
}
|
|
28
|
+
function isSupportedSigningAlgorithm(algorithm) {
|
|
29
|
+
return hasOwnAlgorithmMapping(HMAC_HASH, algorithm) || hasOwnAlgorithmMapping(ASYMMETRIC_HASH, algorithm);
|
|
30
|
+
}
|
|
31
|
+
function assertSigningAlgorithms(algorithms) {
|
|
32
|
+
if (!Array.isArray(algorithms) || algorithms.length === 0) {
|
|
33
|
+
throw new JwtConfigurationError('JWT signer requires at least one allowed JWT algorithm.');
|
|
34
|
+
}
|
|
35
|
+
for (const algorithm of algorithms) {
|
|
36
|
+
if (!isSupportedSigningAlgorithm(algorithm)) {
|
|
37
|
+
throw new JwtConfigurationError(`JWT signer received unsupported JWT algorithm "${String(algorithm)}".`);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
function resolveAccessTokenTtlSeconds(options) {
|
|
42
|
+
const ttl = options.accessTokenTtlSeconds ?? 3600;
|
|
43
|
+
if (!Number.isFinite(ttl) || ttl <= 0) {
|
|
44
|
+
throw new JwtConfigurationError('JWT accessTokenTtlSeconds must be a positive finite number.');
|
|
45
|
+
}
|
|
46
|
+
return ttl;
|
|
47
|
+
}
|
|
25
48
|
|
|
26
49
|
/**
|
|
27
50
|
* Issues access and refresh tokens with the configured signing keys and algorithms.
|
|
@@ -34,7 +57,8 @@ class DefaultJwtSigner {
|
|
|
34
57
|
refreshAlgorithms;
|
|
35
58
|
constructor(options) {
|
|
36
59
|
this.options = options;
|
|
37
|
-
|
|
60
|
+
assertSigningAlgorithms(options.algorithms);
|
|
61
|
+
this.refreshAlgorithms = this.options.algorithms.filter(algorithm => hasOwnAlgorithmMapping(HMAC_HASH, algorithm));
|
|
38
62
|
}
|
|
39
63
|
async signAccessToken(claims) {
|
|
40
64
|
return this.signToken(claims, this.options, false);
|
|
@@ -56,9 +80,9 @@ class DefaultJwtSigner {
|
|
|
56
80
|
async signToken(claims, options, hmacOnly) {
|
|
57
81
|
const algorithm = options.algorithms.find(alg => {
|
|
58
82
|
if (hmacOnly) {
|
|
59
|
-
return alg
|
|
83
|
+
return hasOwnAlgorithmMapping(HMAC_HASH, alg);
|
|
60
84
|
}
|
|
61
|
-
return alg
|
|
85
|
+
return isSupportedSigningAlgorithm(alg);
|
|
62
86
|
});
|
|
63
87
|
if (!algorithm) {
|
|
64
88
|
if (hmacOnly) {
|
|
@@ -66,9 +90,9 @@ class DefaultJwtSigner {
|
|
|
66
90
|
}
|
|
67
91
|
throw new JwtConfigurationError('JWT signer requires at least one supported algorithm (HS256/HS384/HS512/RS256/RS384/RS512/ES256/ES384/ES512) in the allowed algorithms list.');
|
|
68
92
|
}
|
|
69
|
-
const isAsymmetric = algorithm
|
|
93
|
+
const isAsymmetric = hasOwnAlgorithmMapping(ASYMMETRIC_HASH, algorithm);
|
|
70
94
|
const now = Math.floor(Date.now() / 1000);
|
|
71
|
-
const ttl = options
|
|
95
|
+
const ttl = resolveAccessTokenTtlSeconds(options);
|
|
72
96
|
const payload = {
|
|
73
97
|
...claims,
|
|
74
98
|
aud: claims.aud ?? options.audience,
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { JwtPrincipal, JwtVerifierOptions } from '../types.js';
|
|
2
|
+
import { DefaultJwtVerifier } from './verifier.js';
|
|
3
|
+
type AccessTokenVerificationOverrides = Pick<JwtVerifierOptions, 'algorithms' | 'audience' | 'clockSkewSeconds' | 'issuer' | 'maxAge' | 'requireExp'>;
|
|
4
|
+
/**
|
|
5
|
+
* Applies supported per-call access-token overrides through the verifier's public API.
|
|
6
|
+
*
|
|
7
|
+
* @param verifier Configured verifier whose shared key-resolution state should be reused.
|
|
8
|
+
* @param token Compact JWT string to verify.
|
|
9
|
+
* @param overrides Per-call algorithm and claim-policy overrides.
|
|
10
|
+
* @returns The normalized principal for the verified access token.
|
|
11
|
+
*/
|
|
12
|
+
export declare function verifyAccessTokenWithOverrides(verifier: DefaultJwtVerifier, token: string, overrides: Partial<AccessTokenVerificationOverrides>): Promise<JwtPrincipal>;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=verifier-internal.d.ts.map
|
|
@@ -0,0 +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;AAEnD,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"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Applies supported per-call access-token overrides through the verifier's public API.
|
|
3
|
+
*
|
|
4
|
+
* @param verifier Configured verifier whose shared key-resolution state should be reused.
|
|
5
|
+
* @param token Compact JWT string to verify.
|
|
6
|
+
* @param overrides Per-call algorithm and claim-policy overrides.
|
|
7
|
+
* @returns The normalized principal for the verified access token.
|
|
8
|
+
*/
|
|
9
|
+
export function verifyAccessTokenWithOverrides(verifier, token, overrides) {
|
|
10
|
+
return verifier.verifyAccessTokenWithOverrides(token, overrides);
|
|
11
|
+
}
|
|
@@ -11,6 +11,7 @@ export declare const HMAC_HASH: Partial<Record<JwtAlgorithm, string>>;
|
|
|
11
11
|
* Maps supported asymmetric JWT algorithms to their Node.js hash names.
|
|
12
12
|
*/
|
|
13
13
|
export declare const ASYMMETRIC_HASH: Partial<Record<JwtAlgorithm, string>>;
|
|
14
|
+
type AccessTokenVerificationOverrides = Pick<JwtVerifierOptions, 'algorithms' | 'audience' | 'clockSkewSeconds' | 'issuer' | 'maxAge' | 'requireExp'>;
|
|
14
15
|
/**
|
|
15
16
|
* Verifies JWT access and refresh tokens against the configured key sources.
|
|
16
17
|
*/
|
|
@@ -22,6 +23,18 @@ export declare class DefaultJwtVerifier {
|
|
|
22
23
|
private readonly refreshVerificationOptions;
|
|
23
24
|
constructor(options: JwtVerifierOptions);
|
|
24
25
|
verifyAccessToken(token: string): Promise<JwtPrincipal>;
|
|
26
|
+
/**
|
|
27
|
+
* Verifies a JWT access token with per-call claim-policy overrides while reusing configured key sources.
|
|
28
|
+
*
|
|
29
|
+
* @remarks
|
|
30
|
+
* This override path is intentionally limited to algorithm and claim-validation policy.
|
|
31
|
+
* It does not replace configured JWKS/static keys or the shared `secretOrKeyProvider`.
|
|
32
|
+
*
|
|
33
|
+
* @param token Compact JWT string to verify.
|
|
34
|
+
* @param overrides Per-call algorithm and claim-policy overrides layered on top of module defaults.
|
|
35
|
+
* @returns The normalized principal for the verified access token.
|
|
36
|
+
*/
|
|
37
|
+
verifyAccessTokenWithOverrides(token: string, overrides: Partial<AccessTokenVerificationOverrides>): Promise<JwtPrincipal>;
|
|
25
38
|
verifyRefreshToken(token: string): Promise<JwtPrincipal>;
|
|
26
39
|
private createRefreshVerificationOptions;
|
|
27
40
|
private verifyToken;
|
|
@@ -35,4 +48,5 @@ export declare class DefaultJwtVerifier {
|
|
|
35
48
|
private validateIssuerAndAudience;
|
|
36
49
|
private resolveJwksPublicKey;
|
|
37
50
|
}
|
|
51
|
+
export {};
|
|
38
52
|
//# sourceMappingURL=verifier.d.ts.map
|
|
@@ -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":"AAOA,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;AAiCF,KAAK,gCAAgC,GAAG,IAAI,CAC1C,kBAAkB,EAClB,YAAY,GAAG,UAAU,GAAG,kBAAkB,GAAG,QAAQ,GAAG,QAAQ,GAAG,YAAY,CACpF,CAAC;AA+LF;;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;;;;;;;;;;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;IAqB3B,OAAO,CAAC,oBAAoB;IA2B5B,OAAO,CAAC,yBAAyB;YAiBnB,oBAAoB;CAOnC"}
|
package/dist/signing/verifier.js
CHANGED
|
@@ -7,8 +7,9 @@ function _checkInRHS(e) { if (Object(e) !== e) throw TypeError("right-hand side
|
|
|
7
7
|
import { createHmac, createVerify, timingSafeEqual } from 'node:crypto';
|
|
8
8
|
import { Inject } from '@fluojs/core';
|
|
9
9
|
import { JwtConfigurationError, JwtExpiredTokenError, JwtInvalidTokenError } from '../errors.js';
|
|
10
|
-
import { JwksClient } from './jwks.js';
|
|
11
10
|
import { normalizeRefreshTokenOptions } from '../refresh/refresh-token.js';
|
|
11
|
+
import { JwksClient } from './jwks.js';
|
|
12
|
+
|
|
12
13
|
/**
|
|
13
14
|
* Provides the resolved JWT verifier options through dependency injection.
|
|
14
15
|
*/
|
|
@@ -34,8 +35,24 @@ export const ASYMMETRIC_HASH = {
|
|
|
34
35
|
ES384: 'sha384',
|
|
35
36
|
ES512: 'sha512'
|
|
36
37
|
};
|
|
38
|
+
function hasOwnAlgorithmMapping(mappings, alg) {
|
|
39
|
+
return typeof alg === 'string' && Object.hasOwn(mappings, alg);
|
|
40
|
+
}
|
|
41
|
+
function isSupportedAlgorithm(alg) {
|
|
42
|
+
return hasOwnAlgorithmMapping(HMAC_HASH, alg) || hasOwnAlgorithmMapping(ASYMMETRIC_HASH, alg);
|
|
43
|
+
}
|
|
44
|
+
function assertJwtAlgorithms(algorithms, context) {
|
|
45
|
+
if (!Array.isArray(algorithms) || algorithms.length === 0) {
|
|
46
|
+
throw new JwtConfigurationError(`${context} requires at least one allowed JWT algorithm.`);
|
|
47
|
+
}
|
|
48
|
+
for (const algorithm of algorithms) {
|
|
49
|
+
if (!isSupportedAlgorithm(algorithm)) {
|
|
50
|
+
throw new JwtConfigurationError(`${context} received unsupported JWT algorithm "${String(algorithm)}".`);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
37
54
|
function isAllowedAlgorithm(alg, allowed) {
|
|
38
|
-
return
|
|
55
|
+
return isSupportedAlgorithm(alg) && allowed.includes(alg);
|
|
39
56
|
}
|
|
40
57
|
function isFiniteNumericDate(value) {
|
|
41
58
|
return typeof value === 'number' && Number.isFinite(value);
|
|
@@ -175,6 +192,7 @@ class DefaultJwtVerifier {
|
|
|
175
192
|
refreshVerificationOptions;
|
|
176
193
|
constructor(options) {
|
|
177
194
|
this.options = options;
|
|
195
|
+
assertJwtAlgorithms(options.algorithms, 'JWT verifier');
|
|
178
196
|
this.jwksClient = options.jwksUri ? new JwksClient(options.jwksUri, options.jwksCacheTtl, options.jwksRequestTimeoutMs) : undefined;
|
|
179
197
|
this.keyResolutionState = createKeyResolutionState(options.keys);
|
|
180
198
|
this.refreshVerificationOptions = options.refreshToken ? this.createRefreshVerificationOptions(normalizeRefreshTokenOptions(options.refreshToken)) : undefined;
|
|
@@ -183,6 +201,31 @@ class DefaultJwtVerifier {
|
|
|
183
201
|
async verifyAccessToken(token) {
|
|
184
202
|
return this.verifyToken(token, this.options, this.keyResolutionState, this.jwksClient);
|
|
185
203
|
}
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* Verifies a JWT access token with per-call claim-policy overrides while reusing configured key sources.
|
|
207
|
+
*
|
|
208
|
+
* @remarks
|
|
209
|
+
* This override path is intentionally limited to algorithm and claim-validation policy.
|
|
210
|
+
* It does not replace configured JWKS/static keys or the shared `secretOrKeyProvider`.
|
|
211
|
+
*
|
|
212
|
+
* @param token Compact JWT string to verify.
|
|
213
|
+
* @param overrides Per-call algorithm and claim-policy overrides layered on top of module defaults.
|
|
214
|
+
* @returns The normalized principal for the verified access token.
|
|
215
|
+
*/
|
|
216
|
+
async verifyAccessTokenWithOverrides(token, overrides) {
|
|
217
|
+
const algorithms = overrides.algorithms ?? this.options.algorithms;
|
|
218
|
+
assertJwtAlgorithms(algorithms, 'JWT verifier');
|
|
219
|
+
return this.verifyToken(token, {
|
|
220
|
+
...this.options,
|
|
221
|
+
algorithms,
|
|
222
|
+
audience: overrides.audience ?? this.options.audience,
|
|
223
|
+
clockSkewSeconds: overrides.clockSkewSeconds ?? this.options.clockSkewSeconds,
|
|
224
|
+
issuer: overrides.issuer ?? this.options.issuer,
|
|
225
|
+
maxAge: overrides.maxAge ?? this.options.maxAge,
|
|
226
|
+
requireExp: overrides.requireExp ?? this.options.requireExp
|
|
227
|
+
}, this.keyResolutionState, this.jwksClient);
|
|
228
|
+
}
|
|
186
229
|
async verifyRefreshToken(token) {
|
|
187
230
|
if (!this.refreshVerificationOptions) {
|
|
188
231
|
throw new JwtConfigurationError('JWT refresh token options are not configured.');
|
|
@@ -190,7 +233,7 @@ class DefaultJwtVerifier {
|
|
|
190
233
|
return this.verifyToken(token, this.refreshVerificationOptions, this.refreshKeyResolutionState, undefined);
|
|
191
234
|
}
|
|
192
235
|
createRefreshVerificationOptions(refreshToken) {
|
|
193
|
-
const algorithms = this.options.algorithms.filter(algorithm => algorithm
|
|
236
|
+
const algorithms = this.options.algorithms.filter(algorithm => hasOwnAlgorithmMapping(HMAC_HASH, algorithm));
|
|
194
237
|
if (algorithms.length === 0) {
|
|
195
238
|
throw new JwtConfigurationError('JWT refresh token verifier requires at least one HMAC algorithm (HS256/HS384/HS512) in the allowed algorithms list.');
|
|
196
239
|
}
|
|
@@ -228,7 +271,7 @@ class DefaultJwtVerifier {
|
|
|
228
271
|
return segments;
|
|
229
272
|
}
|
|
230
273
|
async verifyTokenSignature(header, signingInput, signatureSegment, options, keyResolutionState, jwksClient) {
|
|
231
|
-
if (header.alg
|
|
274
|
+
if (hasOwnAlgorithmMapping(HMAC_HASH, header.alg)) {
|
|
232
275
|
await this.verifyHmacTokenSignature(header, signingInput, signatureSegment, options, keyResolutionState);
|
|
233
276
|
return;
|
|
234
277
|
}
|
package/dist/status.d.ts
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import type { PlatformDiagnosticIssue, PlatformHealthReport, PlatformReadinessReport, PlatformSnapshot } from '@fluojs/runtime';
|
|
2
|
+
/**
|
|
3
|
+
* Describes the jwt platform status snapshot contract.
|
|
4
|
+
*/
|
|
2
5
|
export interface JwtPlatformStatusSnapshot {
|
|
3
6
|
readiness: PlatformReadinessReport;
|
|
4
7
|
health: PlatformHealthReport;
|
|
5
8
|
ownership: PlatformSnapshot['ownership'];
|
|
6
9
|
details: Record<string, unknown>;
|
|
7
10
|
}
|
|
11
|
+
/**
|
|
12
|
+
* Describes the jwt status adapter input contract.
|
|
13
|
+
*/
|
|
8
14
|
export interface JwtStatusAdapterInput {
|
|
9
15
|
componentId?: string;
|
|
10
16
|
readinessCritical?: boolean;
|
|
@@ -14,6 +20,18 @@ export interface JwtStatusAdapterInput {
|
|
|
14
20
|
refreshTokenDependencyId?: string;
|
|
15
21
|
signingKeySource?: 'shared-secret' | 'key-pair' | 'jwks' | 'key-provider';
|
|
16
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
* Create jwt platform status snapshot.
|
|
25
|
+
*
|
|
26
|
+
* @param input The input.
|
|
27
|
+
* @returns The create jwt platform status snapshot result.
|
|
28
|
+
*/
|
|
17
29
|
export declare function createJwtPlatformStatusSnapshot(input: JwtStatusAdapterInput): JwtPlatformStatusSnapshot;
|
|
30
|
+
/**
|
|
31
|
+
* Create jwt platform diagnostic issues.
|
|
32
|
+
*
|
|
33
|
+
* @param input The input.
|
|
34
|
+
* @returns The create jwt platform diagnostic issues result.
|
|
35
|
+
*/
|
|
18
36
|
export declare function createJwtPlatformDiagnosticIssues(input: JwtStatusAdapterInput): PlatformDiagnosticIssue[];
|
|
19
37
|
//# sourceMappingURL=status.d.ts.map
|
package/dist/status.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../src/status.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EACvB,oBAAoB,EACpB,uBAAuB,EACvB,gBAAgB,EACjB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,WAAW,yBAAyB;IACxC,SAAS,EAAE,uBAAuB,CAAC;IACnC,MAAM,EAAE,oBAAoB,CAAC;IAC7B,SAAS,EAAE,gBAAgB,CAAC,WAAW,CAAC,CAAC;IACzC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AAED,MAAM,WAAW,qBAAqB;IACpC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,gBAAgB,CAAC,EAAE,eAAe,GAAG,UAAU,GAAG,MAAM,GAAG,cAAc,CAAC;CAC3E;AAwCD,wBAAgB,+BAA+B,CAAC,KAAK,EAAE,qBAAqB,GAAG,yBAAyB,CA4CvG;AAED,wBAAgB,iCAAiC,CAAC,KAAK,EAAE,qBAAqB,GAAG,uBAAuB,EAAE,CAqBzG"}
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../src/status.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EACvB,oBAAoB,EACpB,uBAAuB,EACvB,gBAAgB,EACjB,MAAM,iBAAiB,CAAC;AAEzB;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,SAAS,EAAE,uBAAuB,CAAC;IACnC,MAAM,EAAE,oBAAoB,CAAC;IAC7B,SAAS,EAAE,gBAAgB,CAAC,WAAW,CAAC,CAAC;IACzC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,gBAAgB,CAAC,EAAE,eAAe,GAAG,UAAU,GAAG,MAAM,GAAG,cAAc,CAAC;CAC3E;AAwCD;;;;;GAKG;AACH,wBAAgB,+BAA+B,CAAC,KAAK,EAAE,qBAAqB,GAAG,yBAAyB,CA4CvG;AAED;;;;;GAKG;AACH,wBAAgB,iCAAiC,CAAC,KAAK,EAAE,qBAAqB,GAAG,uBAAuB,EAAE,CAqBzG"}
|
package/dist/status.js
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Describes the jwt platform status snapshot contract.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Describes the jwt status adapter input contract.
|
|
7
|
+
*/
|
|
8
|
+
|
|
1
9
|
function isRefreshTokenStoreReady(input) {
|
|
2
10
|
if (!input.refreshTokenEnabled) {
|
|
3
11
|
return true;
|
|
@@ -29,6 +37,13 @@ function createHealth(input) {
|
|
|
29
37
|
status: 'degraded'
|
|
30
38
|
};
|
|
31
39
|
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Create jwt platform status snapshot.
|
|
43
|
+
*
|
|
44
|
+
* @param input The input.
|
|
45
|
+
* @returns The create jwt platform status snapshot result.
|
|
46
|
+
*/
|
|
32
47
|
export function createJwtPlatformStatusSnapshot(input) {
|
|
33
48
|
const componentId = input.componentId ?? 'jwt.default';
|
|
34
49
|
const refreshStoreReady = isRefreshTokenStoreReady(input);
|
|
@@ -65,6 +80,13 @@ export function createJwtPlatformStatusSnapshot(input) {
|
|
|
65
80
|
readiness: createReadiness(input)
|
|
66
81
|
};
|
|
67
82
|
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Create jwt platform diagnostic issues.
|
|
86
|
+
*
|
|
87
|
+
* @param input The input.
|
|
88
|
+
* @returns The create jwt platform diagnostic issues result.
|
|
89
|
+
*/
|
|
68
90
|
export function createJwtPlatformDiagnosticIssues(input) {
|
|
69
91
|
if (isRefreshTokenStoreReady(input)) {
|
|
70
92
|
return [];
|
package/dist/types.d.ts
CHANGED
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
import type { KeyObject } from 'node:crypto';
|
|
2
2
|
import type { RefreshTokenOptions } from './refresh/refresh-token.js';
|
|
3
|
+
/**
|
|
4
|
+
* Defines the jwt algorithm type.
|
|
5
|
+
*/
|
|
3
6
|
export type JwtAlgorithm = 'HS256' | 'HS384' | 'HS512' | 'RS256' | 'RS384' | 'RS512' | 'ES256' | 'ES384' | 'ES512';
|
|
7
|
+
/**
|
|
8
|
+
* Describes the jwt key entry contract.
|
|
9
|
+
*/
|
|
4
10
|
export interface JwtKeyEntry {
|
|
5
11
|
kid: string;
|
|
6
12
|
secret?: string;
|
|
7
13
|
privateKey?: string | KeyObject;
|
|
8
14
|
publicKey?: string | KeyObject;
|
|
9
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* Describes the jwt verifier options contract.
|
|
18
|
+
*/
|
|
10
19
|
export interface JwtVerifierOptions {
|
|
11
20
|
algorithms: JwtAlgorithm[];
|
|
12
21
|
accessTokenTtlSeconds?: number;
|
|
@@ -29,6 +38,9 @@ export interface JwtVerifierOptions {
|
|
|
29
38
|
publicKey?: string | KeyObject;
|
|
30
39
|
refreshToken?: RefreshTokenOptions;
|
|
31
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* Describes the jwt claims contract.
|
|
43
|
+
*/
|
|
32
44
|
export interface JwtClaims extends Record<string, unknown> {
|
|
33
45
|
aud?: string | string[];
|
|
34
46
|
exp?: number;
|
|
@@ -39,6 +51,9 @@ export interface JwtClaims extends Record<string, unknown> {
|
|
|
39
51
|
scopes?: string[];
|
|
40
52
|
sub?: string;
|
|
41
53
|
}
|
|
54
|
+
/**
|
|
55
|
+
* Describes the jwt principal contract.
|
|
56
|
+
*/
|
|
42
57
|
export interface JwtPrincipal {
|
|
43
58
|
subject: string;
|
|
44
59
|
issuer?: string;
|
|
@@ -47,9 +62,15 @@ export interface JwtPrincipal {
|
|
|
47
62
|
scopes?: string[];
|
|
48
63
|
claims: Record<string, unknown>;
|
|
49
64
|
}
|
|
65
|
+
/**
|
|
66
|
+
* Describes the jwt verifier contract.
|
|
67
|
+
*/
|
|
50
68
|
export interface JwtVerifier {
|
|
51
69
|
verifyAccessToken(token: string): Promise<JwtPrincipal>;
|
|
52
70
|
}
|
|
71
|
+
/**
|
|
72
|
+
* Describes the jwt signer contract.
|
|
73
|
+
*/
|
|
53
74
|
export interface JwtSigner {
|
|
54
75
|
signAccessToken(claims: JwtClaims): Promise<string>;
|
|
55
76
|
}
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC;AAEnH,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAA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B,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;CACzD;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,eAAe,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CACrD"}
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"signing",
|
|
10
10
|
"verification"
|
|
11
11
|
],
|
|
12
|
-
"version": "1.0.0-beta.
|
|
12
|
+
"version": "1.0.0-beta.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/core": "^1.0.0-beta.
|
|
40
|
-
"@fluojs/di": "^1.0.0-beta.
|
|
41
|
-
"@fluojs/runtime": "^1.0.0-beta.
|
|
39
|
+
"@fluojs/core": "^1.0.0-beta.2",
|
|
40
|
+
"@fluojs/di": "^1.0.0-beta.4",
|
|
41
|
+
"@fluojs/runtime": "^1.0.0-beta.4"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"vitest": "^3.2.4"
|