mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-07 21:48:39 +00:00
d08446e221
This commit adds reserved or built-in user and role support to x-pack. The reserved roles cannot be modified by users. The reserved users also cannot be modified with the exception of changing the password for a user. In order to change the password for a user, a new API has been added. This API only supports changing passwords for native and reserved users. To support allowing a user to change their own password, a default role has been added to grant access. This default role only grants access to user operations that pertain to the user that is being authorized. In other words, the default role grants `joe` the ability to change their own password but does not allow them to change the password of a different user. Additionally, the authenticate API was made a transport action and is granted by the default role. Closes elastic/elasticsearch#1727 Closes elastic/elasticsearch#1185 Closes elastic/elasticsearch#1158 Original commit: elastic/x-pack-elasticsearch@1a6689d90f
36 lines
1.1 KiB
Groovy
36 lines
1.1 KiB
Groovy
apply plugin: 'elasticsearch.rest-test'
|
|
|
|
dependencies {
|
|
testCompile project(path: ':x-plugins:elasticsearch:x-pack', configuration: 'runtime')
|
|
}
|
|
|
|
integTest {
|
|
cluster {
|
|
setting 'script.inline', 'true'
|
|
plugin 'x-pack', project(':x-plugins:elasticsearch:x-pack')
|
|
extraConfigFile 'x-pack/roles.yml', 'roles.yml'
|
|
[
|
|
test_admin: 'superuser',
|
|
powerful_user: 'superuser',
|
|
minimal_user: 'minimal',
|
|
readonly_user: 'readonly',
|
|
dest_only_user: 'dest_only',
|
|
can_not_see_hidden_docs_user: 'can_not_see_hidden_docs',
|
|
can_not_see_hidden_fields_user: 'can_not_see_hidden_fields',
|
|
].each { String user, String role ->
|
|
setupCommand 'setupUser#' + user,
|
|
'bin/x-pack/users', 'useradd', user, '-p', 'changeme', '-r', role
|
|
}
|
|
waitCondition = { node, ant ->
|
|
File tmpFile = new File(node.cwd, 'wait.success')
|
|
ant.get(src: "http://${node.httpUri()}",
|
|
dest: tmpFile.toString(),
|
|
username: 'test_admin',
|
|
password: 'changeme',
|
|
ignoreerrors: true,
|
|
retries: 10)
|
|
return tmpFile.exists()
|
|
}
|
|
}
|
|
}
|