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

fix: allow empty security requirements #4018

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

tofran
Copy link
Contributor

@tofran tofran commented Feb 19, 2025

Sorry this was supposed to be created in draft mode. Will remove this message and make it ready to review when pending topics are resolved.

Closes #4016

Made the implementation of resolve_security is a little naive and readable, see if you like it.

For discussion:

If I have an App or Router with security and for a specific route, set an empty security, should it override the global policy? This would mean dropping the security from the previous layer.

What if the route wants to add a new one instead of overriding? I think these topics need to be addressed before closing the issue.

@tofran tofran requested review from a team as code owners February 19, 2025 20:53
@github-actions github-actions bot added area/openapi This PR involves changes to the OpenAPI schema area/private-api This PR involves changes to the privatized API size: small type/bug pr/external Triage Required 🏥 This requires triage labels Feb 19, 2025
Copy link

codecov bot commented Feb 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.35%. Comparing base (6768845) to head (cf3be16).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4018   +/-   ##
=======================================
  Coverage   98.35%   98.35%           
=======================================
  Files         347      347           
  Lines       15783    15786    +3     
  Branches     1745     1746    +1     
=======================================
+ Hits        15523    15526    +3     
  Misses        124      124           
  Partials      136      136           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

Documentation preview will be available shortly at https://litestar-org.github.io/litestar-docs-preview/4018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/openapi This PR involves changes to the OpenAPI schema area/private-api This PR involves changes to the privatized API area/router pr/external size: small Triage Required 🏥 This requires triage type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: routes and routers cannot override OpenAPI security requirement
1 participant