diff --git a/x-pack/platform/plugins/private/reindex_service/server/src/lib/reindex_service.test.ts b/x-pack/platform/plugins/private/reindex_service/server/src/lib/reindex_service.test.ts index 6bf1a1b8807b4..f17625605c348 100644 --- a/x-pack/platform/plugins/private/reindex_service/server/src/lib/reindex_service.test.ts +++ b/x-pack/platform/plugins/private/reindex_service/server/src/lib/reindex_service.test.ts @@ -110,10 +110,6 @@ describe('reindexService', () => { allow_restricted_indices: true, privileges: ['all'], }, - { - names: ['.tasks'], - privileges: ['read'], - }, ], }); }); diff --git a/x-pack/platform/plugins/private/reindex_service/server/src/lib/reindex_service.ts b/x-pack/platform/plugins/private/reindex_service/server/src/lib/reindex_service.ts index 428586bd494c8..f76ff0237fdef 100644 --- a/x-pack/platform/plugins/private/reindex_service/server/src/lib/reindex_service.ts +++ b/x-pack/platform/plugins/private/reindex_service/server/src/lib/reindex_service.ts @@ -543,10 +543,6 @@ export const reindexServiceFactory = ( allow_restricted_indices: true, privileges: ['all'], }, - { - names: ['.tasks'], - privileges: ['read'], - }, ], }); diff --git a/x-pack/platform/plugins/private/reindex_service/server/src/lib/reindex_service_wrapper.ts b/x-pack/platform/plugins/private/reindex_service/server/src/lib/reindex_service_wrapper.ts index e8900e7deeb3a..a912c5fd8865d 100644 --- a/x-pack/platform/plugins/private/reindex_service/server/src/lib/reindex_service_wrapper.ts +++ b/x-pack/platform/plugins/private/reindex_service/server/src/lib/reindex_service_wrapper.ts @@ -34,7 +34,6 @@ import type { import type { ReindexSavedObject } from './types'; export interface ReindexServiceScopedClientArgs { - savedObjects: SavedObjectsClientContract; dataClient: IScopedClusterClient; request: KibanaRequest; } @@ -74,6 +73,7 @@ export class ReindexServiceWrapper { logger: Logger; licensing: LicensingPluginStart; security: SecurityPluginStart; + soClient: SavedObjectsClientContract; version: Version; }; @@ -91,6 +91,7 @@ export class ReindexServiceWrapper { logger, licensing, security, + soClient, version, }; @@ -116,10 +117,13 @@ export class ReindexServiceWrapper { public getScopedClient({ dataClient, request, - savedObjects, }: ReindexServiceScopedClientArgs): ReindexServiceScopedClient { const callAsCurrentUser = dataClient.asCurrentUser; - const reindexActions = reindexActionsFactory(savedObjects, callAsCurrentUser, this.deps.logger); + const reindexActions = reindexActionsFactory( + this.deps.soClient, + callAsCurrentUser, + this.deps.logger + ); const reindexService = reindexServiceFactory( callAsCurrentUser, reindexActions, diff --git a/x-pack/platform/plugins/private/reindex_service/server/src/routes/batch_reindex_indices.ts b/x-pack/platform/plugins/private/reindex_service/server/src/routes/batch_reindex_indices.ts index f532589d94cfd..18b63663db7b4 100644 --- a/x-pack/platform/plugins/private/reindex_service/server/src/routes/batch_reindex_indices.ts +++ b/x-pack/platform/plugins/private/reindex_service/server/src/routes/batch_reindex_indices.ts @@ -8,7 +8,6 @@ import { schema } from '@kbn/config-schema'; import { errors } from '@elastic/elasticsearch'; import { handleEsError } from '@kbn/es-ui-shared-plugin/server'; -import { REINDEX_OP_TYPE } from '@kbn/upgrade-assistant-pkg-server'; import { REINDEX_SERVICE_BASE_PATH } from '../../../common'; import type { RouteDependencies } from '../../types'; import { mapAnyErrorToKibanaHttpResponse } from './map_any_error_to_kibana_http_response'; @@ -33,13 +32,10 @@ export function registerBatchReindexIndicesRoutes({ async ({ core }, request, response) => { const { elasticsearch: { client: esClient }, - savedObjects, } = await core; - const { getClient } = savedObjects; try { const reindexService = (await getReindexService()).getScopedClient({ - savedObjects: getClient({ includedHiddenTypes: [REINDEX_OP_TYPE] }), dataClient: esClient, request, }); @@ -74,13 +70,11 @@ export function registerBatchReindexIndicesRoutes({ }, async ({ core }, request, response) => { const { - savedObjects: { getClient }, elasticsearch: { client: esClient }, } = await core; const { indices } = request.body; const reindexService = (await getReindexService()).getScopedClient({ - savedObjects: getClient({ includedHiddenTypes: [REINDEX_OP_TYPE] }), dataClient: esClient, request, }); diff --git a/x-pack/platform/plugins/private/reindex_service/server/src/routes/reindex_indices.ts b/x-pack/platform/plugins/private/reindex_service/server/src/routes/reindex_indices.ts index 29c3871206ae5..b99f34180c53b 100644 --- a/x-pack/platform/plugins/private/reindex_service/server/src/routes/reindex_indices.ts +++ b/x-pack/platform/plugins/private/reindex_service/server/src/routes/reindex_indices.ts @@ -8,7 +8,6 @@ import { schema } from '@kbn/config-schema'; import { errors } from '@elastic/elasticsearch'; import { handleEsError } from '@kbn/es-ui-shared-plugin/server'; -import { REINDEX_OP_TYPE } from '@kbn/upgrade-assistant-pkg-server'; import { REINDEX_SERVICE_BASE_PATH } from '../../../common'; import type { RouteDependencies } from '../../types'; import { mapAnyErrorToKibanaHttpResponse } from './map_any_error_to_kibana_http_response'; @@ -53,7 +52,6 @@ export function registerReindexIndicesRoutes({ router, getReindexService }: Rout }, async ({ core }, request, response) => { const { - savedObjects: { getClient }, elasticsearch: { client: esClient }, } = await core; @@ -63,7 +61,6 @@ export function registerReindexIndicesRoutes({ router, getReindexService }: Rout try { const reindexService = (await getReindexService()).getScopedClient({ - savedObjects: getClient({ includedHiddenTypes: [REINDEX_OP_TYPE] }), dataClient: esClient, request, }); @@ -103,15 +100,12 @@ export function registerReindexIndicesRoutes({ router, getReindexService }: Rout }, async ({ core }, request, response) => { const { - savedObjects, elasticsearch: { client: esClient }, } = await core; - const { getClient } = savedObjects; const { indexName } = request.params; try { const reindexService = (await getReindexService()).getScopedClient({ - savedObjects: getClient({ includedHiddenTypes: [REINDEX_OP_TYPE] }), dataClient: esClient, request, }); @@ -147,15 +141,12 @@ export function registerReindexIndicesRoutes({ router, getReindexService }: Rout }, async ({ core }, request, response) => { const { - savedObjects, elasticsearch: { client: esClient }, } = await core; const { indexName } = request.params; - const { getClient } = savedObjects; try { const reindexService = (await getReindexService()).getScopedClient({ - savedObjects: getClient({ includedHiddenTypes: [REINDEX_OP_TYPE] }), dataClient: esClient, request, });