Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add additional backend roles test cases #300

Open
adityaj1107 opened this issue Feb 3, 2022 · 7 comments
Open

Add additional backend roles test cases #300

adityaj1107 opened this issue Feb 3, 2022 · 7 comments
Labels
enhancement New feature or request

Comments

@adityaj1107
Copy link
Contributor

adityaj1107 commented Feb 3, 2022

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: #219

@lezzago
Copy link
Member

lezzago commented Feb 8, 2022

Add trimIndent to the entities
Ref to the file this started from: https://github.com/opensearch-project/alerting/pull/303/files#r801173359

@adityaj1107
Copy link
Contributor Author

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

@qreshi
Copy link
Contributor

qreshi commented Mar 8, 2022

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.

@lezzago
Copy link
Member

lezzago commented Mar 8, 2022

It seems like the integ tests are flaky

@lezzago
Copy link
Member

lezzago commented Mar 8, 2022

It seems like the integ tests are flaky

This could be due to the security docker image

getsaurabh02 added a commit to getsaurabh02/alerting that referenced this issue Mar 10, 2022
… to unblock build process.

Signed-off-by: Saurabh Singh <[email protected]>
getsaurabh02 added a commit to getsaurabh02/alerting that referenced this issue Mar 10, 2022
… to unblock build process.

Signed-off-by: Saurabh Singh <[email protected]>
getsaurabh02 added a commit that referenced this issue Mar 10, 2022
* Commented out flaky test in favor of known issue #300 to unblock build process.

Signed-off-by: Saurabh Singh <[email protected]>

* Commenting out another test

Signed-off-by: Aditya Jindal <[email protected]>

Co-authored-by: Saurabh Singh <[email protected]>
Co-authored-by: Aditya Jindal <[email protected]>
getsaurabh02 added a commit to getsaurabh02/alerting that referenced this issue Mar 10, 2022
…ensearch-project#331)

* Commented out flaky test in favor of known issue opensearch-project#300 to unblock build process.

Signed-off-by: Saurabh Singh <[email protected]>

* Commenting out another test

Signed-off-by: Aditya Jindal <[email protected]>

Co-authored-by: Saurabh Singh <[email protected]>
Co-authored-by: Aditya Jindal <[email protected]>
adityaj1107 added a commit that referenced this issue Mar 10, 2022
…) (#332)

* Commented out flaky test in favor of known issue #300 to unblock build process.

Signed-off-by: Saurabh Singh <[email protected]>

* Commenting out another test

Signed-off-by: Aditya Jindal <[email protected]>

Co-authored-by: Saurabh Singh <[email protected]>
Co-authored-by: Aditya Jindal <[email protected]>

Co-authored-by: Saurabh Singh <[email protected]>
Co-authored-by: Aditya Jindal <[email protected]>
getsaurabh02 added a commit to getsaurabh02/alerting that referenced this issue Mar 10, 2022
…ensearch-project#331) (opensearch-project#332)

* Commented out flaky test in favor of known issue opensearch-project#300 to unblock build process.

Signed-off-by: Saurabh Singh <[email protected]>

* Commenting out another test

Signed-off-by: Aditya Jindal <[email protected]>

Co-authored-by: Saurabh Singh <[email protected]>
Co-authored-by: Aditya Jindal <[email protected]>

Co-authored-by: Saurabh Singh <[email protected]>
Co-authored-by: Aditya Jindal <[email protected]>
getsaurabh02 added a commit that referenced this issue Mar 10, 2022
…) (#332) (#333)

* Commented out flaky test in favor of known issue #300 to unblock build process.

Signed-off-by: Saurabh Singh <[email protected]>

* Commenting out another test

Signed-off-by: Aditya Jindal <[email protected]>

Co-authored-by: Saurabh Singh <[email protected]>
Co-authored-by: Aditya Jindal <[email protected]>

Co-authored-by: Saurabh Singh <[email protected]>
Co-authored-by: Aditya Jindal <[email protected]>

Co-authored-by: Saurabh Singh <[email protected]>
Co-authored-by: Aditya Jindal <[email protected]>
AWSHurneyt pushed a commit to AWSHurneyt/OpenSearch-Alerting that referenced this issue Mar 11, 2022
…ensearch-project#331) (opensearch-project#332) (opensearch-project#333)

* Commented out flaky test in favor of known issue opensearch-project#300 to unblock build process.

Signed-off-by: Saurabh Singh <[email protected]>

* Commenting out another test

Signed-off-by: Aditya Jindal <[email protected]>

Co-authored-by: Saurabh Singh <[email protected]>
Co-authored-by: Aditya Jindal <[email protected]>

Co-authored-by: Saurabh Singh <[email protected]>
Co-authored-by: Aditya Jindal <[email protected]>

Co-authored-by: Saurabh Singh <[email protected]>
Co-authored-by: Aditya Jindal <[email protected]>
AWSHurneyt added a commit that referenced this issue Mar 11, 2022
* Add 1.2.4.0 release notes (#282)

* Add 1.2.4.0 release notes

Signed-off-by: Ashish Agrawal <[email protected]>

* Commented out flaky test in favor of known issue to unblock build (#331) (#332) (#333)

* Commented out flaky test in favor of known issue #300 to unblock build process.

Signed-off-by: Saurabh Singh <[email protected]>

* Commenting out another test

Signed-off-by: Aditya Jindal <[email protected]>

Co-authored-by: Saurabh Singh <[email protected]>
Co-authored-by: Aditya Jindal <[email protected]>

Co-authored-by: Saurabh Singh <[email protected]>
Co-authored-by: Aditya Jindal <[email protected]>

Co-authored-by: Saurabh Singh <[email protected]>
Co-authored-by: Aditya Jindal <[email protected]>

* Cherry-picking commits for 1.3 release from main to 1.x (#345)

* Added support for JDK 8 and 14. (#335)

* Added support for JDK 8 and 14.

Signed-off-by: AWSHurneyt <[email protected]>

* Added support for JDK 8 and 14.

Signed-off-by: AWSHurneyt <[email protected]>

* Added 1.3 release notes. (#336)

* Added 1.3 release notes.

Signed-off-by: AWSHurneyt <[email protected]>

* Added 1.3 release notes.

Signed-off-by: AWSHurneyt <[email protected]>

* Add backport and auto delete workflow (#339)

Signed-off-by: Annie Lee <[email protected]>

* Implemented support for ClusterMetrics monitors (#221) (#342)

* Implemented support for LocalUriInput monitors.

Signed-off-by: AWSHurneyt <[email protected]>

* Refactored feature naming convention from LocalUriInput to ClusterMetricsInput. Added Cluster Metrics as a new monitor type to align with frontend experience.

Signed-off-by: AWSHurneyt <[email protected]>

* Fixed ktlint errors.

Signed-off-by: AWSHurneyt <[email protected]>

* Implemented randomClusterMetricsMonitor test helper, and refactored tests accordingly.

Signed-off-by: AWSHurneyt <[email protected]>

* Renamed some assets to align with the new name for this feature.

Signed-off-by: AWSHurneyt <[email protected]>

* Refactored cluster metrics feature to remove support for Cat repositories API.

Signed-off-by: AWSHurneyt <[email protected]>

* Refactored supported JSON payload to return all response fields.

Signed-off-by: AWSHurneyt <[email protected]>

* Refactored nodes stats request object to return all metrics.

Signed-off-by: AWSHurneyt <[email protected]>

* Refactored nodes stats request object to return all metrics.

Signed-off-by: AWSHurneyt <[email protected]>

* Removing unused connectionTimeout and socketTimeout params.

Signed-off-by: AWSHurneyt <[email protected]>

* Added cluster metrics monitor to release notes. (#343)

* Added 1.3 release notes.

Signed-off-by: AWSHurneyt <[email protected]>

* Added 1.3 release notes.

Signed-off-by: AWSHurneyt <[email protected]>

* Added cluster metrics monitor to release notes.

Signed-off-by: AWSHurneyt <[email protected]>

* Updated DEVELOPER_GUIDE.md and workflows to reference changes to the supported JDKs. (#338)

* Added support for JDK 8 and 14.

Signed-off-by: AWSHurneyt <[email protected]>

* Added support for JDK 8 and 14.

Signed-off-by: AWSHurneyt <[email protected]>

* Updated DEVELOPER_GUIDE.md to reference changes to the supported JDKs.

Signed-off-by: AWSHurneyt <[email protected]>

* Added additional release note.

Signed-off-by: AWSHurneyt <[email protected]>

* Updated DEVELOPER_GUIDE.md to reference changes to the supported JDKs.

Signed-off-by: AWSHurneyt <[email protected]>

* Updated DEVELOPER_GUIDE.md to reference changes to the supported JDKs.

Signed-off-by: AWSHurneyt <[email protected]>

* Updated workflows to build using JDK 11.

Signed-off-by: AWSHurneyt <[email protected]>

* Removing redundant JDK setup step.

Signed-off-by: AWSHurneyt <[email protected]>

* Fixed guide wording.

Signed-off-by: AWSHurneyt <[email protected]>

* Fixed guide wording.

Signed-off-by: AWSHurneyt <[email protected]>

* Reverted bwc workflow JDK.

Signed-off-by: AWSHurneyt <[email protected]>

Co-authored-by: Annie Lee <[email protected]>

Co-authored-by: Ashish Agrawal <[email protected]>
Co-authored-by: Saurabh Singh <[email protected]>
Co-authored-by: Saurabh Singh <[email protected]>
Co-authored-by: Aditya Jindal <[email protected]>
Co-authored-by: Annie Lee <[email protected]>
AWSHurneyt pushed a commit to AWSHurneyt/OpenSearch-Alerting that referenced this issue Mar 30, 2022
…ensearch-project#331) (opensearch-project#332)

* Commented out flaky test in favor of known issue opensearch-project#300 to unblock build process.

Signed-off-by: Saurabh Singh <[email protected]>

* Commenting out another test

Signed-off-by: Aditya Jindal <[email protected]>

Co-authored-by: Saurabh Singh <[email protected]>
Co-authored-by: Aditya Jindal <[email protected]>

Co-authored-by: Saurabh Singh <[email protected]>
Co-authored-by: Aditya Jindal <[email protected]>
Signed-off-by: AWSHurneyt <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants