Skip to content

Commit

Permalink
Set timeout for idp to 5 seconds
Browse files Browse the repository at this point in the history
  • Loading branch information
ManuelB committed Dec 19, 2023
1 parent a61c327 commit 81627fd
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@
import javax.json.JsonString;
import javax.ws.rs.core.Response;

import com.diffplug.common.base.Errors;
import com.diffplug.common.base.Throwing;

import org.apache.commons.lang3.RandomStringUtils;
import org.apache.commons.lang3.StringUtils;
import org.eclipse.microprofile.rest.client.RestClientBuilder;
import org.jose4j.jwt.JwtClaims;

import com.diffplug.common.base.Errors;
import com.diffplug.common.base.Throwing;

import health.ere.ps.exception.idp.IdpClientException;
import health.ere.ps.exception.idp.IdpException;
import health.ere.ps.exception.idp.IdpJoseException;
Expand Down Expand Up @@ -338,6 +338,7 @@ public IdpHttpClientService getIdpHttpClientInstanceByUrl(String url)
try {
idpHttpClientService = RestClientBuilder.newBuilder()
.baseUrl(new URL(url))
.connectTimeout(5000, java.util.concurrent.TimeUnit.MILLISECONDS)
.build(IdpHttpClientService.class);
} catch (MalformedURLException e) {
throw new IdpClientException("Bad URL: " + url, e);
Expand Down

0 comments on commit 81627fd

Please sign in to comment.