auth export masks secrets by default with no warning; consumers fail later with invalid_client
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Facilidade para iniciantes
- 64/100
Direção de pesquisa
Comece no módulo de comando auth do Rust por trás de gws auth export e encontre onde a flag --unmasked decide se client_secret é mascarado antes da impressão; é nesse ramo que deve ficar um aviso em stderr ou um marcador _masked. Leia o caminho de exportação junto com a seção headless/CI do README para que o aviso corresponda ao fluxo de trabalho documentado, depois verifique os testes CLI existentes para auth export para adicionar um caso que verifique que a saída mascarada emite aviso. Pronto significa que exportações mascaradas são distinguíveis (aviso em stderr ou marcador) enquanto a saída de --unmasked permanece silenciosa; o detalhe de auth status --format json é uma mudança separada e menor na mesma árvore de comandos.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- Rust
- Estrelas
- 32.3k
- Forks
- 2k
- Merge médio
- 16h 3min
- PRs com merge (30d)
- 1
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de googleworkspace/cli
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 80/100
googleworkspace/cli#984 ·
Mantenedores costumam responder em até 1 dia
-
Replace gemini with agyAberta
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 82/100
googleworkspace/cli#958 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
googleworkspace/cli#921 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 88/100
googleworkspace/cli#920 ·
Mantenedores costumam responder em até 1 dia
-
docs(gmail): the --draft tip prints a send command that fails (users.drafts.send --body)Talvez livre de novo Um pull request para esta issue foi fechado sem ser mesclado. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
googleworkspace/cli#914 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
Todas as issues de googleworkspace/cli
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
matrix-org/matrix-rust-sdk#7495 ·
Mantenedores costumam responder em até 1 dia
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
yantrikos/yantrik-os#1272 ·
Mantenedores costumam responder em até 1 dia
-
crate: spate-kafka priority: low tech-debt
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
Mantenedores costumam responder em até 1 dia
-
[Bug]: Executable check only looks at the "others" execute bit, so 0750 binaries are rejectedAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
Mantenedores costumam responder em até 1 dia
-
macOS 菜单栏托盘图标保留橙色,与系统单色图标风格不一致Talvez já em andamento @xhugoliu assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
YizhengWw/HachimoDock#56 · 1 comentário ·