Skip to content

Commit ee0ef13

Browse files
kibanamachineashokadityaviduni94
authored andcommitted
Unauthorized route migration for routes owned by obs-ai-assistant,security-solution (elastic#198338)
### Authz API migration for unauthorized routes This PR migrates unauthorized routes owned by your team to a new security configuration. Please refer to the documentation for more information: [Authorization API](https://docs.elastic.dev/kibana-dev-docs/key-concepts/security-api-authorization) ### **Before migration:** ```ts router.get({ path: '/api/path', ... }, handler); ``` ### **After migration:** ```ts router.get({ path: '/api/path', security: { authz: { enabled: false, reason: 'This route is opted out from authorization because ...', }, }, ... }, handler); ``` ### What to do next? 1. Review the changes in this PR. 2. Elaborate on the reasoning to opt-out of authorization. 3. Routes without a compelling reason to opt-out of authorization should plan to introduce them as soon as possible. 2. You might need to update your tests to reflect the new security configuration: - If you have snapshot tests that include the route definition. ## Any questions? If you have any questions or need help with API authorization, please reach out to the `@elastic/kibana-security` team. Co-authored-by: Ashokaditya <[email protected]> Co-authored-by: Viduni Wickramarachchi <[email protected]>
1 parent 4679e01 commit ee0ef13

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

x-pack/platform/plugins/private/data_usage/server/routes/internal/data_streams.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ export const registerDataStreamsRoute = (
2222
.addVersion(
2323
{
2424
version: '1',
25+
security: {
26+
authz: {
27+
enabled: false,
28+
reason: 'This route is opted out from authorization',
29+
},
30+
},
2531
validate: {
2632
request: DataStreamsRequestSchema,
2733
response: {

x-pack/platform/plugins/private/data_usage/server/routes/internal/usage_metrics.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ export const registerUsageMetricsRoute = (
2323
.addVersion(
2424
{
2525
version: '1',
26+
security: {
27+
authz: {
28+
enabled: false,
29+
reason: 'This route is opted out from authorization',
30+
},
31+
},
2632
validate: {
2733
request: {
2834
body: UsageMetricsRequestSchema,

0 commit comments

Comments
 (0)