From 8e116eaf2ec9d3eebc27721aa4e5df62324d2467 Mon Sep 17 00:00:00 2001 From: Zacqary Xeper Date: Wed, 18 Sep 2024 14:41:03 -0500 Subject: [PATCH] [ResponseOps][Rules] Remove unintended internal Find routes API with public access --- .../routes/rule/apis/find/find_rules_route.ts | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/x-pack/plugins/alerting/server/routes/rule/apis/find/find_rules_route.ts b/x-pack/plugins/alerting/server/routes/rule/apis/find/find_rules_route.ts index 3541e8e31475e..d93c950c19913 100644 --- a/x-pack/plugins/alerting/server/routes/rule/apis/find/find_rules_route.ts +++ b/x-pack/plugins/alerting/server/routes/rule/apis/find/find_rules_route.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { IRouter } from '@kbn/core/server'; +import { IRouter, RouteConfigOptions, RouteMethod } from '@kbn/core/server'; import { UsageCounter } from '@kbn/usage-collection-plugin/server'; import { ILicenseState } from '../../../../lib'; import { verifyAccessAndContext } from '../../../lib'; @@ -29,6 +29,7 @@ interface BuildFindRulesRouteParams { router: IRouter; excludeFromPublicApi?: boolean; usageCounter?: UsageCounter; + options?: RouteConfigOptions; } const buildFindRulesRoute = ({ @@ -37,15 +38,12 @@ const buildFindRulesRoute = ({ router, excludeFromPublicApi = false, usageCounter, + options: routerOptions, }: BuildFindRulesRouteParams) => { router.get( { path, - options: { - access: 'public', - summary: 'Get information about rules', - tags: ['oas-tag:alerting'], - }, + options: routerOptions, validate: { request: { query: findRulesRequestQuerySchemaV1, @@ -162,6 +160,11 @@ export const findRulesRoute = ( path: `${BASE_ALERTING_API_PATH}/rules/_find`, router, usageCounter, + options: { + access: 'public', + summary: 'Get information about rules', + tags: ['oas-tag:alerting'], + }, }); };