Skip to content

Commit

Permalink
added internal access for cases, connectors, actions, rule registry
Browse files Browse the repository at this point in the history
  • Loading branch information
js-jankisalvi committed Sep 20, 2024
1 parent a2c96ff commit 863f7b3
Show file tree
Hide file tree
Showing 35 changed files with 83 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ export const getAllConnectorsIncludingSystemRoute = (
{
path: `${INTERNAL_BASE_ACTION_API_PATH}/connectors`,
validate: {},
options: {
access: 'internal',
},
},
router.handleLegacyErrors(
verifyAccessAndContext(licenseState, async function (context, req, res) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ export const listTypesWithSystemRoute = (
validate: {
query: connectorTypesQuerySchemaV1,
},
options: {
access: 'internal',
},
},
router.handleLegacyErrors(
verifyAccessAndContext(licenseState, async function (context, req, res) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ export const getGlobalExecutionKPIRoute = (
validate: {
body: bodySchema,
},
options: {
access: 'internal',
},
},
router.handleLegacyErrors(
verifyAccessAndContext(licenseState, async function (context, req, res) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ export const getGlobalExecutionLogRoute = (
validate: {
body: bodySchema,
},
options: {
access: 'internal',
},
},
router.handleLegacyErrors(
verifyAccessAndContext(licenseState, async function (context, req, res) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ export const getOAuthAccessToken = (
validate: {
body: bodySchema,
},
options: {
access: 'internal',
},
},
router.handleLegacyErrors(
verifyAccessAndContext(licenseState, async function (context, req, res) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ import type { caseApiV1 } from '../../../../../common/types/api';
export const getCategoriesRoute = createCasesRoute({
method: 'get',
path: INTERNAL_GET_CASE_CATEGORIES_URL,
routerOptions: {
access: 'internal',
},
handler: async ({ context, request, response }) => {
try {
const caseContext = await context.cases;
Expand Down
3 changes: 3 additions & 0 deletions x-pack/plugins/cases/server/routes/api/cases/get_case.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ export const getCaseRoute = createCasesRoute({
export const resolveCaseRoute = createCasesRoute({
method: 'get',
path: `${CASE_DETAILS_URL}/resolve`,
routerOptions: {
access: 'internal',
},
params,
handler: async ({ context, request, response }) => {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ export const bulkCreateAttachmentsRoute = createCasesRoute({
}),
body: schema.arrayOf(escapeHatch),
},
routerOptions: {
access: 'internal',
},
handler: async ({ context, request, response }) => {
try {
const casesContext = await context.cases;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ export const bulkDeleteFileAttachments = createCasesRoute({
}),
body: escapeHatch,
},
routerOptions: {
access: 'internal',
},
handler: async ({ context, request, response }) => {
try {
const caseContext = await context.cases;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ export const bulkGetAttachmentsRoute = createCasesRoute({
}),
body: escapeHatch,
},
routerOptions: {
access: 'internal',
},
handler: async ({ context, request, response }) => {
try {
const caseContext = await context.cases;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ export const bulkGetCasesRoute = createCasesRoute({
params: {
body: escapeHatch,
},
routerOptions: {
access: 'internal',
},
handler: async ({ context, request, response }) => {
const params = request.body as caseApiV1.CasesBulkGetRequest;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ export const getCaseMetricRoute = createCasesRoute({
]),
}),
},
routerOptions: {
access: 'internal',
},
handler: async ({ context, request, response }) => {
try {
const caseContext = await context.cases;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ export const getCaseUserActionStatsRoute = createCasesRoute({
case_id: schema.string(),
}),
},
routerOptions: {
access: 'internal',
},
handler: async ({ context, request, response }) => {
try {
const casesContext = await context.cases;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ export const getCaseUsersRoute = createCasesRoute({
case_id: schema.string(),
}),
},
routerOptions: {
access: 'internal',
},
handler: async ({ context, request, response }) => {
try {
const casesContext = await context.cases;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ import { createCasesRoute } from '../create_cases_route';
export const getCasesMetricRoute = createCasesRoute({
method: 'get',
path: INTERNAL_CASE_METRICS_URL,
routerOptions: {
access: 'internal',
},
params: {
query: schema.object({
features: schema.oneOf([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ export const getConnectorsRoute = createCasesRoute({
case_id: schema.string(),
}),
},
routerOptions: {
access: 'internal',
},
handler: async ({ context, request, response }) => {
try {
const casesContext = await context.cases;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ export const replaceCustomFieldRoute = createCasesRoute({
custom_field_id: schema.string(),
}),
},
routerOptions: {
access: 'internal',
},
handler: async ({ context, request, response }) => {
try {
const caseContext = await context.cases;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export const suggestUserProfilesRoute = (userProfileService: UserProfileService)
path: INTERNAL_SUGGEST_USER_PROFILES_URL,
routerOptions: {
tags: ['access:casesSuggestUserProfiles'],
access: 'internal',
},
params: {
body: escapeHatch,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export const bulkUpdateAlertsRoute = (router: IRouter<RacRequestHandlerContext>)
),
},
options: {
access: 'internal',
tags: ['access:rac'],
},
},
Expand Down
1 change: 1 addition & 0 deletions x-pack/plugins/rule_registry/server/routes/find.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export const findAlertsByQueryRoute = (router: IRouter<RacRequestHandlerContext>
),
},
options: {
access: 'internal',
tags: ['access:rac'],
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export const getAADFieldsByRuleType = (router: IRouter<RacRequestHandlerContext>
),
},
options: {
access: 'internal',
tags: ['access:rac'],
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export const getAlertByIdRoute = (router: IRouter<RacRequestHandlerContext>) =>
),
},
options: {
access: 'internal',
tags: ['access:rac'],
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export const getAlertsIndexRoute = (router: IRouter<RacRequestHandlerContext>) =
),
},
options: {
access: 'internal',
tags: ['access:rac'],
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export const getAlertSummaryRoute = (router: IRouter<RacRequestHandlerContext>)
),
},
options: {
access: 'internal',
tags: ['access:rac'],
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export const getAlertsGroupAggregations = (router: IRouter<RacRequestHandlerCont
),
},
options: {
access: 'internal',
tags: ['access:rac'],
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export const getBrowserFieldsByFeatureId = (router: IRouter<RacRequestHandlerCon
),
},
options: {
access: 'internal',
tags: ['access:rac'],
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export const getFeatureIdsByRegistrationContexts = (router: IRouter<RacRequestHa
),
},
options: {
access: 'internal',
tags: ['access:rac'],
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export const updateAlertByIdRoute = (router: IRouter<RacRequestHandlerContext>)
),
},
options: {
access: 'internal',
tags: ['access:rac'],
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ export const getWellKnownEmailServiceRoute = (router: IRouter) => {
validate: {
params: paramSchema,
},
options: {
access: 'internal',
},
},
handler
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ export const validSlackApiChannelsRoute = (
validate: {
body: bodySchema,
},
options: {
access: 'internal',
},
},
handler
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ export function createFieldsRoute(logger: Logger, router: IRouter, baseRoute: st
validate: {
body: bodySchema,
},
options: {
access: 'internal',
},
},
handler
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ export function createIndicesRoute(logger: Logger, router: IRouter, baseRoute: s
validate: {
body: bodySchema,
},
options: {
access: 'internal',
},
},
handler
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ export function createTimeSeriesQueryRoute(
validate: {
body: TimeSeriesQuerySchema,
},
options: {
access: 'internal',
},
},
handler
);
Expand Down
3 changes: 3 additions & 0 deletions x-pack/plugins/triggers_actions_ui/server/routes/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ export function createConfigRoute({
{
path,
validate: false,
options: {
access: 'internal',
},
},
handler
);
Expand Down
3 changes: 3 additions & 0 deletions x-pack/plugins/triggers_actions_ui/server/routes/health.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ export function createHealthRoute(
{
path,
validate: false,
options: {
access: 'internal',
},
},
handler
);
Expand Down

0 comments on commit 863f7b3

Please sign in to comment.