Skip to content

feat(providers): agent-powered oauth2 scope discovery#5701

Merged
hassan254-prog merged 23 commits into
masterfrom
wari/scopes-list-poc
Apr 15, 2026
Merged

feat(providers): agent-powered oauth2 scope discovery#5701
hassan254-prog merged 23 commits into
masterfrom
wari/scopes-list-poc

Conversation

@hassan254-prog
Copy link
Copy Markdown
Contributor

@hassan254-prog hassan254-prog commented Mar 25, 2026

Describe the problem and your solution

  • This pr introduces an automated pipeline to maintain a catalogue of oauth2 scopes for every provider in Nango, and surfaces them as a searchable dropdown in the scopes input UI.

feat(providers): OAuth2 scope catalog pipeline with API exposure and scope-picker UI

This PR introduces a full provider-scope catalog system centered on a new packages/providers/providers.scopes.yaml dataset and a large new automation script at scripts/validation/providers/sync-scopes.ts. The script supports deterministic and agent-driven modes, batch processing, duplicate-key/YAML sanitization, comment preservation, fallback to default_scopes, validation guards, and CI check/write flows. It is wired into CI via test:providers:scopes, monthly automated sync in .github/workflows/sync-provider-scopes.yaml, and updates in .github/workflows/validation.yaml.

On the product side, provider APIs now include availableScopes through updates in packages/types/lib/providers/api.ts, packages/server/lib/formatters/provider.ts, and provider controllers. The web UI scope input was substantially refactored in packages/webapp/src/components-v2/ScopesInput.tsx to a chips+combobox interaction using new packages/webapp/src/components-v2/ui/combobox.tsx, with searchable suggestions, dedupe, paste/comma/enter parsing, and copy support, and integrated into OAuthCreateForm.


This summary was automatically generated by @propel-code-bot

@hassan254-prog hassan254-prog self-assigned this Mar 25, 2026
propel-code-bot[bot]

This comment was marked as outdated.

propel-code-bot[bot]

This comment was marked as outdated.

propel-code-bot[bot]

This comment was marked as outdated.

propel-code-bot[bot]

This comment was marked as outdated.

propel-code-bot[bot]

This comment was marked as outdated.

@hassan254-prog hassan254-prog changed the title feat(scopes): list scopes using an agent feat(providers): agent-powered oauth2 scope discovery Mar 25, 2026
Comment thread packages/providers/providers.scopes.yaml
propel-code-bot[bot]

This comment was marked as outdated.

@hassan254-prog hassan254-prog requested a review from a team March 25, 2026 21:35
Copy link
Copy Markdown
Collaborator

@TBonnin TBonnin left a comment

Choose a reason for hiding this comment

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

I am not against leveraging llms but I open the generated yaml, click on the first link (brex docs) and it gave me a 404. I then checked a random provider (docusign) and there are some scopes missing. Maybe I was super unlucky but doesn't make me super confident.
One can argue it is better than having nothing but it is also a giant pile of data that we are gonna need to maintain

Comment thread packages/providers/lib/index.ts Outdated
Comment thread packages/providers/lib/index.ts Outdated
Comment thread scripts/validation/providers/sync-scopes.ts Outdated
Comment thread scripts/validation/providers/sync-scopes.ts
@linear
Copy link
Copy Markdown

linear Bot commented Mar 27, 2026

Comment thread packages/providers/lib/index.ts Outdated
propel-code-bot[bot]

This comment was marked as outdated.

propel-code-bot[bot]

This comment was marked as outdated.

@hassan254-prog
Copy link
Copy Markdown
Contributor Author

I am not against leveraging llms but I open the generated yaml, click on the first link (brex docs) and it gave me a 404. I then checked a random provider (docusign) and there are some scopes missing. Maybe I was super unlucky but doesn't make me super confident. One can argue it is better than having nothing but it is also a giant pile of data that we are gonna need to maintain

Yes, I agree, it’s better than having nothing. We will also mention in the docs how we obtain this list to keep it transparent with our customers. I believe that, at the start, the list is not 💯 correct, but over time it will continue to improve through iterative updates run on a monthly basis.

propel-code-bot[bot]

This comment was marked as outdated.

@hassan254-prog hassan254-prog requested a review from TBonnin April 1, 2026 14:51
@hassan254-prog hassan254-prog marked this pull request as ready for review April 10, 2026 13:21
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

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: 3572ef377c

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread scripts/validation/providers/sync-scopes.ts
@hassan254-prog hassan254-prog marked this pull request as draft April 13, 2026 14:55
@hassan254-prog hassan254-prog marked this pull request as ready for review April 14, 2026 06:51
@hassan254-prog hassan254-prog requested a review from kaposke April 14, 2026 06:58
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

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: 18871bb68a

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread scripts/validation/providers/sync-scopes.ts
Comment thread scripts/validation/providers/sync-scopes.ts
Copy link
Copy Markdown
Contributor

@kaposke kaposke left a comment

Choose a reason for hiding this comment

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

[Review of the webapp changes]
I really like the new scopes component, works super well!

Just a few requests on component usage and icon sizing.

And I feel like the "add " item could scroll with the rest of the list like Bastien mentioned (unless you tried and it doesn't feel good?)
Image

Comment thread packages/webapp/src/components-v2/ScopesInput.tsx
Comment thread packages/webapp/src/components-v2/ScopesInput.tsx Outdated
Comment thread packages/webapp/src/components-v2/ScopesInput.tsx
Comment thread packages/webapp/src/components-v2/ScopesInput.tsx Outdated
Comment thread packages/webapp/src/components-v2/ScopesInput.tsx Outdated
Comment thread packages/webapp/src/components-v2/ScopesInput.tsx Outdated
Comment thread packages/webapp/src/components-v2/ScopesInput.tsx Outdated
Comment thread packages/webapp/src/components-v2/ScopesInput.tsx Outdated
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

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: 18b3df0342

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread scripts/validation/providers/sync-scopes.ts
@hassan254-prog
Copy link
Copy Markdown
Contributor Author

I’ve updated the “Add” item to scroll with the rest. I initially thought anchoring it at the top looked better, but we can revisit this later if needed.

@hassan254-prog hassan254-prog requested a review from kaposke April 14, 2026 18:28
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

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: edfd6272f5

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread scripts/validation/providers/sync-scopes.ts Outdated
</Tooltip>
<Tooltip>
<TooltipTrigger asChild>
<Button type="button" size="icon" variant="ghost" onClick={() => void deleteAllScopes()}>
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.

I don't think you need this type="button" everywhere?

Suggested change
<Button type="button" size="icon" variant="ghost" onClick={() => void deleteAllScopes()}>
<Button size="icon" variant="ghost" onClick={() => void deleteAllScopes()}>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The default type for this button is "submit", without type="button", clicking this button would trigger form submission.

@hassan254-prog hassan254-prog added this pull request to the merge queue Apr 15, 2026
Merged via the queue into master with commit 3afeaa3 Apr 15, 2026
23 checks passed
@hassan254-prog hassan254-prog deleted the wari/scopes-list-poc branch April 15, 2026 08:33
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.

4 participants