diff --git a/output/schema/schema.json b/output/schema/schema.json index 42353ab596..9ee36d3c12 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -171191,7 +171191,7 @@ "kind": "instance_of", "type": { "name": "RoleTemplate", - "namespace": "security.get_role" + "namespace": "security._types" } } } @@ -171262,6 +171262,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", @@ -171409,6 +171441,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": { @@ -174463,7 +174511,7 @@ "kind": "instance_of", "type": { "name": "RoleTemplate", - "namespace": "security.get_role" + "namespace": "security._types" } } } @@ -174525,54 +174573,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" @@ -177166,6 +177166,20 @@ } } }, + { + "name": "role_templates", + "required": false, + "type": { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "RoleTemplate", + "namespace": "security._types" + } + } + } + }, { "name": "rules", "required": false, @@ -177233,7 +177247,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 016a51b4e5..5ecca2ee48 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -16073,7 +16073,7 @@ export interface SecurityRoleMapping { metadata: Metadata roles: string[] rules: SecurityRoleMappingRule - role_templates?: SecurityGetRoleRoleTemplate[] + role_templates?: SecurityRoleTemplate[] } export interface SecurityRoleMappingRule { @@ -16083,6 +16083,11 @@ export interface SecurityRoleMappingRule { except?: SecurityRoleMappingRule } +export interface SecurityRoleTemplate { + format?: SecurityTemplateFormat + template: Script +} + export type SecurityRoleTemplateInlineQuery = string | QueryDslQueryContainer export interface SecurityRoleTemplateInlineScript extends ScriptBase { @@ -16097,6 +16102,8 @@ export interface SecurityRoleTemplateQuery { export type SecurityRoleTemplateScript = SecurityRoleTemplateInlineScript | SecurityRoleTemplateInlineQuery | StoredScriptId +export type SecurityTemplateFormat = 'string' | 'json' + export interface SecurityTransientMetadataConfig { enabled: boolean } @@ -16427,17 +16434,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 } @@ -16711,6 +16711,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[] }