Skip to content

chore(setup): announce disk writes during GitHub device-code sign-in#4

Merged
DevelopmentCats merged 1 commit into
mainfrom
cat/setup-notify-disk-writes
Jun 25, 2026
Merged

chore(setup): announce disk writes during GitHub device-code sign-in#4
DevelopmentCats merged 1 commit into
mainfrom
cat/setup-notify-disk-writes

Conversation

@DevelopmentCats

@DevelopmentCats DevelopmentCats commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Changes

The two device-code scripts write five files during first-user setup — a cookie jar, the device-code env file, a transient HTTP response file, and the Coder URL plus admin session token under $CODER_CONFIG_DIR — without ever announcing it. This adds one stderr echo before each write naming the destination path. Paths only, no secret values, stdout protocol unchanged so the calling agent still parses cat "$DEV_FILE" and coder whoami the same way.

The echo before the poll loop runs once, outside the loop, so the "don't echo inside the polling loop" rule in references/first-user-github-device.md still holds.

make lint is green.

Why this was needed

coder/coder-skill-scanner flagged eight SQP-2 (writes sensitive data without notification) findings on coder/setup, but the real reason is just that any install script writing a token to disk should say so out loud.

This PR was prepared with help from Coder Agents.

The two device-code scripts (github-device-fetch.sh, github-device-poll.sh) write five files to disk during the OAuth sign-in flow: a cookie jar carrying OAuth state, a state env file holding the device + user codes, a transient HTTP response file, and the Coder admin URL and session token under $CODER_CONFIG_DIR. None of the writes were announced to the user.

Adds one short stderr echo before each write naming the destination path. No secret values are echoed; only the file paths. Behaviour and stdout protocol are unchanged - the calling agent still parses the env file (fetch) and 'coder whoami' / 'coder users list' (poll) from stdout.

Why this matters: static analysis on the registry skills (coder/coder-skill-scanner) flags 'writes sensitive data without explicit user notification' on these scripts. The user-facing improvement (clearer install-time logging) is the actual reason; the analyzer is just the prompt that surfaced it. The skill's SKILL.md guidance against echoing secrets is respected (paths only, no token or cookie values).

Verified: 'make lint' green (shellcheck, shfmt, markdownlint, jq, claude plugin validate, emdash, SKILL.md description length).
Copilot AI review requested due to automatic review settings June 25, 2026 13:52

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds stderr-only logging to the GitHub device-code sign-in setup scripts to explicitly notify users/agents of on-disk writes (cookie jar, device-code env file, polling response capture file, and Coder CLI config files) without changing stdout behavior or exposing secret values.

Changes:

  • Log (to stderr) where the GitHub OAuth cookie jar and device-code parameters env file are written during the “fetch” step.
  • Log (to stderr) where polling responses are captured, and where the Coder CLI URL/session files are written during the “poll” step.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
skills/setup/scripts/github-device-fetch.sh Adds stderr echo lines announcing cookie jar and device env file writes.
skills/setup/scripts/github-device-poll.sh Adds stderr echo lines announcing response capture and Coder CLI config file writes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@DevelopmentCats DevelopmentCats merged commit 0ecba14 into main Jun 25, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants