Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for REDIS Auth #187

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,15 @@ subprojects {
testCompile "io.netty:netty-all:4.1.14.Final"
}

project.tasks.withType(Javadoc) {
if (JavaVersion.current().isJava8Compatible()) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
//project.tasks.withType(Javadoc) {
// if (JavaVersion.current().isJava8Compatible()) {
// //options.addStringOption('Xdoclint:none', '-quiet')
// options.addBooleanOption('Xdoclint:none', true)
// failOnError=false
// }
//}

tasks.withType(Javadoc).all { enabled = false }

}
project(':dyno-core') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public class Host implements Comparable<Host> {
private final String datacenter;
private String hashtag;
private Status status = Status.Down;
private String password = null;

public enum Status {
Up, Down;
Expand Down Expand Up @@ -106,6 +107,14 @@ public String getHostAddress() {
return hostname;
}

public String getPassword() {
return password;
}

public void setPassword(String password) {
this.password = password;
}

public String getHostName() {
return hostname;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,13 @@ public JedisConnection(HostConnectionPool<Jedis> hostPool) {
jedisClient = new Jedis(host.getHostAddress(), host.getPort(), hostPool.getConnectionTimeout(),
hostPool.getSocketTimeout(), true, sslSocketFactory, new SSLParameters(), null);
}

String redisPassword = host.getPassword();
if(null != jedisClient && null != redisPassword) {
if(!jedisClient.auth(redisPassword).equals("OK")) {
Logger.warn("Failed to set REDIS auth Password");
}
}
}

@Override
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-bin.zip