mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
Unauthorized route migration for routes owned by appex-sharedux (#214779)
### Authz API migration for unauthorized routes This PR migrates last 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); ```
This commit is contained in:
parent
df55627b2d
commit
a7cc00c4fe
3 changed files with 36 additions and 3 deletions
|
@ -38,14 +38,32 @@ export function registerGetRoute(router: InternalUiSettingsRouter) {
|
|||
}
|
||||
};
|
||||
router.get(
|
||||
{ path: '/api/kibana/settings', validate: false },
|
||||
{
|
||||
path: '/api/kibana/settings',
|
||||
validate: false,
|
||||
security: {
|
||||
authz: {
|
||||
enabled: false,
|
||||
reason: 'This route delegates authorization to the UI Settings Client',
|
||||
},
|
||||
},
|
||||
},
|
||||
async (context, request, response) => {
|
||||
const uiSettingsClient = (await context.core).uiSettings.client;
|
||||
return await getFromRequest(uiSettingsClient, context, request, response);
|
||||
}
|
||||
);
|
||||
router.get(
|
||||
{ path: '/api/kibana/global_settings', validate: false },
|
||||
{
|
||||
path: '/api/kibana/global_settings',
|
||||
validate: false,
|
||||
security: {
|
||||
authz: {
|
||||
enabled: false,
|
||||
reason: 'This route delegates authorization to the UI Settings Client',
|
||||
},
|
||||
},
|
||||
},
|
||||
async (context, request, response) => {
|
||||
const uiSettingsClient = (await context.core).uiSettings.globalClient;
|
||||
return await getFromRequest(uiSettingsClient, context, request, response);
|
||||
|
|
|
@ -74,9 +74,18 @@ export function register(router: FilesRouter) {
|
|||
path: FILES_API_ROUTES.public.download,
|
||||
validate: { ...rt },
|
||||
options: {
|
||||
authRequired: false,
|
||||
access: 'public',
|
||||
},
|
||||
security: {
|
||||
authz: {
|
||||
enabled: false,
|
||||
reason: 'This route is public and does not require user authentication',
|
||||
},
|
||||
authc: {
|
||||
enabled: false,
|
||||
reason: 'This route is public and does not require user authentication',
|
||||
},
|
||||
},
|
||||
},
|
||||
handler
|
||||
);
|
||||
|
|
|
@ -18,6 +18,12 @@ export const registerGotoRoute = (router: IRouter, core: CoreSetup) => {
|
|||
core.http.resources.register(
|
||||
{
|
||||
path: '/goto/{id}',
|
||||
security: {
|
||||
authz: {
|
||||
enabled: false,
|
||||
reason: 'This route handles redirection',
|
||||
},
|
||||
},
|
||||
validate: {
|
||||
params: schema.object({
|
||||
id: schema.string({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue