opensearch-project / security-dashboards-plugin

🔐 Manage your internal users, roles, access control, and audit logs from OpenSearch Dashboards
https://opensearch.org/docs/latest/security-plugin/index/
Apache License 2.0
70 stars 152 forks source link

Add fix for data source disabled plugin should work #1916

Closed derek-ho closed 5 months ago

derek-ho commented 5 months ago

Description

While testing the plugin when MDS is turned off, I noticed a few pages were not working. This was because after the refactor done in #1888, we started enforcing datasourceId as a mandator parameter to all APIs. I noticed that a reason why this may have not been caught is because the existing cypress tests for MDS turned off did not do any check that the API call went through, only that a component did not show up. This fixes the code to work when MDS is turned off, and also adds a cypress test to assert this behavior on a tab that broke but was fixed with this PR.

Category

Bug Fix

Why these changes are required?

Bug introduced by #1888 in which MDS turned off breaks a few Security dashboard plugin features

What is the old behavior before changes and new behavior after changes?

When MDS is turned off the security dashboards plugin still functions

Issues Resolved

Fix: #1918 , Fix: #1917

Testing

[Please provide details of testing done: unit testing, integration testing and manual testing]

Check List

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. For more information on following Developer Certificate of Origin and signing off your commits, please check here.

cwperks commented 5 months ago

@derek-ho Can you please fill out the description?

derek-ho commented 5 months ago

@derek-ho Can you please fill out the description?

Updated

codecov[bot] commented 5 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 69.59%. Comparing base (67397ec) to head (c6d8b34).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1916 +/- ## ========================================== - Coverage 69.60% 69.59% -0.02% ========================================== Files 96 96 Lines 2481 2480 -1 Branches 339 333 -6 ========================================== - Hits 1727 1726 -1 Misses 673 673 Partials 81 81 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.