Skip to content

Commit e66c644

Browse files
committed
Fix security plugin health API compatibility with OpenSearch 3.2.0+
Add Settings field to HealthResp struct to handle security plugin configuration settings returned in the health API response. The settings field contains security-related configuration like cache TTL settings. Fixes test failures where the settings field was being dropped during JSON unmarshalling, causing jsondiff mismatches in OpenSearch 3.2.0+. Signed-off-by: Sean Chittenden <sean.chittenden@crowdstrike.com>
1 parent 4b3928e commit e66c644

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
1919
- Fix indices stats API compatibility with OpenSearch 3.2.0+ by adding max_last_index_request_timestamp and startree query fields
2020
- Fix cat APIs compatibility with OpenSearch 3.2.0+ by adding indexing timestamp and startree query fields
2121
- Fix floating point precision loss in nodes stats concurrent_avg_slice_count field by changing from float32 to float64
22+
- Fix security plugin health API compatibility with OpenSearch 3.2.0+ by adding settings field
2223

2324
### Security
2425

plugins/security/api_health.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,10 @@ func (r HealthReq) GetRequest() (*http.Request, error) {
4848

4949
// HealthResp represents the returned struct of the health get response
5050
type HealthResp struct {
51-
Message *string `json:"message"`
52-
Mode string `json:"mode"`
53-
Status string `json:"status"`
51+
Message *string `json:"message"`
52+
Mode string `json:"mode"`
53+
Status string `json:"status"`
54+
Settings map[string]interface{} `json:"settings"` // Available in OpenSearch 3.2.0+
5455
response *opensearch.Response
5556
}
5657

0 commit comments

Comments
 (0)