Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

oas3-operation-security-defined scopes validation not using resolved securitySchemes #2617

Open
cuttingclyde opened this issue May 2, 2024 · 0 comments
Labels
p/medium t/bug Something isn't working triaged

Comments

@cuttingclyde
Copy link

cuttingclyde commented May 2, 2024

fdxapi.components.test.yaml.txt
fdxapi.tax.fails.yaml.txt
fdxapi.tax.passes.yaml.txt

Describe the bug
The oas3-operation-security-defined rule fires even though the referenced securityScheme contains the referenced scopes.

To Reproduce

  1. Given attached fdxapi.tax.fails.yaml OpenAPI document which references securitySchemes in attached fdxapi.components.test.yaml OpenAPI document
  2. Run the spectral:oas ruleset
  3. Which returns error:
 36:15  warning  oas3-operation-security-defined  "fdx:customerpersonal:read" must be listed among scopes.  paths./tax-forms.get.security[0].OAuthFapi1Advanced[0]
  1. Given attached fdxapi.tax.passes.yaml OpenAPI document which includes the full securitySchemes definition copied exactly from fdxapi.components.test.yaml
  2. Run the spectral:oas ruleset
  3. Which succeeds without firing the rule

Expected behavior
The original rule failure should not occur, since the referenced scope fdx:customerpersonal:read is defined in the referenced file's securitySchemes.

Environment (remove any that are not applicable):

  • OAS version: 3.1.0
  • Spectral version: 6.11.1
  • OS: Linux (BitBucket pipeline) and Windows 11 (Spectral CLI)
@mnaumanali94 mnaumanali94 added t/bug Something isn't working p/medium labels May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p/medium t/bug Something isn't working triaged
Projects
None yet
Development

No branches or pull requests

2 participants