Skip to content

Commit 6a326df

Browse files
committed
fix: multiuse invite derived conns should have msg id
Signed-off-by: Daniel Bluhm <[email protected]>
1 parent 7537fbb commit 6a326df

File tree

3 files changed

+126
-0
lines changed

3 files changed

+126
-0
lines changed

acapy_agent/protocols/didexchange/v1_0/manager.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -756,6 +756,7 @@ async def _derive_new_conn_from_multiuse_invitation(
756756
"""
757757
new_conn_rec = ConnRecord(
758758
invitation_key=conn_rec.invitation_key,
759+
invitation_msg_id=conn_rec.invitation_msg_id,
759760
state=ConnRecord.State.INIT.rfc160,
760761
accept=conn_rec.accept,
761762
their_role=conn_rec.their_role,
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
services:
2+
alice:
3+
image: acapy-test
4+
ports:
5+
- "3001:3001"
6+
environment:
7+
RUST_LOG: 'aries-askar::log::target=error'
8+
command: >
9+
start
10+
--label Alice
11+
--inbound-transport http 0.0.0.0 3000
12+
--outbound-transport http
13+
--endpoint http://alice:3000
14+
--admin 0.0.0.0 3001
15+
--admin-insecure-mode
16+
--tails-server-base-url http://tails:6543
17+
--genesis-url http://test.bcovrin.vonx.io/genesis
18+
--wallet-type askar
19+
--wallet-name alice
20+
--wallet-key insecure
21+
--auto-provision
22+
--log-level debug
23+
--debug-webhooks
24+
healthcheck:
25+
test: curl -s -o /dev/null -w '%{http_code}' "http://localhost:3001/status/live" | grep "200" > /dev/null
26+
start_period: 30s
27+
interval: 7s
28+
timeout: 5s
29+
retries: 5
30+
depends_on:
31+
tails:
32+
condition: service_started
33+
34+
bob:
35+
image: acapy-test
36+
ports:
37+
- "3002:3001"
38+
environment:
39+
RUST_LOG: 'aries-askar::log::target=error'
40+
command: >
41+
start
42+
--label Bob
43+
--inbound-transport http 0.0.0.0 3000
44+
--outbound-transport http
45+
--endpoint http://bob:3000
46+
--admin 0.0.0.0 3001
47+
--admin-insecure-mode
48+
--tails-server-base-url http://tails:6543
49+
--genesis-url http://test.bcovrin.vonx.io/genesis
50+
--wallet-type askar
51+
--wallet-name bob
52+
--wallet-key insecure
53+
--auto-provision
54+
--log-level debug
55+
--debug-webhooks
56+
--monitor-revocation-notification
57+
healthcheck:
58+
test: curl -s -o /dev/null -w '%{http_code}' "http://localhost:3001/status/live" | grep "200" > /dev/null
59+
start_period: 30s
60+
interval: 7s
61+
timeout: 5s
62+
retries: 5
63+
64+
tails:
65+
image: ghcr.io/bcgov/tails-server:latest
66+
ports:
67+
- 6543:6543
68+
environment:
69+
- GENESIS_URL=http://test.bcovrin.vonx.io/genesis
70+
command: >
71+
tails-server
72+
--host 0.0.0.0
73+
--port 6543
74+
--storage-path /tmp/tails-files
75+
--log-level INFO
76+
77+
example:
78+
container_name: controller
79+
build:
80+
context: ../..
81+
environment:
82+
- ALICE=http://alice:3001
83+
- BOB=http://bob:3001
84+
volumes:
85+
- ./example.py:/usr/src/app/example.py:ro,z
86+
command: python -m example
87+
depends_on:
88+
alice:
89+
condition: service_healthy
90+
bob:
91+
condition: service_healthy
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
"""Minimal reproducible example script.
2+
3+
This script is for you to use to reproduce a bug or demonstrate a feature.
4+
"""
5+
6+
import asyncio
7+
from os import getenv
8+
9+
from acapy_controller import Controller
10+
from acapy_controller.logging import logging_to_stdout, section
11+
from acapy_controller.protocols import didexchange, oob_invitation
12+
13+
ALICE = getenv("ALICE", "http://alice:3001")
14+
BOB = getenv("BOB", "http://bob:3001")
15+
16+
17+
async def main():
18+
"""Test Controller protocols."""
19+
async with Controller(base_url=ALICE) as alice, Controller(base_url=BOB) as bob:
20+
invite = await oob_invitation(alice, multi_use=True)
21+
with section("first"):
22+
a1, _ = await didexchange(alice, bob, invite=invite)
23+
a1 = a1.serialize()
24+
assert a1["invitation_msg_id"]
25+
with section("second"):
26+
a2, _ = await didexchange(alice, bob, invite=invite)
27+
a2 = a2.serialize()
28+
assert a2["invitation_msg_id"]
29+
assert a1["invitation_msg_id"] == a2["invitation_msg_id"]
30+
31+
32+
if __name__ == "__main__":
33+
logging_to_stdout()
34+
asyncio.run(main())

0 commit comments

Comments
 (0)