[#32074] DocDB: Fix webserver auth failing to start with --webserver_password_file#32135
Open
ddorian wants to merge 1 commit into
Open
[#32074] DocDB: Fix webserver auth failing to start with --webserver_password_file#32135ddorian wants to merge 1 commit into
ddorian wants to merge 1 commit into
Conversation
…bserver_password_file Summary: Setting --webserver_password_file (with --webserver_authentication_domain) to enable Web UI authentication caused yb-master / yb-tserver to fail at startup: Webserver: Invalid option: global_passwords_file Webserver: Could not start on address 0.0.0.0:7000 The embedded webserver passes the password-file path to squeasel under the option name "global_passwords_file", but the bundled squeasel registers that config option as "global_auth_file" (GLOBAL_PASSWORDS_FILE is only the internal enum index, not the option string). squeasel's sq_start() does not recognize the name, logs "Invalid option", and returns NULL, so the webserver - and therefore the whole process - never starts, making the documented webserver authentication flags unusable. Pass the correct "global_auth_file" option name so the password file is wired to squeasel's HTTP digest auth. Added a unit test that sets a password file, asserts the webserver starts, and asserts an unauthenticated request is rejected with HTTP 401. The test fails before this change (the server refuses to start). Test Plan: ./yb_build.sh release --cxx-test webserver-test --gtest_filter 'WebserverAuthTest.*' Passes with the fix. Reverting the option name to "global_passwords_file" reproduces the failure: webserver.cc: Webserver: Invalid option: global_passwords_file Network error: Webserver: Could not start on address 0.0.0.0:0 ---
Contributor
There was a problem hiding this comment.
Code Review
LGTM — The changes fix the squeasel option-name mismatch by using 'global_auth_file' and add a regression test to verify unauthenticated requests are rejected.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
hari90
requested changes
Jun 11, 2026
| // md5("yugabyte:YugabyteDB:yugabyte"). | ||
| ASSERT_OK(WriteStringToFile( | ||
| env_.get(), | ||
| Substitute("yugabyte:$0:0fbdc56fb215d4d2e29ff88863aa2da5\n", kAuthDomain), |
Contributor
There was a problem hiding this comment.
Use Format instead of Substitute
| // without credentials is rejected with HTTP 401. | ||
| TEST_F(WebserverAuthTest, TestUnauthenticatedRequestRejected) { | ||
| Status s = curl_.FetchURL(url_, &buf_); | ||
| ASSERT_EQ("Remote error: HTTP 401", s.ToString(/* no file/line */ false)); |
Contributor
|
PR summary does not match requirements |
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.
Fixes #32074