Skip to content

Commit

Permalink
add access:public to public endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
tsullivan committed Jul 27, 2023
1 parent 4031a4d commit 5122ed6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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' });
Expand Down
3 changes: 2 additions & 1 deletion x-pack/plugins/reporting/server/routes/public/jobs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand All @@ -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 });
Expand Down

0 comments on commit 5122ed6

Please sign in to comment.