Updated APIs to match other clients and opensearch openapi spec (#502)
Signed-off-by: saimedhi <[email protected]>
This commit is contained in:
@@ -164,3 +164,55 @@ class TestSecurityPlugin(TestCase):
|
||||
# Try fetching the user
|
||||
with self.assertRaises(NotFoundError):
|
||||
response = self.client.security.get_user(self.USER_NAME)
|
||||
|
||||
def test_health_check(self):
|
||||
response = self.client.security.health_check()
|
||||
self.assertNotIn("errors", response)
|
||||
self.assertEqual("UP", response.get("status"))
|
||||
|
||||
def test_health(self):
|
||||
response = self.client.security.health()
|
||||
self.assertNotIn("errors", response)
|
||||
self.assertEqual("UP", response.get("status"))
|
||||
|
||||
AUDIT_CONFIG_SETTINGS = {
|
||||
"enabled": True,
|
||||
"audit": {
|
||||
"ignore_users": [],
|
||||
"ignore_requests": [],
|
||||
"disabled_rest_categories": ["AUTHENTICATED", "GRANTED_PRIVILEGES"],
|
||||
"disabled_transport_categories": ["AUTHENTICATED", "GRANTED_PRIVILEGES"],
|
||||
"log_request_body": False,
|
||||
"resolve_indices": False,
|
||||
"resolve_bulk_requests": False,
|
||||
"exclude_sensitive_headers": True,
|
||||
"enable_transport": False,
|
||||
"enable_rest": True,
|
||||
},
|
||||
"compliance": {
|
||||
"enabled": True,
|
||||
"write_log_diffs": False,
|
||||
"read_watched_fields": {},
|
||||
"read_ignore_users": [],
|
||||
"write_watched_indices": [],
|
||||
"write_ignore_users": [],
|
||||
"read_metadata_only": True,
|
||||
"write_metadata_only": True,
|
||||
"external_config": False,
|
||||
"internal_config": True,
|
||||
},
|
||||
}
|
||||
|
||||
def test_update_audit_config(self):
|
||||
response = self.client.security.update_audit_config(
|
||||
body=self.AUDIT_CONFIG_SETTINGS
|
||||
)
|
||||
self.assertNotIn("errors", response)
|
||||
self.assertEqual("OK", response.get("status"))
|
||||
|
||||
def test_update_audit_configuration(self):
|
||||
response = self.client.security.update_audit_configuration(
|
||||
body=self.AUDIT_CONFIG_SETTINGS
|
||||
)
|
||||
self.assertNotIn("errors", response)
|
||||
self.assertEqual("OK", response.get("status"))
|
||||
|
||||
Reference in New Issue
Block a user