Skip to content

fix(oas): allow bearer scopes on operations in OpenAPI 3.1#2962

Open
slegarraga wants to merge 1 commit into
stoplightio:developfrom
slegarraga:fix/oas31-bearer-security-scopes
Open

fix(oas): allow bearer scopes on operations in OpenAPI 3.1#2962
slegarraga wants to merge 1 commit into
stoplightio:developfrom
slegarraga:fix/oas31-bearer-security-scopes

Conversation

@slegarraga
Copy link
Copy Markdown
Contributor

Summary

Fixes false positives from oas3-operation-security-defined when OpenAPI 3.1 documents use type: http + scheme: bearer with operation-level scopes that are not declared on the security scheme (per OAS 3.1 security requirement semantics).

Changes

Test plan

  • yarn jest packages/rulesets/src/oas/__tests__/oas3-operation-security-defined.test.ts

Closes #2643

Made with Cursor

@slegarraga
Copy link
Copy Markdown
Contributor Author

Closes #2643 — OAS 3.1 allows operation-level bearer scopes without scheme-level scope definitions.

Test: oas3.1: bearer http scopes on operation without scheme-level scopes (errors: []).

Pair with #2961 for batch review if helpful (@tomek-tursa-sb). Mergeable, Wiz ✅.

@slegarraga
Copy link
Copy Markdown
Contributor Author

See batch review note on #2961 — closes #2643, MERGEABLE, jest 5/5 on .

OAS 3.1 permits scope lists on http bearer security requirements
without defining those scopes on the security scheme. Skip scope
validation for bearer schemes when the document is OpenAPI 3.1+.

Fixes stoplightio#2643
@slegarraga slegarraga force-pushed the fix/oas31-bearer-security-scopes branch from dc0d18f to 997f718 Compare May 22, 2026 14:09
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.

OAS 3.1 Security Schemes Relax "Scope" definition requirements - Updated Function/Rule ?

1 participant