Skip to content

Commit 106bb15

Browse files
authored
[ResponseOps][Cases] Migrate cases APIs with access tags. (#203746)
## Summary This PR migrates the cases routes that use `access:` tags according to the [documented guidelines](https://docs.elastic.dev/kibana-dev-docs/key-concepts/security-api-authorization#configuring-authorization-on-routes).
1 parent 54e8977 commit 106bb15

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

x-pack/plugins/cases/server/routes/api/configure/get_connectors.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
* 2.0.
66
*/
77

8-
import { CASE_CONFIGURE_CONNECTORS_URL } from '../../../../common/constants';
8+
import {
9+
CASE_CONFIGURE_CONNECTORS_URL,
10+
GET_CONNECTORS_CONFIGURE_API_TAG,
11+
} from '../../../../common/constants';
912
import { createCaseError } from '../../../common/error';
1013
import { createCasesRoute } from '../create_cases_route';
1114

@@ -15,8 +18,13 @@ import { createCasesRoute } from '../create_cases_route';
1518
export const getConnectorsRoute = createCasesRoute({
1619
method: 'get',
1720
path: `${CASE_CONFIGURE_CONNECTORS_URL}/_find`,
21+
security: {
22+
authz: {
23+
requiredPrivileges: [GET_CONNECTORS_CONFIGURE_API_TAG],
24+
},
25+
},
1826
routerOptions: {
19-
tags: ['access:casesGetConnectorsConfigure', 'oas-tag:cases'],
27+
tags: ['oas-tag:cases'],
2028
access: 'public',
2129
summary: 'Get case connectors',
2230
description: 'Retrieves information about connectors that are supported for use in cases.',

x-pack/plugins/cases/server/routes/api/internal/suggest_user_profiles.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@
77

88
import type { KibanaRequest } from '@kbn/core-http-server';
99
import type { UserProfileService } from '../../../services';
10-
import { INTERNAL_SUGGEST_USER_PROFILES_URL } from '../../../../common/constants';
10+
import {
11+
INTERNAL_SUGGEST_USER_PROFILES_URL,
12+
SUGGEST_USER_PROFILES_API_TAG,
13+
} from '../../../../common/constants';
1114
import { createCaseError } from '../../../common/error';
1215
import { createCasesRoute } from '../create_cases_route';
1316
import { escapeHatch } from '../utils';
@@ -17,8 +20,12 @@ export const suggestUserProfilesRoute = (userProfileService: UserProfileService)
1720
createCasesRoute({
1821
method: 'post',
1922
path: INTERNAL_SUGGEST_USER_PROFILES_URL,
23+
security: {
24+
authz: {
25+
requiredPrivileges: [SUGGEST_USER_PROFILES_API_TAG],
26+
},
27+
},
2028
routerOptions: {
21-
tags: ['access:casesSuggestUserProfiles'],
2229
access: 'internal',
2330
},
2431
params: {

0 commit comments

Comments
 (0)