Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import org.opensearch.alerting.util.destinationmigration.sendNotification
import org.opensearch.alerting.util.isAllowed
import org.opensearch.alerting.util.isTestAction
import org.opensearch.client.node.NodeClient
import org.opensearch.commons.ConfigConstants
import org.opensearch.commons.alerting.model.ActionRunResult
import org.opensearch.commons.alerting.model.Monitor
import org.opensearch.commons.alerting.model.MonitorRunResult
Expand Down Expand Up @@ -68,7 +69,10 @@ abstract class MonitorRunner {
}
if (!dryrun) {
val client = monitorCtx.client
client!!.threadPool().threadContext.stashContext().use {
val userStr = client!!.threadPool().threadContext
.getTransient<String>(ConfigConstants.OPENSEARCH_SECURITY_USER_INFO_THREAD_CONTEXT)
client.threadPool().threadContext.stashContext().use {
client.threadPool().threadContext.putTransient(ConfigConstants.OPENSEARCH_SECURITY_USER_INFO_THREAD_CONTEXT, userStr)
withClosableContext(
InjectorContextElement(
monitor.id,
Expand Down
Loading