using doc forge
This commit is contained in:
5
mail_intake/credentials/__init__.pyi
Normal file
5
mail_intake/credentials/__init__.pyi
Normal file
@@ -0,0 +1,5 @@
|
||||
from .store import CredentialStore
|
||||
from .pickle import PickleCredentialStore
|
||||
from .redis import RedisCredentialStore
|
||||
|
||||
__all__ = ["CredentialStore", "PickleCredentialStore", "RedisCredentialStore"]
|
||||
11
mail_intake/credentials/pickle.pyi
Normal file
11
mail_intake/credentials/pickle.pyi
Normal file
@@ -0,0 +1,11 @@
|
||||
from typing import Optional, TypeVar
|
||||
from .store import CredentialStore
|
||||
|
||||
T = TypeVar("T")
|
||||
|
||||
class PickleCredentialStore(CredentialStore[T]):
|
||||
path: str
|
||||
def __init__(self, path: str) -> None: ...
|
||||
def load(self) -> Optional[T]: ...
|
||||
def save(self, credentials: T) -> None: ...
|
||||
def clear(self) -> None: ...
|
||||
15
mail_intake/credentials/redis.pyi
Normal file
15
mail_intake/credentials/redis.pyi
Normal file
@@ -0,0 +1,15 @@
|
||||
from typing import Optional, TypeVar, Callable, Any
|
||||
from .store import CredentialStore
|
||||
|
||||
T = TypeVar("T")
|
||||
|
||||
class RedisCredentialStore(CredentialStore[T]):
|
||||
redis: Any
|
||||
key: str
|
||||
serialize: Callable[[T], bytes]
|
||||
deserialize: Callable[[bytes], T]
|
||||
ttl_seconds: Optional[int]
|
||||
def __init__(self, redis_client: Any, key: str, serialize: Callable[[T], bytes], deserialize: Callable[[bytes], T], ttl_seconds: Optional[int] = ...) -> None: ...
|
||||
def load(self) -> Optional[T]: ...
|
||||
def save(self, credentials: T) -> None: ...
|
||||
def clear(self) -> None: ...
|
||||
@@ -39,12 +39,6 @@ class CredentialStore(ABC, Generic[T]):
|
||||
- The concrete credential type being stored
|
||||
- The serialization format used to persist credentials
|
||||
- The underlying storage backend or durability guarantees
|
||||
|
||||
Type Parameters:
|
||||
T:
|
||||
The concrete credential type managed by the store. This may
|
||||
represent OAuth credentials, API tokens, session objects,
|
||||
or any other authentication material.
|
||||
"""
|
||||
|
||||
@abstractmethod
|
||||
|
||||
12
mail_intake/credentials/store.pyi
Normal file
12
mail_intake/credentials/store.pyi
Normal file
@@ -0,0 +1,12 @@
|
||||
from abc import ABC, abstractmethod
|
||||
from typing import Generic, Optional, TypeVar
|
||||
|
||||
T = TypeVar("T")
|
||||
|
||||
class CredentialStore(ABC, Generic[T]):
|
||||
@abstractmethod
|
||||
def load(self) -> Optional[T]: ...
|
||||
@abstractmethod
|
||||
def save(self, credentials: T) -> None: ...
|
||||
@abstractmethod
|
||||
def clear(self) -> None: ...
|
||||
Reference in New Issue
Block a user