You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by st...@apache.org on 2024/08/15 05:48:03 UTC

(calcite-avatica) branch main updated: [CALCITE-6530] HTTP Sessions are never expired in Avatica server

This is an automated email from the ASF dual-hosted git repository.

stoty pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/calcite-avatica.git


The following commit(s) were added to refs/heads/main by this push:
     new 452df113c [CALCITE-6530] HTTP Sessions are never expired in Avatica server
452df113c is described below

commit 452df113cf85cde5baf5bf7d67d8a014b81a92af
Author: Istvan Toth <st...@apache.org>
AuthorDate: Wed Aug 14 15:07:57 2024 +0200

    [CALCITE-6530] HTTP Sessions are never expired in Avatica server
---
 .../src/main/java/org/apache/calcite/avatica/server/HttpServer.java   | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/server/src/main/java/org/apache/calcite/avatica/server/HttpServer.java b/server/src/main/java/org/apache/calcite/avatica/server/HttpServer.java
index d34a2618b..ce9c2c989 100644
--- a/server/src/main/java/org/apache/calcite/avatica/server/HttpServer.java
+++ b/server/src/main/java/org/apache/calcite/avatica/server/HttpServer.java
@@ -79,6 +79,7 @@ import javax.security.auth.login.LoginException;
 public class HttpServer {
   private static final Logger LOG = LoggerFactory.getLogger(HttpServer.class);
   private static final int MAX_ALLOWED_HEADER_SIZE = 1024 * 64;
+  private static final int MAX_SESSION_INACTIVE_INTERVAL = 60 * 60;
 
   private static final String DEFAULT_KEYSTORE_TYPE = "JKS";
 
@@ -288,6 +289,9 @@ public class HttpServer {
       securityHandler.setHandler(handler);
       // SPNEGO requires a session
       SessionHandler sessionHandler = new SessionHandler();
+      // We could make this configurable, but the only downside of expiring the session is
+      // forcing re-autentication
+      sessionHandler.setMaxInactiveInterval(MAX_SESSION_INACTIVE_INTERVAL);
       sessionHandler.setHandler(securityHandler);
       avaticaHandler = sessionHandler;
     }