Skip to content

✨ [FFL-2597] Feature Flags tab — OAuth sign-in (stacked PR 1 of 3) - #4913

Open
kellyw1806 wants to merge 1 commit into
mainfrom
kelly.wang/ffl-2597
Open

✨ [FFL-2597] Feature Flags tab — OAuth sign-in (stacked PR 1 of 3)#4913
kellyw1806 wants to merge 1 commit into
mainfrom
kelly.wang/ffl-2597

Conversation

@kellyw1806

@kellyw1806 kellyw1806 commented Jul 24, 2026

Copy link
Copy Markdown

Motivation

Part of the Feature Flags devtools integration (FFL-2591), split into a small stacked series for focused review. This PR is the OAuth foundation: sign in to Datadog. Browsing the catalog (#4916) and overriding flags (#4912) build on top.

Stack (review bottom-up)

PR Base What it adds
1 of 3 #4913 (this) · FFL-2597 main OAuth sign-in
2 of 3 #4916 · FFL-2858 ffl-2597 catalog browsing
3 of 3 #4912 · FFL-2596 ffl-2858 flag overrides

Changes

  • OAuth (authorization_code + PKCE, public client) against Datadog's first-party OAuth server; tokens stored in chrome.storage.session (cleared on session end, never persisted).
  • Feature Flags tab wired into the DevTools panel; connect screen + connection header; persisted flagsSite setting; identity manifest permission.
  • When connected, the tab shows the connection state; the catalog UI is added in ✨ [FFL-2858] Feature Flags tab — catalog browsing (stacked PR 2 of 3) #4916.

Demo

This is what all three stacked PRs look like working together:

Screen.Recording.2026-07-24.at.5.14.31.PM.mov

Checklist

  • Tested locally
  • Tested on staging
  • Added unit tests for this change (oauth.spec.tsgetFlagsApiHost).
  • Added e2e/integration tests for this change.
  • Updated documentation and/or relevant AGENTS.md file

@github-actions

github-actions Bot commented Jul 24, 2026

Copy link
Copy Markdown

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@cit-pr-commenter-54b7da

cit-pr-commenter-54b7da Bot commented Jul 24, 2026

Copy link
Copy Markdown

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum 179.09 KiB 179.09 KiB 0 B 0.00%
Rum Profiler 8.43 KiB 8.43 KiB 0 B 0.00%
Rum Recorder 21.12 KiB 21.12 KiB 0 B 0.00%
Logs 55.71 KiB 55.71 KiB 0 B 0.00%
Rum Salesforce N/A 137.07 KiB N/A N/A N/A
Rum Slim 137.06 KiB 137.06 KiB 0 B 0.00%
Worker 22.96 KiB 22.96 KiB 0 B 0.00%

@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Jul 24, 2026

Copy link
Copy Markdown

Pipelines  Tests

⚠️ Warnings

🚦 2 Pipeline jobs failed

DataDog/browser-sdk | e2e: [firefox-pinned]   View in Datadog   GitLab

DataDog/browser-sdk | e2e: [firefox]   View in Datadog   GitLab

ℹ️ Info

No other issues found (see more)

🧪 All tests passed
❄️ No new flaky tests detected

🔄 Datadog auto-retried 3 jobs - 0 passed on retry View in Datadog

🎯 Code Coverage (details)
Patch Coverage: 77.59%
Overall Coverage: 77.23% (+0.02%)

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 3414896 | Docs | Datadog PR Page | Give us feedback!

@kellyw1806

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

@kellyw1806
kellyw1806 requested a review from Copilot July 24, 2026 20:53
@kellyw1806

Copy link
Copy Markdown
Author

@codex review

This comment was marked as resolved.

@DataDog DataDog deleted a comment from chatgpt-codex-connector Bot Jul 24, 2026
@kellyw1806
kellyw1806 force-pushed the kelly.wang/ffl-2597 branch from 5375214 to bc5e1d9 Compare July 24, 2026 21:08
@kellyw1806 kellyw1806 changed the title ✨ [FFL-2597] Feature Flags tab — OAuth + catalog browsing (stacked PR 1 of 2) [FFL-2597] Feature Flags tab with OAuth + catalog fetch (stacked PR 1 of 2) Jul 24, 2026
@kellyw1806 kellyw1806 changed the title [FFL-2597] Feature Flags tab with OAuth + catalog fetch (stacked PR 1 of 2) ✨ [FFL-2597] Feature Flags tab with OAuth + catalog fetch (stacked PR 1 of 2) Jul 24, 2026
// chrome.storage.session (cleared when the browser session ends) — never persisted to disk.
// See FFL-2596 / the OAuth CLI client `13c94d15-067d-4263-a309-be4811141419` (staging).

const CLIENT_ID = '13c94d15-067d-4263-a309-be4811141419'

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.

Heads-up: this is the staging OAuth client only. Prod needs a per-site client map + a registered prod client — deliberately scoped out to FFL-2857. So this PR only works against datad0g.com today.

This comment was marked as resolved.

This comment was marked as resolved.

Comment thread developer-extension/src/panel/components/tabs/flagsTab/oauth.ts
@kellyw1806
kellyw1806 force-pushed the kelly.wang/ffl-2597 branch 2 times, most recently from 2e87cbc to 7b347cd Compare July 27, 2026 04:58
@kellyw1806 kellyw1806 changed the title ✨ [FFL-2597] Feature Flags tab with OAuth + catalog fetch (stacked PR 1 of 2) ✨ [FFL-2597] Feature Flags tab — OAuth sign-in (stacked PR 1 of 3) Jul 27, 2026
Comment thread developer-extension/src/panel/components/tabs/flagsTab/oauth.ts
@kellyw1806
kellyw1806 force-pushed the kelly.wang/ffl-2597 branch from 4d4f152 to 415b54b Compare July 27, 2026 19:28
@kellyw1806
kellyw1806 marked this pull request as ready for review July 27, 2026 20:08
@kellyw1806
kellyw1806 requested a review from a team as a code owner July 27, 2026 20:08
chatgpt-codex-connector[bot]

This comment was marked as resolved.

@kellyw1806
kellyw1806 force-pushed the kelly.wang/ffl-2597 branch from 415b54b to 4a0a996 Compare July 27, 2026 20:30
chatgpt-codex-connector[bot]

This comment was marked as resolved.

@kellyw1806
kellyw1806 force-pushed the kelly.wang/ffl-2597 branch from 4a0a996 to de6b4ea Compare July 27, 2026 20:40
chatgpt-codex-connector[bot]

This comment was marked as resolved.

@kellyw1806
kellyw1806 force-pushed the kelly.wang/ffl-2597 branch from de6b4ea to 9b5a9f3 Compare July 27, 2026 20:54
chatgpt-codex-connector[bot]

This comment was marked as resolved.

@sbarrio
sbarrio requested a review from thomas-lebeau July 28, 2026 07:06
Comment thread developer-extension/src/panel/components/tabs/flagsTab/connectScreen.tsx Outdated
// chrome.storage.session (cleared when the browser session ends) — never persisted to disk.
// See FFL-2596 / the OAuth CLI client `13c94d15-067d-4263-a309-be4811141419` (staging).

const CLIENT_ID = '13c94d15-067d-4263-a309-be4811141419'

This comment was marked as resolved.

Comment thread developer-extension/src/common/extension.types.ts Outdated
// chrome.storage.session (cleared when the browser session ends) — never persisted to disk.
// See FFL-2596 / the OAuth CLI client `13c94d15-067d-4263-a309-be4811141419` (staging).

const CLIENT_ID = '13c94d15-067d-4263-a309-be4811141419'

This comment was marked as resolved.

Comment thread developer-extension/src/panel/components/tabs/flagsTab/oauth.ts Outdated
Comment thread developer-extension/src/panel/components/tabs/flagsTab/oauth.ts
@kellyw1806
kellyw1806 force-pushed the kelly.wang/ffl-2597 branch from 9b5a9f3 to 6d5a341 Compare July 28, 2026 15:32
chatgpt-codex-connector[bot]

This comment was marked as resolved.

@kellyw1806
kellyw1806 force-pushed the kelly.wang/ffl-2597 branch from 6d5a341 to 4596d8b Compare July 28, 2026 16:29

@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: 4596d8b078

ℹ️ 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".

@kellyw1806
kellyw1806 force-pushed the kelly.wang/ffl-2597 branch from 4596d8b to a2d74a1 Compare July 28, 2026 17:19
chatgpt-codex-connector[bot]

This comment was marked as resolved.

@kellyw1806
kellyw1806 force-pushed the kelly.wang/ffl-2597 branch 2 times, most recently from 59a5aa6 to dbf0fe9 Compare July 28, 2026 18:46
@kellyw1806
kellyw1806 force-pushed the kelly.wang/ffl-2597 branch from dbf0fe9 to cf550d4 Compare July 28, 2026 21:30

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

ℹ️ 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 developer-extension/src/panel/components/tabs/flagsTab/oauth.ts
Comment thread developer-extension/src/panel/components/tabs/flagsTab/oauth.ts Outdated

@BeltranBulbarellaDD BeltranBulbarellaDD 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.

Overall it looks great. Just last set of comments and LGTM!

Comment thread developer-extension/src/panel/components/panel.tsx Outdated
Comment thread developer-extension/src/panel/components/tabs/flagsTab/connectScreen.tsx Outdated
Comment thread developer-extension/src/panel/components/tabs/flagsTab/oauth.ts
Comment thread developer-extension/src/panel/components/tabs/flagsTab/oauth.ts
}

export async function loadStoredTokens(): Promise<OAuthTokens | null> {
const result = await chrome.storage.session.get(TOKENS_STORAGE_KEY)

@BeltranBulbarellaDD BeltranBulbarellaDD Jul 29, 2026

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.

Edit:
Same thing as above.

// loginWithOAuth actually generated (so the state check passes and we exercise the domain check).
function mockChromeIdentity(makeRedirect: (params: { state: string }) => string) {
const previousChrome = (globalThis as any).chrome
;(globalThis as any).chrome = {

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.

Adds the Flags tab (gated behind datadogMode) with an OAuth authorization_code
+ PKCE sign-in against Datadog's first-party OAuth server, the connect screen,
and site handling. The selected site is validated against the js-core site
allowlist before building any OAuth/API host, and the callback domain is
checked against it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@BeltranBulbarellaDD BeltranBulbarellaDD 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.

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants