Skip to content

Commit

Permalink
Update to ES 2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Hendrik Saly committed Nov 26, 2015
1 parent 4a55815 commit a245351
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 18 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Shield Kerberos Realm
=====================

Kerberos/SPNEGO custom realm for Elasticsearch Shield 2.0.
Kerberos/SPNEGO custom realm for Elasticsearch Shield 2.1.
Authenticate HTTP and Transport requests via Kerberos/SPNEGO.

###License
Expand All @@ -23,19 +23,19 @@ Available. Please contact [vertrieb@codecentric.de](mailto:vertrieb@codecentric.

###Prerequisites

* Elasticsearch 2.0
* Shield Plugin 2.0
* Elasticsearch 2.1
* Shield Plugin 2.1
* Kerberos Infrastructure (ActiveDirectory, MIT, Heimdal, ...)

###Install release
[Download latest release](https://github.com/codecentric/elasticsearch-shield-kerberos-realm/releases) and store it somewhere. Then execute:

$ bin/plugin install file:///path/to/target/release/elasticsearch-shield-kerberos-realm-2.0.0.zip
$ bin/plugin install file:///path/to/target/release/elasticsearch-shield-kerberos-realm-2.1.0.zip

###Build and install latest
$ git clone https://github.com/codecentric/elasticsearch-shield-kerberos-realm.git
$ mvn package
$ bin/plugin install file:///path/to/target/release/elasticsearch-shield-kerberos-realm-2.0.0.zip
$ bin/plugin install file:///path/to/target/release/elasticsearch-shield-kerberos-realm-2.1.0.zip

###Configuration

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.elasticsearch.plugin</groupId>
<artifactId>plugins</artifactId>
<version>2.0.0</version>
<version>2.1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
import org.elasticsearch.license.plugin.LicensePlugin;
import org.elasticsearch.node.Node;
import org.elasticsearch.node.NodeBuilder;
import org.elasticsearch.node.PluginEnabledNode;
import org.elasticsearch.shield.ShieldPlugin;
import org.junit.After;
import org.junit.Assert;
Expand All @@ -71,6 +72,9 @@
import org.junit.rules.TestWatcher;
import org.junit.runner.Description;

import com.google.common.collect.Lists;

import de.codecentric.elasticsearch.plugin.kerberosrealm.realm.KerberosRealm;
import de.codecentric.elasticsearch.plugin.kerberosrealm.support.EmbeddedKRBServer;
import de.codecentric.elasticsearch.plugin.kerberosrealm.support.JaasKrbUtil;
import de.codecentric.elasticsearch.plugin.kerberosrealm.support.KrbConstants;
Expand Down Expand Up @@ -150,7 +154,8 @@ private Settings.Builder getDefaultSettingsBuilder(final int nodenum, final int

// @formatter:off
return settingsBuilder()
.putArray("plugin.types", ShieldPlugin.class.getName(), LicensePlugin.class.getName(), KerberosRealmPlugin.class.getName())
//.putArray("plugin.types", ShieldPlugin.class.getName(), LicensePlugin.class.getName(), KerberosRealmPlugin.class.getName())
.putArray("plugin.mandatory",KerberosRealm.TYPE + "-realm","shield","license")
.put("index.queries.cache.type", "opt_out_cache").put(PREFIX + "order", 0).put(PREFIX + "type", "cc-kerberos")
.put("path.home", ".").put("node.name", "kerberosrealm_testnode_" + nodenum).put("node.data", dataNode)
.put("node.master", masterNode).put("cluster.name", clustername).put("path.data", "testtmp/data")
Expand Down Expand Up @@ -190,17 +195,16 @@ public final void startES(final Settings settings) throws Exception {
//elasticsearchNodePort2 = portIt.next();
//elasticsearchNodePort3 = portIt.next();

esNode1 = new NodeBuilder().settings(
getDefaultSettingsBuilder(1, 0, elasticsearchHttpPort1, false, true).put(
settings == null ? Settings.Builder.EMPTY_SETTINGS : settings).build()).node();
esNode1 = new PluginEnabledNode(getDefaultSettingsBuilder(1, 0, elasticsearchHttpPort1, false, true).put(
settings == null ? Settings.Builder.EMPTY_SETTINGS : settings).build(), Lists.newArrayList(ShieldPlugin.class, LicensePlugin.class, KerberosRealmPlugin.class)).start();
client = esNode1.client();
esNode2 = new NodeBuilder().settings(
getDefaultSettingsBuilder(2, 0, elasticsearchHttpPort2, true, true).put(
settings == null ? Settings.Builder.EMPTY_SETTINGS : settings).build()).node();
esNode3 = new NodeBuilder().settings(
getDefaultSettingsBuilder(3, 0, elasticsearchHttpPort3, true, false).put(
settings == null ? Settings.Builder.EMPTY_SETTINGS : settings).build()).node();


esNode2 = new PluginEnabledNode(getDefaultSettingsBuilder(2, 0, elasticsearchHttpPort2, true, true).put(
settings == null ? Settings.Builder.EMPTY_SETTINGS : settings).build(), Lists.newArrayList(ShieldPlugin.class, LicensePlugin.class, KerberosRealmPlugin.class)).start();

esNode3 = new PluginEnabledNode(getDefaultSettingsBuilder(3, 0, elasticsearchHttpPort3, true, false).put(
settings == null ? Settings.Builder.EMPTY_SETTINGS : settings).build(), Lists.newArrayList(ShieldPlugin.class, LicensePlugin.class, KerberosRealmPlugin.class)).start();
waitForGreenClusterState();
final NodesInfoResponse nodeInfos = client().admin().cluster().prepareNodesInfo().get();
final NodeInfo[] nodes = nodeInfos.getNodes();
Expand Down
18 changes: 18 additions & 0 deletions src/test/java/org/elasticsearch/node/PluginEnabledNode.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package org.elasticsearch.node;

import java.util.Collection;

import org.elasticsearch.Version;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.node.Node;
import org.elasticsearch.plugins.Plugin;

public class PluginEnabledNode extends Node{

public PluginEnabledNode(Settings preparedSettings, Collection<Class<? extends Plugin>> classpathPlugins) {
super(preparedSettings, Version.CURRENT, classpathPlugins);
}



}
2 changes: 1 addition & 1 deletion src/test/resources/log4j.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
log4j.rootLogger=WARN, out
log4j.rootLogger=INFO, out

log4j.logger.org.elasticsearch.de.codecentric.elasticsearch=ALL
log4j.logger.de.codecentric.elasticsearch=ALL
Expand Down

0 comments on commit a245351

Please sign in to comment.