From 745d2c18ace0ce9e8e5c33c27ef61a23356f7ebb Mon Sep 17 00:00:00 2001 From: Daniel Bluhm Date: Mon, 27 Jan 2025 11:59:17 -0600 Subject: [PATCH 1/2] fix: ensure profile names are unique Signed-off-by: Daniel Bluhm --- acapy_agent/askar/profile.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/acapy_agent/askar/profile.py b/acapy_agent/askar/profile.py index 2b5c8bfe62..e562ff88ff 100644 --- a/acapy_agent/askar/profile.py +++ b/acapy_agent/askar/profile.py @@ -42,7 +42,9 @@ def __init__( profile_id: Optional[str] = None, ): """Create a new AskarProfile instance.""" - super().__init__(context=context, name=opened.name, created=opened.created) + super().__init__( + context=context, name=profile_id or opened.name, created=opened.created + ) self.opened = opened self.ledger_pool: Optional[IndyVdrLedgerPool] = None self.profile_id = profile_id @@ -52,7 +54,7 @@ def __init__( @property def name(self) -> str: """Accessor for the profile name.""" - return self.opened.name + return self.profile_id or self.opened.name @property def store(self) -> Store: From 3f80a4dec87db7f7bbc759041fc6b1880c1b8658 Mon Sep 17 00:00:00 2001 From: Daniel Bluhm Date: Mon, 27 Jan 2025 16:06:18 -0600 Subject: [PATCH 2/2] fix: same fix for anon profile Signed-off-by: Daniel Bluhm --- acapy_agent/askar/profile_anon.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/acapy_agent/askar/profile_anon.py b/acapy_agent/askar/profile_anon.py index 9a3cb3e622..90c6e7a09d 100644 --- a/acapy_agent/askar/profile_anon.py +++ b/acapy_agent/askar/profile_anon.py @@ -44,7 +44,9 @@ def __init__( profile_id: Optional[str] = None, ): """Create a new AskarProfile instance.""" - super().__init__(context=context, name=opened.name, created=opened.created) + super().__init__( + context=context, name=profile_id or opened.name, created=opened.created + ) self.opened = opened self.ledger_pool: Optional[IndyVdrLedgerPool] = None self.profile_id = profile_id @@ -54,7 +56,7 @@ def __init__( @property def name(self) -> str: """Accessor for the profile name.""" - return self.opened.name + return self.profile_id or self.opened.name @property def store(self) -> Store: