Open adityaj1107 opened 2 years ago
Add trimIndent
to the entities
Ref to the file this started from: https://github.com/opensearch-project/alerting/pull/303/files#r801173359
Add the test cases for the no_access
role.
Ref:
Additional References:
Future Improvements:
We will need to create test scenarios for cross roles accesses for backend roles which we are not validating currently. Breaking tests into smaller more logical grouping (classes).
See if we can leverage OpenSearchIntegTestCase and create abstraction to run integration tests against a JVM private OpenSearch Cluster.
cc: @getsaurabh02
Security tests are failing due to a recent change to the assertions and the recommendation is to revert the assertion check back (example run: https://github.com/opensearch-project/alerting/runs/5401010692?check_suite_focus=true)
Current failing assertion:
} catch (e: AssertionError) {
assertEquals("Unexpected status", "Expected 403 FORBIDDEN response", e.message)
}
Old passing assertion:
} catch (e: ResponseException) {
assertEquals("Unexpected status", RestStatus.FORBIDDEN, e.response.restStatus())
}
The reason this wasn't caught when the changes themselves were introduced was because the OpenSearch 1.3.0 snapshot distribution that is used to run these tests was failing for the last couple weeks until recently due to some security plugin bug.
It seems like the integ tests are flaky
It seems like the integ tests are flaky
This could be due to the security docker image
Describe the solution you'd like We can add additional backend role test cases for the alerting plugin to test fine grained access control via security plugin. We can find more information on backend roles here:
Reference: https://github.com/opensearch-project/alerting/issues/219