Skip to content

[Backport 2.x] Use BytesRestResponse constructor with contentType in asRestResponse (#3717)#3722

Merged
peternied merged 3 commits intoopensearch-project:2.xfrom
cwperks:backport-3717-to-2.x
Nov 17, 2023
Merged

[Backport 2.x] Use BytesRestResponse constructor with contentType in asRestResponse (#3717)#3722
peternied merged 3 commits intoopensearch-project:2.xfrom
cwperks:backport-3717-to-2.x

Conversation

@cwperks
Copy link
Copy Markdown
Member

@cwperks cwperks commented Nov 16, 2023

Backport #3717 to 2.x

…pensearch-project#3717)

Modifies `SecurityResponse.asRestResponse` to use the corresponding
constructor for `BytesRestResponse` if the `SecurityResponse` contains
the content-type header. This adds a test that fails before the change
and demonstrates how using the constructor of BytesRestResponse without
content-type defaults to text/plain

---------

Signed-off-by: Craig Perkins <cwperx@amazon.com>
Signed-off-by: Stephen Crawford <steecraw@amazon.com>
Signed-off-by: Craig Perkins <craig5008@gmail.com>
Co-authored-by: Stephen Crawford <steecraw@amazon.com>
Co-authored-by: Stephen Crawford <65832608+scrawfor99@users.noreply.github.com>
(cherry picked from commit b7f47b1)
@cwperks cwperks changed the title Use BytesRestResponse constructor with contentType in asRestResponse (#3717) [Backport 2.x] Use BytesRestResponse constructor with contentType in asRestResponse (#3717) Nov 16, 2023
Signed-off-by: Craig Perkins <cwperx@amazon.com>
@codecov
Copy link
Copy Markdown

codecov bot commented Nov 16, 2023

Codecov Report

Merging #3722 (c92ad58) into 2.x (10c54eb) will increase coverage by 0.03%.
Report is 1 commits behind head on 2.x.
The diff coverage is 77.27%.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##                2.x    #3722      +/-   ##
============================================
+ Coverage     64.86%   64.89%   +0.03%     
- Complexity     3621     3633      +12     
============================================
  Files           285      285              
  Lines         20496    20525      +29     
  Branches       3382     3384       +2     
============================================
+ Hits          13294    13319      +25     
- Misses         5524     5528       +4     
  Partials       1678     1678              
Files Coverage Δ
...g/opensearch/security/filter/SecurityResponse.java 96.22% <100.00%> (+3.36%) ⬆️
...curity/securityconf/impl/AllowlistingSettings.java 77.77% <100.00%> (ø)
...curity/securityconf/impl/WhitelistingSettings.java 78.57% <100.00%> (ø)
...dlic/auth/http/saml/AuthTokenProcessorHandler.java 50.28% <50.00%> (ø)
.../org/opensearch/security/auth/BackendRegistry.java 62.54% <66.66%> (ø)
...opensearch/security/filter/SecurityRestFilter.java 69.23% <0.00%> (ø)
...ic/auth/http/kerberos/HTTPSpnegoAuthenticator.java 0.00% <0.00%> (ø)

... and 3 files with indirect coverage changes

willyborankin
willyborankin previously approved these changes Nov 16, 2023
Signed-off-by: Craig Perkins <cwperx@amazon.com>
@peternied peternied merged commit b7df32d into opensearch-project:2.x Nov 17, 2023
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.

3 participants