Test: remove roles from user on remote cluster (elastic/x-pack-elasticsearch#1144)
This change removes the roles from the user in the remote cluster to show that the roles passed
from the source cluster are used in evaluating the user's permissions during multi-cluster search.
Original commit: elastic/x-pack-elasticsearch@35658168fb04ed779a6e7057345dd60bc62384a9
@@ -86,3 +86,18 @@ setup:
- match: { hits.total: 2 }
- match: { hits.hits.0._source.filter_field: 1 }
- match: { hits.hits.0._index: "test_index" }
+
+# The user is updated to remove its role mappings to show that we do not
+# need the user to be assigned to a role on the remote cluster and that the
+# roles sent with the user from the other cluster are used. The put user
+# request clears the cached reference to the user so we do not need to do
+# that manually
+ - do:
+ xpack.security.put_user:
+ username: "joe"
+ body: >
+ {
+ "password": "s3krit",
+ "roles" : [ ]
+ }
+ - match: { user: { created: false } }
