@fluojs/passport 1.0.3 → 1.0.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 +2 -2
- package/README.md +2 -2
- package/dist/status.d.ts.map +1 -1
- package/dist/status.js +12 -3
- package/package.json +3 -3
package/README.ko.md
CHANGED
|
@@ -235,7 +235,7 @@ Identity-link 결정을 모델링하려면 `createConservativeAccountLinkPolicy(
|
|
|
235
235
|
|
|
236
236
|
### Cookie auth preset
|
|
237
237
|
- `CookieAuthModule`: 내장 cookie-auth preset의 모듈 진입점입니다.
|
|
238
|
-
- `CookieAuthStrategy`, `COOKIE_AUTH_STRATEGY_NAME`, `COOKIE_AUTH_OPTIONS`, `DEFAULT_COOKIE_AUTH_OPTIONS`: Cookie strategy wiring token
|
|
238
|
+
- `CookieAuthStrategy`, `COOKIE_AUTH_STRATEGY_NAME`, `COOKIE_AUTH_OPTIONS`, `DEFAULT_COOKIE_AUTH_OPTIONS`, `DEFAULT_COOKIE_OPTIONS`: Cookie strategy wiring token, preset 기본값, response-cookie 기본값입니다.
|
|
239
239
|
- `CookieAuthOptions`, `CookieAuthPresetConfig`, `CookieManagerConfig`, `CookieOptions`, `SetCookieOptions`: Cookie strategy 및 response cookie 설정 타입입니다.
|
|
240
240
|
- `CookieManager`: HttpOnly access/refresh token cookie를 설정하고 제거하는 유틸리티입니다.
|
|
241
241
|
- Cookie helper: `createCookieAuthPreset`, `createCookieAuthStrategyRegistration`, `createCookieManager`, `normalizeCookieAuthOptions`.
|
|
@@ -263,7 +263,7 @@ Identity-link 결정을 모델링하려면 `createConservativeAccountLinkPolicy(
|
|
|
263
263
|
- `createPassportPlatformDiagnosticIssues(...)`: Empty registry, 누락된 default strategy, cookie preset readiness, refresh-token backing store readiness 문제에 대한 diagnostic issue를 생성합니다.
|
|
264
264
|
- `PassportPlatformStatusSnapshot`, `PassportStatusAdapterInput`: Status helper input/output 계약입니다.
|
|
265
265
|
|
|
266
|
-
`UseOptionalAuth`는 scope가 필요 없는 route에서만 credential 누락을 우회합니다. Scoped route에는 여전히 principal이 필요합니다. Passport.js bridge의 `redirect()`는 response를 commit하고 protected handler를 건너뛰며, `pass()`와 Passport action 없이 완료된 strategy는 인증 실패입니다.
|
|
266
|
+
`UseOptionalAuth`는 scope가 필요 없는 route에서만 credential 누락을 우회합니다. Scoped route에는 여전히 principal이 필요합니다. Passport.js bridge의 `redirect()`는 response를 commit하고 protected handler를 건너뛰며, `pass()`와 Passport action 없이 완료된 strategy는 인증 실패입니다. Refresh-token backing store status 및 diagnostic surface는 readiness, health, details, diagnostic cause를 노출하기 전에 secret처럼 보이는 reason 문자열을 redact합니다.
|
|
267
267
|
|
|
268
268
|
## 관련 패키지
|
|
269
269
|
|
package/README.md
CHANGED
|
@@ -235,7 +235,7 @@ Use `createConservativeAccountLinkPolicy(...)` and `resolveAccountLinking(...)`
|
|
|
235
235
|
|
|
236
236
|
### Cookie Auth Preset
|
|
237
237
|
- `CookieAuthModule`: Module entry point for the built-in cookie-auth preset.
|
|
238
|
-
- `CookieAuthStrategy`, `COOKIE_AUTH_STRATEGY_NAME`, `COOKIE_AUTH_OPTIONS`, `DEFAULT_COOKIE_AUTH_OPTIONS`: Cookie strategy wiring tokens and defaults.
|
|
238
|
+
- `CookieAuthStrategy`, `COOKIE_AUTH_STRATEGY_NAME`, `COOKIE_AUTH_OPTIONS`, `DEFAULT_COOKIE_AUTH_OPTIONS`, `DEFAULT_COOKIE_OPTIONS`: Cookie strategy wiring tokens, preset defaults, and response-cookie defaults.
|
|
239
239
|
- `CookieAuthOptions`, `CookieAuthPresetConfig`, `CookieManagerConfig`, `CookieOptions`, `SetCookieOptions`: Cookie strategy and response cookie configuration types.
|
|
240
240
|
- `CookieManager`: Utility for setting and clearing HttpOnly access/refresh token cookies.
|
|
241
241
|
- Cookie helpers: `createCookieAuthPreset`, `createCookieAuthStrategyRegistration`, `createCookieManager`, `normalizeCookieAuthOptions`.
|
|
@@ -263,7 +263,7 @@ Use `createConservativeAccountLinkPolicy(...)` and `resolveAccountLinking(...)`
|
|
|
263
263
|
- `createPassportPlatformDiagnosticIssues(...)`: Emits diagnostic issues for empty registries, missing default strategies, cookie preset readiness, and refresh-token backing store readiness.
|
|
264
264
|
- `PassportPlatformStatusSnapshot`, `PassportStatusAdapterInput`: Status helper input/output contracts.
|
|
265
265
|
|
|
266
|
-
`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.
|
|
266
|
+
`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. Refresh-token backing store status and diagnostic surfaces redact secret-like reason strings before exposing readiness, health, details, or diagnostic causes.
|
|
267
267
|
|
|
268
268
|
## Related Packages
|
|
269
269
|
|
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,iGAAiG;AACjG,MAAM,WAAW,8BAA8B;IAC7C,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,sFAAsF;AACtF,MAAM,WAAW,0BAA0B;IACzC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,oBAAoB,EAAE,MAAM,EAAE,CAAC;IAC/B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,m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,EAAE,CAiDnH"}
|
package/dist/status.js
CHANGED
|
@@ -23,6 +23,15 @@ function isRefreshTokenStoreReady(input) {
|
|
|
23
23
|
}
|
|
24
24
|
return input.refreshTokenStoreReady ?? true;
|
|
25
25
|
}
|
|
26
|
+
function redactSensitiveDiagnosticReason(reason) {
|
|
27
|
+
if (reason === undefined) {
|
|
28
|
+
return undefined;
|
|
29
|
+
}
|
|
30
|
+
if (/(accessToken|api[-_ ]?key|authorization|bearer|cookie|credential|password|passwd|refreshToken|secret|token\s*[:=])/i.test(reason)) {
|
|
31
|
+
return 'Refresh token backing store is unavailable; sensitive diagnostic detail was redacted.';
|
|
32
|
+
}
|
|
33
|
+
return reason;
|
|
34
|
+
}
|
|
26
35
|
function collectReadinessReasons(input) {
|
|
27
36
|
const reasons = [];
|
|
28
37
|
if (!hasRegisteredStrategies(input)) {
|
|
@@ -35,7 +44,7 @@ function collectReadinessReasons(input) {
|
|
|
35
44
|
reasons.push('Cookie auth preset is enabled but not ready.');
|
|
36
45
|
}
|
|
37
46
|
if (!isRefreshTokenStoreReady(input)) {
|
|
38
|
-
reasons.push(input.refreshTokenStoreReason ?? 'Refresh token backing store is unavailable.');
|
|
47
|
+
reasons.push(redactSensitiveDiagnosticReason(input.refreshTokenStoreReason) ?? 'Refresh token backing store is unavailable.');
|
|
39
48
|
}
|
|
40
49
|
return reasons;
|
|
41
50
|
}
|
|
@@ -90,7 +99,7 @@ export function createPassportPlatformStatusSnapshot(input) {
|
|
|
90
99
|
refreshToken: {
|
|
91
100
|
backingStore: {
|
|
92
101
|
dependencyId: input.refreshTokenDependencyId,
|
|
93
|
-
reason: input.refreshTokenStoreReason,
|
|
102
|
+
reason: redactSensitiveDiagnosticReason(input.refreshTokenStoreReason),
|
|
94
103
|
ready: isRefreshTokenStoreReady(input)
|
|
95
104
|
},
|
|
96
105
|
enabled: input.refreshTokenEnabled ?? false
|
|
@@ -162,7 +171,7 @@ export function createPassportPlatformDiagnosticIssues(input) {
|
|
|
162
171
|
issues.push({
|
|
163
172
|
code: 'AUTH_PASSPORT_REFRESH_TOKEN_BACKING_STORE_NOT_READY',
|
|
164
173
|
componentId,
|
|
165
|
-
cause: input.refreshTokenStoreReason,
|
|
174
|
+
cause: redactSensitiveDiagnosticReason(input.refreshTokenStoreReason),
|
|
166
175
|
dependsOn: input.refreshTokenDependencyId ? [input.refreshTokenDependencyId] : undefined,
|
|
167
176
|
fixHint: 'Restore refresh token backing store readiness, or disable refresh-token strategy for this environment.',
|
|
168
177
|
message: 'Refresh token strategy is enabled, but its backing dependency is not ready.',
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"guard",
|
|
10
10
|
"strategy"
|
|
11
11
|
],
|
|
12
|
-
"version": "1.0.
|
|
12
|
+
"version": "1.0.4",
|
|
13
13
|
"private": false,
|
|
14
14
|
"license": "MIT",
|
|
15
15
|
"repository": {
|
|
@@ -37,10 +37,10 @@
|
|
|
37
37
|
],
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@fluojs/di": "^1.0.3",
|
|
40
|
-
"@fluojs/core": "^1.0.3",
|
|
41
40
|
"@fluojs/http": "^1.1.0",
|
|
42
41
|
"@fluojs/jwt": "^1.0.1",
|
|
43
|
-
"@fluojs/runtime": "^1.1.
|
|
42
|
+
"@fluojs/runtime": "^1.1.2",
|
|
43
|
+
"@fluojs/core": "^1.0.3"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"vitest": "^3.2.4"
|