MCPcopy
hub / github.com/streamlit/streamlit / AuthCache

Class AuthCache

lib/streamlit/auth_util.py:53–71  ·  view source on GitHub ↗

Simple cache implementation for storing info required for Authlib.

Source from the content-addressed store, hash-verified

51
52
53class AuthCache:
54 """Simple cache implementation for storing info required for Authlib."""
55
56 def __init__(self) -> None:
57 self.cache: dict[str, Any] = {}
58
59 def get(self, key: str) -> Any:
60 return self.cache.get(key)
61
62 # for set method, we are follow the same signature used in Authlib
63 # the expires_in is not used in our case
64 def set(self, key: str, value: Any, expires_in: int | None = None) -> None: # noqa: ARG002
65 self.cache[key] = value
66
67 def get_dict(self) -> dict[str, Any]:
68 return self.cache
69
70 def delete(self, key: str) -> None:
71 self.cache.pop(key, None)
72
73
74def is_authlib_installed() -> bool:

Callers 2

test_auth_cacheMethod · 0.90
test_auth_cache_get_dictFunction · 0.90

Calls

no outgoing calls

Tested by 2

test_auth_cacheMethod · 0.72
test_auth_cache_get_dictFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…