Read --json from stdin or a file, so request bodies stay out of process arguments

Open
#952 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
68/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
rust
Domain
cli, security

Research direction

Start at the CLI argument handling for --json and --params, then reproduce the calendar command with stdin and a file input. Check how current JSON arguments are parsed and how CLI tests cover request bodies. Done means - reads stdin, @path reads a file, existing inline input still works, and request contents no longer appear in process arguments.

Written by the indexing model from the issue text.

Description

Request bodies go in --json '<string>', so while the command runs, whatever is in them shows to every user on the machine through ps or /proc/<pid>/cmdline. For a calendar event that's the title, the description and the guest emails.

Could --json (and ideally --params) accept - to read from stdin, or @path to read a file, like curl's -d @file?

gws calendar events insert --params '{"calendarId": "primary"}' --json - < event.json

Context: I maintain an Omarchy calendar plugin that creates and edits events through gws, and a marketplace security review flagged this. I checked 0.13.2 and the changelog up to 0.22.5 and couldn't find a way around it, only the modelarmor helper reads stdin. If that approach works for you I can open a PR.

Dominant language
Rust
Stars
32.3k
Forks
2k
Avg merge
16h 3m
Merged PRs (30d)
1

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from googleworkspace/cli

All issues in googleworkspace/cli

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.