Skip to content

Commit cdc6260

Browse files
author
Andrea Sessa
committed
Add support for elasticsearch 7.6.0
1 parent 1dca0c7 commit cdc6260

File tree

10 files changed

+25
-31
lines changed

10 files changed

+25
-31
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
[![Build Status](https://travis-ci.org/Cleafy/elasticsearch6-http-basic.svg?branch=master)](https://github.com/Cleafy/elasticsearch6-http-basic)
33

44

5-
# HTTP Basic auth for ElasticSearch 6.x
5+
# HTTP Basic auth for ElasticSearch
66

77
This plugin provides an extension of ElasticSearchs HTTP Transport module to enable **HTTP basic authentication** and/or
88
**Ip based authentication**.
@@ -16,7 +16,8 @@ There is no way to configure this on a per index basis.
1616

1717
| Http Basic Plugin | elasticsearch |
1818
|-----------------------------|------------------------------|
19-
| v1.0.0 | 6.3.2 |
19+
| v0.0.1 | 6.3.2 |
20+
| v0.1.0 | 7.6.0 |
2021

2122

2223
## Installation

pom.xml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
44
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
55
<modelVersion>4.0.0</modelVersion>
6-
<groupId>com.cleafy.elasticsearch6</groupId>
7-
<artifactId>elasticsearch6-http-basic</artifactId>
8-
<version>0.0.1</version>
6+
<groupId>com.cleafy.elasticsearch</groupId>
7+
<artifactId>elasticsearch-http-basic</artifactId>
8+
<version>0.1.0</version>
99
<packaging>jar</packaging>
10-
<name>Elasticsearch 6.x Http Basic plugin</name>
10+
<name>Elasticsearch Http Basic plugin</name>
1111
<description>Adds HTTP Basic authentication (BA) to your Elasticsearch cluster</description>
12-
<url>https://github.com/Cleafy/elasticsearch-http-basic</url>
12+
<url>https://github.com/Cleafy/elasticsearch6-http-basic</url>
1313
<inceptionYear>2018</inceptionYear>
1414

1515
<properties>
@@ -21,14 +21,14 @@
2121
<dependency>
2222
<groupId>org.elasticsearch</groupId>
2323
<artifactId>elasticsearch</artifactId>
24-
<version>6.3.2</version>
24+
<version>7.6.0</version>
2525
<scope>provided</scope>
2626
</dependency>
2727

2828
<dependency>
2929
<groupId>org.elasticsearch.test</groupId>
3030
<artifactId>framework</artifactId>
31-
<version>6.3.2</version>
31+
<version>7.6.0</version>
3232
<scope>test</scope>
3333
</dependency>
3434
<dependency>
@@ -40,7 +40,7 @@
4040
</dependencies>
4141

4242
<build>
43-
<finalName>elasticsearch6-http-basic-plugin</finalName>
43+
<finalName>elasticsearch-http-basic-plugin</finalName>
4444
<resources>
4545
<resource>
4646
<directory>src/main/resources</directory>

src/main/java/com/cleafy/elasticsearch6/plugins/http/BasicRestFilter.java renamed to src/main/java/com/cleafy/elasticsearch/plugins/http/BasicRestFilter.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
package com.cleafy.elasticsearch6.plugins.http;
1+
package com.cleafy.elasticsearch.plugins.http;
22

3-
import com.cleafy.elasticsearch6.plugins.http.auth.AuthCredentials;
4-
import com.cleafy.elasticsearch6.plugins.http.auth.HttpBasicAuthenticator;
5-
import com.cleafy.elasticsearch6.plugins.http.utils.Globals;
6-
import com.cleafy.elasticsearch6.plugins.http.utils.LoggerUtils;
3+
import com.cleafy.elasticsearch.plugins.http.auth.AuthCredentials;
4+
import com.cleafy.elasticsearch.plugins.http.auth.HttpBasicAuthenticator;
5+
import com.cleafy.elasticsearch.plugins.http.utils.Globals;
6+
import com.cleafy.elasticsearch.plugins.http.utils.LoggerUtils;
77
import org.elasticsearch.ElasticsearchException;
88
import org.elasticsearch.client.node.NodeClient;
99
import org.elasticsearch.common.settings.Settings;

src/main/java/com/cleafy/elasticsearch6/plugins/http/HttpBasicServerPlugin.java renamed to src/main/java/com/cleafy/elasticsearch/plugins/http/HttpBasicServerPlugin.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
package com.cleafy.elasticsearch6.plugins.http;
1+
package com.cleafy.elasticsearch.plugins.http;
22

3-
import com.cleafy.elasticsearch6.plugins.http.utils.Globals;
3+
import com.cleafy.elasticsearch.plugins.http.utils.Globals;
44
import org.elasticsearch.common.inject.Inject;
55
import org.elasticsearch.common.settings.Setting;
66
import org.elasticsearch.common.settings.Settings;

src/main/java/com/cleafy/elasticsearch6/plugins/http/auth/AuthCredentials.java renamed to src/main/java/com/cleafy/elasticsearch/plugins/http/auth/AuthCredentials.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.cleafy.elasticsearch6.plugins.http.auth;
1+
package com.cleafy.elasticsearch.plugins.http.auth;
22

33
import org.elasticsearch.ElasticsearchSecurityException;
44

src/main/java/com/cleafy/elasticsearch6/plugins/http/auth/Authenticator.java renamed to src/main/java/com/cleafy/elasticsearch/plugins/http/auth/Authenticator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.cleafy.elasticsearch6.plugins.http.auth;
1+
package com.cleafy.elasticsearch.plugins.http.auth;
22

33
import org.elasticsearch.common.settings.Settings;
44
import org.elasticsearch.rest.RestRequest;

src/main/java/com/cleafy/elasticsearch6/plugins/http/auth/HTTPHelper.java renamed to src/main/java/com/cleafy/elasticsearch/plugins/http/auth/HTTPHelper.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.cleafy.elasticsearch6.plugins.http.auth;
1+
package com.cleafy.elasticsearch.plugins.http.auth;
22

33
import java.nio.charset.StandardCharsets;
44
import java.util.Base64;
@@ -14,13 +14,6 @@ public static AuthCredentials extractCredentials(String authorizationHeader) {
1414
final String decodedBasicHeader = new String(Base64.getDecoder().decode(authorizationHeader.split(" ")[1]),
1515
StandardCharsets.UTF_8);
1616

17-
//username:password
18-
//special case
19-
//username must not contain a :, but password is allowed to do so
20-
// username:pass:word
21-
//blank password
22-
// username:
23-
2417
final int firstColonIndex = decodedBasicHeader.indexOf(':');
2518

2619
String username = null;

src/main/java/com/cleafy/elasticsearch6/plugins/http/auth/HttpBasicAuthenticator.java renamed to src/main/java/com/cleafy/elasticsearch/plugins/http/auth/HttpBasicAuthenticator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.cleafy.elasticsearch6.plugins.http.auth;
1+
package com.cleafy.elasticsearch.plugins.http.auth;
22

33
import org.elasticsearch.common.settings.Settings;
44
import org.elasticsearch.rest.RestRequest;

src/main/java/com/cleafy/elasticsearch6/plugins/http/utils/Globals.java renamed to src/main/java/com/cleafy/elasticsearch/plugins/http/utils/Globals.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.cleafy.elasticsearch6.plugins.http.utils;
1+
package com.cleafy.elasticsearch.plugins.http.utils;
22

33
public class Globals {
44
public static final String SETTINGS_ENABLED = "http.basic.enabled";

src/main/java/com/cleafy/elasticsearch6/plugins/http/utils/LoggerUtils.java renamed to src/main/java/com/cleafy/elasticsearch/plugins/http/utils/LoggerUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.cleafy.elasticsearch6.plugins.http.utils;
1+
package com.cleafy.elasticsearch.plugins.http.utils;
22

33
import org.apache.logging.log4j.LogManager;
44
import org.apache.logging.log4j.Logger;
@@ -36,6 +36,6 @@ public static void logUnAuthorizedRequest(final RestRequest request, Class<?> kl
3636
}
3737

3838
private static InetAddress getAddress(RestRequest request) {
39-
return ((InetSocketAddress) request.getRemoteAddress()).getAddress();
39+
return ((InetSocketAddress) request.getHttpChannel().getRemoteAddress()).getAddress();
4040
}
4141
}

0 commit comments

Comments
 (0)