Skip to content

Commit 2ab345f

Browse files
committed
remove all jedis config and dependency
1 parent 457d4af commit 2ab345f

File tree

5 files changed

+2
-273
lines changed

5 files changed

+2
-273
lines changed

.github/workflows/entraid_integration.yml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,6 @@ jobs:
2727
working-directory: ./entraid
2828
steps:
2929
- uses: actions/checkout@v2
30-
- name: Checkout Jedis repository (tba_draft branch)
31-
uses: actions/checkout@v2
32-
with:
33-
repository: atakavci/jedis # Replace with the actual jedis repository URL
34-
ref: ali/authx2
35-
path: jedis # Check out into a subdirectory named `jedis` so it's isolated
3630

3731
- name: Set up publishing to maven central
3832
uses: actions/setup-java@v2
@@ -56,15 +50,6 @@ jobs:
5650
mvn clean install -DskipTests # Skip tests for faster builds, but you can remove the flag if needed
5751
working-directory: ./core
5852

59-
- name: Maven offline-jedis
60-
run: |
61-
mvn -q dependency:go-offline
62-
working-directory: ./jedis
63-
- name: Build and install Jedis supports TBA into local repo
64-
run: |
65-
mvn clean install -DskipTests # Skip tests for faster builds, but you can remove the flag if needed
66-
working-directory: ./jedis
67-
6853
- name: Build docs
6954
run: |
7055
mvn javadoc:jar

entraid/pom.xml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,7 @@
6767
<artifactId>msal4j</artifactId>
6868
<version>1.17.2</version>
6969
</dependency>
70-
<dependency>
71-
<groupId>redis.clients</groupId>
72-
<artifactId>jedis</artifactId>
73-
<version>5.3.0-SNAPSHOT</version>
74-
<scope>test</scope>
75-
</dependency>
76-
<dependency>
70+
<dependency>
7771
<groupId>junit</groupId>
7872
<artifactId>junit</artifactId>
7973
<version>4.13.2</version>
Lines changed: 1 addition & 140 deletions
Original file line numberDiff line numberDiff line change
@@ -1,140 +1 @@
1-
package redis.clients.authentication;
2-
3-
import com.google.gson.FieldNamingPolicy;
4-
import com.google.gson.Gson;
5-
import com.google.gson.GsonBuilder;
6-
import com.google.gson.reflect.TypeToken;
7-
8-
import redis.clients.jedis.DefaultJedisClientConfig;
9-
import redis.clients.jedis.HostAndPort;
10-
import redis.clients.jedis.util.JedisURIHelper;
11-
12-
import java.io.FileReader;
13-
import java.net.URI;
14-
import java.util.*;
15-
16-
public class EndpointConfig {
17-
18-
private final boolean tls;
19-
private final String username;
20-
private final String password;
21-
private final int bdbId;
22-
private final List<URI> endpoints;
23-
24-
public EndpointConfig(HostAndPort hnp, String username, String password, boolean tls) {
25-
this.tls = tls;
26-
this.username = username;
27-
this.password = password;
28-
this.bdbId = 0;
29-
this.endpoints = Collections.singletonList(
30-
URI.create(getURISchema(tls) + hnp.getHost() + ":" + hnp.getPort()));
31-
}
32-
33-
public HostAndPort getHostAndPort() {
34-
return JedisURIHelper.getHostAndPort(endpoints.get(0));
35-
}
36-
37-
public HostAndPort getHostAndPort(int index) {
38-
return JedisURIHelper.getHostAndPort(endpoints.get(index));
39-
}
40-
41-
public String getPassword() {
42-
return password;
43-
}
44-
45-
public String getUsername() {
46-
return username == null? "default" : username;
47-
}
48-
49-
public String getHost() {
50-
return getHostAndPort().getHost();
51-
}
52-
53-
public int getPort() {
54-
return getHostAndPort().getPort();
55-
}
56-
57-
public int getBdbId() { return bdbId; }
58-
59-
public URI getURI() {
60-
return endpoints.get(0);
61-
}
62-
63-
public class EndpointURIBuilder {
64-
private boolean tls;
65-
66-
private String username;
67-
68-
private String password;
69-
70-
private String path;
71-
72-
public EndpointURIBuilder() {
73-
this.username = "";
74-
this.password = "";
75-
this.path = "";
76-
this.tls = EndpointConfig.this.tls;
77-
}
78-
79-
public EndpointURIBuilder defaultCredentials() {
80-
this.username = EndpointConfig.this.username == null ? "" : getUsername();
81-
this.password = EndpointConfig.this.getPassword();
82-
return this;
83-
}
84-
85-
public EndpointURIBuilder tls(boolean v) {
86-
this.tls = v;
87-
return this;
88-
}
89-
90-
public EndpointURIBuilder path(String v) {
91-
this.path = v;
92-
return this;
93-
}
94-
95-
public EndpointURIBuilder credentials(String u, String p) {
96-
this.username = u;
97-
this.password = p;
98-
return this;
99-
}
100-
101-
public URI build() {
102-
String userInfo = !(this.username.isEmpty() && this.password.isEmpty()) ?
103-
this.username + ':' + this.password + '@' :
104-
"";
105-
return URI.create(
106-
getURISchema(this.tls) + userInfo + getHost() + ":" + getPort() + this.path);
107-
}
108-
}
109-
110-
public EndpointURIBuilder getURIBuilder() {
111-
return new EndpointURIBuilder();
112-
}
113-
114-
public DefaultJedisClientConfig.Builder getClientConfigBuilder() {
115-
DefaultJedisClientConfig.Builder builder = DefaultJedisClientConfig.builder()
116-
.password(password).ssl(tls);
117-
118-
if (username != null) {
119-
return builder.user(username);
120-
}
121-
122-
return builder;
123-
}
124-
125-
protected String getURISchema(boolean tls) {
126-
return (tls ? "rediss" : "redis") + "://";
127-
}
128-
129-
public static HashMap<String, EndpointConfig> loadFromJSON(String filePath) throws Exception {
130-
Gson gson = new GsonBuilder().setFieldNamingPolicy(
131-
FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES).create();
132-
133-
HashMap<String, EndpointConfig> configs;
134-
try (FileReader reader = new FileReader(filePath)) {
135-
configs = gson.fromJson(reader, new TypeToken<HashMap<String, EndpointConfig>>() {
136-
}.getType());
137-
}
138-
return configs;
139-
}
140-
}
1+
//

entraid/src/test/java/redis/clients/authentication/EntraIDUnitTests.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,6 @@
6161
import redis.clients.authentication.entraid.ServicePrincipalInfo;
6262
import redis.clients.authentication.entraid.ManagedIdentityInfo.UserManagedIdentityType;
6363

64-
// import redis.clients.jedis.DefaultJedisClientConfig;
65-
// import redis.clients.jedis.HostAndPort;
66-
// import redis.clients.jedis.JedisPooled;
67-
6864
public class EntraIDUnitTests {
6965

7066
private static final float EXPIRATION_REFRESH_RATIO = 0.7F;

entraid/src/test/resources/endpoints.json

Lines changed: 0 additions & 107 deletions
This file was deleted.

0 commit comments

Comments
 (0)