mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
[Infra] Update deprecated access tags to the new security configuration in routes (#204214)
## Summary Closes https://github.com/elastic/kibana/issues/203793 This PR replaces the deprecated `access` tags with the new `security` configuration. All instances of `options: {tags: ['access:infra']}` are now updated to `security: {authz: {requiredPrivileges: ['infra']}}`.
This commit is contained in:
parent
50713ca6d8
commit
73066e8cc3
1 changed files with 7 additions and 10 deletions
|
@ -52,9 +52,8 @@ export class KibanaFramework {
|
|||
config: InfraRouteConfig<Params, Query, Body, Method>,
|
||||
handler: RequestHandler<Params, Query, Body, InfraPluginRequestHandlerContext>
|
||||
) {
|
||||
const defaultOptions = {
|
||||
tags: ['access:infra'],
|
||||
};
|
||||
const defaultSecurity = { authz: { requiredPrivileges: ['infra'] } };
|
||||
|
||||
const routeConfig = {
|
||||
path: config.path,
|
||||
validate: config.validate,
|
||||
|
@ -65,7 +64,8 @@ export class KibanaFramework {
|
|||
* using `as ...` below to ensure the route config has
|
||||
* the correct options type.
|
||||
*/
|
||||
options: { ...config.options, ...defaultOptions },
|
||||
options: { ...config.options },
|
||||
security: defaultSecurity,
|
||||
};
|
||||
switch (config.method) {
|
||||
case 'get':
|
||||
|
@ -89,15 +89,12 @@ export class KibanaFramework {
|
|||
public registerVersionedRoute<Method extends RouteMethod = any>(
|
||||
config: InfraVersionedRouteConfig<Method>
|
||||
) {
|
||||
const defaultOptions = {
|
||||
tags: ['access:infra'],
|
||||
};
|
||||
const defaultSecurity = { authz: { requiredPrivileges: ['infra'] } };
|
||||
|
||||
const routeConfig = {
|
||||
access: config.access,
|
||||
path: config.path,
|
||||
// Currently we have no use of custom options beyond tags, this can be extended
|
||||
// beyond defaultOptions if it's needed.
|
||||
options: defaultOptions,
|
||||
security: defaultSecurity,
|
||||
};
|
||||
switch (config.method) {
|
||||
case 'get':
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue