auth export masks secrets by default with no warning; consumers fail later with invalid_client
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 64/100
Línea de trabajo
Empieza en el módulo de comandos de auth de Rust que está detrás de gws auth export y localiza dónde el flag --unmasked decide si client_secret se enmascara antes de imprimir; esa rama es donde corresponde una advertencia por stderr o una marca _masked. Lee la ruta de exportación junto con la sección headless/CI del README para que la advertencia coincida con el flujo de trabajo documentado, y luego revisa las pruebas CLI existentes para auth export para añadir un caso que verifique que la salida enmascarada advierte. Hecho significa que las exportaciones enmascaradas se distinguen (advertencia por stderr o marca) mientras que la salida de --unmasked permanece silenciosa; la minucia de auth status --format json es un cambio aparte y más pequeño en el mismo árbol de comandos.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Rust
- Estrellas
- 32.3k
- Forks
- 2k
- Merge medio
- 16 h 3 min
- PR fusionados (30 d)
- 1
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de googleworkspace/cli
-
`gws auth login` keeps the old token cache, so API calls use a token from the previous grantAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
googleworkspace/cli#984 ·
Los mantenedores suelen responder en 1 día
-
Replace gemini with agyAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
googleworkspace/cli#958 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
googleworkspace/cli#921 ·
Los mantenedores suelen responder en 1 día
-
Add cli to awesome-ai-plugins?Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
googleworkspace/cli#920 ·
Los mantenedores suelen responder en 1 día
-
docs(gmail): the --draft tip prints a send command that fails (users.drafts.send --body)Quizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
googleworkspace/cli#914 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de googleworkspace/cli
Issues similares
-
area:cli area:security bug priority:medium
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
rtk-ai/rtk#5127 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
status: new topic: ga4gh-sdk type: bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
comp-rbac
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
ClickHouse/ClickHouse#131875 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día
-
bug(python): read_transaction raises TypeError on a Rewrite with rewritten indicesPosiblemente ocupada @Borg93 la tomó hoy. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
lance-format/lance#11117 ·
Los mantenedores suelen responder en 2 días