diff --git a/config/opensearch_dashboards.yml b/config/opensearch_dashboards.yml index 40d643b014fd..67ff5a3d45a1 100644 --- a/config/opensearch_dashboards.yml +++ b/config/opensearch_dashboards.yml @@ -34,11 +34,11 @@ # opensearchDashboards.configIndex: ".opensearch_dashboards_config" # Set the value of this setting to true to enable plugin application config. By default it is disabled. -# application_config.enabled: false +application_config.enabled: true # Set the value of this setting to true to enable plugin CSP handler. By default it is disabled. # It requires the application config plugin as its dependency. -# csp_handler.enabled: false +csp_handler.enabled: true # The default application to load. #opensearchDashboards.defaultAppId: "home" diff --git a/src/plugins/application_config/server/routes/index.ts b/src/plugins/application_config/server/routes/index.ts index b6ec638e1aa9..87b6a98b9b45 100644 --- a/src/plugins/application_config/server/routes/index.ts +++ b/src/plugins/application_config/server/routes/index.ts @@ -6,7 +6,6 @@ import { schema } from '@osd/config-schema'; import { IRouter, - IScopedClusterClient, Logger, OpenSearchDashboardsRequest, OpenSearchDashboardsResponseFactory, @@ -15,7 +14,7 @@ import { ConfigurationClient } from '../types'; export function defineRoutes( router: IRouter, - getConfigurationClient: (configurationClient: IScopedClusterClient) => ConfigurationClient, + getConfigurationClient: (request?: OpenSearchDashboardsRequest) => ConfigurationClient, logger: Logger ) { router.get( @@ -24,8 +23,7 @@ export function defineRoutes( validate: false, }, async (context, request, response) => { - const client = getConfigurationClient(context.core.opensearch.client); - + const client = getConfigurationClient(request); return await handleGetConfig(client, request, response, logger); } ); @@ -39,7 +37,7 @@ export function defineRoutes( }, }, async (context, request, response) => { - const client = getConfigurationClient(context.core.opensearch.client); + const client = getConfigurationClient(request); return await handleGetEntityConfig(client, request, response, logger); } @@ -57,7 +55,7 @@ export function defineRoutes( }, }, async (context, request, response) => { - const client = getConfigurationClient(context.core.opensearch.client); + const client = getConfigurationClient(request); return await handleUpdateEntityConfig(client, request, response, logger); } @@ -72,7 +70,7 @@ export function defineRoutes( }, }, async (context, request, response) => { - const client = getConfigurationClient(context.core.opensearch.client); + const client = getConfigurationClient(request); return await handleDeleteEntityConfig(client, request, response, logger); }