From 5122ed637b0a0041215cf85dbd6c8867eb14ab9f Mon Sep 17 00:00:00 2001 From: Timothy Sullivan Date: Thu, 27 Jul 2023 16:42:49 -0700 Subject: [PATCH] add access:public to public endpoints --- .../reporting/server/routes/public/generate_from_jobparams.ts | 3 ++- x-pack/plugins/reporting/server/routes/public/jobs.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/reporting/server/routes/public/generate_from_jobparams.ts b/x-pack/plugins/reporting/server/routes/public/generate_from_jobparams.ts index b5868e8d93cc2..c3a8e886302f5 100644 --- a/x-pack/plugins/reporting/server/routes/public/generate_from_jobparams.ts +++ b/x-pack/plugins/reporting/server/routes/public/generate_from_jobparams.ts @@ -24,7 +24,7 @@ export function registerGenerationRoutesPublic(reporting: ReportingCore, logger: { path, validate: RequestHandler.getValidation(), - options: { tags: kibanaAccessControlTags }, + options: { tags: kibanaAccessControlTags, access: 'public' }, }, authorizedUserPreRouting(reporting, async (user, context, req, res) => { try { @@ -47,6 +47,7 @@ export function registerGenerationRoutesPublic(reporting: ReportingCore, logger: { path: `${PUBLIC_ROUTES.GENERATE_PREFIX}/{p*}`, validate: false, + options: { access: 'public' }, }, (_context, _req, res) => { return res.customError({ statusCode: 405, body: 'GET is not allowed' }); diff --git a/x-pack/plugins/reporting/server/routes/public/jobs.ts b/x-pack/plugins/reporting/server/routes/public/jobs.ts index 22cf46db08892..5f90e77c9520f 100644 --- a/x-pack/plugins/reporting/server/routes/public/jobs.ts +++ b/x-pack/plugins/reporting/server/routes/public/jobs.ts @@ -25,7 +25,7 @@ export function registerJobInfoRoutesPublic(reporting: ReportingCore) { { path, validate: jobHandlers.validate, - options: { tags: [ROUTE_TAG_CAN_REDIRECT] }, + options: { tags: [ROUTE_TAG_CAN_REDIRECT], access: 'public' }, }, authorizedUserPreRouting(reporting, async (user, context, req, res) => { return jobHandlers.handleDownloadReport({ path, user, context, req, res }); @@ -40,6 +40,7 @@ export function registerJobInfoRoutesPublic(reporting: ReportingCore) { { path, validate: jobHandlers.validate, + options: { access: 'public' }, }, authorizedUserPreRouting(reporting, async (user, context, req, res) => { return jobHandlers.handleDeleteReport({ path, user, context, req, res });