Hotfix: Login / Auth on Private IP#839
Conversation
…rivate network HTTP connections - Expanded fetchSessionUser to include Bearer token from localStorage as a fallback for authentication when Secure cookies fail. - Updated headers to conditionally include Authorization if a token is present. - Ensured compatibility with the recent fix for the Secure cookie flag on private network connections.
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
There was a problem hiding this comment.
Pull request overview
This PR addresses a login failure when Charon is accessed over plain HTTP via a private-network IP by (1) ensuring the backend does not set Secure=true cookies for local/private HTTP requests and (2) adding a frontend Bearer-token fallback for session validation.
Changes:
- Expand backend “local request” host detection to treat RFC1918/IPv6 ULA IPs as local, so HTTP logins from private IPs can receive usable (non-
Secure) auth cookies. - Add
Authorization: Bearer <token>fallback tofetchSessionUser()so/api/v1/auth/mecan succeed even if cookies are not available/accepted. - Add/extend backend tests and add QA/spec/manual test documentation for issue #825.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/context/AuthContext.tsx | Adds Bearer token header fallback for /api/v1/auth/me session validation. |
| backend/internal/api/handlers/auth_handler.go | Treats private IPs as “local” for cookie security decisions; updates related comments. |
| backend/internal/api/handlers/auth_handler_test.go | Adds test coverage for private IP + IPv6 ULA cookie behavior and host helper assertions. |
| docs/reports/qa_report_issue_825.md | QA audit report for issue #825 and validation steps/results. |
| docs/plans/telegram_remediation_spec.md | Adds a Telegram test remediation plan document (unrelated to auth hotfix functionality, but included in PR). |
| docs/plans/current_spec.md | Replaces current plan with issue #825 investigation/spec writeup. |
| docs/issues/issue-825-manual-test-plan.md | Adds a manual test plan for validating HTTP login on private-network IPs. |
You can also share your feedback on Copilot code review. Take the survey.
|
| Severity | Count |
|---|---|
| 🔴 Critical | 0 |
| 🟠 High | 3 |
| 🟡 Medium | 18 |
| 🟢 Low | 3 |
| Total | 24 |
📎 Artifacts
- SBOM (CycloneDX JSON) and Grype results available in workflow artifacts
Generated by Supply Chain Verification workflow • View Details
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
No description provided.