Skip to content

Commit 154133a

Browse files
committed
fix: respect auto verify in pres v1
Signed-off-by: Daniel Bluhm <dbluhm@pm.me>
1 parent 5578c0d commit 154133a

2 files changed

Lines changed: 14 additions & 6 deletions

File tree

aries_cloudagent/protocols/present_proof/v1_0/handlers/presentation_handler.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,14 @@ async def handle(self, context: RequestContext, responder: BaseResponder):
6464
)
6565

6666
# Automatically move to next state if flag is set
67-
if presentation_exchange_record and presentation_exchange_record.auto_verify:
67+
if (
68+
presentation_exchange_record
69+
and presentation_exchange_record.auto_verify
70+
or context.settings.get("debug.auto_verify_presentation")
71+
):
6872
try:
6973
await presentation_manager.verify_presentation(
70-
presentation_exchange_record
74+
presentation_exchange_record, responder
7175
)
7276
except (BaseModelError, LedgerError, StorageError) as err:
7377
self._logger.exception(err)

aries_cloudagent/protocols/present_proof/v1_0/manager.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,9 @@ async def receive_presentation(
393393
return presentation_exchange_record
394394

395395
async def verify_presentation(
396-
self, presentation_exchange_record: V10PresentationExchange
396+
self,
397+
presentation_exchange_record: V10PresentationExchange,
398+
responder: Optional[BaseResponder] = None,
397399
):
398400
"""
399401
Verify a presentation.
@@ -436,11 +438,13 @@ async def verify_presentation(
436438
session, reason="verify presentation"
437439
)
438440

439-
await self.send_presentation_ack(presentation_exchange_record)
441+
await self.send_presentation_ack(presentation_exchange_record, responder)
440442
return presentation_exchange_record
441443

442444
async def send_presentation_ack(
443-
self, presentation_exchange_record: V10PresentationExchange
445+
self,
446+
presentation_exchange_record: V10PresentationExchange,
447+
responder: Optional[BaseResponder] = None,
444448
):
445449
"""
446450
Send acknowledgement of presentation receipt.
@@ -449,7 +453,7 @@ async def send_presentation_ack(
449453
presentation_exchange_record: presentation exchange record with thread id
450454
451455
"""
452-
responder = self._profile.inject_or(BaseResponder)
456+
responder = responder or self._profile.inject_or(BaseResponder)
453457

454458
if not presentation_exchange_record.connection_id:
455459
# Find associated oob record. If this presentation exchange is created

0 commit comments

Comments
 (0)