Skip to content

datasets: send OAuth bearer token, document user_access_manage scope requirement | DAL-548 - #691

Merged
platinummonkey merged 2 commits into
DataDog:mainfrom
srosenthal-dd:stephen.rosenthal/datasets-oauth-support
Jul 29, 2026
Merged

datasets: send OAuth bearer token, document user_access_manage scope requirement | DAL-548#691
platinummonkey merged 2 commits into
DataDog:mainfrom
srosenthal-dd:stephen.rosenthal/datasets-oauth-support

Conversation

@srosenthal-dd

@srosenthal-dd srosenthal-dd commented Jul 28, 2026

Copy link
Copy Markdown
Member

Summary

  • Flip pup datasets {list,get,create,update,delete} from make_api_no_auth! to make_api! so the OAuth bearer is actually sent.
  • Document in the command help text that all 5 operations require user_access_manage, which is not requested by default -- mirrors the existing logs-restriction precedent (pup auth login --extra-scopes user_access_manage).

Why not just add the scope to defaults?

user_access_manage is deliberately excluded from pup's default/read-only scope lists (same as for logs-restriction writes) since it's broad and sensitive. This PR sends the token when present and lets users opt in explicitly, rather than changing that policy.

Test plan

  • cargo test datasets passes
  • CI passes
  • Manually verify pup datasets list works with pup auth login --extra-scopes user_access_manage

Jira: DAL-548

…requirement

All 5 dataset operations require the user_access_manage scope server-side,
which is not requested by default. Flip from make_api_no_auth! to make_api!
so the OAuth bearer is actually sent, and document the --extra-scopes
opt-in in the command help text, mirroring the existing logs-restriction
pattern.
@srosenthal-dd
srosenthal-dd marked this pull request as ready for review July 29, 2026 05:12
@srosenthal-dd
srosenthal-dd requested a review from a team as a code owner July 29, 2026 05:12

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 93dd0847f0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/commands/datasets.rs
@srosenthal-dd
srosenthal-dd marked this pull request as draft July 29, 2026 05:19
@srosenthal-dd
srosenthal-dd marked this pull request as ready for review July 29, 2026 05:20

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 93dd0847f0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/commands/datasets.rs
Existing tests used an all-defaults test_config with no access_token, so
the make_api_no_auth! -> make_api! change wasn't exercised by any test.
@platinummonkey
platinummonkey merged commit 7cff361 into DataDog:main Jul 29, 2026
6 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.

2 participants