From 52c103fda003e82b58b224cc0121f12678133558 Mon Sep 17 00:00:00 2001 From: Ryan Doherty Date: Mon, 25 Nov 2024 07:07:39 -0500 Subject: [PATCH] Skip guest creation in new create-guest path --- .../java/org/gusdb/wdk/service/filter/CheckLoginFilter.java | 5 +++-- .../java/org/gusdb/wdk/service/service/SessionService.java | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Service/src/main/java/org/gusdb/wdk/service/filter/CheckLoginFilter.java b/Service/src/main/java/org/gusdb/wdk/service/filter/CheckLoginFilter.java index a17452684..0c8228baa 100644 --- a/Service/src/main/java/org/gusdb/wdk/service/filter/CheckLoginFilter.java +++ b/Service/src/main/java/org/gusdb/wdk/service/filter/CheckLoginFilter.java @@ -132,8 +132,9 @@ private String findRawBearerToken(RequestData request, ContainerRequestContext r } protected boolean isPathToSkip(String path) { - // skip user check for prometheus metrics requests - return SystemService.PROMETHEUS_ENDPOINT_PATH.equals(path); + // skip user check for prometheus metrics and new guest requests + return SystemService.PROMETHEUS_ENDPOINT_PATH.equals(path) + || SessionService.CREATE_GUEST_ENDPOINT_PATH.equals(path); } @Override diff --git a/Service/src/main/java/org/gusdb/wdk/service/service/SessionService.java b/Service/src/main/java/org/gusdb/wdk/service/service/SessionService.java index 3afaa5a43..7808baf55 100644 --- a/Service/src/main/java/org/gusdb/wdk/service/service/SessionService.java +++ b/Service/src/main/java/org/gusdb/wdk/service/service/SessionService.java @@ -49,6 +49,8 @@ public class SessionService extends AbstractWdkService { private static final Logger LOG = Logger.getLogger(SessionService.class); + public static final String CREATE_GUEST_ENDPOINT_PATH = "create-guest"; + private enum ResponseType { REDIRECT, JSON; } @@ -117,7 +119,7 @@ private static String generateStateToken(WdkModel wdkModel) throws WdkModelExcep } @GET - @Path("create-guest") + @Path(CREATE_GUEST_ENDPOINT_PATH) @Produces(MediaType.APPLICATION_JSON) public Response createGuest() throws WdkModelException { TwoTuple guest = getWdkModel().getUserFactory().createUnregisteredUser();