Repository navigation
fix(sts): keep "not found" in the LDAP auth failure so the console can log in root - #275
Merged
Merged
Conversation
Vonng
force-pushed
the
fix/ldap-sts-failure-message
branch
3 times, most recently
from
November 3, 2026 00:40
d184052 to
356adaa
Compare
…n log in root Signed-off-by: Denis Babchuk <babchukdenis@icloud.com>
Vonng
force-pushed
the
fix/ldap-sts-failure-message
branch
from
November 3, 2026 00:52
356adaa to
a21f420
Compare
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.
Contribution Licensing (no CLA, inbound=outbound, DCO required)
This pull request contributes to PGSTY SILO (
pgsty/silo). Code contributionsare accepted under AGPL-3.0-or-later, the same license as the server.
This project does not use a CLA or require a separate Apache-2.0 license grant.
By submitting this pull request I represent that I have the right to contribute
the code changes under this repository's
GNU Affero General Public License v3.0 or later
and retain copyright in my original work. Existing copyright and license
notices remain intact; separately licensed material keeps its applicable terms.
Every commit must carry a DCO
Signed-off-bytrailer(
git commit -s) certifying theDeveloper Certificate of Origin — see
CONTRIBUTING.md.
Description
Fixes #272.
The console tries the built-in login (root) after a failed LDAP login only when the LDAP STS error contains "not found" (silo-console
api/client.go,NewConsoleCredentials). Since 3b950f8 the uniform auth failure says onlyLDAP authentication failed, so with LDAP enabled root cannot log in to the console.One commit:
fix(sts): keep "not found" in the LDAP auth failure so the console can log in root
errLDAPAuthenticationFailed(cmd/sts-handlers.go) becomesLDAP authentication failed: user not found or invalid password, with a comment on why the words matter. It stays one message for unknown users and wrong passwords, with the same 400InvalidParameterValue. LDAP infrastructure failures are not touched (ErrSTSUpstreamError).TestLDAPAuthFailureKeepsConsoleFallback(cmd/sts-handlers_test.go) applies the console's check to the auth failure fromldapBindErrorToSTS. The existing uniform-message checks compare againsterrLDAPAuthenticationFailed.Error()and pass unchanged.Motivation and Context
With LDAP enabled, new built-in users cannot be created, so root is the only non-LDAP console login, and it is the way back in when the LDAP side is misconfigured. A server-side message keeps every console that relies on the "not found" fallback working, without a console release. Details and a script are in the issue.
How to test this PR?
On main, with this test file (
git checkout <this branch> -- cmd/sts-handlers_test.go):Run locally on Go 1.27.3 (darwin/arm64), on main
0cfca29cb:make verifiers(golangci-lint: 0 issues),make buildgo test ./cmd -count=1 -run '^(Test.*STS.*|Test.*LDAP.*)$':ok_MINIO_LDAP_TEST_SERVER=localhost:13391 go test ./cmd -count=1 -run '^Test.*LDAP.*$'againstquay.io/minio/openldap:okManual check with the script from the issue (OpenLDAP, one server with 4 drives, embedded console): root's console login goes from 401 to 204; LDAP logins and the wrong-password case do not change, and STS gives the same message for an unknown user and a wrong password.
Compatibility impact
No API, configuration, storage metadata, metric, route or dependency changes.
Messageof the 400InvalidParameterValuefor an LDAP auth failure changes. Clients that compare the exact text need the new one; the code and the status do not change.AssumeRolecall per failed console login. That is the console's behavior before 3b950f8.Types of changes
Checklist:
git commit -s) per the DCOcommit-idorPR #here): 3b950f8make verifierspassesmake buildpasspgsty/silo.pgsty.com, if needed (not needed)