Skip to content

Commit

Permalink
- FIX: Fixed small issues with the documentation.
Browse files Browse the repository at this point in the history
- FIX: Fixed issues with Gatekeeper client.
  • Loading branch information
sebastian-raubach committed Jan 10, 2022
1 parent 2ea8311 commit 1b2922c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
6 changes: 6 additions & 0 deletions docs/setup-example.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,12 @@ database.password=gatekeeper-password
# Note, we're not using the 9307 port here. That's only for remote access.
database.port=3306
email.address=
email.username=
email.password=
email.server=
email.port=
# This is only true if trying to access it from the machine running Docker.
# If you want the setup to be available from the outside world, use whatever your Proxy setup is configured as.
web.base=http://localhost:9081/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ private static String getContextPath(HttpServletRequest request)
*/
public static boolean isValidImageToken(String imageToken)
{
return tokenToImageToken.containsValue(imageToken);
return !StringUtils.isEmpty(imageToken) && tokenToImageToken.containsValue(imageToken);
}

public static class UserDetails implements Principal
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/jhi/germinate/server/GatekeeperClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@ private static void reset()
{
// Close any existing connections
close();

if (connectionPool == null) {
// Create a connection pool
connectionPool = new ConnectionPool(3, 1, TimeUnit.MINUTES);
}

// Create the HTTP client with the pool and timeouts
httpClient = new OkHttpClient.Builder()
.readTimeout(20, TimeUnit.SECONDS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ public Response getImage(@QueryParam("type") String imageType, @QueryParam("name
return null;
}

if (mode == AuthenticationMode.FULL)
// If it's not a template image, check the image token
if (mode == AuthenticationMode.FULL && type != ImageType.template)
{
Logger.getLogger("").info("TOKEN: " + token + " -> " + AuthenticationFilter.isValidImageToken(token));
if (StringUtils.isEmpty(token) || !AuthenticationFilter.isValidImageToken(token))
Expand Down

0 comments on commit 1b2922c

Please sign in to comment.