Skip to content

Omit OAuth client credentials from auth help text#1309

Merged
mscoutermarsh merged 2 commits into
mainfrom
cursor/auth-login-help-secrets-e3f0
Jul 23, 2026
Merged

Omit OAuth client credentials from auth help text#1309
mscoutermarsh merged 2 commits into
mainfrom
cursor/auth-login-help-secrets-e3f0

Conversation

@mscoutermarsh

@mscoutermarsh mscoutermarsh commented Jul 23, 2026

Copy link
Copy Markdown
Member

Summary

Fixes #1279.

pscale auth login --help (and the same flags on logout) printed the built-in --client-id and --client-secret defaults. Agents often scrape help into cloud context, which leaks those values and can trigger credential rotation policies.

Changes

  • Register --client-id / --client-secret with empty defaults so Cobra help no longer prints the built-in OAuth credentials.
  • Resolve to the built-in PlanetScale CLI OAuth app credentials at runtime when the flags are unset (login / logout).
  • Remove unused --client-id / --client-secret from auth check entirely.
  • Correct the --client-secret help string (previously said "client ID").
  • Regression tests assert help output does not contain the OAuth client ID or secret.

Test plan

  • go test ./internal/cmd/auth/
  • pscale auth login --help no longer shows client-id/secret defaults
  • Same for auth logout --help
  • auth check no longer defines those flags
Open in Web Open in Cursor 

pscale auth login/logout/check --help was printing the built-in
client-id and client-secret defaults, which agents often scrape into
cloud context. Keep the flags, but resolve the built-in values only at
runtime when the flags are unset.

Co-authored-by: Mike Coutermarsh <coutermarsh.mike@gmail.com>
@mscoutermarsh
mscoutermarsh marked this pull request as ready for review July 23, 2026 13:57
@mscoutermarsh
mscoutermarsh requested a review from a team as a code owner July 23, 2026 13:57
auth check never used --client-id or --client-secret; drop them
instead of registering empty placeholders.

Co-authored-by: Mike Coutermarsh <coutermarsh.mike@gmail.com>
}

cmd.Flags().StringVar(&clientID, "client-id", psauth.OAuthClientID, "The client ID for the PlanetScale CLI application.")
cmd.Flags().StringVar(&clientSecret, "client-secret", psauth.OAuthClientSecret, "The client ID for the PlanetScale CLI application")

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Flags are unused by this command, can be removed.

@mscoutermarsh
mscoutermarsh merged commit 924bb3a into main Jul 23, 2026
4 checks passed
@mscoutermarsh
mscoutermarsh deleted the cursor/auth-login-help-secrets-e3f0 branch July 23, 2026 14:04
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.

pscale auth login --help appears to output secrets

3 participants