Repository navigation
auth: make the TUI work with basic auth, and refuse a credential-less… - #5
Merged
Merged
Conversation
… 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
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
… 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 tuiby 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