Skip to content

Commit

Permalink
Skip guest creation in new create-guest path
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanrdoherty committed Nov 25, 2024
1 parent b33ba9d commit 52c103f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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<ValidatedToken, User> guest = getWdkModel().getUserFactory().createUnregisteredUser();
Expand Down

0 comments on commit 52c103f

Please sign in to comment.