Skip to content

Commit

Permalink
Add role_templates in SecurityPutRoleMappingRequest (#2357)
Browse files Browse the repository at this point in the history
(cherry picked from commit 4f9a95d)
  • Loading branch information
pquentin authored and github-actions[bot] committed Dec 7, 2023
1 parent 5fea44e commit 0a086eb
Show file tree
Hide file tree
Showing 6 changed files with 110 additions and 73 deletions.
116 changes: 65 additions & 51 deletions output/schema/schema.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 10 additions & 9 deletions output/typescript/types.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion specification/security/_types/RoleMapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
31 changes: 31 additions & 0 deletions specification/security/_types/RoleTemplate.ts
Original file line number Diff line number Diff line change
@@ -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
}
13 changes: 1 addition & 12 deletions specification/security/get_role/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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[]
Expand All @@ -40,14 +40,3 @@ export class Role {
*/
global?: Dictionary<string, Dictionary<string, Dictionary<string, string[]>>>
}

export enum TemplateFormat {
string = 0,
json = 1
}

// ES: TemplateRoleName
export class RoleTemplate {
format?: TemplateFormat
template: Script
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -37,6 +38,7 @@ export interface Request extends RequestBase {
enabled?: boolean
metadata?: Metadata
roles?: string[]
role_templates?: RoleTemplate[]
rules?: RoleMappingRule
run_as?: string[]
}
Expand Down

0 comments on commit 0a086eb

Please sign in to comment.