Skip to content

Commit

Permalink
Get Role Mappings optional roles field (#2474) (#2475)
Browse files Browse the repository at this point in the history
The roles is optional the same way as role_templates is.
ES in both 7.17 https://github.com/elastic/elasticsearch/blob/92f290e9537478f85ff3fe3ab39945c1a49a[…]k/core/security/authc/support/mapper/ExpressionRoleMapping.java and master (8.13) https://github.com/elastic/elasticsearch/blob/09df99393193b2c53d92899662a8b8b3c55b[…]k/core/security/authc/support/mapper/ExpressionRoleMapping.java
would only show the roles and roles_templates fields in the response if they are non-empty.

(cherry picked from commit 591a05e)
Authored-by: Albert Zaharovits <[email protected]>
  • Loading branch information
github-actions[bot] authored Mar 29, 2024
1 parent bec78a0 commit a03afe2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions specification/security/_types/RoleMapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ import { RoleTemplate } from './RoleTemplate'
export class RoleMapping {
enabled: boolean
metadata: Metadata
roles: string[]
rules: RoleMappingRule
// Exactly one of roles or role_templates should be set
roles?: string[]
// Exactly one of roles or role_templates should be set
role_templates?: RoleTemplate[]
rules: RoleMappingRule
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ export interface Request extends RequestBase {
body: {
enabled?: boolean
metadata?: Metadata
// Exactly one of roles or role_templates must be specified
roles?: string[]
// Exactly one of roles or role_templates must be specified
role_templates?: RoleTemplate[]
rules?: RoleMappingRule
run_as?: string[]
Expand Down

0 comments on commit a03afe2

Please sign in to comment.