Store
mail_intake.credentials.store
Credential persistence abstractions for Mail Intake.
Summary
This module defines the generic persistence contract used to store and retrieve authentication credentials across Mail Intake components.
The CredentialStore abstraction establishes a strict separation
between credential lifecycle management and credential storage.
Authentication providers are responsible for acquiring, validating,
refreshing, and revoking credentials, while concrete store
implementations are responsible solely for persistence concerns.
By remaining agnostic to credential structure, serialization format, and storage backend, this module enables multiple persistence strategies—such as local files, in-memory caches, distributed stores, or secrets managers—without coupling authentication logic to any specific storage mechanism.
Classes
CredentialStore
Bases: ABC, Generic[T]
Abstract base class defining a generic persistence interface for authentication credentials.
Notes
Responsibilities:
1 2 | |
Constraints:
1 2 3 4 | |
Functions
clear
abstractmethod
Remove any persisted credentials from the store.
Notes
Lifecycle:
1 2 | |
Guarantees:
1 | |
load
abstractmethod
Load previously persisted credentials.
Returns:
| Type | Description |
|---|---|
Optional[T]
|
Optional[T]:
An instance of type |
Notes
Guarantees:
1 2 | |
save
abstractmethod
Persist credentials to the underlying storage backend.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
credentials |
T
|
The credential object to persist. |
required |
Notes
Lifecycle:
1 | |
Responsibilities:
1 2 3 | |