fix: annotate redis_client param and formalize Args in RedisCredentialStore.__init__; refresh MCP docs
This commit is contained in:
@@ -25,7 +25,7 @@ responsibility of authentication provider implementations.
|
||||
"""
|
||||
|
||||
from collections.abc import Callable
|
||||
from typing import TypeVar
|
||||
from typing import Any, TypeVar
|
||||
|
||||
from mail_intake.credentials.store import CredentialStore
|
||||
|
||||
@@ -57,7 +57,7 @@ class RedisCredentialStore(CredentialStore[T]):
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
redis_client,
|
||||
redis_client: Any,
|
||||
key: str,
|
||||
serialize: Callable[[T], bytes],
|
||||
deserialize: Callable[[bytes], T],
|
||||
@@ -66,10 +66,18 @@ class RedisCredentialStore(CredentialStore[T]):
|
||||
"""
|
||||
Initialize a Redis-backed credential store.
|
||||
|
||||
Callers supply all runtime dependencies: ``redis_client`` is an
|
||||
initialized Redis client instance, ``key`` names the storage key,
|
||||
``serialize``/``deserialize`` are the encoding and decoding callables,
|
||||
and ``ttl_seconds`` optionally limits credential lifetime.
|
||||
Args:
|
||||
redis_client (Any):
|
||||
Initialized Redis client instance used for persistence.
|
||||
key (str):
|
||||
Storage key under which credentials are persisted.
|
||||
serialize (Callable[[T], bytes]):
|
||||
Callable that encodes credentials to bytes for storage.
|
||||
deserialize (Callable[[bytes], T]):
|
||||
Callable that decodes stored bytes back into credentials.
|
||||
ttl_seconds (int | None):
|
||||
Optional time-to-live in seconds after which stored
|
||||
credentials expire automatically. ``None`` disables expiry.
|
||||
"""
|
||||
self.redis = redis_client
|
||||
self.key = key
|
||||
|
||||
Reference in New Issue
Block a user