Skip to content

feat(auth): expose OAuth scope contract#485

Closed
lkretvix wants to merge 1 commit into
DataDog:mainfrom
lkretvix:lucas.kretvix/pup-auth-scopes
Closed

feat(auth): expose OAuth scope contract#485
lkretvix wants to merge 1 commit into
DataDog:mainfrom
lkretvix:lucas.kretvix/pup-auth-scopes

Conversation

@lkretvix
Copy link
Copy Markdown

@lkretvix lkretvix commented May 9, 2026

What does this PR do?

Adds a machine-readable Pup auth scope contract for downstream consumers:

  • Introduces pup auth scopes --output=json.
  • Emits schema_version, the default pup auth login OAuth scopes, and source: "pup auth login" without requiring authentication or config loading.
  • Reuses the same default-scope helper for auth login and the new contract so they cannot drift silently.
  • Adds integration coverage for the JSON output and for rejecting non-JSON output.

Motivation

Bits needs to decide whether Pup is installed and, when available, request the same OAuth scope set Pup expects. A stable JSON command lets Bits feature-probe Pup directly instead of hard-coding or scraping CLI behavior.

Additional Notes

Validation performed:

  • cargo test auth_scopes_json
  • cargo test default_login_scopes_match_auth_scopes_contract
  • cargo test auth::types::tests::
  • cargo run -- auth scopes --output=json
  • cargo fmt --check
  • cargo clippy -- -D warnings
  • cargo test -- --test-threads=1

A parallel cargo test run exposed existing mock-base-url interference in five unrelated tests that attempted to call http://unused.local; each failed test passed when rerun individually, and the full suite passed with --test-threads=1.

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

Part of the Pup Agent Integration plan.

Comment thread CHANGELOG.md
Comment on lines +3 to +8
## Next release

- Add `pup auth scopes --output=json` to expose the default `pup auth login`
OAuth scope set without requiring authentication. The first compatible
version for Bits feature-probing will be the next release after `0.58.5`.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

remove the mention of bits here

@lkretvix lkretvix closed this May 10, 2026
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.

1 participant