Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix dynamic config API calls to pass correct input #6474

Merged
merged 4 commits into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
update dynamic API calls to pass correct input
Signed-off-by: Tianle Huang <tianleh@amazon.com>
  • Loading branch information
tianleh committed Apr 16, 2024
commit e808850cd5510126abecb8233f55e7ab1fba1bd7
4 changes: 2 additions & 2 deletions config/opensearch_dashboards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
12 changes: 5 additions & 7 deletions src/plugins/application_config/server/routes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import { schema } from '@osd/config-schema';
import {
IRouter,
IScopedClusterClient,
Logger,
OpenSearchDashboardsRequest,
OpenSearchDashboardsResponseFactory,
Expand All @@ -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(
Expand All @@ -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);
}
);
Expand All @@ -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);
}
Expand All @@ -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);
}
Expand All @@ -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);
}
Expand Down