fix(auth): keep refresh sessions alive on HTTP - #14252
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
WalkthroughRefresh-cookie defaults now use same-site lax settings, with explicit cross-site HTTPS configuration covered by tests. Frontend access-token expiry fallbacks now use a one-hour backend default and include calculation tests. ChangesRefresh Cookie Policy
Access-Token Expiry Alignment
Estimated code review effort: 2 (Simple) | ~15 minutes Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 8 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (8 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
✅ Test Coverage AdvisorNo source changes detected without accompanying tests. Thanks for keeping coverage up! 🎉
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## release-1.11.1 #14252 +/- ##
==================================================
+ Coverage 61.41% 61.57% +0.15%
==================================================
Files 2444 2444
Lines 239915 239932 +17
Branches 37329 37390 +61
==================================================
+ Hits 147344 147730 +386
+ Misses 90804 90435 -369
Partials 1767 1767
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/frontend/src/constants/__tests__/auth-token-expiration.test.ts`:
- Around line 1-34: Extend the authentication token expiration coverage around
LANGFLOW_ACCESS_TOKEN_EXPIRE_SECONDS_ENV to exercise the Vite-injected
import.meta.env.ACCESS_TOKEN_EXPIRE_SECONDS path, not only process.env. Add
focused frontend test or build-level checks for both the default one-hour value
and a configured expiry, verifying each is transformed to the expected 10%-early
refresh value through the actual vite.config.mts injection.
In `@src/frontend/src/constants/constants.ts`:
- Around line 885-886: Update the ACCESS_TOKEN_CLI_EXPIRE_SECONDS handling in
constants.ts (lines 885-886) to use a supported browser/module-level environment
lookup instead of getEnvVar’s invalid new Function import path, preserving
configured expiry values before applying the 10% adjustment. Update the
corresponding environment injection in vite.config.mts (line 51) so the same
supported lookup receives the configured value rather than falling back to the
constant defaults.
In `@src/lfx/src/lfx/services/settings/auth.py`:
- Around line 126-128: Update the REFRESH_SECURE setting in the authentication
settings configuration to default to enabled, while preserving the ability for
development or local deployments to explicitly override it for intentional HTTP
usage.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 2bf2c75d-fa4a-4388-9027-d51aa317095f
📒 Files selected for processing (5)
src/backend/tests/unit/test_security_cors.pysrc/frontend/src/constants/__tests__/auth-token-expiration.test.tssrc/frontend/src/constants/constants.tssrc/frontend/vite.config.mtssrc/lfx/src/lfx/services/settings/auth.py
This comment has been minimized.
This comment has been minimized.
|
Build successful! ✅ |
* fix(auth): keep refresh sessions alive on HTTP * fix(auth): use supported Vite token expiry injection * fix(auth): make Vite env injection Playwright-safe
* fix(auth): keep refresh sessions alive on HTTP * fix(auth): use supported Vite token expiry injection * fix(auth): make Vite env injection Playwright-safe
Summary
Testing
npm test -- --runInBand src/constants/__tests__/auth-token-expiration.test.ts src/components/authorization/authGuard/__tests__/proactive-refresh.test.tsxuv run pytest src/backend/tests/unit/test_auth_settings.py src/backend/tests/unit/test_security_cors.py -qnpx @biomejs/biome check src/constants/constants.ts src/constants/__tests__/auth-token-expiration.test.ts vite.config.mtsuv run ruff check src/lfx/src/lfx/services/settings/auth.py src/backend/tests/unit/test_security_cors.pyuv run ruff format --check src/lfx/src/lfx/services/settings/auth.py src/backend/tests/unit/test_security_cors.pynpm run buildAddresses LE-2013.
Summary by CodeRabbit
Security
Authentication