File tree Expand file tree Collapse file tree
alerting/src/main/kotlin/org/opensearch/alerting Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ import org.opensearch.alerting.util.destinationmigration.sendNotification
2323import org.opensearch.alerting.util.isAllowed
2424import org.opensearch.alerting.util.isTestAction
2525import org.opensearch.alerting.util.use
26+ import org.opensearch.commons.ConfigConstants
2627import org.opensearch.commons.alerting.model.ActionRunResult
2728import org.opensearch.commons.alerting.model.Monitor
2829import org.opensearch.commons.alerting.model.MonitorRunResult
@@ -69,7 +70,10 @@ abstract class MonitorRunner {
6970 }
7071 if (! dryrun) {
7172 val client = monitorCtx.client
72- client!! .threadPool().threadContext.stashContext().use {
73+ val userStr = client!! .threadPool().threadContext
74+ .getTransient<String >(ConfigConstants .OPENSEARCH_SECURITY_USER_INFO_THREAD_CONTEXT )
75+ client.threadPool().threadContext.stashContext().use {
76+ client.threadPool().threadContext.putTransient(ConfigConstants .OPENSEARCH_SECURITY_USER_INFO_THREAD_CONTEXT , userStr)
7377 withClosableContext(
7478 InjectorContextElement (
7579 monitor.id,
You can’t perform that action at this time.
0 commit comments