Skip to content

pup: remove stale OAuth-excluded endpoints for fleet, cost/billing, and CCM - #762

Merged
platinummonkey merged 7 commits into
DataDog:mainfrom
srosenthal-dd:stephen.rosenthal/oauth-cleanup-excluded
Aug 27, 2026
Merged

pup: remove stale OAuth-excluded endpoints for fleet, cost/billing, and CCM#762
platinummonkey merged 7 commits into
DataDog:mainfrom
srosenthal-dd:stephen.rosenthal/oauth-cleanup-excluded

Conversation

@srosenthal-dd

@srosenthal-dd srosenthal-dd commented Aug 25, 2026

Copy link
Copy Markdown
Member

Summary

Remove 32 stale entries from OAUTH_EXCLUDED_ENDPOINTS (src/raw_client.rs) whose server-side routes already accept OAuth: Fleet Automation v2 routes (15, since 2026-06-04), Cost/Billing (3, DAL-959), Cloud Cost Management config (14, DAL-959). This table only affects raw_get/raw_post (pup api passthrough and hand-written commands) -- no live pup command uses raw_get/raw_post for any of these paths today, so this only changes pup api passthrough behavior.

Note: this doesn't close pup's fleet OAuth gap. fleet.rs's commands call /api/unstable/fleet/*, not the /api/v2/fleet/* paths covered here, and that surface still deliberately excludes OAuth (DAL-509, separate issue).

Also removes the brittle test_oauth_excluded_count assertion.

Remaining excluded entries (8)

…nd CCM

Remove 32 entries from OAUTH_EXCLUDED_ENDPOINTS for endpoint groups
whose server-side routes already accept OAuth:

- Fleet Automation (15): v2 routes already have ValidOAuthAccessToken
- Cost/Billing (3): server already accepts OAuth (DAL-959)
- Cloud Cost Management config (14): server already accepts OAuth (DAL-959)

Also remove the brittle OAUTH_EXCLUDED_ENDPOINTS count assertion
(test_oauth_excluded_count) which was prone to merge conflicts and
tested no actual behavior. Update test_requires_api_key_fallback_fleet
to test_no_fallback_for_fleet, and switch the
test_other_oauth_excluded_endpoints example from Fleet to Profiling
(which remains excluded).

Remaining excluded entries (8): DDSQL editor (3, handled by DataDog#756),
Profiling (4, no OAuth scope), Events intake (1, SDK codegen issue).
@datadog-official

This comment has been minimized.

Three tests used /api/v2/fleet/agents as their OAuth-excluded example,
but fleet entries were removed from OAUTH_EXCLUDED_ENDPOINTS in this
PR. Switch all three to use /profiling/api/v1/profiles/abc/info which
is still excluded:

- test_prefix_matching_with_id (raw_client.rs)
- test_api_oauth_excluded_uses_api_keys (api.rs)
- test_api_absolute_url_oauth_excluded_uses_api_keys (api.rs)
Add a fake /api/v2/test-oauth-excluded/ entry to OAUTH_EXCLUDED_ENDPOINTS
that exists only for tests needing a "still excluded" example. This
avoids churn when real endpoints (e.g. profiling) gain OAuth support
and are removed from the excluded list.

Update test_prefix_matching_with_id, test_other_oauth_excluded_endpoints,
test_api_oauth_excluded_uses_api_keys, and test_api_absolute_url_oauth_excluded
to use the test fixture instead of profiling or fleet paths.

Also fixes the CI failure where api.rs tests used /profiling/ paths that
didn't work with run()'s /api/ path prefix prepending.
@srosenthal-dd
srosenthal-dd marked this pull request as ready for review August 25, 2026 19:49
@srosenthal-dd
srosenthal-dd requested a review from a team as a code owner August 25, 2026 19:49

@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: a3df23e121

ℹ️ 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/raw_client.rs
Comment thread src/raw_client.rs
platinummonkey
platinummonkey previously approved these changes Aug 26, 2026
…th-cleanup-excluded

# Conflicts:
#	src/raw_client.rs

@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: 6308c1cb13

ℹ️ 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/raw_client.rs Outdated
Addresses codex review: no test proved /api/v2/usage/* and
/api/v2/cost/* requests use the OAuth bearer instead of falling back
to API/application keys, matching the existing fleet coverage.
Addresses codex review: the exclusion table gates real pup api
passthrough requests, so a fake path there is live production
behavior, not just test fixture. Swap it for the unstable Fleet
surface (DAL-509), which is a real, currently-excluded route --
current status, not a permanent contract, and expected to be deleted
once DAL-509 ships OAuth support there.
Drop the Jira reference and shorten the explanation.
@platinummonkey
platinummonkey merged commit 58d3c28 into DataDog:main Aug 27, 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