Skip to content

Commit

Permalink
Merge pull request #18 from Indicio-tech/feat/mediator-demo
Browse files Browse the repository at this point in the history
fix: enc_payload issues for Delivery Request
  • Loading branch information
dbluhm authored Apr 14, 2022
2 parents f9a1ce0 + 5c73047 commit 868c6d4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
24 changes: 12 additions & 12 deletions acapy_plugin_pickup/protocol/delivery.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,20 +72,20 @@ async def handle(self, context: RequestContext, responder: BaseResponder):
routing_keys = msg.target_list[0].routing_keys or []
sender_key = msg.target_list[0].sender_key or key

# Depending on send_outbound() implementation, there is a
# race condition with the timestamp. When ACA-Py is under
# load, there is a potential for this encryption to not
# match the actual encryption
# This scenario is rare; a message will almost always have an
# encrypted payload. The only time it won't is if we're sending a
# message from the mediator itself, rather than forwarding a message
# from another agent.
# TODO: update ACA-Py to store all messages with an
# encrypted payload

msg.enc_payload = await wire_format.encode_message(
profile_session,
msg.payload,
recipient_key,
routing_keys,
sender_key,
)
if not msg.enc_payload:
msg.enc_payload = await wire_format.encode_message(
profile_session,
msg.payload,
recipient_key,
routing_keys,
sender_key,
)

attached_msg = Attach.data_base64(
ident=json.loads(msg.enc_payload)["tag"], value=msg.enc_payload
Expand Down
3 changes: 2 additions & 1 deletion docker/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ debug-presentations: true
auto-accept-invites: true
auto-accept-requests: true
connections-invite: true
log-level: debug
# Modify for more output:
log-level: warning

# Accept mediation requests
open-mediation: true

0 comments on commit 868c6d4

Please sign in to comment.