From 44345b93cab98a3b1a854d4502568ec245ee70d9 Mon Sep 17 00:00:00 2001 From: Anantha Krishna Bhatta Date: Tue, 1 Dec 2020 16:17:58 -0800 Subject: [PATCH] Using common-utils for Security plugin transient thread context key --- reports-scheduler/build.gradle | 2 +- .../reportsscheduler/action/PluginBaseAction.kt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/reports-scheduler/build.gradle b/reports-scheduler/build.gradle index daf701e6..28d5891d 100644 --- a/reports-scheduler/build.gradle +++ b/reports-scheduler/build.gradle @@ -124,7 +124,7 @@ dependencies { compile "org.jetbrains.kotlin:kotlin-stdlib:${kotlin_version}" compile "org.jetbrains.kotlin:kotlin-stdlib-common:${kotlin_version}" compile "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9" - compile "${group}:common-utils:${opendistroVersion}.1" + compile "${group}:common-utils:${opendistroVersion}.2" compileOnly "${group}:opendistro-job-scheduler-spi:${opendistroVersion}.0" compile group: 'com.google.guava', name: 'guava', version: '15.0' testImplementation( diff --git a/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/action/PluginBaseAction.kt b/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/action/PluginBaseAction.kt index 05b6287f..c24240fa 100644 --- a/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/action/PluginBaseAction.kt +++ b/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/action/PluginBaseAction.kt @@ -16,6 +16,7 @@ package com.amazon.opendistroforelasticsearch.reportsscheduler.action +import com.amazon.opendistroforelasticsearch.commons.ConfigConstants.OPENDISTRO_SECURITY_USER_INFO_THREAD_CONTEXT import com.amazon.opendistroforelasticsearch.commons.authuser.User import com.amazon.opendistroforelasticsearch.reportsscheduler.ReportsSchedulerPlugin.Companion.LOG_PREFIX import com.amazon.opendistroforelasticsearch.reportsscheduler.util.logger @@ -49,7 +50,6 @@ abstract class PluginBaseAction ) { - val userStr: String? = client.threadPool().threadContext.getTransient(OPENDISTRO_SECURITY_USER_AND_ROLES) + val userStr: String? = client.threadPool().threadContext.getTransient(OPENDISTRO_SECURITY_USER_INFO_THREAD_CONTEXT) val user: User? = User.parse(userStr) scope.launch { try {