Skip to content

Support alternative security scope groups#3976

Merged
nolannbiron merged 4 commits intomainfrom
nolann/rnd-9168-render-openapi-oauth-scopes
Mar 2, 2026
Merged

Support alternative security scope groups#3976
nolannbiron merged 4 commits intomainfrom
nolann/rnd-9168-render-openapi-oauth-scopes

Conversation

@nolannbiron
Copy link
Member

@nolannbiron nolannbiron commented Feb 4, 2026

Demo:

CleanShot 2026-02-04 at 14 49 16@2x

@linear
Copy link

linear bot commented Feb 4, 2026

@changeset-bot
Copy link

changeset-bot bot commented Feb 4, 2026

⚠️ No Changeset found

Latest commit: 8d31267

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@argos-ci
Copy link

argos-ci bot commented Feb 4, 2026

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
customers-v2-cloudflare (Inspect) ✅ No changes detected - Mar 2, 2026, 11:10 AM
customers-v2-vercel (Inspect) ✅ No changes detected - Mar 2, 2026, 3:17 PM
v2-cloudflare (Inspect) ✅ No changes detected - Mar 2, 2026, 11:14 AM
v2-vercel (Inspect) ✅ No changes detected - Mar 2, 2026, 3:21 PM

@nolannbiron nolannbiron marked this pull request as ready for review March 2, 2026 08:24
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds support for displaying multiple alternative required-scope sets for a single security scheme group (i.e., OR’d scope requirements), improving how OpenAPI security requirements are represented in the React OpenAPI UI.

Changes:

  • Extend OperationSecurityInfo to carry scopeAlternatives and compute alternatives from securityRequirement entries.
  • Deduplicate/merge scopes per security scheme key when resolving an operation’s securities.
  • Update required-scopes UI (and CSS) to render multiple scope alternatives with an “or” separator.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
packages/react-openapi/src/utils.ts Groups security requirements and collects required-scope alternatives per security scheme group.
packages/react-openapi/src/resolveOpenAPIOperation.ts Resolves securities into a map to dedupe entries and merges scopes across occurrences.
packages/react-openapi/src/OpenAPIRequiredScopes.tsx Renders required scopes as a list of alternatives when multiple sets exist.
packages/gitbook/src/components/DocumentView/OpenAPI/style.css Adds styling for the new scope-alternatives layout.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@gregberge gregberge left a comment

Choose a reason for hiding this comment

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

Would be good to update GBX also.

@nolannbiron nolannbiron merged commit 8621c7f into main Mar 2, 2026
49 of 53 checks passed
@nolannbiron nolannbiron deleted the nolann/rnd-9168-render-openapi-oauth-scopes branch March 2, 2026 16:04
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