From 244ff7b2c37f66518dbb0d7121a8d02b1405fe93 Mon Sep 17 00:00:00 2001 From: Jean-Louis Leysens Date: Wed, 25 Sep 2024 09:25:12 +0200 Subject: [PATCH] [HTTP] Set explicit access for `public` HTTP APIs 2 (#192579) ## Summary Part 2 of this [PR](https://github.com/elastic/kibana/pull/192554). See more info there. Screenshot 2024-09-11 at 14 50 11 --------- Co-authored-by: shahzad31 --- x-pack/plugins/logstash/server/routes/pipelines/delete.ts | 1 + x-pack/plugins/logstash/server/routes/pipelines/list.ts | 1 + .../synthetics/server/routes/index.ts | 2 +- .../server/routes/monitor_cruds/get_monitors_list.ts | 7 +++++-- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/x-pack/plugins/logstash/server/routes/pipelines/delete.ts b/x-pack/plugins/logstash/server/routes/pipelines/delete.ts index edf235a7357b0..8c1a6d399a9ba 100644 --- a/x-pack/plugins/logstash/server/routes/pipelines/delete.ts +++ b/x-pack/plugins/logstash/server/routes/pipelines/delete.ts @@ -37,6 +37,7 @@ export function registerPipelinesDeleteRoute(router: LogstashPluginRouter) { { path: '/api/logstash/pipelines/delete', options: { + access: 'public', summary: `Delete managed Logstash pipelines`, }, validate: { diff --git a/x-pack/plugins/logstash/server/routes/pipelines/list.ts b/x-pack/plugins/logstash/server/routes/pipelines/list.ts index 30b4e1d08802c..1b6eaf62fb8d8 100644 --- a/x-pack/plugins/logstash/server/routes/pipelines/list.ts +++ b/x-pack/plugins/logstash/server/routes/pipelines/list.ts @@ -28,6 +28,7 @@ export function registerPipelinesListRoute(router: LogstashPluginRouter) { { path: '/api/logstash/pipelines', options: { + access: 'public', summary: `Get all managed Logstash pipelines`, }, validate: false, diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/index.ts b/x-pack/plugins/observability_solution/synthetics/server/routes/index.ts index 75aaf9f49c4d3..48e0de1c7fba4 100644 --- a/x-pack/plugins/observability_solution/synthetics/server/routes/index.ts +++ b/x-pack/plugins/observability_solution/synthetics/server/routes/index.ts @@ -66,7 +66,6 @@ export const syntheticsAppRestApiRoutes: SyntheticsRestApiRouteFactory[] = [ disableSyntheticsRoute, getServiceLocationsRoute, getSyntheticsProjectMonitorsRoute, - getAllSyntheticsMonitorRoute, installIndexTemplatesRoute, runOnceSyntheticsMonitorRoute, testNowMonitorRoute, @@ -109,6 +108,7 @@ export const syntheticsAppPublicRestApiRoutes: SyntheticsRestApiRouteFactory[] = addPrivateLocationRoute, deletePrivateLocationRoute, getPrivateLocationsRoute, + getAllSyntheticsMonitorRoute, getSyntheticsMonitorRoute, addSyntheticsMonitorRoute, editSyntheticsMonitorRoute, diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/get_monitors_list.ts b/x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/get_monitors_list.ts index 22584df3a7090..62f60f6b5636c 100644 --- a/x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/get_monitors_list.ts +++ b/x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/get_monitors_list.ts @@ -13,8 +13,11 @@ import { syntheticsMonitorType } from '../../../common/types/saved_objects'; export const getAllSyntheticsMonitorRoute: SyntheticsRestApiRouteFactory = () => ({ method: 'GET', path: SYNTHETICS_API_URLS.SYNTHETICS_MONITORS, - validate: { - query: QuerySchema, + validate: {}, + validation: { + request: { + query: QuerySchema, + }, }, handler: async (routeContext): Promise => { const { request, savedObjectsClient, syntheticsMonitorClient } = routeContext;