Skip to content

auth: make the TUI work with basic auth, and refuse a credential-less… - #5

Merged
langhorst merged 1 commit into
mainfrom
claude/fix-basic-auth-tui
Sep 15, 2026
Merged

langhorst merged 1 commit into
mainfrom
claude/fix-basic-auth-tui

Conversation

@langhorst

Copy link
Copy Markdown
Owner

… daemon

Two rough edges in the auth work, both reported from real use.

The TUI was token-only. HTTPBackend had no way to send basic credentials and runTUI read only auth.token, so a daemon configured with auth.basicUser/auth.basicPassword was unreachable from waggle tui by any combination of flags. HTTPBackend gains BasicUser/BasicPassword (a token still wins, since it satisfies the daemon alone) and the command reads both from the config, from -user/-password, or from $WAGGLE_USER/$WAGGLE_PASSWORD.

A daemon with no credentials configured used to start and then reject every request, including its own operator's, with nothing able to satisfy it: validation only refused the no-auth case off-loopback, and the missing-file path skipped validation entirely. Both now fail at startup with a message naming all three remedies. auth.disabled stays the full opt-out at any address, because it is how a daemon behind an authenticating reverse proxy is configured; off-loopback it now warns that anyone reaching the port controls every channel.

Also: apiError classifies by status instead of returning early on any JSON error body, so a 401 is distinguishable from a generic failure -- the daemon always sends such a body, so the old ordering never reached the status check. A rejected credential now says which kind was tried. An explicit -config that does not exist is an error rather than a silent fallback to the defaults.

Claude-Session: https://claude.ai/code/session_01CDAe95EyukJTfQD3SePK6U

… daemon

Two rough edges in the auth work, both reported from real use.

The TUI was token-only. HTTPBackend had no way to send basic credentials
and runTUI read only auth.token, so a daemon configured with
auth.basicUser/auth.basicPassword was unreachable from `waggle tui` by any
combination of flags. HTTPBackend gains BasicUser/BasicPassword (a token
still wins, since it satisfies the daemon alone) and the command reads both
from the config, from -user/-password, or from $WAGGLE_USER/$WAGGLE_PASSWORD.

A daemon with no credentials configured used to start and then reject every
request, including its own operator's, with nothing able to satisfy it:
validation only refused the no-auth case off-loopback, and the missing-file
path skipped validation entirely. Both now fail at startup with a message
naming all three remedies. auth.disabled stays the full opt-out at any
address, because it is how a daemon behind an authenticating reverse proxy
is configured; off-loopback it now warns that anyone reaching the port
controls every channel.

Also: apiError classifies by status instead of returning early on any JSON
error body, so a 401 is distinguishable from a generic failure -- the
daemon always sends such a body, so the old ordering never reached the
status check. A rejected credential now says which kind was tried. An
explicit -config that does not exist is an error rather than a silent
fallback to the defaults.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01CDAe95EyukJTfQD3SePK6U
@langhorst
langhorst merged commit 6716cbe into main Sep 15, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants