@fluojs/passport 1.0.0-beta.2 → 1.0.0-beta.4

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 CHANGED
@@ -114,6 +114,24 @@ export class AuthModule {}
114
114
 
115
115
  `CookieAuthStrategy`는 `@fluojs/jwt`가 정규화한 JWT principal 계약을 보존하며, `subject`, `claims`, `issuer`, `audience`, `roles`, `scopes`를 그대로 전달합니다.
116
116
 
117
+ 보호된 라우트는 계속 `@UseAuth(...)`를 사용해야 합니다. `requireAccessToken: false`를 설정해도 쿠키가 없을 때는 이제 익명 principal이 아니라 명시적인 미인증 결과를 반환하므로, 보호된 라우트는 요청을 계속 거부합니다.
118
+
119
+ 로그인 사용자와 게스트 호출자를 모두 허용하려는 라우트에서만 `@UseOptionalAuth(...)`를 사용하세요.
120
+
121
+ ```typescript
122
+ import { Controller, Get, type RequestContext } from '@fluojs/http';
123
+ import { UseOptionalAuth } from '@fluojs/passport';
124
+
125
+ @Controller('/session')
126
+ export class SessionController {
127
+ @Get('/')
128
+ @UseOptionalAuth('cookie')
129
+ getSession(_input: never, ctx: RequestContext) {
130
+ return { subject: ctx.principal?.subject ?? null };
131
+ }
132
+ }
133
+ ```
134
+
117
135
  ### 리프레시 토큰 수명 주기
118
136
 
119
137
  패키지에서 제공하는 `RefreshTokenStrategy`와 `RefreshTokenService`를 사용하여 안전한 토큰 로테이션 및 폐기 기능을 구현할 수 있습니다.
@@ -157,6 +175,7 @@ export class AuthController {
157
175
 
158
176
  ### 데코레이터
159
177
  - `@UseAuth(strategyName)`: `AuthGuard`를 부착하고 사용할 전략을 설정합니다.
178
+ - `@UseOptionalAuth(strategyName)`: `AuthGuard`를 부착하지만 전략이 자격 증명 누락을 보고하면 스코프가 없는 라우트는 계속 진행할 수 있게 합니다.
160
179
  - `@RequireScopes(...scopes)`: 특정 권한(스코프) 요구 사항을 강제합니다.
161
180
 
162
181
  ### 주요 클래스
package/README.md CHANGED
@@ -114,6 +114,24 @@ Import `CookieAuthModule.forRoot(...)` alongside `PassportModule.forRoot(...)` w
114
114
 
115
115
  `CookieAuthStrategy` preserves the normalized JWT principal contract from `@fluojs/jwt`, including `subject`, `claims`, `issuer`, `audience`, `roles`, and `scopes`.
116
116
 
117
+ Protected routes must keep using `@UseAuth(...)`. If you configure `requireAccessToken: false`, a missing cookie now resolves to an explicit unauthenticated result instead of an anonymous principal, so protected routes still reject the request.
118
+
119
+ Use `@UseOptionalAuth(...)` only on routes that intentionally support both signed-in and guest callers:
120
+
121
+ ```typescript
122
+ import { Controller, Get, type RequestContext } from '@fluojs/http';
123
+ import { UseOptionalAuth } from '@fluojs/passport';
124
+
125
+ @Controller('/session')
126
+ export class SessionController {
127
+ @Get('/')
128
+ @UseOptionalAuth('cookie')
129
+ getSession(_input: never, ctx: RequestContext) {
130
+ return { subject: ctx.principal?.subject ?? null };
131
+ }
132
+ }
133
+ ```
134
+
117
135
  ### Refresh Token Lifecycle
118
136
 
119
137
  The package provides a built-in `RefreshTokenStrategy` and `RefreshTokenService` to handle secure token rotation and revocation.
@@ -157,6 +175,7 @@ Import `RefreshTokenModule.forRoot(...)` alongside `PassportModule.forRoot(...)`
157
175
 
158
176
  ### Decorators
159
177
  - `@UseAuth(strategyName)`: Attaches `AuthGuard` and sets the active strategy.
178
+ - `@UseOptionalAuth(strategyName)`: Attaches `AuthGuard` but allows routes without scopes to continue when the strategy reports missing credentials.
160
179
  - `@RequireScopes(...scopes)`: Enforces specific scope requirements.
161
180
 
162
181
  ### Core Classes
@@ -6,7 +6,7 @@ import type { AuthStrategy, AuthStrategyResult } from '../types.js';
6
6
  */
7
7
  export declare const COOKIE_AUTH_OPTIONS: unique symbol;
8
8
  /**
9
- * Configures cookie names and fallback behavior for cookie-based authentication.
9
+ * Configures cookie names and missing-cookie behavior for cookie-based authentication.
10
10
  */
11
11
  export interface CookieAuthOptions {
12
12
  accessTokenCookieName?: string;
@@ -26,6 +26,11 @@ export declare const DEFAULT_COOKIE_AUTH_OPTIONS: Required<CookieAuthOptions>;
26
26
  export declare function normalizeCookieAuthOptions(options?: CookieAuthOptions): Required<CookieAuthOptions>;
27
27
  /**
28
28
  * Authenticates requests by reading and verifying JWTs from HTTP cookies.
29
+ *
30
+ * @remarks
31
+ * When `requireAccessToken` is `false`, missing cookies now resolve to an explicit
32
+ * unauthenticated result. Protected routes still reject that result unless they opt in
33
+ * with `@UseOptionalAuth(...)`.
29
34
  */
30
35
  export declare class CookieAuthStrategy implements AuthStrategy {
31
36
  private readonly verifier;
@@ -1 +1 @@
1
- {"version":3,"file":"cookie-auth.d.ts","sourceRoot":"","sources":["../../src/cookie/cookie-auth.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAGjD,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEpE;;GAEG;AACH,eAAO,MAAM,mBAAmB,eAAkD,CAAC;AAEnF;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED;;GAEG;AACH,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,iBAAiB,CAInE,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,CAAC,EAAE,iBAAiB,GAAG,QAAQ,CAAC,iBAAiB,CAAC,CAMnG;AAED;;GAEG;AACH,qBACa,kBAAmB,YAAW,YAAY;IAInD,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAH3B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA8B;gBAGnC,QAAQ,EAAE,kBAAkB,EAC7C,OAAO,CAAC,EAAE,iBAAiB;IAKvB,YAAY,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,kBAAkB,CAAC;CA+CvE;AAED;;GAEG;AACH,eAAO,MAAM,yBAAyB,WAAW,CAAC"}
1
+ {"version":3,"file":"cookie-auth.d.ts","sourceRoot":"","sources":["../../src/cookie/cookie-auth.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAGjD,OAAO,KAAK,EAAsB,YAAY,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAMxF;;GAEG;AACH,eAAO,MAAM,mBAAmB,eAAkD,CAAC;AAEnF;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED;;GAEG;AACH,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,iBAAiB,CAInE,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,CAAC,EAAE,iBAAiB,GAAG,QAAQ,CAAC,iBAAiB,CAAC,CAMnG;AAED;;;;;;;GAOG;AACH,qBACa,kBAAmB,YAAW,YAAY;IAInD,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAH3B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA8B;gBAGnC,QAAQ,EAAE,kBAAkB,EAC7C,OAAO,CAAC,EAAE,iBAAiB;IAKvB,YAAY,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,kBAAkB,CAAC;CAyCvE;AAED;;GAEG;AACH,eAAO,MAAM,yBAAyB,WAAW,CAAC"}
@@ -7,13 +7,17 @@ function _checkInRHS(e) { if (Object(e) !== e) throw TypeError("right-hand side
7
7
  import { Inject } from '@fluojs/core';
8
8
  import { DefaultJwtVerifier } from '@fluojs/jwt';
9
9
  import { AuthenticationRequiredError } from '../errors.js';
10
+ const unauthenticatedCookieAuthResult = {
11
+ authenticated: false
12
+ };
13
+
10
14
  /**
11
15
  * Provides cookie-auth strategy options through dependency injection.
12
16
  */
13
17
  export const COOKIE_AUTH_OPTIONS = Symbol.for('fluo.passport.cookie-auth-options');
14
18
 
15
19
  /**
16
- * Configures cookie names and fallback behavior for cookie-based authentication.
20
+ * Configures cookie names and missing-cookie behavior for cookie-based authentication.
17
21
  */
18
22
 
19
23
  /**
@@ -41,6 +45,11 @@ export function normalizeCookieAuthOptions(options) {
41
45
 
42
46
  /**
43
47
  * Authenticates requests by reading and verifying JWTs from HTTP cookies.
48
+ *
49
+ * @remarks
50
+ * When `requireAccessToken` is `false`, missing cookies now resolve to an explicit
51
+ * unauthenticated result. Protected routes still reject that result unless they opt in
52
+ * with `@UseOptionalAuth(...)`.
44
53
  */
45
54
  let _CookieAuthStrategy;
46
55
  class CookieAuthStrategy {
@@ -59,20 +68,14 @@ class CookieAuthStrategy {
59
68
  if (this.options.requireAccessToken) {
60
69
  throw new AuthenticationRequiredError('Access token cookie is required.');
61
70
  }
62
- return {
63
- claims: {},
64
- subject: 'anonymous'
65
- };
71
+ return unauthenticatedCookieAuthResult;
66
72
  }
67
73
  const accessToken = cookies[this.options.accessTokenCookieName];
68
74
  if (!accessToken) {
69
75
  if (this.options.requireAccessToken) {
70
76
  throw new AuthenticationRequiredError('Access token cookie is required.');
71
77
  }
72
- return {
73
- claims: {},
74
- subject: 'anonymous'
75
- };
78
+ return unauthenticatedCookieAuthResult;
76
79
  }
77
80
  try {
78
81
  const principal = await this.verifier.verifyAccessToken(accessToken);
@@ -1,5 +1,8 @@
1
1
  import type { FrameworkResponse } from '@fluojs/http';
2
2
  import { type CookieAuthOptions } from './cookie-auth.js';
3
+ /**
4
+ * Describes the cookie options contract.
5
+ */
3
6
  export interface CookieOptions {
4
7
  httpOnly?: boolean;
5
8
  secure?: boolean;
@@ -8,15 +11,27 @@ export interface CookieOptions {
8
11
  domain?: string;
9
12
  maxAge?: number;
10
13
  }
14
+ /**
15
+ * Describes the set cookie options contract.
16
+ */
11
17
  export interface SetCookieOptions extends CookieOptions {
12
18
  accessTokenTtlSeconds?: number;
13
19
  refreshTokenTtlSeconds?: number;
14
20
  }
21
+ /**
22
+ * Describes the cookie manager config contract.
23
+ */
15
24
  export interface CookieManagerConfig extends CookieAuthOptions {
16
25
  cookieOptions?: CookieOptions;
17
26
  }
18
27
  type NormalizedCookieOptions = Omit<Required<CookieOptions>, 'domain' | 'maxAge'> & Pick<CookieOptions, 'domain' | 'maxAge'>;
28
+ /**
29
+ * Provides the default cookie options value.
30
+ */
19
31
  export declare const DEFAULT_COOKIE_OPTIONS: NormalizedCookieOptions;
32
+ /**
33
+ * Represents the cookie manager.
34
+ */
20
35
  export declare class CookieManager {
21
36
  private readonly options;
22
37
  private readonly cookieOptions;
@@ -29,6 +44,12 @@ export declare class CookieManager {
29
44
  setAuthCookies(response: FrameworkResponse, accessToken: string, accessTokenTtlSeconds?: number, refreshToken?: string, refreshTokenTtlSeconds?: number): void;
30
45
  private appendSetCookie;
31
46
  }
47
+ /**
48
+ * Create cookie manager.
49
+ *
50
+ * @param config The config.
51
+ * @returns The create cookie manager result.
52
+ */
32
53
  export declare function createCookieManager(config?: CookieManagerConfig): CookieManager;
33
54
  export {};
34
55
  //# sourceMappingURL=cookie-manager.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cookie-manager.d.ts","sourceRoot":"","sources":["../../src/cookie/cookie-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEtD,OAAO,EAA+B,KAAK,iBAAiB,EAA8B,MAAM,kBAAkB,CAAC;AAEnH,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,QAAQ,GAAG,KAAK,GAAG,MAAM,CAAC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EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI;IAa3F,qBAAqB,CAAC,QAAQ,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI;IAa5F,sBAAsB,CAAC,QAAQ,EAAE,iBAAiB,GAAG,IAAI;IASzD,uBAAuB,CAAC,QAAQ,EAAE,iBAAiB,GAAG,IAAI;IAS1D,eAAe,CAAC,QAAQ,EAAE,iBAAiB,GAAG,IAAI;IAKlD,cAAc,CACZ,QAAQ,EAAE,iBAAiB,EAC3B,WAAW,EAAE,MAAM,EACnB,qBAAqB,CAAC,EAAE,MAAM,EAC9B,YAAY,CAAC,EAAE,MAAM,EACrB,sBAAsB,CAAC,EAAE,MAAM,GAC9B,IAAI;IAQP,OAAO,CAAC,eAAe;CAWxB;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,CAAC,EAAE,mBAAmB,GAAG,aAAa,CAE/E"}
@@ -1,4 +1,20 @@
1
1
  import { normalizeCookieAuthOptions } from './cookie-auth.js';
2
+
3
+ /**
4
+ * Describes the cookie options contract.
5
+ */
6
+
7
+ /**
8
+ * Describes the set cookie options contract.
9
+ */
10
+
11
+ /**
12
+ * Describes the cookie manager config contract.
13
+ */
14
+
15
+ /**
16
+ * Provides the default cookie options value.
17
+ */
2
18
  export const DEFAULT_COOKIE_OPTIONS = {
3
19
  httpOnly: true,
4
20
  secure: true,
@@ -35,6 +51,10 @@ function buildClearCookieHeader(name, options) {
35
51
  maxAge: 0
36
52
  });
37
53
  }
54
+
55
+ /**
56
+ * Represents the cookie manager.
57
+ */
38
58
  export class CookieManager {
39
59
  options;
40
60
  cookieOptions;
@@ -88,6 +108,13 @@ export class CookieManager {
88
108
  response.setHeader('Set-Cookie', cookies.length === 1 ? cookies[0] : cookies);
89
109
  }
90
110
  }
111
+
112
+ /**
113
+ * Create cookie manager.
114
+ *
115
+ * @param config The config.
116
+ * @returns The create cookie manager result.
117
+ */
91
118
  export function createCookieManager(config) {
92
119
  return new CookieManager(config);
93
120
  }
@@ -19,6 +19,26 @@ type ClassOrMethodDecoratorLike = StandardClassDecoratorFn & StandardMethodDecor
19
19
  * @returns A class-or-method decorator that stores the auth requirement metadata.
20
20
  */
21
21
  export declare function UseAuth(strategy: string): ClassOrMethodDecoratorLike;
22
+ /**
23
+ * Declares a strategy that may leave `requestContext.principal` unset when credentials are absent.
24
+ *
25
+ * @remarks
26
+ * Use this decorator only for routes that intentionally accept both authenticated and
27
+ * unauthenticated callers. Scope requirements still require a resolved principal.
28
+ *
29
+ * @example
30
+ * ```ts
31
+ * @UseOptionalAuth('cookie')
32
+ * @Get('/session')
33
+ * getSession(_input: unknown, ctx: RequestContext) {
34
+ * return { subject: ctx.principal?.subject ?? null };
35
+ * }
36
+ * ```
37
+ *
38
+ * @param strategy Strategy name previously registered through `PassportModule.forRoot(...)`.
39
+ * @returns A class-or-method decorator that stores the optional auth requirement metadata.
40
+ */
41
+ export declare function UseOptionalAuth(strategy: string): ClassOrMethodDecoratorLike;
22
42
  /**
23
43
  * Declares scope requirements that `AuthGuard` must enforce after authentication succeeds.
24
44
  *
@@ -1 +1 @@
1
- {"version":3,"file":"decorators.d.ts","sourceRoot":"","sources":["../src/decorators.ts"],"names":[],"mappings":"AAQA,KAAK,wBAAwB,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,qBAAqB,KAAK,IAAI,CAAC;AAC1F,KAAK,yBAAyB,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,2BAA2B,KAAK,IAAI,CAAC;AACjG,KAAK,0BAA0B,GAAG,wBAAwB,GAAG,yBAAyB,CAAC;AAuEvF;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,0BAA0B,CAEpE;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,aAAa,CAAC,GAAG,MAAM,EAAE,MAAM,EAAE,GAAG,0BAA0B,CAE7E"}
1
+ {"version":3,"file":"decorators.d.ts","sourceRoot":"","sources":["../src/decorators.ts"],"names":[],"mappings":"AAQA,KAAK,wBAAwB,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,qBAAqB,KAAK,IAAI,CAAC;AAC1F,KAAK,yBAAyB,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,2BAA2B,KAAK,IAAI,CAAC;AACjG,KAAK,0BAA0B,GAAG,wBAAwB,GAAG,yBAAyB,CAAC;AAuEvF;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,0BAA0B,CAEpE;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,0BAA0B,CAE5E;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,aAAa,CAAC,GAAG,MAAM,EAAE,MAAM,EAAE,GAAG,0BAA0B,CAE7E"}
@@ -70,6 +70,32 @@ export function UseAuth(strategy) {
70
70
  });
71
71
  }
72
72
 
73
+ /**
74
+ * Declares a strategy that may leave `requestContext.principal` unset when credentials are absent.
75
+ *
76
+ * @remarks
77
+ * Use this decorator only for routes that intentionally accept both authenticated and
78
+ * unauthenticated callers. Scope requirements still require a resolved principal.
79
+ *
80
+ * @example
81
+ * ```ts
82
+ * @UseOptionalAuth('cookie')
83
+ * @Get('/session')
84
+ * getSession(_input: unknown, ctx: RequestContext) {
85
+ * return { subject: ctx.principal?.subject ?? null };
86
+ * }
87
+ * ```
88
+ *
89
+ * @param strategy Strategy name previously registered through `PassportModule.forRoot(...)`.
90
+ * @returns A class-or-method decorator that stores the optional auth requirement metadata.
91
+ */
92
+ export function UseOptionalAuth(strategy) {
93
+ return createAuthRequirementDecorator({
94
+ optional: true,
95
+ strategy
96
+ });
97
+ }
98
+
73
99
  /**
74
100
  * Declares scope requirements that `AuthGuard` must enforce after authentication succeeds.
75
101
  *
@@ -1 +1 @@
1
- {"version":3,"file":"guard.d.ts","sourceRoot":"","sources":["../src/guard.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6C,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AAa5F,OAAO,KAAK,EACV,iBAAiB,EAIjB,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,YAAY,CAAC;AA8EpB;;;;;;;;;GASG;AACH,qBACa,SAAU,YAAW,iBAAiB;IAE/C,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,OAAO;gBADP,UAAU,GAAE,oBAAyB,EACrC,OAAO,GAAE,qBAA0B;IAGtD;;;;;;;;;;;;;;;;;;;OAmBG;IACG,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;CA8DxD"}
1
+ {"version":3,"file":"guard.d.ts","sourceRoot":"","sources":["../src/guard.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6C,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AAa5F,OAAO,KAAK,EACV,iBAAiB,EAKjB,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,YAAY,CAAC;AAsFpB;;;;;;;;;GASG;AACH,qBACa,SAAU,YAAW,iBAAiB;IAE/C,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,OAAO;gBADP,UAAU,GAAE,oBAAyB,EACrC,OAAO,GAAE,qBAA0B;IAGtD;;;;;;;;;;;;;;;;;;;OAmBG;IACG,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;CAkExD"}
package/dist/guard.js CHANGED
@@ -13,10 +13,16 @@ import { getAuthRequirement } from './metadata.js';
13
13
  function isAuthHandledResult(result) {
14
14
  return typeof result === 'object' && result !== null && 'handled' in result && result.handled === true;
15
15
  }
16
+ function isAuthOptionalResult(result) {
17
+ return typeof result === 'object' && result !== null && 'authenticated' in result && result.authenticated === false;
18
+ }
16
19
  function resolvePrincipal(result) {
17
20
  if (isAuthHandledResult(result)) {
18
21
  return result.principal;
19
22
  }
23
+ if (isAuthOptionalResult(result)) {
24
+ return undefined;
25
+ }
20
26
  return result;
21
27
  }
22
28
  function isRecord(value) {
@@ -131,6 +137,9 @@ class AuthGuard {
131
137
  return true;
132
138
  }
133
139
  if (!principal) {
140
+ if (isAuthOptionalResult(result) && requirement?.optional && !requirement.scopes?.length) {
141
+ return true;
142
+ }
134
143
  throw new AuthenticationFailedError('Authentication strategy did not return a principal.');
135
144
  }
136
145
  if (!isPrincipal(principal)) {
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Provides the passport options value.
3
+ */
1
4
  export declare const PASSPORT_OPTIONS: unique symbol;
5
+ /**
6
+ * Provides the auth strategy registry value.
7
+ */
2
8
  export declare const AUTH_STRATEGY_REGISTRY: unique symbol;
3
9
  //# sourceMappingURL=internal-tokens.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"internal-tokens.d.ts","sourceRoot":"","sources":["../src/internal-tokens.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,gBAAgB,eAAmC,CAAC;AACjE,eAAO,MAAM,sBAAsB,eAAyC,CAAC"}
1
+ {"version":3,"file":"internal-tokens.d.ts","sourceRoot":"","sources":["../src/internal-tokens.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,eAAO,MAAM,gBAAgB,eAAmC,CAAC;AACjE;;GAEG;AACH,eAAO,MAAM,sBAAsB,eAAyC,CAAC"}
@@ -1,4 +1,11 @@
1
1
  const PASSPORT_OPTIONS_KEY = 'fluo.passport.options';
2
2
  const AUTH_STRATEGY_REGISTRY_KEY = 'fluo.passport.strategy-registry';
3
+
4
+ /**
5
+ * Provides the passport options value.
6
+ */
3
7
  export const PASSPORT_OPTIONS = Symbol.for(PASSPORT_OPTIONS_KEY);
8
+ /**
9
+ * Provides the auth strategy registry value.
10
+ */
4
11
  export const AUTH_STRATEGY_REGISTRY = Symbol.for(AUTH_STRATEGY_REGISTRY_KEY);
@@ -1,6 +1,27 @@
1
1
  import { type MetadataPropertyKey } from '@fluojs/core';
2
2
  import type { AuthRequirement } from './types.js';
3
+ /**
4
+ * Define auth requirement.
5
+ *
6
+ * @param target The target.
7
+ * @param requirement The requirement.
8
+ * @param propertyKey The property key.
9
+ */
3
10
  export declare function defineAuthRequirement(target: Function | object, requirement: AuthRequirement, propertyKey?: MetadataPropertyKey): void;
11
+ /**
12
+ * Get own auth requirement.
13
+ *
14
+ * @param target The target.
15
+ * @param propertyKey The property key.
16
+ * @returns The get own auth requirement result.
17
+ */
4
18
  export declare function getOwnAuthRequirement(target: Function | object, propertyKey?: MetadataPropertyKey): AuthRequirement | undefined;
19
+ /**
20
+ * Get auth requirement.
21
+ *
22
+ * @param controllerType The controller type.
23
+ * @param propertyKey The property key.
24
+ * @returns The get auth requirement result.
25
+ */
5
26
  export declare function getAuthRequirement(controllerType: Function, propertyKey?: MetadataPropertyKey): AuthRequirement | undefined;
6
27
  //# sourceMappingURL=metadata.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../src/metadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAIxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAwElD,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,QAAQ,GAAG,MAAM,EAAE,WAAW,EAAE,eAAe,EAAE,WAAW,CAAC,EAAE,mBAAmB,GAAG,IAAI,CAkCtI;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,QAAQ,GAAG,MAAM,EAAE,WAAW,CAAC,EAAE,mBAAmB,GAAG,eAAe,GAAG,SAAS,CAM/H;AAED,wBAAgB,kBAAkB,CAAC,cAAc,EAAE,QAAQ,EAAE,WAAW,CAAC,EAAE,mBAAmB,GAAG,eAAe,GAAG,SAAS,CA6B3H"}
1
+ {"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../src/metadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAIxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAmElD;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,QAAQ,GAAG,MAAM,EAAE,WAAW,EAAE,eAAe,EAAE,WAAW,CAAC,EAAE,mBAAmB,GAAG,IAAI,CAkCtI;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,QAAQ,GAAG,MAAM,EAAE,WAAW,CAAC,EAAE,mBAAmB,GAAG,eAAe,GAAG,SAAS,CAM/H;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,cAAc,EAAE,QAAQ,EAAE,WAAW,CAAC,EAAE,mBAAmB,GAAG,eAAe,GAAG,SAAS,CA6B3H"}
package/dist/metadata.js CHANGED
@@ -1,4 +1,4 @@
1
- import { metadataSymbol } from '@fluojs/core/internal';
1
+ import { getStandardConstructorMetadataBag, getStandardMetadataBag } from '@fluojs/core/internal';
2
2
  import { mergeAuthRequirements, normalizeDeclaredScopes } from './scope.js';
3
3
  const standardClassRequirementKey = Symbol.for('fluo.passport.standard.class-auth');
4
4
  const standardMethodRequirementKey = Symbol.for('fluo.passport.standard.method-auth');
@@ -11,11 +11,13 @@ function normalizeRequirement(requirement) {
11
11
  return undefined;
12
12
  }
13
13
  const strategy = requirement.strategy;
14
+ const optional = requirement.optional;
14
15
  const scopes = normalizeDeclaredScopes(requirement.scopes);
15
- if (!strategy && !scopes) {
16
+ if (!strategy && !scopes && optional !== true) {
16
17
  return undefined;
17
18
  }
18
19
  return {
20
+ optional,
19
21
  scopes,
20
22
  strategy
21
23
  };
@@ -38,17 +40,21 @@ function invalidateRequirementCache(controllerType, propertyKey) {
38
40
  mergedMethodRequirementCache.delete(controllerType);
39
41
  }
40
42
  }
41
- function getStandardMetadataBag(target) {
42
- return target[metadataSymbol];
43
- }
44
43
  function getStandardClassRequirement(target) {
45
44
  return normalizeRequirement(getStandardMetadataBag(target)?.[standardClassRequirementKey]);
46
45
  }
47
46
  function getStandardMethodRequirement(target, propertyKey) {
48
- const constructor = target.constructor;
49
- const map = constructor ? getStandardMetadataBag(constructor)?.[standardMethodRequirementKey] : undefined;
47
+ const map = getStandardConstructorMetadataBag(target)?.[standardMethodRequirementKey];
50
48
  return normalizeRequirement(map?.get(propertyKey));
51
49
  }
50
+
51
+ /**
52
+ * Define auth requirement.
53
+ *
54
+ * @param target The target.
55
+ * @param requirement The requirement.
56
+ * @param propertyKey The property key.
57
+ */
52
58
  export function defineAuthRequirement(target, requirement, propertyKey) {
53
59
  const normalizedRequirement = normalizeRequirement(requirement);
54
60
  if (propertyKey === undefined) {
@@ -76,12 +82,28 @@ export function defineAuthRequirement(target, requirement, propertyKey) {
76
82
  invalidateRequirementCache(controllerType, propertyKey);
77
83
  }
78
84
  }
85
+
86
+ /**
87
+ * Get own auth requirement.
88
+ *
89
+ * @param target The target.
90
+ * @param propertyKey The property key.
91
+ * @returns The get own auth requirement result.
92
+ */
79
93
  export function getOwnAuthRequirement(target, propertyKey) {
80
94
  if (propertyKey === undefined) {
81
95
  return mergeAuthRequirements(classRequirementStore.get(target), getStandardClassRequirement(target));
82
96
  }
83
97
  return mergeAuthRequirements(methodRequirementStore.get(target)?.get(propertyKey), getStandardMethodRequirement(target, propertyKey));
84
98
  }
99
+
100
+ /**
101
+ * Get auth requirement.
102
+ *
103
+ * @param controllerType The controller type.
104
+ * @param propertyKey The property key.
105
+ * @returns The get auth requirement result.
106
+ */
85
107
  export function getAuthRequirement(controllerType, propertyKey) {
86
108
  if (propertyKey === undefined) {
87
109
  if (mergedClassRequirementCache.has(controllerType)) {
package/dist/scope.d.ts CHANGED
@@ -1,5 +1,24 @@
1
1
  import type { AuthRequirement } from './types.js';
2
+ /**
3
+ * Normalize declared scopes.
4
+ *
5
+ * @param scopes The scopes.
6
+ * @returns The normalize declared scopes result.
7
+ */
2
8
  export declare function normalizeDeclaredScopes(scopes: unknown): string[] | undefined;
9
+ /**
10
+ * Normalize principal scopes.
11
+ *
12
+ * @param claims The claims.
13
+ * @returns The normalize principal scopes result.
14
+ */
3
15
  export declare function normalizePrincipalScopes(claims: Record<string, unknown>): string[] | undefined;
16
+ /**
17
+ * Merge auth requirements.
18
+ *
19
+ * @param base The base.
20
+ * @param extra The extra.
21
+ * @returns The merge auth requirements result.
22
+ */
4
23
  export declare function mergeAuthRequirements(base: AuthRequirement | undefined, extra: AuthRequirement | undefined): AuthRequirement | undefined;
5
24
  //# sourceMappingURL=scope.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"scope.d.ts","sourceRoot":"","sources":["../src/scope.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAoBlD,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,EAAE,GAAG,SAAS,CAO7E;AAED,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,EAAE,GAAG,SAAS,CAW9F;AAED,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,eAAe,GAAG,SAAS,EACjC,KAAK,EAAE,eAAe,GAAG,SAAS,GACjC,eAAe,GAAG,SAAS,CAgB7B"}
1
+ {"version":3,"file":"scope.d.ts","sourceRoot":"","sources":["../src/scope.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAoBlD;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,EAAE,GAAG,SAAS,CAO7E;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,EAAE,GAAG,SAAS,CAW9F;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,eAAe,GAAG,SAAS,EACjC,KAAK,EAAE,eAAe,GAAG,SAAS,GACjC,eAAe,GAAG,SAAS,CAuB7B"}
package/dist/scope.js CHANGED
@@ -11,6 +11,13 @@ function normalizeScopeItems(items) {
11
11
  }
12
12
  return normalized.length > 0 ? normalized : undefined;
13
13
  }
14
+
15
+ /**
16
+ * Normalize declared scopes.
17
+ *
18
+ * @param scopes The scopes.
19
+ * @returns The normalize declared scopes result.
20
+ */
14
21
  export function normalizeDeclaredScopes(scopes) {
15
22
  if (!Array.isArray(scopes)) {
16
23
  return undefined;
@@ -18,6 +25,13 @@ export function normalizeDeclaredScopes(scopes) {
18
25
  const scopeItems = scopes.filter(scope => typeof scope === 'string');
19
26
  return normalizeScopeItems(scopeItems);
20
27
  }
28
+
29
+ /**
30
+ * Normalize principal scopes.
31
+ *
32
+ * @param claims The claims.
33
+ * @returns The normalize principal scopes result.
34
+ */
21
35
  export function normalizePrincipalScopes(claims) {
22
36
  if (Array.isArray(claims.scopes)) {
23
37
  const scopes = claims.scopes.filter(scope => typeof scope === 'string');
@@ -28,16 +42,26 @@ export function normalizePrincipalScopes(claims) {
28
42
  }
29
43
  return undefined;
30
44
  }
45
+
46
+ /**
47
+ * Merge auth requirements.
48
+ *
49
+ * @param base The base.
50
+ * @param extra The extra.
51
+ * @returns The merge auth requirements result.
52
+ */
31
53
  export function mergeAuthRequirements(base, extra) {
32
54
  if (!base && !extra) {
33
55
  return undefined;
34
56
  }
35
57
  const scopes = normalizeDeclaredScopes([...(base?.scopes ?? []), ...(extra?.scopes ?? [])]);
58
+ const optional = extra && Object.hasOwn(extra, 'optional') ? extra.optional : base?.optional === true && extra?.strategy ? false : base?.optional;
36
59
  const strategy = extra?.strategy ?? base?.strategy;
37
- if (!strategy && !scopes) {
60
+ if (!strategy && !scopes && optional !== true) {
38
61
  return undefined;
39
62
  }
40
63
  return {
64
+ optional,
41
65
  scopes,
42
66
  strategy
43
67
  };
package/dist/types.d.ts CHANGED
@@ -4,16 +4,22 @@ import type { Guard, GuardContext, Principal } from '@fluojs/http';
4
4
  export interface AuthRequirement {
5
5
  /** Named strategy to resolve from the strategy registry. */
6
6
  strategy?: string;
7
+ /** Allows the request to continue without a resolved principal. */
8
+ optional?: boolean;
7
9
  /** Required scopes that must be present on the resolved principal. */
8
10
  scopes?: string[];
9
11
  }
12
+ /** Authentication result variant used when a route explicitly allows missing credentials. */
13
+ export interface AuthOptionalResult {
14
+ authenticated: false;
15
+ }
10
16
  /** Authentication result variant used when a strategy fully handled the response. */
11
17
  export interface AuthHandledResult {
12
18
  handled: true;
13
19
  principal?: Principal;
14
20
  }
15
21
  /** Return type of an `AuthStrategy.authenticate(...)` call. */
16
- export type AuthStrategyResult = Principal | AuthHandledResult;
22
+ export type AuthStrategyResult = Principal | AuthHandledResult | AuthOptionalResult;
17
23
  /** Strategy contract implemented by authentication adapters. */
18
24
  export interface AuthStrategy {
19
25
  authenticate(context: GuardContext): MaybePromise<AuthStrategyResult>;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEnE,uDAAuD;AACvD,MAAM,WAAW,eAAe;IAC9B,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,sEAAsE;IACtE,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,qFAAqF;AACrF,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,IAAI,CAAC;IACd,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB;AAED,+D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,CAAC,EAAE,SAAS,CAAC;CACvB;AAED,+DAA+D;AAC/D,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG,iBAAiB,GAAG,kBAAkB,CAAC;AAEpF,gEAAgE;AAChE,MAAM,WAAW,YAAY;IAC3B,YAAY,CAAC,OAAO,EAAE,YAAY,GAAG,YAAY,CAAC,kBAAkB,CAAC,CAAC;CACvE;AAED,gEAAgE;AAChE,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC;CAC5B;AAED,4DAA4D;AAC5D,MAAM,MAAM,oBAAoB,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;AAEjF,yDAAyD;AACzD,MAAM,WAAW,qBAAqB;IACpC,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,oDAAoD;AACpD,MAAM,WAAW,iBAAkB,SAAQ,KAAK;IAC9C,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACnD"}
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "guard",
10
10
  "strategy"
11
11
  ],
12
- "version": "1.0.0-beta.2",
12
+ "version": "1.0.0-beta.4",
13
13
  "private": false,
14
14
  "license": "MIT",
15
15
  "repository": {
@@ -36,11 +36,11 @@
36
36
  "dist"
37
37
  ],
38
38
  "dependencies": {
39
- "@fluojs/core": "^1.0.0-beta.1",
40
- "@fluojs/di": "^1.0.0-beta.2",
41
- "@fluojs/http": "^1.0.0-beta.1",
42
- "@fluojs/jwt": "^1.0.0-beta.1",
43
- "@fluojs/runtime": "^1.0.0-beta.2"
39
+ "@fluojs/core": "^1.0.0-beta.2",
40
+ "@fluojs/di": "^1.0.0-beta.4",
41
+ "@fluojs/http": "^1.0.0-beta.3",
42
+ "@fluojs/jwt": "^1.0.0-beta.2",
43
+ "@fluojs/runtime": "^1.0.0-beta.4"
44
44
  },
45
45
  "devDependencies": {
46
46
  "vitest": "^3.2.4"