Admin Users must be able to access all monitors #139#220
Admin Users must be able to access all monitors #139#220skkosuri-amzn merged 2 commits intoopensearch-project:mainfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## main #220 +/- ##
============================================
- Coverage 78.86% 78.77% -0.09%
Complexity 214 214
============================================
Files 172 173 +1
Lines 6964 6959 -5
Branches 908 912 +4
============================================
- Hits 5492 5482 -10
- Misses 987 993 +6
+ Partials 485 484 -1
Continue to review full report at Codecov.
|
alerting/src/main/kotlin/org/opensearch/alerting/transport/SecureTransportAction.kt
Show resolved
Hide resolved
|
|
||
| init { | ||
| clusterService.clusterSettings.addSettingsUpdateConsumer(AlertingSettings.FILTER_BY_BACKEND_ROLES) { filterByEnabled = it } | ||
| listenFilterBySettingChange(clusterService) |
There was a problem hiding this comment.
Since this is a method defined in an interface and is being used as an init, should we make the method final to prevent unexpected behavior or is the expectation that this method be overridden in the future for more complicated inheritance hierarchies of SecureTransportAction?
There was a problem hiding this comment.
I think this should be a var since this is a setting that can change overtime
There was a problem hiding this comment.
I cant make listenFilterBySettingChange final since it is in an interface.
There was a problem hiding this comment.
I don't think the AlertingSettings.FILTER_BY_BACKEND_ROLES will be changing too often.
If the user needs to specify that listener in the init manually for any child class anyway, it might be better to have them explicitly state it rather than leave listenFilterBySettingChange open to override since it could be misleading.
Alternatively, we could make the class abstract to make the method final. Just something to consider for longevity, I don't think it's a blocker to merge.
alerting/src/test/kotlin/org/opensearch/alerting/resthandler/SecureMonitorRestApiIT.kt
Show resolved
Hide resolved
opensearch-project#220) * Admin Users must be able to access all monitors opensearch-project#139 * Refactored
opensearch-project#220) * Admin Users must be able to access all monitors opensearch-project#139 * Refactored
* Update copyright notice (#222) Signed-off-by: Mohammad Qureshi <qreshi@amazon.com> * Admin Users must be able to access all monitors #139 (#220) * Admin Users must be able to access all monitors #139 * Refactored Co-authored-by: Mohammad Qureshi <47198598+qreshi@users.noreply.github.com> Co-authored-by: Sriram <59816283+skkosuri-amzn@users.noreply.github.com>
* Admin Users must be able to access all monitors #139 (#220) * Admin Users must be able to access all monitors #139 * Refactored * Update copyright notice (#222) Signed-off-by: Mohammad Qureshi <qreshi@amazon.com> Co-authored-by: Sriram <59816283+skkosuri-amzn@users.noreply.github.com> Co-authored-by: Mohammad Qureshi <47198598+qreshi@users.noreply.github.com>
* Cherry-pick commits to 1.x (#227) * Update copyright notice (#222) Signed-off-by: Mohammad Qureshi <qreshi@amazon.com> * Admin Users must be able to access all monitors #139 (#220) * Admin Users must be able to access all monitors #139 * Refactored Co-authored-by: Mohammad Qureshi <47198598+qreshi@users.noreply.github.com> Co-authored-by: Sriram <59816283+skkosuri-amzn@users.noreply.github.com> * Updates alerting version to 1.2 (#192) * Updates alerting version to 1.2 * Adds snapshot repo to the repository file Signed-off-by: Clay Downs <downsrob@amazon.com> * Update build to use public Maven repo (#184) Signed-off-by: Abbas Hussain <abbas_10690@yahoo.com> * Publish notification JARs checksums. (#196) * Publish notification JARs checksums. Signed-off-by: dblock <dblock@dblock.org> * Remove sonatype staging. Signed-off-by: dblock <dblock@dblock.org> * Updates testCompile mockito version to match OpenSearch changes (#204) Signed-off-by: Clay Downs <downsrob@amazon.com> * Update maven publication to include cksums. (#224) This change adds a task to publish to a local staging repo under build/ that includes cksums. It also updates build.sh to use this new task and copy the contents of the staging repo to the output directory. The maven publish plugin will not include these cksums when publishing to maven local but will when published to a separate folder. Signed-off-by: Marc Handalian <handalm@amazon.com> * Add release notes for 1.2.0.0 release (#225) * Create opensearch-alerting.release-notes-1.2.0.0.md Signed-off-by: Annie Lee <leeyun@amazon.com> * Update opensearch-alerting.release-notes-1.2.0.0.md * Update opensearch-alerting.release-notes-1.2.0.0.md * Add backwards compatibility tests (#199) * Initial commit for BWC tests Signed-off-by: Mohammad Qureshi <qreshi@amazon.com> * Update bwc test to check Monitor stats and add bwc tests to GitHub Actions Signed-off-by: Mohammad Qureshi <qreshi@amazon.com> * Use current version plugin bundle from build for bwc tests instead of manually uploading Signed-off-by: Mohammad Qureshi <qreshi@amazon.com> * Update mockito-core dependency to 3.12.4 to prevent conflict Signed-off-by: Mohammad Qureshi <qreshi@amazon.com> * Remove disabling security manager flag when running BWC tests Signed-off-by: Mohammad Qureshi <qreshi@amazon.com> Co-authored-by: Mohammad Qureshi <47198598+qreshi@users.noreply.github.com> Co-authored-by: Sriram <59816283+skkosuri-amzn@users.noreply.github.com> Co-authored-by: Clay Downs <89109232+downsrob@users.noreply.github.com> Co-authored-by: Abbas Hussain <abbashus@amazon.com> Co-authored-by: Daniel Doubrovkine (dB.) <dblock@dblock.org> Co-authored-by: Marc Handalian <handalm@amazon.com> Co-authored-by: Annie Lee <71157062+leeyun-amzn@users.noreply.github.com>
* Update copyright notice (opensearch-project#222) Signed-off-by: Mohammad Qureshi <qreshi@amazon.com> * Admin Users must be able to access all monitors opensearch-project#139 (opensearch-project#220) * Admin Users must be able to access all monitors opensearch-project#139 * Refactored Co-authored-by: Mohammad Qureshi <47198598+qreshi@users.noreply.github.com> Co-authored-by: Sriram <59816283+skkosuri-amzn@users.noreply.github.com> Signed-off-by: AWSHurneyt <hurneyt@amazon.com>
Issue #, if available:
#139
./gradlew :alerting:integTest -Dtests.rest.cluster=localhost:9200 -Dtests.cluster=localhost:9200 -Dtests.clustername=opensearch -Dhttps=true -Dsecurity=true -Duser=admin -Dpassword=admin.Description of changes:
#139
adminusers can access all monitors.CheckList:
[x] Commits are signed per the DCO using --signoff
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.