Skip to content

Commit

Permalink
Troubleshooting user injection.
Browse files Browse the repository at this point in the history
Signed-off-by: AWSHurneyt <[email protected]>
  • Loading branch information
AWSHurneyt committed Jan 31, 2024
1 parent 883afe6 commit c3ab6f2
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,12 @@ class TransportGetRemoteIndexesAction @Inject constructor(
return
}

val userStr = client.threadPool().threadContext
.getTransient<String>(ConfigConstants.OPENSEARCH_SECURITY_USER_INFO_THREAD_CONTEXT)
log.info("hurneyt TransportGetRemoteIndexesAction::userStr = {}", userStr)

client.threadPool().threadContext.stashContext().use {
if (userStr.isNotEmpty()) client.threadPool().threadContext.putTransient(ConfigConstants.INJECTED_USER, userStr)
scope.launch {
val clusterIndexesList = mutableListOf<ClusterIndexes>()

Expand Down Expand Up @@ -164,12 +169,7 @@ class TransportGetRemoteIndexesAction @Inject constructor(
ResolveIndexAction.Request.DEFAULT_INDICES_OPTIONS
)

val userStr = client.threadPool().threadContext
.getTransient<String>(ConfigConstants.OPENSEARCH_SECURITY_USER_INFO_THREAD_CONTEXT)
log.info("hurneyt TransportGetRemoteIndexesAction::userStr = {}", userStr)

return client.suspendUntil {
if (userStr.isNotEmpty()) threadPool().threadContext.putTransient(ConfigConstants.INJECTED_USER, userStr)
// TODO hurneyt: return aliases as well
admin().indices().resolveIndex(resolveRequest, it)
}
Expand Down

0 comments on commit c3ab6f2

Please sign in to comment.