diff --git a/docs/reference.asciidoc b/docs/reference.asciidoc index fcba0067b..e6cc15f01 100644 --- a/docs/reference.asciidoc +++ b/docs/reference.asciidoc @@ -8121,6 +8121,7 @@ client.security.putRoleMapping({ name }) ** *`enabled` (Optional, boolean)* ** *`metadata` (Optional, Record)* ** *`roles` (Optional, string[])* +** *`role_templates` (Optional, { format, template }[])* ** *`rules` (Optional, { any, all, field, except })* ** *`run_as` (Optional, string[])* ** *`refresh` (Optional, Enum(true | false | "wait_for"))*: If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. diff --git a/src/api/api/security.ts b/src/api/api/security.ts index 1b4475b12..739162df1 100644 --- a/src/api/api/security.ts +++ b/src/api/api/security.ts @@ -1400,7 +1400,7 @@ export default class Security { async putRoleMapping (this: That, params: T.SecurityPutRoleMappingRequest | TB.SecurityPutRoleMappingRequest, options?: TransportRequestOptions): Promise async putRoleMapping (this: That, params: T.SecurityPutRoleMappingRequest | TB.SecurityPutRoleMappingRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] - const acceptedBody: string[] = ['enabled', 'metadata', 'roles', 'rules', 'run_as'] + const acceptedBody: string[] = ['enabled', 'metadata', 'roles', 'role_templates', 'rules', 'run_as'] const querystring: Record = {} // @ts-expect-error const userBody: any = params?.body diff --git a/src/api/types.ts b/src/api/types.ts index 6f4682b56..03afc0a8a 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -15752,7 +15752,7 @@ export interface SecurityRoleMapping { metadata: Metadata roles: string[] rules: SecurityRoleMappingRule - role_templates?: SecurityGetRoleRoleTemplate[] + role_templates?: SecurityRoleTemplate[] } export interface SecurityRoleMappingRule { @@ -15762,6 +15762,11 @@ export interface SecurityRoleMappingRule { except?: SecurityRoleMappingRule } +export interface SecurityRoleTemplate { + format?: SecurityTemplateFormat + template: Script +} + export type SecurityRoleTemplateInlineQuery = string | QueryDslQueryContainer export interface SecurityRoleTemplateInlineScript extends ScriptBase { @@ -15776,6 +15781,8 @@ export interface SecurityRoleTemplateQuery { export type SecurityRoleTemplateScript = SecurityRoleTemplateInlineScript | SecurityRoleTemplateInlineQuery | StoredScriptId +export type SecurityTemplateFormat = 'string' | 'json' + export interface SecurityTransientMetadataConfig { enabled: boolean } @@ -16100,17 +16107,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 } @@ -16369,6 +16369,7 @@ export interface SecurityPutRoleMappingRequest extends RequestBase { enabled?: boolean metadata?: Metadata roles?: string[] + role_templates?: SecurityRoleTemplate[] rules?: SecurityRoleMappingRule run_as?: string[] } diff --git a/src/api/typesWithBodyKey.ts b/src/api/typesWithBodyKey.ts index 8658ac2ca..ac2280ce9 100644 --- a/src/api/typesWithBodyKey.ts +++ b/src/api/typesWithBodyKey.ts @@ -16063,7 +16063,7 @@ export interface SecurityRoleMapping { metadata: Metadata roles: string[] rules: SecurityRoleMappingRule - role_templates?: SecurityGetRoleRoleTemplate[] + role_templates?: SecurityRoleTemplate[] } export interface SecurityRoleMappingRule { @@ -16073,6 +16073,11 @@ export interface SecurityRoleMappingRule { except?: SecurityRoleMappingRule } +export interface SecurityRoleTemplate { + format?: SecurityTemplateFormat + template: Script +} + export type SecurityRoleTemplateInlineQuery = string | QueryDslQueryContainer export interface SecurityRoleTemplateInlineScript extends ScriptBase { @@ -16087,6 +16092,8 @@ export interface SecurityRoleTemplateQuery { export type SecurityRoleTemplateScript = SecurityRoleTemplateInlineScript | SecurityRoleTemplateInlineQuery | StoredScriptId +export type SecurityTemplateFormat = 'string' | 'json' + export interface SecurityTransientMetadataConfig { enabled: boolean } @@ -16420,17 +16427,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 } @@ -16713,6 +16713,7 @@ export interface SecurityPutRoleMappingRequest extends RequestBase { enabled?: boolean metadata?: Metadata roles?: string[] + role_templates?: SecurityRoleTemplate[] rules?: SecurityRoleMappingRule run_as?: string[] }