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

Improves Rest Layer Authz robustness #4879

Conversation

DarshitChanpura
Copy link
Member

Description

This PR improves the robustness of the path check when evaluating whether the path supports rest layer authorization.

  • Category : Enhancement

  • What is the old behavior before changes and new behavior after changes?
    The request will not be evaluated at REST layer if they were missing leading or trailing slashes since restPathMatches() function will filter them out. Post this fix the leading/trailing slashes will not determine whether the path matches, but the actual path will.

Testing

  • automated tests

Check List

  • New functionality includes testing
    - [ ] New functionality has been documented
    - [ ] New Roles/Permissions have a corresponding security dashboards plugin PR
    - [ ] API changes companion pull request created
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Copy link

codecov bot commented Nov 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.89%. Comparing base (1c898dc) to head (6108c30).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4879      +/-   ##
==========================================
- Coverage   69.90%   69.89%   -0.01%     
==========================================
  Files         320      320              
  Lines       21688    21690       +2     
  Branches     3460     3461       +1     
==========================================
+ Hits        15160    15161       +1     
- Misses       4734     4736       +2     
+ Partials     1794     1793       -1     
Files with missing lines Coverage Δ
...opensearch/security/filter/SecurityRestFilter.java 84.44% <100.00%> (+0.23%) ⬆️

... and 4 files with indirect coverage changes

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.

1 participant