Skip to content

Commit b30f88f

Browse files
committed
- cleanup
- fix cert issue - drop jedis integration tests (move to jedis) - add unit tests - change textcontext to load demand
1 parent 10852a8 commit b30f88f

File tree

9 files changed

+151
-257
lines changed

9 files changed

+151
-257
lines changed

core/src/main/java/redis/clients/authentication/core/TokenManager.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ public class TokenManager {
1818
private IdentityProvider identityProvider;
1919
private TokenListener listener;
2020
private ScheduledExecutorService scheduler = Executors.newSingleThreadScheduledExecutor();
21-
private ExecutorService executor = Executors.newSingleThreadExecutor();
21+
22+
// TODO: manage thread pool to avoid blocking on IDP hangs
23+
private ExecutorService executor = Executors.newFixedThreadPool(2);
2224
private boolean stopped = false;
2325
private ScheduledFuture<?> scheduledTask;
2426
private int numberOfRetries = 0;

core/src/test/java/redis/clients/authentication/CoreAuthenticationIntegrationTests.java

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

entraid/src/main/java/redis/clients/authentication/entraid/EntraIDIdentityProvider.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
import com.microsoft.aad.msal4j.IClientCredential;
1414
import com.microsoft.aad.msal4j.ManagedIdentityApplication;
1515
import com.microsoft.aad.msal4j.ManagedIdentityParameters;
16-
1716
import redis.clients.authentication.core.IdentityProvider;
1817
import redis.clients.authentication.core.Token;
1918

@@ -48,8 +47,9 @@ public EntraIDIdentityProvider(ManagedIdentityInfo info, Set<String> scopes) {
4847
resultSupplier = () -> supplierForManagedIdentityApp(app, params);
4948
}
5049

51-
public EntraIDIdentityProvider(Supplier<IAuthenticationResult> customEntraIdAppSupplier) {
52-
this.resultSupplier = customEntraIdAppSupplier;
50+
public EntraIDIdentityProvider(
51+
Supplier<IAuthenticationResult> customEntraIdAuthenticationSupplier) {
52+
this.resultSupplier = customEntraIdAuthenticationSupplier;
5353
}
5454

5555
private IClientCredential getClientCredential(ServicePrincipalInfo servicePrincipalInfo) {

entraid/src/main/java/redis/clients/authentication/entraid/EntraIDIdentityProviderConfig.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ public EntraIDIdentityProviderConfig(ManagedIdentityInfo info, Set<String> scope
2121
}
2222

2323
public EntraIDIdentityProviderConfig(
24-
Supplier<IAuthenticationResult> customEntraIdAppSupplier) {
25-
providerSupplier = () -> new EntraIDIdentityProvider(customEntraIdAppSupplier);
24+
Supplier<IAuthenticationResult> customEntraIdAuthenticationSupplier) {
25+
providerSupplier = () -> new EntraIDIdentityProvider(customEntraIdAuthenticationSupplier);
2626
}
2727

2828
@Override

entraid/src/main/java/redis/clients/authentication/entraid/EntraIDTokenAuthConfigBuilder.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ public EntraIDTokenAuthConfigBuilder secret(String secret) {
5050

5151
public EntraIDTokenAuthConfigBuilder key(PrivateKey key, X509Certificate cert) {
5252
this.key = key;
53+
this.cert = cert;
5354
this.accessWith = ServicePrincipalAccess.WithCert;
5455
return this;
5556
}

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
public class EntraIDIntegrationTests {
1212

13-
1413
@Test
1514
public void requestTokenWithSecret() throws MalformedURLException {
1615
TestContext testCtx = TestContext.DEFAULT;

0 commit comments

Comments
 (0)