8000 Implement support for logical AND in security schemes by StarKhan6368 · Pull Request #1826 · specmatic/specmatic · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Implement support for logical AND in security schemes #1826

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

Merged
merged 14 commits into from
May 22, 2025

Conversation

StarKhan6368
Copy link
Contributor

What: Implement support for logical AND in security schemes

Why:

  • Previously, we only supported OR between the security schemes defined in the OAS.
  • However, a path can define multiple security schemes according to the OAS standards.

Sources:

Checklist:

  • Unit Tests
  • Build passing locally
  • Sonar Quality Gate
  • Security scans don't report any vulnerabilities
  • Documentation added/updated (share link)
  • Sample Project added/updated (share link)
  • Demo video (share link)
  • Article on Website (share link)
  • Roadmap updated (share link)
  • Conference Talk (share link)

Issue ID:
Closes: #932

- Represent `AND` relationship between securitySchemes in OAS
- Add simple tests for the same
- logical `AND` with multiple security-schemes is represented by
  CompositeSecurityScheme
- Add tests for the same
- Should send appropriate security-scheme values based on the OAS
- Mimics what isInRow does, but with HttpRequest instead
- Should only ignore failures if none of the schemes areIn request
- Add test for the same
- For composite logical AND/OR security schemes
- Only applicable to compositeScheme to check if all or any of
  sub-schemes are in a request
- To better handle multiple and composite schemes
@StarKhan6368 StarKhan6368 marked this pull request as ready for review May 16, 2025 20:02
schemeName to toSecurityScheme(schemeName, scheme)
}

val securitySchemesForRequestPattern = parseOperationSecuritySchemas(operation) { name ->
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not pass the securitySchemes directly instead of a function?

@joelrosario joelrosario merged commit 4e2b665 into main May 22, 2025
1 check passed
@joelrosario joelrosario deleted the composite-security-schemes branch May 22, 2025 12:17
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.

Secure schema not respected when generating test scenarios
2 participants
0