From 5632adb8773d96648211133592c2d9e5b3644c76 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 26 Nov 2023 01:20:28 +0000 Subject: [PATCH] fix workflow security tests in alerting (#1310) Signed-off-by: Subhobrata Dey (cherry picked from commit 32718e8c3e23ff5057b586780002eac44242c7fc) Signed-off-by: github-actions[bot] --- .../opensearch/alerting/resthandler/SecureWorkflowRestApiIT.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/alerting/src/test/kotlin/org/opensearch/alerting/resthandler/SecureWorkflowRestApiIT.kt b/alerting/src/test/kotlin/org/opensearch/alerting/resthandler/SecureWorkflowRestApiIT.kt index 1c838aaeb..6d0112c52 100644 --- a/alerting/src/test/kotlin/org/opensearch/alerting/resthandler/SecureWorkflowRestApiIT.kt +++ b/alerting/src/test/kotlin/org/opensearch/alerting/resthandler/SecureWorkflowRestApiIT.kt @@ -394,6 +394,7 @@ class SecureWorkflowRestApiIT : AlertingRestTestCase() { assertEquals("Get workflow failed", RestStatus.FORBIDDEN.status, e.response.statusLine.statusCode) } finally { deleteRoleAndRoleMapping(TEST_HR_ROLE) + deleteRoleMapping(ALERTING_FULL_ACCESS_ROLE) deleteUser(getUser) getUserClient?.close() } @@ -444,6 +445,7 @@ class SecureWorkflowRestApiIT : AlertingRestTestCase() { } catch (e: ResponseException) { assertEquals("Create workflow failed", RestStatus.FORBIDDEN.status, e.response.statusLine.statusCode) } finally { + deleteRoleMapping(ALERTING_FULL_ACCESS_ROLE) deleteUser(userWithDifferentRole) userWithDifferentRoleClient?.close() } @@ -1101,6 +1103,7 @@ class SecureWorkflowRestApiIT : AlertingRestTestCase() { assertEquals("Delete workflow failed", RestStatus.OK, response?.restStatus()) } finally { deleteRoleAndRoleMapping(TEST_HR_ROLE) + deleteRoleMapping(ALERTING_FULL_ACCESS_ROLE) deleteUser(deleteUser) deleteUserClient?.close() }