diff --git a/output/schema/schema.json b/output/schema/schema.json index 7afdc3cace..89a67b537e 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -170606,7 +170606,7 @@ "kind": "instance_of", "type": { "name": "RoleTemplate", - "namespace": "security.get_role" + "namespace": "security._types" } } } @@ -170677,6 +170677,38 @@ "kind": "container" } }, + { + "kind": "interface", + "name": { + "name": "RoleTemplate", + "namespace": "security._types" + }, + "properties": [ + { + "name": "format", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "TemplateFormat", + "namespace": "security._types" + } + } + }, + { + "name": "template", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "Script", + "namespace": "_types" + } + } + } + ], + "specLocation": "security/_types/RoleTemplate.ts#L28-L31" + }, { "codegenNames": [ "query_string", @@ -170824,6 +170856,22 @@ "kind": "union_of" } }, + { + "kind": "enum", + "members": [ + { + "name": "string" + }, + { + "name": "json" + } + ], + "name": { + "name": "TemplateFormat", + "namespace": "security._types" + }, + "specLocation": "security/_types/RoleTemplate.ts#L22-L25" + }, { "kind": "interface", "name": { @@ -173878,7 +173926,7 @@ "kind": "instance_of", "type": { "name": "RoleTemplate", - "namespace": "security.get_role" + "namespace": "security._types" } } } @@ -173940,54 +173988,6 @@ ], "specLocation": "security/get_role/types.ts#L29-L42" }, - { - "kind": "interface", - "name": { - "name": "RoleTemplate", - "namespace": "security.get_role" - }, - "properties": [ - { - "name": "format", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "TemplateFormat", - "namespace": "security.get_role" - } - } - }, - { - "name": "template", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "Script", - "namespace": "_types" - } - } - } - ], - "specLocation": "security/get_role/types.ts#L50-L53" - }, - { - "kind": "enum", - "members": [ - { - "name": "string" - }, - { - "name": "json" - } - ], - "name": { - "name": "TemplateFormat", - "namespace": "security.get_role" - }, - "specLocation": "security/get_role/types.ts#L44-L47" - }, { "attachedBehaviors": [ "CommonQueryParameters" @@ -176581,6 +176581,20 @@ } } }, + { + "name": "role_templates", + "required": false, + "type": { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "RoleTemplate", + "namespace": "security._types" + } + } + } + }, { "name": "rules", "required": false, @@ -176648,7 +176662,7 @@ } } ], - "specLocation": "security/put_role_mapping/SecurityPutRoleMappingRequest.ts#L24-L43" + "specLocation": "security/put_role_mapping/SecurityPutRoleMappingRequest.ts#L25-L45" }, { "body": { diff --git a/output/typescript/types.ts b/output/typescript/types.ts index d818b59c24..9ffd778679 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -16047,7 +16047,7 @@ export interface SecurityRoleMapping { metadata: Metadata roles: string[] rules: SecurityRoleMappingRule - role_templates?: SecurityGetRoleRoleTemplate[] + role_templates?: SecurityRoleTemplate[] } export interface SecurityRoleMappingRule { @@ -16057,6 +16057,11 @@ export interface SecurityRoleMappingRule { except?: SecurityRoleMappingRule } +export interface SecurityRoleTemplate { + format?: SecurityTemplateFormat + template: Script +} + export type SecurityRoleTemplateInlineQuery = string | QueryDslQueryContainer export interface SecurityRoleTemplateInlineScript extends ScriptBase { @@ -16071,6 +16076,8 @@ export interface SecurityRoleTemplateQuery { export type SecurityRoleTemplateScript = SecurityRoleTemplateInlineScript | SecurityRoleTemplateInlineQuery | StoredScriptId +export type SecurityTemplateFormat = 'string' | 'json' + export interface SecurityTransientMetadataConfig { enabled: boolean } @@ -16401,17 +16408,10 @@ export interface SecurityGetRoleRole { run_as: string[] transient_metadata: SecurityTransientMetadataConfig applications: SecurityApplicationPrivileges[] - role_templates?: SecurityGetRoleRoleTemplate[] + role_templates?: SecurityRoleTemplate[] global?: Record>> } -export interface SecurityGetRoleRoleTemplate { - format?: SecurityGetRoleTemplateFormat - template: Script -} - -export type SecurityGetRoleTemplateFormat = 'string' | 'json' - export interface SecurityGetRoleMappingRequest extends RequestBase { name?: Names } @@ -16685,6 +16685,7 @@ export interface SecurityPutRoleMappingRequest extends RequestBase { enabled?: boolean metadata?: Metadata roles?: string[] + role_templates?: SecurityRoleTemplate[] rules?: SecurityRoleMappingRule run_as?: string[] } diff --git a/specification/security/_types/RoleMapping.ts b/specification/security/_types/RoleMapping.ts index 494a1bfe74..9f505418a9 100644 --- a/specification/security/_types/RoleMapping.ts +++ b/specification/security/_types/RoleMapping.ts @@ -17,9 +17,9 @@ * under the License. */ -import { RoleTemplate } from '@security/get_role/types' import { Metadata } from '@_types/common' import { RoleMappingRule } from './RoleMappingRule' +import { RoleTemplate } from './RoleTemplate' // ES: ExpressionRoleMapping export class RoleMapping { diff --git a/specification/security/_types/RoleTemplate.ts b/specification/security/_types/RoleTemplate.ts new file mode 100644 index 0000000000..2065b84377 --- /dev/null +++ b/specification/security/_types/RoleTemplate.ts @@ -0,0 +1,31 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { Script } from '@_types/Scripting' + +export enum TemplateFormat { + string = 0, + json = 1 +} + +// ES: TemplateRoleName +export class RoleTemplate { + format?: TemplateFormat + template: Script +} diff --git a/specification/security/get_role/types.ts b/specification/security/get_role/types.ts index 2cef4c0e17..64e7be0146 100644 --- a/specification/security/get_role/types.ts +++ b/specification/security/get_role/types.ts @@ -24,7 +24,7 @@ import { import { TransientMetadataConfig } from '@security/_types/TransientMetadataConfig' import { Dictionary } from '@spec_utils/Dictionary' import { Metadata } from '@_types/common' -import { Script } from '@_types/Scripting' +import { RoleTemplate } from '@security/_types/RoleTemplate' export class Role { cluster: string[] @@ -40,14 +40,3 @@ export class Role { */ global?: Dictionary>> } - -export enum TemplateFormat { - string = 0, - json = 1 -} - -// ES: TemplateRoleName -export class RoleTemplate { - format?: TemplateFormat - template: Script -} diff --git a/specification/security/put_role_mapping/SecurityPutRoleMappingRequest.ts b/specification/security/put_role_mapping/SecurityPutRoleMappingRequest.ts index 87ebba9cc1..fd9e6fc050 100644 --- a/specification/security/put_role_mapping/SecurityPutRoleMappingRequest.ts +++ b/specification/security/put_role_mapping/SecurityPutRoleMappingRequest.ts @@ -20,6 +20,7 @@ import { RoleMappingRule } from '@security/_types/RoleMappingRule' import { RequestBase } from '@_types/Base' import { Metadata, Name, Refresh } from '@_types/common' +import { RoleTemplate } from '@security/_types/RoleTemplate' /** * @rest_spec_name security.put_role_mapping @@ -37,6 +38,7 @@ export interface Request extends RequestBase { enabled?: boolean metadata?: Metadata roles?: string[] + role_templates?: RoleTemplate[] rules?: RoleMappingRule run_as?: string[] }