-
-
Notifications
You must be signed in to change notification settings - Fork 0
Hotfix: Login / Auth on Private IP #839
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
6777f6e
feat(auth): implement Bearer token fallback in fetchSessionUser for p…
actions-user f33ab83
fix(auth): rename isLocalHost to isLocalOrPrivateHost and update rela…
actions-user fd58f9d
fix(auth): update SameSite cookie policy description for clarity
actions-user File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,93 @@ | ||
| --- | ||
| title: "Manual Test Plan - Issue #825: HTTP Login from Private Network IPs" | ||
| status: Open | ||
| priority: High | ||
| assignee: QA | ||
| labels: testing, backend, frontend, security | ||
| --- | ||
|
|
||
| # Test Objective | ||
|
|
||
| Confirm that users can log in to Charon over HTTP when accessing from a private network IP (e.g., `192.168.x.x:8080`), and that HTTPS and localhost login paths remain unaffected. | ||
|
|
||
| # Scope | ||
|
|
||
| - In scope: Auth cookie behavior across HTTP/HTTPS, private IPs, localhost, and port remapping. Session persistence and the Bearer token fallback. | ||
| - Out of scope: Setup wizard UI styling, non-auth API endpoints, Caddy proxy configuration changes. | ||
|
|
||
| # Prerequisites | ||
|
|
||
| - Fresh Charon instance (no existing users in the database). | ||
| - Access to a machine on the same LAN (or the host machine itself using its LAN IP). | ||
| - A second device or browser for cross-tab and LAN IP tests. | ||
| - For HTTPS scenarios: a reverse proxy (Caddy or nginx) with TLS termination in front of Charon. | ||
| - Browser DevTools available to inspect cookies and network requests. | ||
|
|
||
| # Manual Scenarios | ||
|
|
||
| ## 1) Fresh install login over HTTP from LAN IP (original bug) | ||
|
|
||
| - [ ] Deploy a fresh Charon instance with an empty database. | ||
| - [ ] From another machine on the LAN, open `http://<LAN-IP>:8080` (e.g., `http://192.168.1.50:8080`). | ||
| - [ ] Complete the setup wizard and create an admin user. | ||
| - [ ] Log in with the credentials you just created. | ||
| - [ ] **Expected**: Login succeeds. You are redirected to the dashboard. No "unauthorized" flash or redirect back to login. | ||
| - [ ] Open DevTools > Network tab. Confirm `/api/auth/me` returns `200`. | ||
| - [ ] Open DevTools > Application > Cookies. Confirm the auth cookie has `Secure: false`. | ||
|
|
||
| ## 2) Login over HTTPS via reverse proxy | ||
|
|
||
| - [ ] Configure a reverse proxy (Caddy or nginx) with TLS termination pointing to Charon. | ||
| - [ ] Open `https://<your-domain-or-ip>` in the browser. | ||
| - [ ] Log in with valid credentials. | ||
| - [ ] **Expected**: Login succeeds. Redirected to the dashboard. | ||
| - [ ] Open DevTools > Application > Cookies. Confirm the auth cookie has `Secure: true`. | ||
|
|
||
| ## 3) Login from localhost over HTTP (regression check) | ||
|
|
||
| - [ ] On the machine running Charon, open `http://localhost:8080`. | ||
| - [ ] Log in with valid credentials. | ||
| - [ ] **Expected**: Login succeeds. This is existing behavior and must not regress. | ||
|
|
||
| ## 4) Session persistence after page refresh | ||
|
|
||
| - [ ] Log in successfully via any access method. | ||
| - [ ] Press F5 (hard refresh). | ||
| - [ ] **Expected**: You remain logged in. The dashboard loads without a redirect to the login page. | ||
|
|
||
| ## 5) Multiple browser tabs | ||
|
|
||
| - [ ] Log in on Tab 1. | ||
| - [ ] Open a new Tab 2 and navigate to the same Charon URL. | ||
| - [ ] **Expected**: Tab 2 loads the dashboard immediately without prompting for login. | ||
|
|
||
| ## 6) Logout and re-login | ||
|
|
||
| - [ ] Log in, then click Logout. | ||
| - [ ] **Expected**: Redirected to the login page. | ||
| - [ ] Log in again with the same credentials. | ||
| - [ ] **Expected**: Login succeeds with a clean session. No stale session errors. | ||
|
|
||
| ## 7) Port remapping scenario | ||
|
|
||
| - [ ] Run Charon with Docker port mappings: `-p 82:80 -p 445:443 -p 8080:8080`. | ||
| - [ ] Access Charon on `http://<LAN-IP>:8080`. | ||
| - [ ] Log in with valid credentials. | ||
| - [ ] **Expected**: Login succeeds on the remapped port. | ||
| - [ ] If a reverse proxy is available, repeat via `https://<LAN-IP>:445`. | ||
| - [ ] **Expected**: Login succeeds with `Secure: true` on the cookie. | ||
|
|
||
| # Expected Results | ||
|
|
||
| - Login over HTTP from a private network IP works on fresh install. | ||
| - Cookie `Secure` flag is `false` for HTTP and `true` for HTTPS. | ||
| - Localhost login remains functional. | ||
| - Sessions survive page refreshes and work across tabs. | ||
| - Logout cleanly destroys the session, and re-login creates a new one. | ||
| - Port remapping does not break authentication. | ||
|
|
||
| # Regression Checks | ||
|
|
||
| - [ ] Confirm no changes to login behavior when accessing via `localhost` or `127.0.0.1`. | ||
| - [ ] Confirm HTTPS connections still set `Secure: true` on the auth cookie. | ||
| - [ ] Confirm the Bearer token header fallback does not interfere when cookies are working normally. | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.