auth export masks secrets by default with no warning; consumers fail later with invalid_client
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 64/100
Direzione di ricerca
Inizia nel modulo dei comandi auth di Rust dietro gws auth export e trova dove il flag --unmasked decide se client_secret viene mascherato prima della stampa; è in quel ramo che va un avviso su stderr o un marcatore _masked. Leggi il percorso di export insieme alla sezione headless/CI del README affinché l’avviso corrisponda al workflow documentato, poi controlla i test CLI esistenti per auth export per aggiungere un caso che verifichi che l’output mascherato avvisa. Fatto significa che gli export mascherati sono distinguibili (avviso su stderr o marcatore) mentre l’output di --unmasked resta silenzioso; la minuzia su auth status --format json è una modifica separata e più piccola nello stesso albero dei comandi.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
gws auth export without --unmasked prints credential-shaped JSON and exits 0, with nothing in the output, the exit code, or stderr indicating that the client_secret is masked. Anything that consumes that output — a script, an agent, a human setting up a headless box — accepts the shape and then fails later, inside a different library, with an error that points at credential corruption instead of at the export step.
Environment
gws0.22.5 on Linux- OAuth2 desktop client,
keyringbackend, encrypted credentials store - Consumer:
google.oauth2.credentials.Credentials.from_authorized_user_info(...)fromgoogle-auth
Reproduction
gws auth logininteractively; confirmgws auth statusreportstoken_valid: trueand that real API calls succeed (they did —gmail users getProfile,calendar calendarList list).gws auth export→ prints JSON with keystype,client_id,client_secret,refresh_token. Exit code 0.- Feed that JSON to
google-authand refresh:
RefreshError: ('invalid_client: The provided client secret is invalid.',
{'error': 'invalid_client',
'error_description': 'The provided client secret is invalid.'})
I read that as "the stored client secret is corrupt" and went looking for credential damage — while gws itself kept working fine against the same store, which made export look broken rather than under-promising.
The actual answer was in gws auth export --help:
--unmasked Show secrets without masking
and in the README's Headless / CI flow, which uses gws auth export --unmasked > credentials.json. Masking by default is the right call; failing silently about it is the problem.
Why it matters
- Masked output is structurally indistinguishable from a real credential file, so consumers cannot detect it.
- The failure surfaces later, in another process, with a message that misattributes the cause (
invalid_clientsuggests a bad secret for thatclient_id, not an intentionally masked value). - The CLI knows exactly which flag was missing but never says so.
Suggested fixes
Any one of these would have avoided the detour:
- When emitting masked output, warn on stderr:
warning: client_secret is masked and this output is not usable as credentials — re-run with --unmasked. - Add a marker field to the JSON when masking, e.g.
"_masked": true, so consumers can detect it programmatically. - Consider a non-zero exit (or a
--force) when masked output is written while stdout is redirected to a file, since that is the exact shape of the documented copy-to-another-machine workflow.
Related nit (same investigation)
gws auth status --format json fails with error: unexpected argument '--format' (exit 3), even though the default auth status output is already JSON. Every other command surface accepts --format, so scripts that pass it uniformly trip over this one subcommand.
- Lingua principale
- Rust
- Stelle
- 32.3k
- Fork
- 2k
- Merge medio
- 16h 3m
- PR unite (30g)
- 1
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di googleworkspace/cli
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
googleworkspace/cli#984 ·
I maintainer di solito rispondono entro 1 giorno
-
Replace gemini with agyAperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
googleworkspace/cli#958 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
googleworkspace/cli#921 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
googleworkspace/cli#920 ·
I maintainer di solito rispondono entro 1 giorno
-
docs(gmail): the --draft tip prints a send command that fails (users.drafts.send --body)Forse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
googleworkspace/cli#914 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di googleworkspace/cli
Issue simili
-
area:cli area:security bug priority:medium
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
rtk-ai/rtk#5127 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
status: new topic: ga4gh-sdk type: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
comp-rbac
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
ClickHouse/ClickHouse#131875 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno
-
bug(python): read_transaction raises TypeError on a Rewrite with rewritten indicesForse già presa @Borg93 l’ha presa oggi. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
lance-format/lance#11117 ·
I maintainer di solito rispondono entro 2 giorni