Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport 8.12] Add role_templates in SecurityPutRoleMappingRequest #2359

Merged
merged 2 commits into from
Dec 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading