From e0fcbcbb519b69f1ed6594322b0390ee2b3ccc54 Mon Sep 17 00:00:00 2001 From: Alexander Reelsen Date: Wed, 30 Mar 2016 09:07:57 +0200 Subject: [PATCH] Elasticsearch: Rename plugin from 'xpack' to 'x-pack' This is just to be consistent with out naming, which is supposed to be `x-pack`. Closes elastic/elasticsearch#1759 Original commit: elastic/x-pack-elasticsearch@0697f7085513eac564aa68af98b7f3edb1f36785 --- elasticsearch/qa/shield-audit-tests/build.gradle | 2 +- elasticsearch/qa/shield-client-tests/build.gradle | 4 ++-- .../qa/shield-core-rest-tests/build.gradle | 2 +- elasticsearch/qa/shield-example-realm/build.gradle | 8 ++++---- ...ties => x-pack-extension-descriptor.properties} | 0 elasticsearch/qa/shield-reindex-tests/build.gradle | 4 ++-- .../shield-tribe-node-tests/integration-tests.xml | 4 ++-- .../integration-tests.xml | 8 ++++---- .../qa/smoke-test-graph-with-shield/build.gradle | 8 ++++---- .../qa/smoke-test-plugins-ssl/build.gradle | 4 ++-- elasticsearch/qa/smoke-test-plugins/build.gradle | 2 +- .../qa/smoke-test-watcher-with-shield/build.gradle | 8 ++++---- elasticsearch/x-pack/bin/{xpack => x-pack}/.in.bat | 0 .../x-pack/bin/{xpack => x-pack}/extension | 10 +++++----- .../x-pack/bin/{xpack => x-pack}/extension.bat | 0 elasticsearch/x-pack/build.gradle | 14 +++++++------- .../x-pack/shield/bin/{xpack => x-pack}/syskeygen | 8 ++++---- .../shield/bin/{xpack => x-pack}/syskeygen.bat | 0 .../x-pack/shield/bin/{xpack => x-pack}/users | 8 ++++---- .../x-pack/shield/bin/{xpack => x-pack}/users.bat | 0 .../shield/config/{xpack => x-pack}/logging.yml | 0 .../config/{xpack => x-pack}/role_mapping.yml | 0 .../shield/config/{xpack => x-pack}/roles.yml | 0 .../x-pack/shield/config/{xpack => x-pack}/users | 0 .../shield/config/{xpack => x-pack}/users_roles | 0 .../shield/authc/file/FileUserPasswdStore.java | 2 +- .../shield/authc/file/FileUserRolesStore.java | 2 +- .../shield/crypto/tool/syskey-generate.help | 2 +- .../shield/authc/file/tool/UsersToolTests.java | 3 ++- .../shield/crypto/tool/SystemKeyToolTests.java | 2 +- .../java/org/elasticsearch/xpack/XPackPlugin.java | 9 ++++++--- .../extensions/InstallXPackExtensionCommand.java | 2 +- .../extensions/RemoveXPackExtensionCommand.java | 2 +- .../xpack/extensions/XPackExtensionInfo.java | 2 +- .../InstallXPackExtensionCommandTests.java | 6 +++--- .../extensions/ListXPackExtensionCommandTests.java | 2 +- .../RemoveXPackExtensionCommandTests.java | 2 +- .../rest-api-spec/test/xpack/10_basic.yaml | 2 +- .../x-pack/watcher/bin/{xpack => x-pack}/croneval | 2 +- .../watcher/bin/{xpack => x-pack}/croneval.bat | 0 40 files changed, 69 insertions(+), 65 deletions(-) rename elasticsearch/qa/shield-example-realm/src/main/resources/{xpack-extension-descriptor.properties => x-pack-extension-descriptor.properties} (100%) rename elasticsearch/x-pack/bin/{xpack => x-pack}/.in.bat (100%) rename elasticsearch/x-pack/bin/{xpack => x-pack}/extension (90%) rename elasticsearch/x-pack/bin/{xpack => x-pack}/extension.bat (100%) rename elasticsearch/x-pack/shield/bin/{xpack => x-pack}/syskeygen (92%) rename elasticsearch/x-pack/shield/bin/{xpack => x-pack}/syskeygen.bat (100%) rename elasticsearch/x-pack/shield/bin/{xpack => x-pack}/users (92%) rename elasticsearch/x-pack/shield/bin/{xpack => x-pack}/users.bat (100%) rename elasticsearch/x-pack/shield/config/{xpack => x-pack}/logging.yml (100%) rename elasticsearch/x-pack/shield/config/{xpack => x-pack}/role_mapping.yml (100%) rename elasticsearch/x-pack/shield/config/{xpack => x-pack}/roles.yml (100%) rename elasticsearch/x-pack/shield/config/{xpack => x-pack}/users (100%) rename elasticsearch/x-pack/shield/config/{xpack => x-pack}/users_roles (100%) rename elasticsearch/x-pack/watcher/bin/{xpack => x-pack}/croneval (98%) rename elasticsearch/x-pack/watcher/bin/{xpack => x-pack}/croneval.bat (100%) diff --git a/elasticsearch/qa/shield-audit-tests/build.gradle b/elasticsearch/qa/shield-audit-tests/build.gradle index 7b0c0cbe825..454f3f33d33 100644 --- a/elasticsearch/qa/shield-audit-tests/build.gradle +++ b/elasticsearch/qa/shield-audit-tests/build.gradle @@ -10,7 +10,7 @@ integTest { setting 'shield.audit.enabled', 'true' setting 'shield.audit.outputs', 'index' setupCommand 'setupDummyUser', - 'bin/xpack/users', 'useradd', 'test_user', '-p', 'changeme', '-r', 'admin' + 'bin/x-pack/users', 'useradd', 'test_user', '-p', 'changeme', '-r', 'admin' waitCondition = { node, ant -> File tmpFile = new File(node.cwd, 'wait.success') ant.get(src: "http://${node.httpUri()}", diff --git a/elasticsearch/qa/shield-client-tests/build.gradle b/elasticsearch/qa/shield-client-tests/build.gradle index 75199ff7eeb..1e4099fee20 100644 --- a/elasticsearch/qa/shield-client-tests/build.gradle +++ b/elasticsearch/qa/shield-client-tests/build.gradle @@ -8,9 +8,9 @@ integTest { cluster { plugin 'x-pack', project(':x-plugins:elasticsearch:x-pack') setupCommand 'setupDummyUser', - 'bin/xpack/users', 'useradd', 'test_user', '-p', 'changeme', '-r', 'admin' + 'bin/x-pack/users', 'useradd', 'test_user', '-p', 'changeme', '-r', 'admin' setupCommand 'setupTransportClientUser', - 'bin/xpack/users', 'useradd', 'transport', '-p', 'changeme', '-r', 'transport_client' + 'bin/x-pack/users', 'useradd', 'transport', '-p', 'changeme', '-r', 'transport_client' waitCondition = { node, ant -> File tmpFile = new File(node.cwd, 'wait.success') ant.get(src: "http://${node.httpUri()}", diff --git a/elasticsearch/qa/shield-core-rest-tests/build.gradle b/elasticsearch/qa/shield-core-rest-tests/build.gradle index e8b38558d15..ad48d2e98dd 100644 --- a/elasticsearch/qa/shield-core-rest-tests/build.gradle +++ b/elasticsearch/qa/shield-core-rest-tests/build.gradle @@ -37,7 +37,7 @@ integTest { setting 'xpack.watcher.enabled', 'false' setting 'xpack.monitoring.enabled', 'false' setupCommand 'setupDummyUser', - 'bin/xpack/users', 'useradd', 'test_user', '-p', 'changeme', '-r', 'admin' + 'bin/x-pack/users', 'useradd', 'test_user', '-p', 'changeme', '-r', 'admin' waitCondition = { node, ant -> File tmpFile = new File(node.cwd, 'wait.success') ant.get(src: "http://${node.httpUri()}", diff --git a/elasticsearch/qa/shield-example-realm/build.gradle b/elasticsearch/qa/shield-example-realm/build.gradle index 20b8dd2c37b..f0803a3ebf1 100644 --- a/elasticsearch/qa/shield-example-realm/build.gradle +++ b/elasticsearch/qa/shield-example-realm/build.gradle @@ -28,7 +28,7 @@ processResources { } task buildZip(type:Zip, dependsOn: [jar]) { - from 'build/resources/main/xpack-extension-descriptor.properties' + from 'build/resources/main/x-pack-extension-descriptor.properties' from project.jar } @@ -42,9 +42,9 @@ task integTest(type: org.elasticsearch.gradle.test.RestIntegTestTask, dependsOn: setting 'shield.authc.realms.esusers.type', 'file' setupCommand 'setupDummyUser', - 'bin/xpack/users', 'useradd', 'test_user', '-p', 'changeme', '-r', 'admin' + 'bin/x-pack/users', 'useradd', 'test_user', '-p', 'changeme', '-r', 'admin' setupCommand 'installExtension', - 'bin/xpack/extension', 'install', 'file:' + buildZip.archivePath + 'bin/x-pack/extension', 'install', 'file:' + buildZip.archivePath waitCondition = { node, ant -> File tmpFile = new File(node.cwd, 'wait.success') ant.get(src: "http://${node.httpUri()}", @@ -58,4 +58,4 @@ task integTest(type: org.elasticsearch.gradle.test.RestIntegTestTask, dependsOn: } } check.dependsOn integTest -integTest.mustRunAfter precommit \ No newline at end of file +integTest.mustRunAfter precommit diff --git a/elasticsearch/qa/shield-example-realm/src/main/resources/xpack-extension-descriptor.properties b/elasticsearch/qa/shield-example-realm/src/main/resources/x-pack-extension-descriptor.properties similarity index 100% rename from elasticsearch/qa/shield-example-realm/src/main/resources/xpack-extension-descriptor.properties rename to elasticsearch/qa/shield-example-realm/src/main/resources/x-pack-extension-descriptor.properties diff --git a/elasticsearch/qa/shield-reindex-tests/build.gradle b/elasticsearch/qa/shield-reindex-tests/build.gradle index 735090a7c36..ef409b366df 100644 --- a/elasticsearch/qa/shield-reindex-tests/build.gradle +++ b/elasticsearch/qa/shield-reindex-tests/build.gradle @@ -8,7 +8,7 @@ integTest { cluster { setting 'script.inline', 'true' plugin 'x-pack', project(':x-plugins:elasticsearch:x-pack') - extraConfigFile 'xpack/roles.yml', 'roles.yml' + extraConfigFile 'x-pack/roles.yml', 'roles.yml' [ test_admin: 'admin', powerful_user: 'admin', @@ -19,7 +19,7 @@ integTest { can_not_see_hidden_fields_user: 'can_not_see_hidden_fields', ].each { String user, String role -> setupCommand 'setupUser#' + user, - 'bin/xpack/users', 'useradd', user, '-p', 'changeme', '-r', role + 'bin/x-pack/users', 'useradd', user, '-p', 'changeme', '-r', role } waitCondition = { node, ant -> File tmpFile = new File(node.cwd, 'wait.success') diff --git a/elasticsearch/qa/shield-tribe-node-tests/integration-tests.xml b/elasticsearch/qa/shield-tribe-node-tests/integration-tests.xml index 1b773cb560c..f3dffc65824 100644 --- a/elasticsearch/qa/shield-tribe-node-tests/integration-tests.xml +++ b/elasticsearch/qa/shield-tribe-node-tests/integration-tests.xml @@ -75,10 +75,10 @@ Adding roles.yml - + Adding shield users... - + diff --git a/elasticsearch/qa/smoke-test-found-license-with-shield-and-watcher/integration-tests.xml b/elasticsearch/qa/smoke-test-found-license-with-shield-and-watcher/integration-tests.xml index 6cbb6907506..375f3db605f 100644 --- a/elasticsearch/qa/smoke-test-found-license-with-shield-and-watcher/integration-tests.xml +++ b/elasticsearch/qa/smoke-test-found-license-with-shield-and-watcher/integration-tests.xml @@ -63,10 +63,10 @@ Adding roles.yml with watcher roles - + Adding shield users... - + @@ -76,7 +76,7 @@ - + @@ -86,7 +86,7 @@ - + diff --git a/elasticsearch/qa/smoke-test-graph-with-shield/build.gradle b/elasticsearch/qa/smoke-test-graph-with-shield/build.gradle index 5c3cb6551d0..166cb2c821b 100644 --- a/elasticsearch/qa/smoke-test-graph-with-shield/build.gradle +++ b/elasticsearch/qa/smoke-test-graph-with-shield/build.gradle @@ -16,13 +16,13 @@ integTest { cluster { plugin 'x-pack', project(':x-plugins:elasticsearch:x-pack') - extraConfigFile 'xpack/roles.yml', 'roles.yml' + extraConfigFile 'x-pack/roles.yml', 'roles.yml' setupCommand 'setupTestAdminUser', - 'bin/xpack/users', 'useradd', 'test_admin', '-p', 'changeme', '-r', 'admin' + 'bin/x-pack/users', 'useradd', 'test_admin', '-p', 'changeme', '-r', 'admin' setupCommand 'setupGraphExplorerUser', - 'bin/xpack/users', 'useradd', 'graph_explorer', '-p', 'changeme', '-r', 'graph_explorer' + 'bin/x-pack/users', 'useradd', 'graph_explorer', '-p', 'changeme', '-r', 'graph_explorer' setupCommand 'setupPowerlessUser', - 'bin/xpack/users', 'useradd', 'no_graph_explorer', '-p', 'changeme', '-r', 'no_graph_explorer' + 'bin/x-pack/users', 'useradd', 'no_graph_explorer', '-p', 'changeme', '-r', 'no_graph_explorer' waitCondition = { node, ant -> File tmpFile = new File(node.cwd, 'wait.success') ant.get(src: "http://${node.httpUri()}", diff --git a/elasticsearch/qa/smoke-test-plugins-ssl/build.gradle b/elasticsearch/qa/smoke-test-plugins-ssl/build.gradle index a3fc29f702e..fc2b3515258 100644 --- a/elasticsearch/qa/smoke-test-plugins-ssl/build.gradle +++ b/elasticsearch/qa/smoke-test-plugins-ssl/build.gradle @@ -165,9 +165,9 @@ integTest { extraConfigFile clientKeyStore.name, clientKeyStore setupCommand 'setupTestUser', - 'bin/xpack/users', 'useradd', 'test_user', '-p', 'changeme', '-r', 'admin' + 'bin/x-pack/users', 'useradd', 'test_user', '-p', 'changeme', '-r', 'admin' setupCommand 'setupMarvelUser', - 'bin/xpack/users', 'useradd', 'monitoring_agent', '-p', 'changeme', '-r', 'remote_monitoring_agent' + 'bin/x-pack/users', 'useradd', 'monitoring_agent', '-p', 'changeme', '-r', 'remote_monitoring_agent' waitCondition = { node, ant -> // HTTPS check is tricky to do, so we wait for the log file to indicate that the node is started diff --git a/elasticsearch/qa/smoke-test-plugins/build.gradle b/elasticsearch/qa/smoke-test-plugins/build.gradle index b62b0c6b798..02f763f90ec 100644 --- a/elasticsearch/qa/smoke-test-plugins/build.gradle +++ b/elasticsearch/qa/smoke-test-plugins/build.gradle @@ -18,7 +18,7 @@ integTest { plugin 'x-pack', project(':x-plugins:elasticsearch:x-pack') setupCommand 'setupDummyUser', - 'bin/xpack/users', 'useradd', 'test_user', '-p', 'changeme', '-r', 'admin' + 'bin/x-pack/users', 'useradd', 'test_user', '-p', 'changeme', '-r', 'admin' waitCondition = { node, ant -> File tmpFile = new File(node.cwd, 'wait.success') ant.get(src: "http://${node.httpUri()}", diff --git a/elasticsearch/qa/smoke-test-watcher-with-shield/build.gradle b/elasticsearch/qa/smoke-test-watcher-with-shield/build.gradle index 12b40d0914f..789db6ea5c3 100644 --- a/elasticsearch/qa/smoke-test-watcher-with-shield/build.gradle +++ b/elasticsearch/qa/smoke-test-watcher-with-shield/build.gradle @@ -20,13 +20,13 @@ integTest { cluster { plugin 'x-pack', project(':x-plugins:elasticsearch:x-pack') - extraConfigFile 'xpack/roles.yml', 'roles.yml' + extraConfigFile 'x-pack/roles.yml', 'roles.yml' setupCommand 'setupTestAdminUser', - 'bin/xpack/users', 'useradd', 'test_admin', '-p', 'changeme', '-r', 'admin' + 'bin/x-pack/users', 'useradd', 'test_admin', '-p', 'changeme', '-r', 'admin' setupCommand 'setupWatcherManagerUser', - 'bin/xpack/users', 'useradd', 'watcher_manager', '-p', 'changeme', '-r', 'watcher_manager' + 'bin/x-pack/users', 'useradd', 'watcher_manager', '-p', 'changeme', '-r', 'watcher_manager' setupCommand 'setupPowerlessUser', - 'bin/xpack/users', 'useradd', 'powerless_user', '-p', 'changeme', '-r', 'crappy_role' + 'bin/x-pack/users', 'useradd', 'powerless_user', '-p', 'changeme', '-r', 'crappy_role' waitCondition = { node, ant -> File tmpFile = new File(node.cwd, 'wait.success') ant.get(src: "http://${node.httpUri()}", diff --git a/elasticsearch/x-pack/bin/xpack/.in.bat b/elasticsearch/x-pack/bin/x-pack/.in.bat similarity index 100% rename from elasticsearch/x-pack/bin/xpack/.in.bat rename to elasticsearch/x-pack/bin/x-pack/.in.bat diff --git a/elasticsearch/x-pack/bin/xpack/extension b/elasticsearch/x-pack/bin/x-pack/extension similarity index 90% rename from elasticsearch/x-pack/bin/xpack/extension rename to elasticsearch/x-pack/bin/x-pack/extension index 35e061c7deb..e2c9305a60f 100755 --- a/elasticsearch/x-pack/bin/xpack/extension +++ b/elasticsearch/x-pack/bin/x-pack/extension @@ -94,9 +94,9 @@ if [ -e "$CONF_DIR" ]; then case "$properties" in *-Des.default.path.conf=*) ;; *) - if [ ! -d "$CONF_DIR/xpack" ]; then - echo "ERROR: The configuration directory [$CONF_DIR/xpack] does not exist. The extension tool expects security configuration files in that location." - echo "The plugin may not have been installed with the correct configuration path. If [$ES_HOME/config/xpack] exists, please copy the 'xpack' directory to [$CONF_DIR]" + if [ ! -d "$CONF_DIR/x-pack" ]; then + echo "ERROR: The configuration directory [$CONF_DIR/x-pack] does not exist. The extension tool expects security configuration files in that location." + echo "The plugin may not have been installed with the correct configuration path. If [$ES_HOME/config/x-pack] exists, please copy the 'x-pack' directory to [$CONF_DIR]" exit 1 fi properties="$properties -Des.default.path.conf=$CONF_DIR" @@ -107,10 +107,10 @@ fi export HOSTNAME=`hostname -s` # include x-pack jars in classpath -ES_CLASSPATH="$ES_CLASSPATH:$ES_HOME/plugins/xpack/*" +ES_CLASSPATH="$ES_CLASSPATH:$ES_HOME/plugins/x-pack/*" cd "$ES_HOME" > /dev/null "$JAVA" $ES_JAVA_OPTS -cp "$ES_CLASSPATH" -Des.path.home="$ES_HOME" $properties org.elasticsearch.xpack.extensions.XPackExtensionCli "$@" status=$? cd - > /dev/null -exit $status \ No newline at end of file +exit $status diff --git a/elasticsearch/x-pack/bin/xpack/extension.bat b/elasticsearch/x-pack/bin/x-pack/extension.bat similarity index 100% rename from elasticsearch/x-pack/bin/xpack/extension.bat rename to elasticsearch/x-pack/bin/x-pack/extension.bat diff --git a/elasticsearch/x-pack/build.gradle b/elasticsearch/x-pack/build.gradle index 02526722332..48cbe9e9dbb 100644 --- a/elasticsearch/x-pack/build.gradle +++ b/elasticsearch/x-pack/build.gradle @@ -5,7 +5,7 @@ group 'org.elasticsearch.plugin' apply plugin: 'elasticsearch.esplugin' esplugin { - name 'xpack' + name 'x-pack' description 'Elasticsearch Expanded Pack Plugin' classname 'org.elasticsearch.xpack.XPackPlugin' } @@ -112,16 +112,16 @@ bundlePlugin { include 'LICENSE.txt' include 'NOTICE.txt' } - from('bin/xpack') { + from('bin/x-pack') { into 'bin' } - from('shield/bin/xpack') { + from('shield/bin/x-pack') { into 'bin' } - from('shield/config/xpack') { + from('shield/config/x-pack') { into 'config' } - from('watcher/bin/xpack') { + from('watcher/bin/x-pack') { into 'bin' } } @@ -130,7 +130,7 @@ integTest { // TODO: fix this rest test to not depend on a hardcoded port! systemProperty 'tests.rest.blacklist', 'getting_started/10_monitor_cluster_health/*' cluster { - setupCommand 'setupDummyUser', 'bin/xpack/users', 'useradd', 'test_user', '-p', 'changeme', '-r', 'admin' + setupCommand 'setupDummyUser', 'bin/x-pack/users', 'useradd', 'test_user', '-p', 'changeme', '-r', 'admin' waitCondition = { NodeInfo node, AntBuilder ant -> File tmpFile = new File(node.cwd, 'wait.success') ant.get(src: "http://${node.httpUri()}", @@ -158,7 +158,7 @@ artifacts { } run { - setupCommand 'setupDummyUser', 'bin/xpack/users', 'useradd', 'test_user', '-p', 'changeme', '-r', 'admin' + setupCommand 'setupDummyUser', 'bin/x-pack/users', 'useradd', 'test_user', '-p', 'changeme', '-r', 'admin' } // classes are missing, e.g. com.ibm.icu.lang.UCharacter diff --git a/elasticsearch/x-pack/shield/bin/xpack/syskeygen b/elasticsearch/x-pack/shield/bin/x-pack/syskeygen similarity index 92% rename from elasticsearch/x-pack/shield/bin/xpack/syskeygen rename to elasticsearch/x-pack/shield/bin/x-pack/syskeygen index 47ba00497c8..1918c0d99ec 100755 --- a/elasticsearch/x-pack/shield/bin/xpack/syskeygen +++ b/elasticsearch/x-pack/shield/bin/x-pack/syskeygen @@ -94,9 +94,9 @@ if [ -e "$CONF_DIR" ]; then case "$properties" in *-Des.default.path.conf=*) ;; *) - if [ ! -d "$CONF_DIR/xpack" ]; then - echo "ERROR: The configuration directory [$CONF_DIR/xpack] does not exist. The syskeygen tool expects security configuration files in that location." - echo "The plugin may not have been installed with the correct configuration path. If [$ES_HOME/config/xpack] exists, please copy the 'xpack' directory to [$CONF_DIR]" + if [ ! -d "$CONF_DIR/x-pack" ]; then + echo "ERROR: The configuration directory [$CONF_DIR/x-pack] does not exist. The syskeygen tool expects security configuration files in that location." + echo "The plugin may not have been installed with the correct configuration path. If [$ES_HOME/config/x-pack] exists, please copy the 'x-pack' directory to [$CONF_DIR]" exit 1 fi properties="$properties -Des.default.path.conf=$CONF_DIR" @@ -115,7 +115,7 @@ fi export HOSTNAME=`hostname -s` # include shield jars in classpath -ES_CLASSPATH="$ES_CLASSPATH:$ES_HOME/plugins/xpack/*" +ES_CLASSPATH="$ES_CLASSPATH:$ES_HOME/plugins/x-pack/*" # don't let JAVA_TOOL_OPTIONS slip in (e.g. crazy agents in ubuntu) # works around https://bugs.launchpad.net/ubuntu/+source/jayatana/+bug/1441487 diff --git a/elasticsearch/x-pack/shield/bin/xpack/syskeygen.bat b/elasticsearch/x-pack/shield/bin/x-pack/syskeygen.bat similarity index 100% rename from elasticsearch/x-pack/shield/bin/xpack/syskeygen.bat rename to elasticsearch/x-pack/shield/bin/x-pack/syskeygen.bat diff --git a/elasticsearch/x-pack/shield/bin/xpack/users b/elasticsearch/x-pack/shield/bin/x-pack/users similarity index 92% rename from elasticsearch/x-pack/shield/bin/xpack/users rename to elasticsearch/x-pack/shield/bin/x-pack/users index fda25e854ee..a2430820dc2 100755 --- a/elasticsearch/x-pack/shield/bin/xpack/users +++ b/elasticsearch/x-pack/shield/bin/x-pack/users @@ -94,9 +94,9 @@ if [ -e "$CONF_DIR" ]; then case "$properties" in *-Des.default.path.conf=*) ;; *) - if [ ! -d "$CONF_DIR/xpack" ]; then - echo "ERROR: The configuration directory [$CONF_DIR/xpack] does not exist. The users tool expects security configuration files in that location." - echo "The plugin may not have been installed with the correct configuration path. If [$ES_HOME/config/xpack] exists, please copy the 'xpack' directory to [$CONF_DIR]" + if [ ! -d "$CONF_DIR/x-pack" ]; then + echo "ERROR: The configuration directory [$CONF_DIR/x-pack] does not exist. The users tool expects security configuration files in that location." + echo "The plugin may not have been installed with the correct configuration path. If [$ES_HOME/config/x-pack] exists, please copy the 'x-pack' directory to [$CONF_DIR]" exit 1 fi properties="$properties -Des.default.path.conf=$CONF_DIR" @@ -115,7 +115,7 @@ fi export HOSTNAME=`hostname -s` # include shield jars in classpath -ES_CLASSPATH="$ES_CLASSPATH:$ES_HOME/plugins/xpack/*" +ES_CLASSPATH="$ES_CLASSPATH:$ES_HOME/plugins/x-pack/*" # don't let JAVA_TOOL_OPTIONS slip in (e.g. crazy agents in ubuntu) # works around https://bugs.launchpad.net/ubuntu/+source/jayatana/+bug/1441487 diff --git a/elasticsearch/x-pack/shield/bin/xpack/users.bat b/elasticsearch/x-pack/shield/bin/x-pack/users.bat similarity index 100% rename from elasticsearch/x-pack/shield/bin/xpack/users.bat rename to elasticsearch/x-pack/shield/bin/x-pack/users.bat diff --git a/elasticsearch/x-pack/shield/config/xpack/logging.yml b/elasticsearch/x-pack/shield/config/x-pack/logging.yml similarity index 100% rename from elasticsearch/x-pack/shield/config/xpack/logging.yml rename to elasticsearch/x-pack/shield/config/x-pack/logging.yml diff --git a/elasticsearch/x-pack/shield/config/xpack/role_mapping.yml b/elasticsearch/x-pack/shield/config/x-pack/role_mapping.yml similarity index 100% rename from elasticsearch/x-pack/shield/config/xpack/role_mapping.yml rename to elasticsearch/x-pack/shield/config/x-pack/role_mapping.yml diff --git a/elasticsearch/x-pack/shield/config/xpack/roles.yml b/elasticsearch/x-pack/shield/config/x-pack/roles.yml similarity index 100% rename from elasticsearch/x-pack/shield/config/xpack/roles.yml rename to elasticsearch/x-pack/shield/config/x-pack/roles.yml diff --git a/elasticsearch/x-pack/shield/config/xpack/users b/elasticsearch/x-pack/shield/config/x-pack/users similarity index 100% rename from elasticsearch/x-pack/shield/config/xpack/users rename to elasticsearch/x-pack/shield/config/x-pack/users diff --git a/elasticsearch/x-pack/shield/config/xpack/users_roles b/elasticsearch/x-pack/shield/config/x-pack/users_roles similarity index 100% rename from elasticsearch/x-pack/shield/config/xpack/users_roles rename to elasticsearch/x-pack/shield/config/x-pack/users_roles diff --git a/elasticsearch/x-pack/shield/src/main/java/org/elasticsearch/shield/authc/file/FileUserPasswdStore.java b/elasticsearch/x-pack/shield/src/main/java/org/elasticsearch/shield/authc/file/FileUserPasswdStore.java index a9f0941cd54..f8008329650 100644 --- a/elasticsearch/x-pack/shield/src/main/java/org/elasticsearch/shield/authc/file/FileUserPasswdStore.java +++ b/elasticsearch/x-pack/shield/src/main/java/org/elasticsearch/shield/authc/file/FileUserPasswdStore.java @@ -167,7 +167,7 @@ public class FileUserPasswdStore { } if (users.isEmpty()) { - logger.warn("no users found in users file [{}]. use bin/xpack/file to add users and role mappings", path.toAbsolutePath()); + logger.warn("no users found in users file [{}]. use bin/x-pack/users to add users and role mappings", path.toAbsolutePath()); } return unmodifiableMap(users); } diff --git a/elasticsearch/x-pack/shield/src/main/java/org/elasticsearch/shield/authc/file/FileUserRolesStore.java b/elasticsearch/x-pack/shield/src/main/java/org/elasticsearch/shield/authc/file/FileUserRolesStore.java index 0b4c1efe7ab..566adca87d0 100644 --- a/elasticsearch/x-pack/shield/src/main/java/org/elasticsearch/shield/authc/file/FileUserRolesStore.java +++ b/elasticsearch/x-pack/shield/src/main/java/org/elasticsearch/shield/authc/file/FileUserRolesStore.java @@ -181,7 +181,7 @@ public class FileUserRolesStore { } if (usersRoles.isEmpty()) { - logger.warn("no entries found in users_roles file [{}]. use bin/xpack/file to add users and role mappings", path + logger.warn("no entries found in users_roles file [{}]. use bin/xpack/users to add users and role mappings", path .toAbsolutePath()); } diff --git a/elasticsearch/x-pack/shield/src/main/resources/org/elasticsearch/shield/crypto/tool/syskey-generate.help b/elasticsearch/x-pack/shield/src/main/resources/org/elasticsearch/shield/crypto/tool/syskey-generate.help index d4a175fb16e..c4dc6c228e9 100644 --- a/elasticsearch/x-pack/shield/src/main/resources/org/elasticsearch/shield/crypto/tool/syskey-generate.help +++ b/elasticsearch/x-pack/shield/src/main/resources/org/elasticsearch/shield/crypto/tool/syskey-generate.help @@ -9,7 +9,7 @@ SYNOPSIS DESCRIPTION Generates the system key and stores in the system_key file. By default - it will be stored in 'config/xpack/system_key' file. If the file location + it will be stored in 'config/x-pack/system_key' file. If the file location is customized in the elasticsearch.yml (under the 'shield.system_key.file' setting), the generated key will be stored in that custom location. diff --git a/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/authc/file/tool/UsersToolTests.java b/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/authc/file/tool/UsersToolTests.java index 89af9b4017c..9cfa53152d7 100644 --- a/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/authc/file/tool/UsersToolTests.java +++ b/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/authc/file/tool/UsersToolTests.java @@ -28,6 +28,7 @@ import org.elasticsearch.env.Environment; import org.elasticsearch.shield.authc.support.Hasher; import org.elasticsearch.shield.authc.support.SecuredString; import org.elasticsearch.shield.authc.support.SecuredStringTests; +import org.elasticsearch.xpack.XPackPlugin; import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; @@ -56,7 +57,7 @@ public class UsersToolTests extends CommandTestCase { public void setupHome() throws IOException { Path homeDir = jimfs.getPath("eshome"); IOUtils.rm(homeDir); - confDir = homeDir.resolve("config").resolve("xpack"); + confDir = homeDir.resolve("config").resolve(XPackPlugin.NAME); Files.createDirectories(confDir); Files.write(confDir.resolve("users"), Arrays.asList( "existing_user:" + new String(Hasher.BCRYPT.hash(new SecuredString("changeme".toCharArray()))), diff --git a/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/crypto/tool/SystemKeyToolTests.java b/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/crypto/tool/SystemKeyToolTests.java index 95d20b10661..f7056504463 100644 --- a/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/crypto/tool/SystemKeyToolTests.java +++ b/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/crypto/tool/SystemKeyToolTests.java @@ -64,7 +64,7 @@ public class SystemKeyToolTests extends CommandTestCase { public void testGenerateDefaultPath() throws Exception { assumeTrue("test cannot run with security manager enabled", System.getSecurityManager() == null); - Path keyPath = homeDir.resolve("config/xpack/system_key"); + Path keyPath = homeDir.resolve("config/x-pack/system_key"); Files.createDirectories(keyPath.getParent()); execute(); byte[] bytes = Files.readAllBytes(keyPath); diff --git a/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/XPackPlugin.java b/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/XPackPlugin.java index af42ebdc055..b615bc42ef6 100644 --- a/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/XPackPlugin.java +++ b/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/XPackPlugin.java @@ -39,7 +39,10 @@ import java.util.Collections; public class XPackPlugin extends Plugin { - public static final String NAME = "xpack"; + public static final String NAME = "x-pack"; + + // inside of YAML settings we still use xpack do not having handle issues with dashes + public static final String SETTINGS_NAME = "xpack"; // TODO: clean up this library to not ask for write access to all system properties! static { @@ -228,7 +231,7 @@ public class XPackPlugin extends Plugin { } public static String featureSettingPrefix(String featureName) { - return NAME + "." + featureName; + return SETTINGS_NAME + "." + featureName; } public static String legacyFeatureEnabledSetting(String featureName) { @@ -251,6 +254,6 @@ public class XPackPlugin extends Plugin { } public static Path resolveXPackExtensionsFile(Environment env) { - return env.pluginsFile().resolve("xpack").resolve("extensions"); + return env.pluginsFile().resolve(XPackPlugin.NAME).resolve("extensions"); } } diff --git a/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/extensions/InstallXPackExtensionCommand.java b/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/extensions/InstallXPackExtensionCommand.java index 749cc745760..3f97ea13546 100644 --- a/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/extensions/InstallXPackExtensionCommand.java +++ b/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/extensions/InstallXPackExtensionCommand.java @@ -46,7 +46,7 @@ import static org.elasticsearch.cli.Terminal.Verbosity.VERBOSE; * directory in order to verify the extension satisfies the following requirements: *
    *
  • The property file exists and contains valid metadata. See {@link XPackExtensionInfo#readFromProperties(Path)}
  • - *
  • Jar hell does not exist, either between the extension's own jars or with the parent classloader (elasticsearch + xpack)
  • + *
  • Jar hell does not exist, either between the extension's own jars or with the parent classloader (elasticsearch + x-pack)
  • *
*/ class InstallXPackExtensionCommand extends Command { diff --git a/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/extensions/RemoveXPackExtensionCommand.java b/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/extensions/RemoveXPackExtensionCommand.java index 4b51adbaa82..b700a8d62ad 100644 --- a/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/extensions/RemoveXPackExtensionCommand.java +++ b/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/extensions/RemoveXPackExtensionCommand.java @@ -55,7 +55,7 @@ class RemoveXPackExtensionCommand extends Command { Path extensionDir = resolveXPackExtensionsFile(env).resolve(extensionName); if (Files.exists(extensionDir) == false) { throw new UserError(ExitCodes.USAGE, - "Extension " + extensionName + " not found. Run 'bin/xpack/extension list' to get list of installed extensions."); + "Extension " + extensionName + " not found. Run 'bin/x-pack/extension list' to get list of installed extensions."); } List extensionPaths = new ArrayList<>(); diff --git a/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/extensions/XPackExtensionInfo.java b/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/extensions/XPackExtensionInfo.java index 08a3eb01626..d705f8457ae 100644 --- a/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/extensions/XPackExtensionInfo.java +++ b/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/extensions/XPackExtensionInfo.java @@ -15,7 +15,7 @@ import java.nio.file.Path; import java.util.Properties; public class XPackExtensionInfo { - public static final String XPACK_EXTENSION_PROPERTIES = "xpack-extension-descriptor.properties"; + public static final String XPACK_EXTENSION_PROPERTIES = "x-pack-extension-descriptor.properties"; private String name; private String description; diff --git a/elasticsearch/x-pack/src/test/java/org/elasticsearch/xpack/extensions/InstallXPackExtensionCommandTests.java b/elasticsearch/x-pack/src/test/java/org/elasticsearch/xpack/extensions/InstallXPackExtensionCommandTests.java index e86e7112545..33d96ccbb03 100644 --- a/elasticsearch/x-pack/src/test/java/org/elasticsearch/xpack/extensions/InstallXPackExtensionCommandTests.java +++ b/elasticsearch/x-pack/src/test/java/org/elasticsearch/xpack/extensions/InstallXPackExtensionCommandTests.java @@ -91,14 +91,14 @@ public class InstallXPackExtensionCommandTests extends ESTestCase { } void assertExtension(String name, Path original, Environment env) throws IOException { - Path got = env.pluginsFile().resolve("xpack").resolve("extensions").resolve(name); + Path got = env.pluginsFile().resolve("x-pack").resolve("extensions").resolve(name); assertTrue("dir " + name + " exists", Files.exists(got)); assertTrue("jar was copied", Files.exists(got.resolve("extension.jar"))); assertInstallCleaned(env); } void assertInstallCleaned(Environment env) throws IOException { - try (DirectoryStream stream = Files.newDirectoryStream(env.pluginsFile().resolve("xpack").resolve("extensions"))) { + try (DirectoryStream stream = Files.newDirectoryStream(env.pluginsFile().resolve("x-pack").resolve("extensions"))) { for (Path file : stream) { if (file.getFileName().toString().startsWith(".installing")) { fail("Installation dir still exists, " + file); @@ -179,7 +179,7 @@ public class InstallXPackExtensionCommandTests extends ESTestCase { NoSuchFileException e = expectThrows(NoSuchFileException.class, () -> { installExtension(extZip, env); }); - assertTrue(e.getMessage(), e.getMessage().contains("xpack-extension-descriptor.properties")); + assertTrue(e.getMessage(), e.getMessage().contains("x-pack-extension-descriptor.properties")); assertInstallCleaned(env); } } diff --git a/elasticsearch/x-pack/src/test/java/org/elasticsearch/xpack/extensions/ListXPackExtensionCommandTests.java b/elasticsearch/x-pack/src/test/java/org/elasticsearch/xpack/extensions/ListXPackExtensionCommandTests.java index 2f61e219687..c4f484daa9e 100644 --- a/elasticsearch/x-pack/src/test/java/org/elasticsearch/xpack/extensions/ListXPackExtensionCommandTests.java +++ b/elasticsearch/x-pack/src/test/java/org/elasticsearch/xpack/extensions/ListXPackExtensionCommandTests.java @@ -28,7 +28,7 @@ public class ListXPackExtensionCommandTests extends ESTestCase { } Path createExtensionDir(Environment env) throws IOException { - Path path = env.pluginsFile().resolve("xpack").resolve("extensions"); + Path path = env.pluginsFile().resolve("x-pack").resolve("extensions"); return Files.createDirectories(path); } diff --git a/elasticsearch/x-pack/src/test/java/org/elasticsearch/xpack/extensions/RemoveXPackExtensionCommandTests.java b/elasticsearch/x-pack/src/test/java/org/elasticsearch/xpack/extensions/RemoveXPackExtensionCommandTests.java index aa5a27d1f76..fec7b42e86f 100644 --- a/elasticsearch/x-pack/src/test/java/org/elasticsearch/xpack/extensions/RemoveXPackExtensionCommandTests.java +++ b/elasticsearch/x-pack/src/test/java/org/elasticsearch/xpack/extensions/RemoveXPackExtensionCommandTests.java @@ -30,7 +30,7 @@ public class RemoveXPackExtensionCommandTests extends ESTestCase { } Path createExtensionDir(Environment env) throws IOException { - Path path = env.pluginsFile().resolve("xpack").resolve("extensions"); + Path path = env.pluginsFile().resolve("x-pack").resolve("extensions"); return Files.createDirectories(path); } diff --git a/elasticsearch/x-pack/src/test/resources/rest-api-spec/test/xpack/10_basic.yaml b/elasticsearch/x-pack/src/test/resources/rest-api-spec/test/xpack/10_basic.yaml index efedbf34e42..1b084271907 100644 --- a/elasticsearch/x-pack/src/test/resources/rest-api-spec/test/xpack/10_basic.yaml +++ b/elasticsearch/x-pack/src/test/resources/rest-api-spec/test/xpack/10_basic.yaml @@ -10,4 +10,4 @@ - do: nodes.info: {} - - match: { nodes.$master.plugins.0.name: xpack } + - match: { nodes.$master.plugins.0.name: x-pack } diff --git a/elasticsearch/x-pack/watcher/bin/xpack/croneval b/elasticsearch/x-pack/watcher/bin/x-pack/croneval similarity index 98% rename from elasticsearch/x-pack/watcher/bin/xpack/croneval rename to elasticsearch/x-pack/watcher/bin/x-pack/croneval index 18c3a6604dd..7fb4f6a6328 100755 --- a/elasticsearch/x-pack/watcher/bin/xpack/croneval +++ b/elasticsearch/x-pack/watcher/bin/x-pack/croneval @@ -106,7 +106,7 @@ fi export HOSTNAME=`hostname -s` # include watcher jars in classpath -ES_CLASSPATH="$ES_CLASSPATH:$ES_HOME/plugins/xpack/*" +ES_CLASSPATH="$ES_CLASSPATH:$ES_HOME/plugins/x-pack/*" # don't let JAVA_TOOL_OPTIONS slip in (e.g. crazy agents in ubuntu) # works around https://bugs.launchpad.net/ubuntu/+source/jayatana/+bug/1441487 diff --git a/elasticsearch/x-pack/watcher/bin/xpack/croneval.bat b/elasticsearch/x-pack/watcher/bin/x-pack/croneval.bat similarity index 100% rename from elasticsearch/x-pack/watcher/bin/xpack/croneval.bat rename to elasticsearch/x-pack/watcher/bin/x-pack/croneval.bat