Skip to content

Commit 4f9a95d

Browse files
authored
Add role_templates in SecurityPutRoleMappingRequest (#2357)
1 parent 4c51be9 commit 4f9a95d

File tree

6 files changed

+110
-73
lines changed

6 files changed

+110
-73
lines changed

output/schema/schema.json

Lines changed: 65 additions & 51 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

output/typescript/types.ts

Lines changed: 10 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

specification/security/_types/RoleMapping.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
* under the License.
1818
*/
1919

20-
import { RoleTemplate } from '@security/get_role/types'
2120
import { Metadata } from '@_types/common'
2221
import { RoleMappingRule } from './RoleMappingRule'
22+
import { RoleTemplate } from './RoleTemplate'
2323

2424
// ES: ExpressionRoleMapping
2525
export class RoleMapping {
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
import { Script } from '@_types/Scripting'
21+
22+
export enum TemplateFormat {
23+
string = 0,
24+
json = 1
25+
}
26+
27+
// ES: TemplateRoleName
28+
export class RoleTemplate {
29+
format?: TemplateFormat
30+
template: Script
31+
}

specification/security/get_role/types.ts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import {
2424
import { TransientMetadataConfig } from '@security/_types/TransientMetadataConfig'
2525
import { Dictionary } from '@spec_utils/Dictionary'
2626
import { Metadata } from '@_types/common'
27-
import { Script } from '@_types/Scripting'
27+
import { RoleTemplate } from '@security/_types/RoleTemplate'
2828

2929
export class Role {
3030
cluster: string[]
@@ -40,14 +40,3 @@ export class Role {
4040
*/
4141
global?: Dictionary<string, Dictionary<string, Dictionary<string, string[]>>>
4242
}
43-
44-
export enum TemplateFormat {
45-
string = 0,
46-
json = 1
47-
}
48-
49-
// ES: TemplateRoleName
50-
export class RoleTemplate {
51-
format?: TemplateFormat
52-
template: Script
53-
}

specification/security/put_role_mapping/SecurityPutRoleMappingRequest.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import { RoleMappingRule } from '@security/_types/RoleMappingRule'
2121
import { RequestBase } from '@_types/Base'
2222
import { Metadata, Name, Refresh } from '@_types/common'
23+
import { RoleTemplate } from '@security/_types/RoleTemplate'
2324

2425
/**
2526
* @rest_spec_name security.put_role_mapping
@@ -37,6 +38,7 @@ export interface Request extends RequestBase {
3738
enabled?: boolean
3839
metadata?: Metadata
3940
roles?: string[]
41+
role_templates?: RoleTemplate[]
4042
rules?: RoleMappingRule
4143
run_as?: string[]
4244
}

0 commit comments

Comments
 (0)