@fluojs/passport 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 +40 -11
- package/README.md +38 -9
- package/package.json +4 -4
package/README.ko.md
CHANGED
|
@@ -216,21 +216,50 @@ Identity-link 결정을 모델링하려면 `createConservativeAccountLinkPolicy(
|
|
|
216
216
|
- `@UseOptionalAuth(strategyName)`: `AuthGuard`를 부착하지만 전략이 자격 증명 누락을 보고하면 스코프가 없는 라우트는 계속 진행할 수 있게 합니다.
|
|
217
217
|
- `@RequireScopes(...scopes)`: 특정 권한(스코프) 요구 사항을 강제합니다.
|
|
218
218
|
|
|
219
|
-
###
|
|
219
|
+
### 모듈 및 가드 진입점
|
|
220
220
|
- `PassportModule`: passport 전략 wiring을 위한 모듈 진입점입니다.
|
|
221
|
-
- `AuthGuard`: 전략 체인을
|
|
222
|
-
- `
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
- `
|
|
226
|
-
- `
|
|
221
|
+
- `AuthGuard`: 전략 체인을 실행하고 required scope를 강제하는 HTTP 가드입니다.
|
|
222
|
+
- `PassportModuleOptions`, `AuthStrategyRegistration`, `AuthStrategyRegistry`, `AuthGuardContract`: Strategy registry 및 guard wiring 계약입니다.
|
|
223
|
+
|
|
224
|
+
### 전략 계약 및 에러
|
|
225
|
+
- `AuthStrategy`: 커스텀 인증 로직 구현을 위한 계약입니다.
|
|
226
|
+
- `AuthRequirement`: 선택된 strategy, optional-auth mode, required scope를 담는 route-level metadata입니다.
|
|
227
|
+
- `AuthStrategyResult`, `AuthOptionalResult`, `AuthHandledResult`: Principal, 의도적으로 누락된 credential, 이미 처리된 response를 표현하는 strategy return variant입니다.
|
|
228
|
+
- `AuthStrategyResolutionError`, `AuthenticationRequiredError`, `AuthenticationFailedError`, `AuthenticationExpiredError`: Registry miss, 누락된 credential, 잘못된 credential, 만료된 credential에 대해 guard와 strategy adapter가 사용하는 공개 error입니다.
|
|
229
|
+
|
|
230
|
+
### Metadata 및 scope helper
|
|
231
|
+
- `defineAuthRequirement(...)`, `getOwnAuthRequirement(...)`, `getAuthRequirement(...)`: Custom decorator나 tooling을 `AuthGuard`와 통합할 때 auth requirement metadata를 읽고 쓰는 공개 helper입니다.
|
|
232
|
+
- Scope requirement는 일반적으로 `@RequireScopes(...)`로 작성합니다. 더 낮은 수준의 scope normalization helper는 internal로 남아 있으며 package root export의 일부가 아닙니다.
|
|
233
|
+
|
|
234
|
+
### Cookie auth preset
|
|
235
|
+
- `CookieAuthModule`: 내장 cookie-auth preset의 모듈 진입점입니다.
|
|
236
|
+
- `CookieAuthStrategy`, `COOKIE_AUTH_STRATEGY_NAME`, `COOKIE_AUTH_OPTIONS`, `DEFAULT_COOKIE_AUTH_OPTIONS`: Cookie strategy wiring token과 기본값입니다.
|
|
237
|
+
- `CookieAuthOptions`, `CookieAuthPresetConfig`, `CookieManagerConfig`, `CookieOptions`, `SetCookieOptions`: Cookie strategy 및 response cookie 설정 타입입니다.
|
|
238
|
+
- `CookieManager`: HttpOnly access/refresh token cookie를 설정하고 제거하는 유틸리티입니다.
|
|
227
239
|
- Cookie helper: `createCookieAuthPreset`, `createCookieAuthStrategyRegistration`, `createCookieManager`, `normalizeCookieAuthOptions`.
|
|
240
|
+
|
|
241
|
+
### Refresh token preset
|
|
242
|
+
- `RefreshTokenModule`: 내장 refresh-token preset의 모듈 진입점입니다.
|
|
243
|
+
- `RefreshTokenStrategy`, `REFRESH_TOKEN_STRATEGY_NAME`, `REFRESH_TOKEN_SERVICE`: Refresh-token strategy 및 service alias wiring입니다.
|
|
244
|
+
- `RefreshTokenService`, `RefreshTokenInput`, `RefreshTokenAuthResult`: Application service contract와 exchange payload shape입니다.
|
|
245
|
+
- `JwtRefreshTokenAdapter`: `@fluojs/jwt`의 refresh logic을 passport interface로 연결합니다.
|
|
246
|
+
- `REFRESH_TOKEN_MODULE_OPTIONS`, `RefreshTokenModuleOptions`: 필수 `secret`과 `store` 계약을 포함하는 JWT 기반 refresh-token adapter 설정 token 및 option입니다.
|
|
228
247
|
- Refresh helper: `createRefreshTokenStrategyRegistration`.
|
|
229
|
-
- Status/diagnostics helper: `createPassportPlatformStatusSnapshot`, `createPassportPlatformDiagnosticIssues`.
|
|
230
248
|
|
|
231
|
-
###
|
|
232
|
-
- `
|
|
233
|
-
- `
|
|
249
|
+
### Passport.js bridge
|
|
250
|
+
- `createPassportJsStrategyBridge(...)`: Passport.js strategy를 fluo `AuthStrategy`로 변환합니다.
|
|
251
|
+
- `PassportJsAuthStrategy`, `PassportJsStrategyLike`, `PassportJsPrincipalMapperInput`, `PassportJsPrincipalMapper`, `PassportJsAuthStrategyOptions`, `PassportJsStrategyBridge`: Bridge strategy, mapper, 설정, provider bundle 계약입니다.
|
|
252
|
+
|
|
253
|
+
### Account linking
|
|
254
|
+
- `ACCOUNT_LINKING_POLICY`: Account-linking policy implementation을 등록하기 위한 DI token입니다.
|
|
255
|
+
- `createConservativeAccountLinkPolicy(...)`, `resolveAccountLinking(...)`: Identity-link 결정을 위한 conservative default policy와 resolver입니다.
|
|
256
|
+
- `AccountIdentity`, `AccountLinkCandidate`, `AccountLinkAttempt`, `AccountLinkContext`, `AccountLinkPolicy`, `AccountLinkPolicyDecision`, `AccountLinkingOptions`, `AccountLinkingResolution`: Account-linking input, policy, result 계약입니다.
|
|
257
|
+
- `AccountLinkConflictError`, `AccountLinkRejectedError`: 모호하거나 거부된 account-linking attempt에서 발생하는 error입니다.
|
|
258
|
+
|
|
259
|
+
### Status 및 diagnostics
|
|
260
|
+
- `createPassportPlatformStatusSnapshot(...)`: Strategy registry, preset readiness, ownership, telemetry label을 위한 runtime platform snapshot을 생성합니다.
|
|
261
|
+
- `createPassportPlatformDiagnosticIssues(...)`: Empty registry, 누락된 default strategy, cookie preset readiness, refresh-token backing store readiness 문제에 대한 diagnostic issue를 생성합니다.
|
|
262
|
+
- `PassportPlatformStatusSnapshot`, `PassportStatusAdapterInput`: Status helper input/output 계약입니다.
|
|
234
263
|
|
|
235
264
|
`UseOptionalAuth`는 scope가 필요 없는 route에서만 credential 누락을 우회합니다. Scoped route에는 여전히 principal이 필요합니다. Passport.js bridge의 `redirect()`는 response를 commit하고 protected handler를 건너뛰며, `pass()`와 Passport action 없이 완료된 strategy는 인증 실패입니다.
|
|
236
265
|
|
package/README.md
CHANGED
|
@@ -216,21 +216,50 @@ Use `createConservativeAccountLinkPolicy(...)` and `resolveAccountLinking(...)`
|
|
|
216
216
|
- `@UseOptionalAuth(strategyName)`: Attaches `AuthGuard` but allows routes without scopes to continue when the strategy reports missing credentials.
|
|
217
217
|
- `@RequireScopes(...scopes)`: Enforces specific scope requirements.
|
|
218
218
|
|
|
219
|
-
###
|
|
219
|
+
### Module and Guard Entry Points
|
|
220
220
|
- `PassportModule`: Module entry point for passport strategy wiring.
|
|
221
|
-
- `AuthGuard`: The HTTP guard that executes the strategy chain.
|
|
221
|
+
- `AuthGuard`: The HTTP guard that executes the strategy chain and enforces required scopes.
|
|
222
|
+
- `PassportModuleOptions`, `AuthStrategyRegistration`, `AuthStrategyRegistry`, `AuthGuardContract`: Strategy registry and guard wiring contracts.
|
|
223
|
+
|
|
224
|
+
### Strategy Contracts and Errors
|
|
225
|
+
- `AuthStrategy`: The contract for implementing custom authentication logic.
|
|
226
|
+
- `AuthRequirement`: Route-level metadata for the selected strategy, optional-auth mode, and required scopes.
|
|
227
|
+
- `AuthStrategyResult`, `AuthOptionalResult`, `AuthHandledResult`: Strategy return variants for principals, intentionally missing credentials, and fully handled responses.
|
|
228
|
+
- `AuthStrategyResolutionError`, `AuthenticationRequiredError`, `AuthenticationFailedError`, `AuthenticationExpiredError`: Public errors used by guards and strategy adapters for registry misses, missing credentials, invalid credentials, and expired credentials.
|
|
229
|
+
|
|
230
|
+
### Metadata and Scope Helpers
|
|
231
|
+
- `defineAuthRequirement(...)`, `getOwnAuthRequirement(...)`, `getAuthRequirement(...)`: Public helpers for reading and writing auth requirement metadata when integrating custom decorators or tooling with `AuthGuard`.
|
|
232
|
+
- Scope requirements are normally authored with `@RequireScopes(...)`; lower-level scope normalization helpers remain internal and are not part of the package root export.
|
|
233
|
+
|
|
234
|
+
### Cookie Auth Preset
|
|
222
235
|
- `CookieAuthModule`: Module entry point for the built-in cookie-auth preset.
|
|
223
|
-
- `
|
|
236
|
+
- `CookieAuthStrategy`, `COOKIE_AUTH_STRATEGY_NAME`, `COOKIE_AUTH_OPTIONS`, `DEFAULT_COOKIE_AUTH_OPTIONS`: Cookie strategy wiring tokens and defaults.
|
|
237
|
+
- `CookieAuthOptions`, `CookieAuthPresetConfig`, `CookieManagerConfig`, `CookieOptions`, `SetCookieOptions`: Cookie strategy and response cookie configuration types.
|
|
238
|
+
- `CookieManager`: Utility for setting and clearing HttpOnly access/refresh token cookies.
|
|
239
|
+
- Cookie helpers: `createCookieAuthPreset`, `createCookieAuthStrategyRegistration`, `createCookieManager`, `normalizeCookieAuthOptions`.
|
|
240
|
+
|
|
241
|
+
### Refresh Token Preset
|
|
224
242
|
- `RefreshTokenModule`: Module entry point for the built-in refresh-token preset.
|
|
243
|
+
- `RefreshTokenStrategy`, `REFRESH_TOKEN_STRATEGY_NAME`, `REFRESH_TOKEN_SERVICE`: Refresh-token strategy and service alias wiring.
|
|
244
|
+
- `RefreshTokenService`, `RefreshTokenInput`, `RefreshTokenAuthResult`: Application service contract and exchange payload shapes.
|
|
225
245
|
- `JwtRefreshTokenAdapter`: Bridges `@fluojs/jwt` refresh logic to the passport interface.
|
|
226
|
-
- `
|
|
227
|
-
- Cookie helpers: `createCookieAuthPreset`, `createCookieAuthStrategyRegistration`, `createCookieManager`, `normalizeCookieAuthOptions`.
|
|
246
|
+
- `REFRESH_TOKEN_MODULE_OPTIONS`, `RefreshTokenModuleOptions`: JWT-backed refresh-token adapter configuration token and options, including the required `secret` and `store` contract.
|
|
228
247
|
- Refresh helpers: `createRefreshTokenStrategyRegistration`.
|
|
229
|
-
- Status/diagnostics helpers: `createPassportPlatformStatusSnapshot`, `createPassportPlatformDiagnosticIssues`.
|
|
230
248
|
|
|
231
|
-
###
|
|
232
|
-
- `
|
|
233
|
-
- `
|
|
249
|
+
### Passport.js Bridge
|
|
250
|
+
- `createPassportJsStrategyBridge(...)`: Adapts Passport.js strategies to fluo `AuthStrategy`.
|
|
251
|
+
- `PassportJsAuthStrategy`, `PassportJsStrategyLike`, `PassportJsPrincipalMapperInput`, `PassportJsPrincipalMapper`, `PassportJsAuthStrategyOptions`, `PassportJsStrategyBridge`: Bridge strategy, mapper, configuration, and provider bundle contracts.
|
|
252
|
+
|
|
253
|
+
### Account Linking
|
|
254
|
+
- `ACCOUNT_LINKING_POLICY`: DI token for registering an account-linking policy implementation.
|
|
255
|
+
- `createConservativeAccountLinkPolicy(...)`, `resolveAccountLinking(...)`: Conservative default policy and resolver for identity-link decisions.
|
|
256
|
+
- `AccountIdentity`, `AccountLinkCandidate`, `AccountLinkAttempt`, `AccountLinkContext`, `AccountLinkPolicy`, `AccountLinkPolicyDecision`, `AccountLinkingOptions`, `AccountLinkingResolution`: Account-linking input, policy, and result contracts.
|
|
257
|
+
- `AccountLinkConflictError`, `AccountLinkRejectedError`: Errors raised for ambiguous or rejected account-linking attempts.
|
|
258
|
+
|
|
259
|
+
### Status and Diagnostics
|
|
260
|
+
- `createPassportPlatformStatusSnapshot(...)`: Creates a runtime platform snapshot for strategy registry, preset readiness, ownership, and telemetry labels.
|
|
261
|
+
- `createPassportPlatformDiagnosticIssues(...)`: Emits diagnostic issues for empty registries, missing default strategies, cookie preset readiness, and refresh-token backing store readiness.
|
|
262
|
+
- `PassportPlatformStatusSnapshot`, `PassportStatusAdapterInput`: Status helper input/output contracts.
|
|
234
263
|
|
|
235
264
|
`UseOptionalAuth` only bypasses missing credentials when no scopes are required; scoped routes still need a principal. Passport.js bridge `redirect()` commits the response and skips the protected handler, while `pass()` and strategy completion without a Passport action are authentication failures.
|
|
236
265
|
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"guard",
|
|
10
10
|
"strategy"
|
|
11
11
|
],
|
|
12
|
-
"version": "1.0.
|
|
12
|
+
"version": "1.0.2",
|
|
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.
|
|
40
|
-
"@fluojs/di": "^1.0.
|
|
39
|
+
"@fluojs/core": "^1.0.2",
|
|
40
|
+
"@fluojs/di": "^1.0.2",
|
|
41
41
|
"@fluojs/http": "^1.0.0",
|
|
42
42
|
"@fluojs/jwt": "^1.0.0",
|
|
43
|
-
"@fluojs/runtime": "^1.0
|
|
43
|
+
"@fluojs/runtime": "^1.1.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"vitest": "^3.2.4"
|