Skip to content

Enable OAuth on remaining API+App Key endpoints: 100% client-side coverage - #832

Merged
platinummonkey merged 2 commits into
DataDog:mainfrom
srosenthal-dd:stephen.rosenthal/oauth-exclusion-cleanup
Sep 16, 2026
Merged

platinummonkey merged 2 commits into
DataDog:mainfrom
srosenthal-dd:stephen.rosenthal/oauth-exclusion-cleanup

Conversation

@srosenthal-dd

@srosenthal-dd srosenthal-dd commented Sep 16, 2026

Copy link
Copy Markdown
Member

Summary

This gets pup to 100% OAuth support(*) on the client side! 🚀

With few exceptions, the general rule is that any API which accepts API+App Key should also accept OAuth. Submitting telemetry (POST events) and similar are exceptions where they'll only allow API keys (with no App Key).

I'm working on finishing up server-side OAuth support - we're at 90+% with a plan to get to ~100% in the next couple of weeks.

Changes

The OAUTH_EXCLUDED_ENDPOINTS table shrinks from 6 entries to 2: only POST /api/v1/events (API-key-only intake) and GET /api/v2/validate_keys (indefinite server-side exemption; validates the API+App key pair the caller holds) remain.

  • Removed the 5 stale entries: fleet unstable GETs (fleet-api now serves OAuth, dd-source#93561) and 4 Continuous Profiler paths (prof-gateway already accepts OAuth)
  • Documented the policy on the table: endpoints accepting API + App Key should also accept OAuth; prefer landing server-side OAuth over widening the table
  • Dropped the now-dead trailing-"/" prefix-match branch (both remaining entries are exact matches)
  • Replaced 15 per-family no-fallback tests with a table-equality test asserting the exact 2 entries, plus an exact-match test

Notes

Behavior change: pup api and raw helpers now send the OAuth bearer for fleet unstable GETs and profiling paths instead of forcing API+App key fallback. Typed commands already did.

The server caught up on both surfaces: fleet-api now serves
/api/unstable/fleet with RouteAuthn including ValidOAuthAccessToken
(dd-source#93561), and every Continuous Profiler endpoint on
prof-gateway accepts OAuth (the remaining exclusions predated
prof-gateway's OAuth rollout). Remove the five stale entries.

Add GET /api/v2/validate_keys as an indefinitely-excluded entry:
the endpoint validates the exact API+App key pair the caller holds,
so OAuth would defeat its purpose. It becomes the canonical example
exercising the both-keys fallback path in tests.
State the policy as general (API + App Key endpoints should also
accept OAuth) without claiming the list is known-complete — the
server-side rollout is still in progress.

Both remaining entries are exact matches, so drop the trailing-/
prefix-match branch, which no entry can exercise. Replace the 15
per-family no-fallback tests (~300 lines of point-in-time comments)
with a single table-equality test that fails on any deliberate or
incidental change to the exception list, plus an exact-match test.
@srosenthal-dd srosenthal-dd changed the title Drop stale OAuth exclusions for fleet and profiling; add validate_keys example Enable OAuth on remaining API+App Key endpoints: 100% client-side coverage Sep 16, 2026
@srosenthal-dd
srosenthal-dd marked this pull request as ready for review September 16, 2026 18:36
@srosenthal-dd
srosenthal-dd requested a review from a team as a code owner September 16, 2026 18:36
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 16, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-16T18:39:16.418610Z 02e65e8 Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@platinummonkey
platinummonkey merged commit 3b8bc9a into DataDog:main Sep 16, 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