Skip to content

Commit

Permalink
Fix Rolling Upgrade tests
Browse files Browse the repository at this point in the history
Adds a number of api calls that use the deprecated endpoints so
that these can be used in the `old_cluster` tests
  • Loading branch information
jkakavas committed Dec 7, 2018
1 parent fff0ea2 commit a509387
Show file tree
Hide file tree
Showing 12 changed files with 305 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"security.deprecated_authenticate": {
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-authenticate.html",
"methods": [
"GET"
],
"url": {
"path": "/_xpack/security/_authenticate",
"paths": [
"/_xpack/security/_authenticate"
],
"parts": {},
"params": {}
},
"body": null
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"security.deprecated_change_password": {
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-change-password.html",
"methods": [
"PUT",
"POST"
],
"url": {
"path": "/_xpack/security/user/{username}/_password",
"paths": [
"/_xpack/security/user/{username}/_password",
"/_xpack/security/user/_password"
],
"parts": {
"username": {
"type": "string",
"description": "The username of the user to change the password for",
"required": false
}
},
"params": {
"refresh": {
"type": "enum",
"options": [
"true",
"false",
"wait_for"
],
"description": "If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes."
}
}
},
"body": {
"description": "the new password for the user",
"required": true
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"security.deprecated_clear_cached_realms": {
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-cache.html",
"methods": [
"POST"
],
"url": {
"path": "/_xpack/security/realm/{realms}/_clear_cache",
"paths": [
"/_xpack/security/realm/{realms}/_clear_cache"
],
"parts": {
"realms": {
"type": "list",
"description": "Comma-separated list of realms to clear",
"required": true
}
},
"params": {
"usernames": {
"type": "list",
"description": "Comma-separated list of usernames to clear from the cache",
"required": false
}
}
},
"body": null
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"security.deprecated_clear_cached_roles": {
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-role-cache.html",
"methods": [
"POST"
],
"url": {
"path": "/_xpack/security/role/{name}/_clear_cache",
"paths": [
"/_xpack/security/role/{name}/_clear_cache"
],
"parts": {
"name": {
"type": "list",
"description": "Role name",
"required": true
}
},
"params": {}
},
"body": null
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"security.deprecated_disable_user": {
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-disable-user.html",
"methods": [
"PUT",
"POST"
],
"url": {
"path": "/_xpack/security/user/{username}/_disable",
"paths": [
"/_xpack/security/user/{username}/_disable"
],
"parts": {
"username": {
"type": "string",
"description": "The username of the user to disable",
"required": false
}
},
"params": {
"refresh": {
"type": "enum",
"options": [
"true",
"false",
"wait_for"
],
"description": "If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes."
}
}
},
"body": null
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"security.deprecated_enable_user": {
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-enable-user.html",
"methods": [
"PUT",
"POST"
],
"url": {
"path": "/_xpack/security/user/{username}/_enable",
"paths": [
"/_xpack/security/user/{username}/_enable"
],
"parts": {
"username": {
"type": "string",
"description": "The username of the user to enable",
"required": false
}
},
"params": {
"refresh": {
"type": "enum",
"options": [
"true",
"false",
"wait_for"
],
"description": "If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes."
}
}
},
"body": null
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"security.deprecated_get_token": {
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-token.html",
"methods": [
"POST"
],
"url": {
"path": "/_xpack/security/oauth2/token",
"paths": [
"/_xpack/security/oauth2/token"
],
"parts": {},
"params": {}
},
"body": {
"description": "The token request to get",
"required": true
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"security.deprecated_get_user": {
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user.html",
"methods": [
"GET"
],
"url": {
"path": "/_xpack/security/user/{username}",
"paths": [
"/_xpack/security/user/{username}",
"/_xpack/security/user"
],
"parts": {
"username": {
"type": "list",
"description": "A comma-separated list of usernames",
"required": false
}
},
"params": {}
},
"body": null
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"security.deprecated_put_role": {
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-role.html",
"methods": [
"PUT",
"POST"
],
"url": {
"path": "/_xpack/security/role/{name}",
"paths": [
"/_xpack/security/role/{name}"
],
"parts": {
"name": {
"type": "string",
"description": "Role name",
"required": true
}
},
"params": {
"refresh": {
"type": "enum",
"options": [
"true",
"false",
"wait_for"
],
"description": "If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes."
}
}
},
"body": {
"description": "The role to add",
"required": true
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"security.deprecated_put_user": {
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-user.html",
"methods": [
"PUT",
"POST"
],
"url": {
"path": "/_xpack/security/user/{username}",
"paths": [
"/_xpack/security/user/{username}"
],
"parts": {
"username": {
"type": "string",
"description": "The username of the User",
"required": true
}
},
"params": {
"refresh": {
"type": "enum",
"options": [
"true",
"false",
"wait_for"
],
"description": "If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes."
}
}
},
"body": {
"description": "The user to add",
"required": true
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
features: headers
# create native user and role
- do:
security.put_user:
security.deprecated_put_user:
username: "native_user"
body: >
{
Expand All @@ -14,7 +14,7 @@
- match: { created: true }

- do:
security.put_role:
security.deprecated_put_role:
name: "native_role"
body: >
{
Expand All @@ -36,11 +36,11 @@
- match: { timed_out: false }

- do:
security.clear_cached_roles:
security.deprecated_clear_cached_roles:
name: "native_role"

- do:
security.clear_cached_realms:
security.deprecated_clear_cached_realms:
realms: "_all"

- do:
Expand All @@ -51,27 +51,27 @@
# Check that enabling a user in old cluster will not prevent the user from having a "default password" in the new cluster.
# See: org.elasticsearch.xpack.security.authc.esnative.NativeRealmMigrator.doConvertDefaultPasswords
- do:
security.disable_user:
security.deprecated_disable_user:
username: "kibana"

- do:
security.get_user:
security.deprecated_get_user:
username: "kibana"
- match: { kibana.enabled: false }

- do:
security.change_password:
security.deprecated_change_password:
username: "logstash_system"
body: >
{
"password" : "changed-it"
}
- do:
security.enable_user:
security.deprecated_enable_user:
username: "logstash_system"

- do:
security.get_user:
security.deprecated_get_user:
username: "logstash_system"
- match: { logstash_system.enabled: true }
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
wait_for_status: yellow

- do:
security.put_user:
security.deprecated_put_user:
username: "token_user"
body: >
{
Expand All @@ -18,7 +18,7 @@
}
- do:
security.get_token:
security.deprecated_get_token:
body:
grant_type: "password"
username: "token_user"
Expand All @@ -33,7 +33,7 @@
- do:
headers:
Authorization: Bearer ${token}
security.authenticate: {}
security.deprecated_authenticate: {}

- match: { username: "token_user" }
- match: { roles.0: "superuser" }
Expand Down

0 comments on commit a509387

Please sign in to comment.