From 61805454010a39fabcdf9e3e7fe3be019951da98 Mon Sep 17 00:00:00 2001 From: Sergey Beryozkin Date: Tue, 13 Jun 2023 18:58:23 +0100 Subject: [PATCH] Avoid indefinite Uni wait in OIDC recorders --- .../java/io/quarkus/oidc/client/runtime/OidcClientRecorder.java | 2 +- .../src/main/java/io/quarkus/oidc/runtime/OidcRecorder.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/oidc-client/runtime/src/main/java/io/quarkus/oidc/client/runtime/OidcClientRecorder.java b/extensions/oidc-client/runtime/src/main/java/io/quarkus/oidc/client/runtime/OidcClientRecorder.java index 4d3015c436322..4915d298d2300 100644 --- a/extensions/oidc-client/runtime/src/main/java/io/quarkus/oidc/client/runtime/OidcClientRecorder.java +++ b/extensions/oidc-client/runtime/src/main/java/io/quarkus/oidc/client/runtime/OidcClientRecorder.java @@ -87,7 +87,7 @@ public OidcClients get() { protected static OidcClient createOidcClient(OidcClientConfig oidcConfig, String oidcClientId, TlsConfig tlsConfig, Supplier vertx) { - return createOidcClientUni(oidcConfig, oidcClientId, tlsConfig, vertx).await().indefinitely(); + return createOidcClientUni(oidcConfig, oidcClientId, tlsConfig, vertx).await().atMost(oidcConfig.connectionTimeout); } protected static Uni createOidcClientUni(OidcClientConfig oidcConfig, String oidcClientId, diff --git a/extensions/oidc/runtime/src/main/java/io/quarkus/oidc/runtime/OidcRecorder.java b/extensions/oidc/runtime/src/main/java/io/quarkus/oidc/runtime/OidcRecorder.java index 3f10ffc72b0ae..1a77ace20ff89 100644 --- a/extensions/oidc/runtime/src/main/java/io/quarkus/oidc/runtime/OidcRecorder.java +++ b/extensions/oidc/runtime/src/main/java/io/quarkus/oidc/runtime/OidcRecorder.java @@ -140,7 +140,7 @@ public TenantConfigContext apply(Throwable t) { throw new OIDCException(t); } }) - .await().indefinitely(); + .await().atMost(oidcConfig.getConnectionTimeout()); } private static Throwable logTenantConfigContextFailure(Throwable t, String tenantId) {