$42 GRAYBYTE WORDPRESS FILE MANAGER $93

SERVER : vnpttt-amd7f72-h1.vietnix.vn #1 SMP Fri May 24 12:42:50 UTC 2024
SERVER IP : 103.200.23.149 | ADMIN IP 216.73.216.22
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/opt/cloudlinux/venv/lib/python3.11/site-packages/jwt/

HOME
Current File : /opt/cloudlinux/venv/lib/python3.11/site-packages/jwt//jwk_set_cache.py
import time
from typing import Optional

from .api_jwk import PyJWKSet, PyJWTSetWithTimestamp


class JWKSetCache:
    def __init__(self, lifespan: int) -> None:
        self.jwk_set_with_timestamp: Optional[PyJWTSetWithTimestamp] = None
        self.lifespan = lifespan

    def put(self, jwk_set: PyJWKSet) -> None:
        if jwk_set is not None:
            self.jwk_set_with_timestamp = PyJWTSetWithTimestamp(jwk_set)
        else:
            # clear cache
            self.jwk_set_with_timestamp = None

    def get(self) -> Optional[PyJWKSet]:
        if self.jwk_set_with_timestamp is None or self.is_expired():
            return None

        return self.jwk_set_with_timestamp.get_jwk_set()

    def is_expired(self) -> bool:
        return (
            self.jwk_set_with_timestamp is not None
            and self.lifespan > -1
            and time.monotonic()
            > self.jwk_set_with_timestamp.get_timestamp() + self.lifespan
        )

Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
17 Dec 2025 3.08 AM
root / root
0755
__pycache__
--
14 Aug 2025 9.24 PM
root / root
0755
__init__.py
1.631 KB
17 Apr 2025 8.10 PM
root / root
0644
algorithms.py
29.102 KB
17 Apr 2025 8.10 PM
root / root
0644
api_jwk.py
4.098 KB
17 Apr 2025 8.10 PM
root / root
0644
api_jws.py
10.839 KB
17 Apr 2025 8.10 PM
root / root
0644
api_jwt.py
12.342 KB
17 Apr 2025 8.10 PM
root / root
0644
exceptions.py
1.021 KB
17 Apr 2025 8.10 PM
root / root
0644
help.py
1.708 KB
17 Apr 2025 8.10 PM
root / root
0644
jwk_set_cache.py
0.937 KB
17 Apr 2025 8.10 PM
root / root
0644
jwks_client.py
4.123 KB
17 Apr 2025 8.10 PM
root / root
0644
py.typed
0 KB
17 Apr 2025 8.10 PM
root / root
0644
types.py
0.097 KB
17 Apr 2025 8.10 PM
root / root
0644
utils.py
3.812 KB
17 Apr 2025 8.10 PM
root / root
0644
warnings.py
0.058 KB
17 Apr 2025 8.10 PM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF