acapy_agent.multitenant package
Subpackages
Submodules
acapy_agent.multitenant.base module
acapy_agent.multitenant.cache module
Cache for multitenancy profiles.
- class acapy_agent.multitenant.cache.ProfileCache(capacity: int)[source]
Bases:
objectProfile cache that caches based on LRU strategy.
- get(key: str) Profile | None[source]
Get profile with associated key from cache.
If a profile is open but has been evicted from the cache, this will reinsert the profile back into the cache. This prevents attempting to open a profile that is already open. Triggers clean up.
- Parameters:
key (str) – the key to get the profile for.
- Returns:
Profile if found in cache.
- Return type:
Optional[Profile]
- has(key: str) bool[source]
Check whether there is a profile with associated key in the cache.
- Parameters:
key (str) – the key to check for a profile
- Returns:
Whether the key exists in the cache
- Return type:
bool
acapy_agent.multitenant.error module
Multitenant error classes.
- exception acapy_agent.multitenant.error.InvalidTokenError(message: str = 'Token not valid')[source]
Bases:
MultitenantManagerErrorException raised for invalid tokens.
- exception acapy_agent.multitenant.error.MissingProfileError(message: str = 'Missing profile')[source]
Bases:
MultitenantManagerErrorException raised when a profile is missing.
- exception acapy_agent.multitenant.error.MultitenantManagerError(*args, error_code: str | None = None, **kwargs)[source]
Bases:
BaseErrorGeneric multitenant error.
- exception acapy_agent.multitenant.error.WalletAlreadyExistsError(wallet_name: str)[source]
Bases:
MultitenantManagerErrorException raised when a wallet already exists.
- exception acapy_agent.multitenant.error.WalletKeyMissingError(message: str = 'Missing key to open wallet')[source]
Bases:
MultitenantManagerErrorWallet key missing exception.
acapy_agent.multitenant.manager module
acapy_agent.multitenant.manager_provider module
Profile manager for multitenancy.
- class acapy_agent.multitenant.manager_provider.MultitenantManagerProvider(root_profile)[source]
Bases:
BaseProviderMultitenant manager provider.
Decides which manager to use based on the settings.
- MANAGER_TYPES = {'basic': 'acapy_agent.multitenant.manager.MultitenantManager', 'single-wallet-askar': 'acapy_agent.multitenant.single_wallet_askar_manager.SingleWalletAskarMultitenantManager', 'single-wallet-kanon': 'acapy_agent.multitenant.single_wallet_kanon_manager.SingleWalletKanonMultitenantManager'}
- provide(settings: BaseSettings, injector: BaseInjector)[source]
Create the multitenant manager instance.
- single_wallet_askar_manager_path = 'acapy_agent.multitenant.single_wallet_askar_manager.SingleWalletAskarMultitenantManager'
- single_wallet_kanon_manager_path = 'acapy_agent.multitenant.single_wallet_kanon_manager.SingleWalletKanonMultitenantManager'