Skip to content

fix(auth): return auth status as a single JSON object - #851

Merged
platinummonkey merged 1 commit into
mainfrom
fix/auth-status-json
Sep 28, 2026
Merged

platinummonkey merged 1 commit into
mainfrom
fix/auth-status-json

Conversation

@platinummonkey

Copy link
Copy Markdown
Collaborator

What does this PR do?

pup auth status now prints a single JSON object. The human-readable line (for example ⚠️ Token expired for site: datadoghq.com) is included as status_message, immediately after status, so JSON formatters can color the whole response.

Motivation

A text line before the JSON document kept auto-formatting from coloring the status output. Callers still get the same message, inside the JSON payload.

Additional Notes

Applies to stored OAuth tokens and to API-key / bearer / unauthenticated status. A valid OAuth token reports remaining time in status_message (Token expires in: …) instead of a second stderr line.

Checklist

  • The code change follows the project conventions (see CONTRIBUTING.md)
  • Tests have been added/updated (if applicable)
  • Documentation has been updated (if applicable)
  • All CI checks pass
  • Code coverage is maintained or improved

Related Issues

Made with Cursor

Move the human-readable status line into status_message so stdout is
one JSON document and formatters can color it.

Co-authored-by: Cursor <cursoragent@cursor.com>
@platinummonkey
platinummonkey requested a review from a team as a code owner September 22, 2026 19:29

@datadog-datadog-prod-us1 datadog-datadog-prod-us1 Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Bits Code Review: PASS

More details

Each authentication path returns one JSON document with status_message next to status. No reportable failure is present.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit 5e9dc23 · @DataDog review to ask questions

@platinummonkey
platinummonkey merged commit ec3a738 into main Sep 28, 2026
6 checks passed
@platinummonkey
platinummonkey deleted the fix/auth-status-json branch September 28, 2026 13:56
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.

2 participants