[fix] an hourly token is not a login's expiry; verify the profile you pressed - #10
Merged
Merged
Conversation
… pressed Five bugs, all visible on one gcloud card. `verify` on a profile row verified whichever profile was active: the Tauri command threw the profile id away, and GcloudProbe had no verify_profile at all. On a board with two configurations both rows reported the same answer, belonging to one of them. The command now calls Registry::verify_profile and gcloud runs `auth print-access-token --account=<that config's account>`, which is per-invocation and never activates what it checks. gcloud, firebase and neon all stored a refreshable OAuth access token's expiry as the profile's, so working logins read "expired 3d" / "expired 235d" / "expired 12d", counted in the board's expired tally — and since a token minted this second is an hour out, well inside the 24h attention window, gcloud could never once read Connected. Each now reports no expiry where it has none to report, and keeps one only where the hour really is the whole login: firebase when no refresh_token sits beside it, neon when the grant has no offline scope. gcloud has no such case, so it is always unknown, with a note pointing at verify. A failed gcloud check was gcloud's own four lines of shell instructions joined with `; `. Reauth, revoked and missing-credential are each one sentence ending in the command that fixes it, for the account it is about. The IAM hint carried <project>/<account> placeholders while patchbay had both values on the row above, and its unquoted `bindings[].members` is a glob that zsh refuses before gcloud starts. Filled in, quoted, subject named. Release 0.3.2.
|
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.



Five bugs, all of them visible on one
gcloudcard at the same time.1. Verifying a profile verified a different profile
The panel's per-row check has always sent the profile id, and
verify_profilein
app/src-tauri/src/lib.rshas always thrown it away and asked aboutwhichever profile was active —
GcloudProbehad noverify_profileeither, sothere was nothing to call anyway. On a board with two configurations, pressing
"verify" on the inactive one reported the active account's answer under the
inactive one's row. Two rows, one truth, filed under both:
The command now calls
Registry::verify_profile, and the probe runsgcloud auth print-access-token --account=<the account that configuration names>.--accountis per-invocation, so checking a profile never activatesit. On a real two-configuration machine:
2. Three probes were dating a borrowed hour
gcloud,firebaseandneoneach stored an OAuth access token's expiryas the profile's expiry. All three refresh that token silently, so the board
read
expired 3d/expired 235d/expired 12dabout logins that work,counted them in the expired tally on every refresh, and — because a token
minted this second is one hour out, well inside the 24h attention window —
meant
gcloudcould never once reachConnected.Each now reports no expiry where it has none, and keeps one only where the hour
genuinely is the whole login:
gcloudaccess_tokens.dbonly ever holds the hourly tokenfirebaserefresh_tokenbeside it in the configstoreneonofflinescopefirebasereads that presence throughserde::de::IgnoredAny, so it learns therefresh token is there without ever holding its value — the same guarantee the
probe already made for
access_tokenby never naming it.What actually ends these sessions — revocation, an org reauthentication policy —
is decided server-side and written nowhere on this machine, so
None(unknown)is the honest answer, and the notes now say what is unknown instead of
apologising for what was shown.
azandawsalready worked this way; thisbrings the other three in line.
3. A failed check was a paste of gcloud's error
gcloud answers a reauth failure with four lines of shell instructions, which the
panel joined into one:
Reauthentication, a revoked credential and a missing credential are now each one
sentence ending in the command that fixes it, for the account it is actually
about. Anything else keeps gcloud's own first line minus the prefix that only
repeats what patchbay just ran. An account with no row in
credentials.dbisanswered from tier 1 without spawning anything, and a
gcloudthat is not onPATHisunsupportedrather than anErr.4. The IAM hint could not be run
It carried
<project>and<account>placeholders while patchbay had bothvalues on the row directly above, and
--flatten=bindings[].memberswasunquoted — a glob, which zsh answers with
no matches foundbefore gcloud everstarts. Now filled in, quoted, and the report names the account as its subject:
That line, run verbatim, returns the account's five roles.
5. "re-read scopes" for a tool with no scope reader
A second press cannot say anything the first did not. The button stays (it is
still how you ask), but it no longer claims there is something to re-read.
Notes
Profile::expires_atwas alreadyOption<DateTime<Utc>>and alreadynullforaz,ghand staticawskeys; MCP consumers are told
expires_at: nullmeans unknown, which is nowsimply true more often.
migrate/plan.rsused gcloud as the fixture for "an expired credential is asetup task". Moved to an AWS SSO session, which dates a real login.
scripts/bump-version.sh.Verification
cargo test --workspace --locked— 611 pass (7 new gcloud tests, 2 newfirebase, 2 new neon)
cargo clippy --workspace --all-targets --locked— cleantsc --noEmit— cleanpb status/pb verify gcloud --profile …/pb perms gcloudrun against areal machine with two gcloud configurations, a firebase login and a neon
grant; every output quoted above is real