openstack: say when a Keystone cannot redeem application credentials at all - #36
Merged
github-actions[bot] merged 1 commit intoSep 11, 2026
Merged
Conversation
…at all A lab validation against a CubeCOS cluster could not redeem an application credential that existed, was not revoked, and was scoped correctly. Keystone answered 401 with "Attempted to authenticate with an unsupported method" and the list it does support: password, token, oauth1, mapped. CubeCOS ships methods = password,token,oauth1,mapped in keystone.conf, so an application credential can be created there and never redeemed. The old message named the one thing that was not wrong — "check that it exists and has not been revoked" — and sent the reader to inspect a healthy credential. The two conditions have different owners: a revoked credential is the operator's to reissue, a missing auth method is the platform's to enable. Only the method names are read from the error body, never error.message and never the body itself, because a Keystone error can echo the request and the request holds the secret. An ordinary 401 keeps its original wording, pinned by its own test so the new branch cannot swallow it. Signed-off-by: Travis Wu <travis.wu@bigstack.co>
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.
What
When Keystone refuses because it does not enable the
application_credentialauth method at all, say that, and say which methods it does offer. An ordinary
401 keeps its existing wording.
Why
Found by the ADR 0011 lab validation, on a real CubeCOS cluster. An
application credential that existed, was scoped to the right project and had
not been revoked could not be redeemed:
/etc/keystone/keystone.confon that cluster:application_credentialis absent. Upstream Keystone enables it by default;CubeCOS has narrowed the list. So an application credential can be created
there — the API allows it, and
openstack application credential createsucceeds — and never redeemed.
The message this replaces named the one thing that was not wrong:
That sends the reader to inspect a healthy credential. The two conditions have
different owners — a revoked credential is the operator's to reissue, a missing
auth method is the platform's to enable — and an operator reading a log needs
to know which one they are looking at.
Reviewer notes
Only
error.identity.methodsis read. Nevererror.message, never the body:a Keystone error can echo the request, and the request holds the secret. The
existing
TestAKeystoneRefusalNeverQuotesTheSecretstill passes, and the newtest asserts the secret is absent from the new branch's message too.
TestAnOrdinaryKeystoneRefusalStillBlamesTheCredentialpins the otherdirection — a revoked or mistyped credential is still the common case, and
that test fails if this branch swallows it.
Proved failable: disabling the new branch fails
TestAKeystoneThatCannotRedeemApplicationCredentialsSaysSoon all three of itsassertions; restored, the full suite is green (
GO_TEST_RC=0, zero--- FAIL:lines).
This improves the diagnosis, it does not make creates work on CubeCOS.
Whether the product should enable
application_credential, or whether theagent should authenticate some other way, is a design question this PR
deliberately does not answer — it is recorded in the lab validation runbook.
Docs
Lab validation runbook in the handbook records the finding, the evidence and
the open question.