From 3a6a1d5dc2d02a0f3ec117e70f5ef7e1c90209a2 Mon Sep 17 00:00:00 2001 From: uboness Date: Tue, 9 Feb 2016 14:35:37 +0100 Subject: [PATCH] Shield refactoring for 5.0 - phase 3 - Consolidated the `bin` and `config` directories of watcher, shield and marvel under a single `config/xpack` and `bin/xpack` directories. - updated docs accordingly Original commit: elastic/x-pack-elasticsearch@c2aa6132fa1ae29ced85db60686c5d8ea57ba586 --- .../integration-tests.xml | 4 +- .../integration-tests.xml | 8 +- .../main/resources/ant/shield-overrides.xml | 97 ------------------- .../elasticsearch_license_header.txt | 14 --- .../license_header_definition.xml | 13 --- elasticsearch/x-pack/build.gradle | 6 +- .../shield/bin/{shield => xpack}/.in.bat | 0 .../shield/bin/{shield => xpack}/esusers | 6 +- .../shield/bin/{shield => xpack}/esusers.bat | 0 .../shield/bin/{shield => xpack}/syskeygen | 6 +- .../bin/{shield => xpack}/syskeygen.bat | 0 .../config/{shield => xpack}/logging.yml | 0 .../config/{shield => xpack}/role_mapping.yml | 0 .../shield/config/{shield => xpack}/roles.yml | 0 .../shield/config/{shield => xpack}/users | 0 .../config/{shield => xpack}/users_roles | 0 .../authc/esusers/FileUserPasswdStore.java | 2 +- .../authc/esusers/FileUserRolesStore.java | 2 +- .../shield/crypto/tool/syskey-generate.help | 2 +- .../watcher/bin/{watcher => xpack}/.in.bat | 0 .../watcher/bin/{watcher => xpack}/croneval | 0 .../bin/{watcher => xpack}/croneval.bat | 0 22 files changed, 18 insertions(+), 142 deletions(-) delete mode 100644 elasticsearch/x-dev-tools/src/main/resources/ant/shield-overrides.xml delete mode 100644 elasticsearch/x-dev-tools/src/main/resources/commercial-license-check/elasticsearch_license_header.txt delete mode 100644 elasticsearch/x-dev-tools/src/main/resources/commercial-license-check/license_header_definition.xml rename elasticsearch/x-pack/shield/bin/{shield => xpack}/.in.bat (100%) rename elasticsearch/x-pack/shield/bin/{shield => xpack}/esusers (93%) rename elasticsearch/x-pack/shield/bin/{shield => xpack}/esusers.bat (100%) rename elasticsearch/x-pack/shield/bin/{shield => xpack}/syskeygen (93%) rename elasticsearch/x-pack/shield/bin/{shield => xpack}/syskeygen.bat (100%) rename elasticsearch/x-pack/shield/config/{shield => xpack}/logging.yml (100%) rename elasticsearch/x-pack/shield/config/{shield => xpack}/role_mapping.yml (100%) rename elasticsearch/x-pack/shield/config/{shield => xpack}/roles.yml (100%) rename elasticsearch/x-pack/shield/config/{shield => xpack}/users (100%) rename elasticsearch/x-pack/shield/config/{shield => xpack}/users_roles (100%) rename elasticsearch/x-pack/watcher/bin/{watcher => xpack}/.in.bat (100%) rename elasticsearch/x-pack/watcher/bin/{watcher => xpack}/croneval (100%) rename elasticsearch/x-pack/watcher/bin/{watcher => xpack}/croneval.bat (100%) diff --git a/elasticsearch/qa/shield-tribe-node-tests/integration-tests.xml b/elasticsearch/qa/shield-tribe-node-tests/integration-tests.xml index 329ea365bb5..1b773cb560c 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 7961590747f..6cbb6907506 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/x-dev-tools/src/main/resources/ant/shield-overrides.xml b/elasticsearch/x-dev-tools/src/main/resources/ant/shield-overrides.xml deleted file mode 100644 index 79c1e3eb624..00000000000 --- a/elasticsearch/x-dev-tools/src/main/resources/ant/shield-overrides.xml +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - - - - Waiting for elasticsearch to become available on port @{port}... - - - - - - - - - - - - - - - - - - - - true - - - - - - - - - - - - - - - - - - - - Setting up Shield auth - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Checking we can connect with basic auth on port ${integ.http.port}... - - - - - - diff --git a/elasticsearch/x-dev-tools/src/main/resources/commercial-license-check/elasticsearch_license_header.txt b/elasticsearch/x-dev-tools/src/main/resources/commercial-license-check/elasticsearch_license_header.txt deleted file mode 100644 index 250c1ffaa0b..00000000000 --- a/elasticsearch/x-dev-tools/src/main/resources/commercial-license-check/elasticsearch_license_header.txt +++ /dev/null @@ -1,14 +0,0 @@ -ELASTICSEARCH CONFIDENTIAL -__________________ - - [2014] Elasticsearch Incorporated. All Rights Reserved. - -NOTICE: All information contained herein is, and remains -the property of Elasticsearch Incorporated and its suppliers, -if any. The intellectual and technical concepts contained -herein are proprietary to Elasticsearch Incorporated -and its suppliers and may be covered by U.S. and Foreign Patents, -patents in process, and are protected by trade secret or copyright law. -Dissemination of this information or reproduction of this material -is strictly forbidden unless prior written permission is obtained -from Elasticsearch Incorporated. \ No newline at end of file diff --git a/elasticsearch/x-dev-tools/src/main/resources/commercial-license-check/license_header_definition.xml b/elasticsearch/x-dev-tools/src/main/resources/commercial-license-check/license_header_definition.xml deleted file mode 100644 index 1cc53bda001..00000000000 --- a/elasticsearch/x-dev-tools/src/main/resources/commercial-license-check/license_header_definition.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - /* - * - */ - - (\s|\t)*/\*.*$ - .*\*/(\s|\t)*$ - false - true - - diff --git a/elasticsearch/x-pack/build.gradle b/elasticsearch/x-pack/build.gradle index afca83b1a04..1b074b11b05 100644 --- a/elasticsearch/x-pack/build.gradle +++ b/elasticsearch/x-pack/build.gradle @@ -114,13 +114,13 @@ bundlePlugin { include 'LICENSE.txt' include 'NOTICE.txt' } - from('shield/bin/shield') { + from('shield/bin/xpack') { into 'bin' } - from('shield/config/shield') { + from('shield/config/xpack') { into 'config' } - from('watcher/bin/watcher') { + from('watcher/bin/xpack') { into 'bin' } } diff --git a/elasticsearch/x-pack/shield/bin/shield/.in.bat b/elasticsearch/x-pack/shield/bin/xpack/.in.bat similarity index 100% rename from elasticsearch/x-pack/shield/bin/shield/.in.bat rename to elasticsearch/x-pack/shield/bin/xpack/.in.bat diff --git a/elasticsearch/x-pack/shield/bin/shield/esusers b/elasticsearch/x-pack/shield/bin/xpack/esusers similarity index 93% rename from elasticsearch/x-pack/shield/bin/shield/esusers rename to elasticsearch/x-pack/shield/bin/xpack/esusers index cf5aa74d018..50d7d522c34 100755 --- a/elasticsearch/x-pack/shield/bin/shield/esusers +++ b/elasticsearch/x-pack/shield/bin/xpack/esusers @@ -102,9 +102,9 @@ if [ -e "$CONF_DIR" ]; then case "$properties" in *-Des.default.path.conf=*) ;; *) - if [ ! -d "$CONF_DIR/shield" ]; then - echo "ERROR: The configuration directory [$CONF_DIR/shield] does not exist. The esusers tool expects Shield configuration files in that location." - echo "The plugin may not have been installed with the correct configuration path. If [$ES_HOME/config/shield] exists, please copy the shield directory to [$CONF_DIR]" + if [ ! -d "$CONF_DIR/xpack" ]; then + echo "ERROR: The configuration directory [$CONF_DIR/xpack] does not exist. The esusers 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]" exit 1 fi properties="$properties -Des.default.path.conf=$CONF_DIR" diff --git a/elasticsearch/x-pack/shield/bin/shield/esusers.bat b/elasticsearch/x-pack/shield/bin/xpack/esusers.bat similarity index 100% rename from elasticsearch/x-pack/shield/bin/shield/esusers.bat rename to elasticsearch/x-pack/shield/bin/xpack/esusers.bat diff --git a/elasticsearch/x-pack/shield/bin/shield/syskeygen b/elasticsearch/x-pack/shield/bin/xpack/syskeygen similarity index 93% rename from elasticsearch/x-pack/shield/bin/shield/syskeygen rename to elasticsearch/x-pack/shield/bin/xpack/syskeygen index f3cb8bfa123..6f29cb744b8 100755 --- a/elasticsearch/x-pack/shield/bin/shield/syskeygen +++ b/elasticsearch/x-pack/shield/bin/xpack/syskeygen @@ -102,9 +102,9 @@ if [ -e "$CONF_DIR" ]; then case "$properties" in *-Des.default.path.conf=*) ;; *) - if [ ! -d "$CONF_DIR/shield" ]; then - echo "ERROR: The configuration directory [$CONF_DIR/shield] does not exist. The syskeygen tool expects Shield configuration files in that location." - echo "The plugin may not have been installed with the correct configuration path. If [$ES_HOME/config/shield] exists, please copy the shield directory to [$CONF_DIR]" + 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]" exit 1 fi properties="$properties -Des.default.path.conf=$CONF_DIR" diff --git a/elasticsearch/x-pack/shield/bin/shield/syskeygen.bat b/elasticsearch/x-pack/shield/bin/xpack/syskeygen.bat similarity index 100% rename from elasticsearch/x-pack/shield/bin/shield/syskeygen.bat rename to elasticsearch/x-pack/shield/bin/xpack/syskeygen.bat diff --git a/elasticsearch/x-pack/shield/config/shield/logging.yml b/elasticsearch/x-pack/shield/config/xpack/logging.yml similarity index 100% rename from elasticsearch/x-pack/shield/config/shield/logging.yml rename to elasticsearch/x-pack/shield/config/xpack/logging.yml diff --git a/elasticsearch/x-pack/shield/config/shield/role_mapping.yml b/elasticsearch/x-pack/shield/config/xpack/role_mapping.yml similarity index 100% rename from elasticsearch/x-pack/shield/config/shield/role_mapping.yml rename to elasticsearch/x-pack/shield/config/xpack/role_mapping.yml diff --git a/elasticsearch/x-pack/shield/config/shield/roles.yml b/elasticsearch/x-pack/shield/config/xpack/roles.yml similarity index 100% rename from elasticsearch/x-pack/shield/config/shield/roles.yml rename to elasticsearch/x-pack/shield/config/xpack/roles.yml diff --git a/elasticsearch/x-pack/shield/config/shield/users b/elasticsearch/x-pack/shield/config/xpack/users similarity index 100% rename from elasticsearch/x-pack/shield/config/shield/users rename to elasticsearch/x-pack/shield/config/xpack/users diff --git a/elasticsearch/x-pack/shield/config/shield/users_roles b/elasticsearch/x-pack/shield/config/xpack/users_roles similarity index 100% rename from elasticsearch/x-pack/shield/config/shield/users_roles rename to elasticsearch/x-pack/shield/config/xpack/users_roles diff --git a/elasticsearch/x-pack/shield/src/main/java/org/elasticsearch/shield/authc/esusers/FileUserPasswdStore.java b/elasticsearch/x-pack/shield/src/main/java/org/elasticsearch/shield/authc/esusers/FileUserPasswdStore.java index e9a6da330ab..88a1ccf055b 100644 --- a/elasticsearch/x-pack/shield/src/main/java/org/elasticsearch/shield/authc/esusers/FileUserPasswdStore.java +++ b/elasticsearch/x-pack/shield/src/main/java/org/elasticsearch/shield/authc/esusers/FileUserPasswdStore.java @@ -167,7 +167,7 @@ public class FileUserPasswdStore { } if (users.isEmpty()) { - logger.warn("no users found in users file [{}]. use bin/shield/esusers to add users and role mappings", path.toAbsolutePath()); + logger.warn("no users found in users file [{}]. use bin/xpack/esusers 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/esusers/FileUserRolesStore.java b/elasticsearch/x-pack/shield/src/main/java/org/elasticsearch/shield/authc/esusers/FileUserRolesStore.java index 266f57cd487..420fcddf308 100644 --- a/elasticsearch/x-pack/shield/src/main/java/org/elasticsearch/shield/authc/esusers/FileUserRolesStore.java +++ b/elasticsearch/x-pack/shield/src/main/java/org/elasticsearch/shield/authc/esusers/FileUserRolesStore.java @@ -182,7 +182,7 @@ public class FileUserRolesStore { } if (usersRoles.isEmpty()) { - logger.warn("no entries found in users_roles file [{}]. use bin/shield/esusers to add users and role mappings", path + logger.warn("no entries found in users_roles file [{}]. use bin/xpack/esusers 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 bf76a24d6b8..d4a175fb16e 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/shield/.system_key' file. If the file location + it will be stored in 'config/xpack/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/watcher/bin/watcher/.in.bat b/elasticsearch/x-pack/watcher/bin/xpack/.in.bat similarity index 100% rename from elasticsearch/x-pack/watcher/bin/watcher/.in.bat rename to elasticsearch/x-pack/watcher/bin/xpack/.in.bat diff --git a/elasticsearch/x-pack/watcher/bin/watcher/croneval b/elasticsearch/x-pack/watcher/bin/xpack/croneval similarity index 100% rename from elasticsearch/x-pack/watcher/bin/watcher/croneval rename to elasticsearch/x-pack/watcher/bin/xpack/croneval diff --git a/elasticsearch/x-pack/watcher/bin/watcher/croneval.bat b/elasticsearch/x-pack/watcher/bin/xpack/croneval.bat similarity index 100% rename from elasticsearch/x-pack/watcher/bin/watcher/croneval.bat rename to elasticsearch/x-pack/watcher/bin/xpack/croneval.bat