From eb8ee9f64a6929e5464421305cb7f8297df2d1b8 Mon Sep 17 00:00:00 2001 From: jamshale <31809382+jamshale@users.noreply.github.com> Date: Fri, 17 Jan 2025 15:03:25 -0800 Subject: [PATCH] Prevent dummy profiles on start up (#3449) Signed-off-by: jamshale --- acapy_agent/utils/profiles.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/acapy_agent/utils/profiles.py b/acapy_agent/utils/profiles.py index 1e78314de7..9fd888c3e4 100644 --- a/acapy_agent/utils/profiles.py +++ b/acapy_agent/utils/profiles.py @@ -8,6 +8,7 @@ from ..askar.profile_anon import AskarAnoncredsProfile from ..core.profile import Profile from ..multitenant.manager import MultitenantManager +from ..multitenant.single_wallet_askar_manager import SingleWalletAskarMultitenantManager from ..storage.base import BaseStorageSearch from ..wallet.models.wallet_record import WalletRecord @@ -41,6 +42,13 @@ async def get_subwallet_profiles_from_storage(root_profile: Profile) -> list[Pro search_session = base_storage_search.search_records( type_filter=WalletRecord.RECORD_TYPE, page_size=10 ) + if ( + root_profile.context.settings.get("multitenant.wallet_type") + == "single-wallet-askar" + ): + manager = SingleWalletAskarMultitenantManager(root_profile) + else: + manager = MultitenantManager(root_profile) while search_session._done is False: wallet_storage_records = await search_session.fetch() for wallet_storage_record in wallet_storage_records: @@ -49,7 +57,7 @@ async def get_subwallet_profiles_from_storage(root_profile: Profile) -> list[Pro json.loads(wallet_storage_record.value), ) subwallet_profiles.append( - await MultitenantManager(root_profile).get_wallet_profile( + await manager.get_wallet_profile( base_context=root_profile.context, wallet_record=wallet_record, )