Skip to content

Commit

Permalink
query roles
Browse files Browse the repository at this point in the history
  • Loading branch information
albertzaharovits committed Jul 3, 2024
1 parent 2d148e2 commit 53670f8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,20 +87,6 @@ teardown:
- match: { admin_role.indices.0.names.0: "*" }
- match: { admin_role.indices.0.privileges.0: "all" }

# query match_all roles
- do:
headers:
Authorization: "Basic am9lOnMza3JpdC1wYXNzd29yZA=="
security.query_role:
body: >
{
"query": { "match_all": {} }, "sort": ["name"]
}
- match: { total: 2 }
- match: { count: 2 }
- match: { roles.0.name: "admin_role" }
- match: { roles.1.name: "backwards_role" }

- do:
security.put_role:
name: "role_with_description"
Expand All @@ -118,16 +104,3 @@ teardown:
name: "role_with_description"
- match: { role_with_description.cluster.0: "manage_security" }
- match: { role_with_description.description: "Allows all security-related operations such as CRUD operations on users and roles and cache clearing." }

# query again for this last role
- do:
headers:
Authorization: "Basic am9lOnMza3JpdC1wYXNzd29yZA=="
security.query_role:
body: >
{
"query": { "match_all": {} }, "sort": ["name"], "from": 2
}
- match: { total: 3 }
- match: { count: 1 }
- match: { roles.0.name: "role_with_description" }
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,17 @@ teardown:
}
- match: { deleted.0: "admin_role" }
- match: { deleted.1: "role_with_description" }

# query match_all roles
- do:
headers:
Authorization: "Basic am9lOnMza3JpdC1wYXNzd29yZA=="
security.query_role:
body: >
{
"query": { "match_all": {} }, "sort": ["name"]
}
- match: { total: 2 }
- match: { count: 2 }
- match: { roles.0.name: "admin_role" }
- match: { roles.1.name: "role_with_description" }

0 comments on commit 53670f8

Please sign in to comment.