Skip to content

Commit

Permalink
Adding user context.
Browse files Browse the repository at this point in the history
Signed-off-by: AWSHurneyt <[email protected]>
  • Loading branch information
AWSHurneyt committed Jan 25, 2024
1 parent b284919 commit 2ec34d0
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import org.opensearch.cluster.service.ClusterService
import org.opensearch.common.inject.Inject
import org.opensearch.common.settings.Settings
import org.opensearch.common.xcontent.XContentType
import org.opensearch.commons.ConfigConstants
import org.opensearch.commons.alerting.util.string
import org.opensearch.core.xcontent.NamedXContentRegistry
import org.opensearch.core.xcontent.ToXContent
Expand Down Expand Up @@ -81,6 +82,9 @@ class TransportGetRemoteIndexesAction @Inject constructor(
}

client.threadPool().threadContext.stashContext().use {
val userStr = client.threadPool().threadContext
.getTransient<String>(ConfigConstants.OPENSEARCH_SECURITY_USER_INFO_THREAD_CONTEXT)
client.threadPool().threadContext.putTransient(ConfigConstants.OPENSEARCH_SECURITY_USER_INFO_THREAD_CONTEXT, userStr)
scope.launch {
val clusterIndexesList = mutableListOf<ClusterIndexes>()

Expand Down

0 comments on commit 2ec34d0

Please sign in to comment.