Skip to content

Commit

Permalink
Merge branch 'devel' into dbeaver/dbeaver-vscode#7-drivers-download
Browse files Browse the repository at this point in the history
  • Loading branch information
serge-rider authored Nov 22, 2024
2 parents a828bb3 + 350136f commit 341ee7c
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@
*/
package io.cloudbeaver.server.graphql;

import io.cloudbeaver.model.app.BaseWebApplication;
import io.cloudbeaver.model.session.WebSession;
import io.cloudbeaver.server.CBApplication;
import io.cloudbeaver.server.CBPlatform;
import jakarta.servlet.http.HttpServletRequest;
import org.jkiss.code.Nullable;
import org.jkiss.utils.CommonUtils;

import java.util.Map;
Expand Down Expand Up @@ -51,13 +53,18 @@ public static String getSessionId(HttpServletRequest request) {
return session.getUserContext().getSmSessionId();
}

@Nullable
private static WebSession getWebSession(HttpServletRequest request) {
if (request.getSession() == null) {
return null;
}
return (WebSession) CBApplication.getInstance()
.getSessionManager()
.getSession(request.getSession().getId());

if (BaseWebApplication.getInstance() instanceof CBApplication<?> cbApp) {
return (WebSession)cbApp.getSessionManager()
.getSession(request.getSession().getId());
} else {
return null;
}
}

public static String buildLoggerMessage(String sessionId, String userId, Map<String, Object> variables) {
Expand Down

0 comments on commit 341ee7c

Please sign in to comment.