Repository navigation
Conversation
A log line reaches only standard error, and tests never assert on log output, so no test can catch it.
configure no longer refreshes the ADC login when no configuration could be marked. A label shows at most 64 characters of the account, so 999 configurations with the longest names still fit in one line. A failure logs only its error kind. Tests cover a refused refresh, a stalled refresh, the exact 5 s wait and an account that needs escaping.
odgrim
force-pushed
the
track-a/google-another-account
branch
from
December 6, 2026 16:05
51a5a73 to
764faf6
Compare
The refusal test checked only the account's first characters, so cutting it at the label's 64 passed.
odgrim
marked this pull request as ready for review
December 6, 2026 16:14
This branch has not been deployed
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.
Change
The gcloud method's
configurationchoices name a configuration set up for another account than the Application Default Credentials sign in as, before the person picks it:other (another account: "ana@example.com")other (active, another account: "ana@example.com")when it is the active one.Picking it is still refused at sign-in, naming both accounts, as before. A configuration with no account, or set up for the same account (case ignored), reads as before.
Decisions
configureasks Google who the login is, only when a configuration names an account: it refreshes the Application Default Credentials and asks tokeninfo (STS introspection for a workforce login), within one 5 s bound over both calls. Past the bound, or on any failure, no choice is marked and the error kind (timedOut,network, ...) goes to standard error. Only a user's or a workforce login is asked; a service account or other credential costs nothing, as at sign-in, which compares only those.quotedtakes the cap.accountis not read. gcloud 578.0.0 writes it empty:creds.WithAccounthas no caller, and google-auth'sCredentials.to_jsonwrites_account, which defaults to "". So tokeninfo is the only source.session::another_account) serves the label and the refusal, andUserClaimpicks what names the login (email or workforce subject) for both.all_configuration_namesreturnsConfigurationNames, so a listed name is not parsed twice.logto standard error, as Azure's has..cargo/mutants.tomlexcludesreplace log with (), approved by the operator: a log line reaches only standard error, and tests never assert on log output. It drops exactly two mutants, Google's and Azure'slog(cargo mutants --listover the workspace: 1635 without it, 1633 with it).Gaps
logmutant); 9281c19 adds the exclusion.configurewith a user login and a configuration that names an account costs one refresh and one tokeninfo call, up to 5 s, and a sign-in that follows asks again. Two workforce tests now expect each pair twice.log; a shared one is not made here.Evidence
a_configuration_set_up_for_another_account_names_itfailed before the change:left: ... "other (active)" ... right: ... "other (active, another account: \"ana@example.com\")". It now also checks an escaped and cut account, a refused refresh, a stalled refresh and a stalled tokeninfo call (each unmarked, at exactly 0 s or 5 s of paused time), and that no token is requested when no configuration names an account.the_most_configurations_set_up_for_other_accounts_fit_in_a_linefailed with the account cut at 256.a_refusal_shows_each_account_escaped_and_boundedpins the refusal's 256-character cut of the account; with the label's 64 there, it fails (154 passed, 1 failed).a_configuration_set_up_for_another_account_names_itfails (154 passed, 1 failed);only_a_login_is_held_to_its_configurations_account).32 mutants tested in 7m: 27 caught, 5 unviable.Audit dependenciesis red, as on main, until the pin-project-lite 0.2.19 lock update.mise run checkat 51a5a73:507 tests run: 507 passed, 0 skipped, lint clean.git patch-id --stable(c862a33d2c2f) and the same changed lines; 764faf6's tree equalsgit merge-tree --write-tree 51a5a73 origin/main.mise run checkthere:509 tests run: 509 passed, 0 skipped.lib/googlecloudsdk/core/credentials/creds.py:243-260(WithAccount, no caller in the SDK),1731-1747(a user's ADC iscredentials.to_jsonminus the token fields);lib/third_party/google/oauth2/credentials.py:164setsself._account = account or ""and:567writes"account": self._account.