From 2ed041695f6adaf3b9513ea1ee603181ce88fdb7 Mon Sep 17 00:00:00 2001 From: Ezri Brimhall Date: Tue, 2 Sep 2025 16:52:08 -0600 Subject: [PATCH] Added auth cache support --- src/vpn_manager_globalprotect/backend.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/vpn_manager_globalprotect/backend.py b/src/vpn_manager_globalprotect/backend.py index 9c71470..b5da280 100644 --- a/src/vpn_manager_globalprotect/backend.py +++ b/src/vpn_manager_globalprotect/backend.py @@ -24,6 +24,7 @@ import base64 import re import psutil import signal +from datetime import timedelta class LoginTarget(StrEnum): @@ -85,6 +86,13 @@ class GlobalProtectConnection( logger = logging.getLogger(f"{__name__}.GlobalProtectConnection") + def get_auth_cache_timeout(self, options: dict[str, Variant]) -> timedelta | None: + """Get the timeout for the authdata cache.""" + timeout = options.get("auth_cache_timeout") + if timeout is None: + return None + return timedelta(seconds=timeout.value) + async def _prelogin(self, options: dict[str, Variant]): """Perform prelogin request."""