Simple cache implementation for storing info required for Authlib.
| 51 | |
| 52 | |
| 53 | class 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 | |
| 74 | def is_authlib_installed() -> bool: |
no outgoing calls
searching dependent graphs…