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

[Cleanup] Remove duplication in Netty4HttpRequestHeaderVerifier #3506

Merged

Conversation

cwperks
Copy link
Member

@cwperks cwperks commented Oct 9, 2023

Description

This PR removes some duplication in the Netty4HttpRequestHeaderVerifier around the /_plugins/_security/api/authtoken endpoint and also abstracts the logic for where authentication is skipped into helper methods.

  • Category (Enhancement, New feature, Bug fix, Test fix, Refactoring, Maintenance, Documentation)

Maintenance

Check List

  • New functionality includes testing
  • New functionality has been documented
  • 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.

Signed-off-by: Craig Perkins <craig5008@gmail.com>
@codecov
Copy link

codecov bot commented Oct 9, 2023

Codecov Report

Merging #3506 (7ba265c) into main (904a966) will decrease coverage by 0.16%.
The diff coverage is 60.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##               main    #3506      +/-   ##
============================================
- Coverage     65.03%   64.87%   -0.16%     
+ Complexity     3642     3639       -3     
============================================
  Files           282      282              
  Lines         20597    20595       -2     
  Branches       3390     3388       -2     
============================================
- Hits          13395    13361      -34     
- Misses         5519     5560      +41     
+ Partials       1683     1674       -9     
Files Coverage Δ
...rg/opensearch/security/filter/SecurityRequest.java 100.00% <ø> (ø)
...opensearch/security/filter/SecurityRestFilter.java 69.23% <100.00%> (+0.29%) ⬆️
.../opensearch/security/filter/SecurityRestUtils.java 90.90% <100.00%> (+10.90%) ⬆️
...sl/http/netty/Netty4HttpRequestHeaderVerifier.java 85.36% <100.00%> (+4.97%) ⬆️
...rity/filter/SecurityRequestChannelUnsupported.java 0.00% <0.00%> (ø)
...zon/dlic/auth/http/saml/HTTPSamlAuthenticator.java 67.36% <0.00%> (-1.09%) ⬇️

... and 3 files with indirect coverage changes

Signed-off-by: Craig Perkins <cwperx@amazon.com>
@cwperks cwperks force-pushed the header-verifier-cleanup branch from 92c94a6 to 2f6019b Compare October 9, 2023 13:27
@DarshitChanpura
Copy link
Member

@cwperks Should this be marked ready for review?

Signed-off-by: Craig Perkins <cwperx@amazon.com>
Signed-off-by: Craig Perkins <cwperx@amazon.com>
Signed-off-by: Craig Perkins <cwperx@amazon.com>
willyborankin
willyborankin previously approved these changes Oct 16, 2023
peternied
peternied previously approved these changes Oct 16, 2023
@cwperks cwperks added the backport 2.x backport to 2.x branch label Oct 18, 2023
@DarshitChanpura DarshitChanpura merged commit 900d9d5 into opensearch-project:main Oct 18, 2023
opensearch-trigger-bot bot pushed a commit that referenced this pull request Oct 18, 2023
Removes some duplication in the Netty4HttpRequestHeaderVerifier
around the `/_plugins/_security/api/authtoken` endpoint and also
abstracts the logic for where authentication is skipped into helper
methods.

Signed-off-by: Craig Perkins <craig5008@gmail.com>
Signed-off-by: Craig Perkins <cwperx@amazon.com>
(cherry picked from commit 900d9d5)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
cwperks pushed a commit that referenced this pull request Oct 18, 2023
…rVerifier (#3564)

Backport 900d9d5 from #3506.

Signed-off-by: Craig Perkins <craig5008@gmail.com>
Signed-off-by: Craig Perkins <cwperx@amazon.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x backport to 2.x branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants