-
Notifications
You must be signed in to change notification settings - Fork 9
/
test_verifier.py
756 lines (653 loc) · 23.9 KB
/
test_verifier.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
import asyncio
import json
import time
import pytest
from aries_cloudcontroller import IndyPresSpec, IndyRequestedCredsRequestedAttr
from fastapi import HTTPException
from app.routes.connections import router as conn_router
from app.routes.definitions import router as def_router
from app.routes.issuer import router as issuer_router
from app.routes.oob import router as oob_router
from app.routes.verifier import AcceptProofRequest, RejectProofRequest
from app.routes.verifier import router as verifier_router
from app.tests.fixtures.credentials import ReferentCredDef
from app.tests.services.verifier.utils import indy_proof_request
from app.tests.util.connections import AcmeAliceConnect, MeldCoAliceConnect
from app.tests.util.regression_testing import TestMode
from app.tests.util.verifier import send_proof_request
from app.tests.util.webhooks import check_webhook_state
from shared import RichAsyncClient
from shared.models.credential_exchange import CredentialExchange
from shared.models.presentation_exchange import PresentationExchange
CONNECTIONS_BASE_PATH = conn_router.prefix
DEFINITIONS_BASE_PATH = def_router.prefix
ISSUER_BASE_PATH = issuer_router.prefix
OOB_BASE_PATH = oob_router.prefix
VERIFIER_BASE_PATH = verifier_router.prefix
@pytest.mark.anyio
@pytest.mark.parametrize("protocol_version", ["v1", "v2"])
@pytest.mark.parametrize(
"acme_and_alice_connection", ["trust_registry", "default"], indirect=True
)
async def test_send_proof_request(
acme_and_alice_connection: AcmeAliceConnect,
acme_client: RichAsyncClient,
alice_member_client: RichAsyncClient,
protocol_version: str,
):
request_body = {
"connection_id": acme_and_alice_connection.acme_connection_id,
"protocol_version": protocol_version,
"indy_proof_request": indy_proof_request.to_dict(),
}
send_proof_response = await send_proof_request(acme_client, request_body)
assert "presentation" in send_proof_response
assert "presentation_request" in send_proof_response
assert "created_at" in send_proof_response
assert "proof_id" in send_proof_response
assert send_proof_response["role"] == "verifier"
assert send_proof_response["state"]
thread_id = send_proof_response["thread_id"]
assert thread_id
alice_connection_event = await check_webhook_state(
client=alice_member_client,
topic="proofs",
state="request-received",
filter_map={
"thread_id": thread_id,
},
)
assert alice_connection_event["protocol_version"] == protocol_version
@pytest.mark.anyio
@pytest.mark.parametrize("protocol_version", ["v1", "v2"])
@pytest.mark.parametrize(
"acme_and_alice_connection", ["trust_registry", "default"], indirect=True
)
async def test_accept_proof_request(
issue_credential_to_alice: CredentialExchange, # pylint: disable=unused-argument
alice_member_client: RichAsyncClient,
acme_client: RichAsyncClient,
credential_definition_id: str,
protocol_version: str,
acme_and_alice_connection: AcmeAliceConnect,
):
request_body = {
"connection_id": acme_and_alice_connection.acme_connection_id,
"protocol_version": protocol_version,
"indy_proof_request": {
"name": "Proof Request",
"version": "1.0.0",
"requested_attributes": {
"0_speed_uuid": {
"name": "speed",
"restrictions": [{"cred_def_id": credential_definition_id}],
}
},
"requested_predicates": {},
},
}
send_proof_response = await send_proof_request(acme_client, request_body)
assert send_proof_response["protocol_version"] == protocol_version
acme_proof_id = send_proof_response["proof_id"]
thread_id = send_proof_response["thread_id"]
alice_payload = await check_webhook_state(
client=alice_member_client,
topic="proofs",
state="request-received",
filter_map={
"thread_id": thread_id,
},
)
alice_proof_id = alice_payload["proof_id"]
requested_credentials = await alice_member_client.get(
f"{VERIFIER_BASE_PATH}/proofs/{alice_proof_id}/credentials"
)
referent = requested_credentials.json()[0]["cred_info"]["referent"]
indy_request_attrs = IndyRequestedCredsRequestedAttr(
cred_id=referent, revealed=True
)
proof_accept = AcceptProofRequest(
proof_id=alice_proof_id,
indy_presentation_spec=IndyPresSpec(
requested_attributes={"0_speed_uuid": indy_request_attrs},
requested_predicates={},
self_attested_attributes={},
),
)
response = await alice_member_client.post(
VERIFIER_BASE_PATH + "/accept-request",
json=proof_accept.model_dump(),
)
result = response.json()
pres_exchange_result = PresentationExchange(**result)
assert isinstance(pres_exchange_result, PresentationExchange)
assert await check_webhook_state(
client=alice_member_client,
topic="proofs",
state="done",
filter_map={
"proof_id": alice_proof_id,
},
look_back=5,
)
acme_proof_event = await check_webhook_state(
client=acme_client,
topic="proofs",
state="done",
filter_map={
"proof_id": acme_proof_id,
},
look_back=5,
)
assert acme_proof_event["verified"] is True
@pytest.mark.anyio
@pytest.mark.parametrize("protocol_version", ["v1", "v2"])
@pytest.mark.parametrize("delete_proof_record", [True, False])
async def test_reject_proof_request(
acme_and_alice_connection: AcmeAliceConnect,
alice_member_client: RichAsyncClient,
acme_client: RichAsyncClient,
protocol_version: str,
delete_proof_record: bool,
):
request_body = {
"connection_id": acme_and_alice_connection.acme_connection_id,
"protocol_version": protocol_version,
"indy_proof_request": indy_proof_request.to_dict(),
}
send_proof_response = await send_proof_request(acme_client, request_body)
thread_id = send_proof_response["thread_id"]
assert thread_id
alice_exchange = await check_webhook_state(
client=alice_member_client,
topic="proofs",
state="request-received",
filter_map={
"thread_id": thread_id,
},
)
assert alice_exchange["protocol_version"] == protocol_version
reject_proof_request = RejectProofRequest(
proof_id=alice_exchange["proof_id"],
problem_report="rejected",
delete_proof_record=delete_proof_record,
)
response = await alice_member_client.post(
VERIFIER_BASE_PATH + "/reject-request",
json=reject_proof_request.model_dump(),
)
assert response.status_code == 204
# assert that record has transitioned to "abandoned" state
alice_abandoned_webhook = await check_webhook_state(
client=alice_member_client,
topic="proofs",
state="abandoned",
filter_map={
"thread_id": thread_id,
},
)
assert alice_abandoned_webhook["error_msg"] == "created problem report: rejected"
# assert that record has transitioned to "abandoned" state
acme_abandoned_webhook = await check_webhook_state(
client=acme_client,
topic="proofs",
state="abandoned",
filter_map={
"thread_id": thread_id,
},
)
assert acme_abandoned_webhook["error_msg"] == "abandoned: rejected"
# assert that alice has webhook for "deleted" state change
if delete_proof_record:
alice_exchange = await check_webhook_state(
client=alice_member_client,
topic="proofs",
state="deleted",
filter_map={
"thread_id": thread_id,
},
)
@pytest.mark.anyio
@pytest.mark.parametrize("protocol_version", ["v1", "v2"])
async def test_get_proof_and_get_proofs(
acme_and_alice_connection: AcmeAliceConnect,
issue_credential_to_alice: CredentialExchange, # pylint: disable=unused-argument
acme_client: RichAsyncClient,
alice_member_client: RichAsyncClient,
protocol_version: str,
):
acme_connection_id = acme_and_alice_connection.acme_connection_id
request_body = {
"save_exchange_record": True,
"connection_id": acme_connection_id,
"protocol_version": protocol_version,
"indy_proof_request": indy_proof_request.to_dict(),
}
send_proof_response = await send_proof_request(acme_client, request_body)
# Assert that getting single proof record works
acme_proof_id = send_proof_response["proof_id"]
thread_id = send_proof_response["thread_id"]
response = await acme_client.get(
f"{VERIFIER_BASE_PATH}/proofs/{acme_proof_id}",
)
result = response.json()
assert "connection_id" in result
assert "created_at" in result
assert "updated_at" in result
assert "presentation" in result
assert "presentation_request" in result
assert result["protocol_version"] == protocol_version
await asyncio.sleep(0.3) # allow moment for alice records to update
# Fetch proofs for alice
alice_payload = await check_webhook_state(
client=alice_member_client,
topic="proofs",
state="request-received",
filter_map={
"thread_id": thread_id,
},
look_back=5,
)
alice_proof_id = alice_payload["proof_id"]
# Get credential referent for alice to accept request
referent = (
await alice_member_client.get(
f"{VERIFIER_BASE_PATH}/proofs/{alice_proof_id}/credentials"
)
).json()[0]["cred_info"]["referent"]
indy_request_attrs = IndyRequestedCredsRequestedAttr(
cred_id=referent, revealed=True
)
proof_accept = AcceptProofRequest(
proof_id=alice_proof_id,
indy_presentation_spec=IndyPresSpec(
requested_attributes={"0_speed_uuid": indy_request_attrs},
requested_predicates={},
self_attested_attributes={},
),
)
# Alice accepts
await alice_member_client.post(
VERIFIER_BASE_PATH + "/accept-request",
json=proof_accept.model_dump(),
)
await check_webhook_state(
client=alice_member_client,
topic="proofs",
state="done",
filter_map={
"proof_id": alice_proof_id,
},
look_back=5,
)
await check_webhook_state(
client=acme_client,
topic="proofs",
state="done",
filter_map={
"proof_id": acme_proof_id,
},
look_back=5,
)
acme_proof_exchange = (
await acme_client.get(f"{VERIFIER_BASE_PATH}/proofs/{acme_proof_id}")
).json()
# Make sure the proof is done
assert acme_proof_exchange["state"] == "done"
# Acme does proof request and alice does not respond
request_body = {
"save_exchange_record": True,
"connection_id": acme_connection_id,
"protocol_version": protocol_version,
"indy_proof_request": indy_proof_request.to_dict(),
}
send_proof_response_2 = await send_proof_request(acme_client, request_body)
acme_proof_id_2 = send_proof_response_2["proof_id"]
thread_id_2 = send_proof_response_2["thread_id"]
all_verifier_proofs = (await acme_client.get(f"{VERIFIER_BASE_PATH}/proofs")).json()
all_verifier_proofs = [proof["proof_id"] for proof in all_verifier_proofs]
# Make sure both proofs are in the list
proof_ids = [acme_proof_id, acme_proof_id_2]
assert sum(1 for proof in proof_ids if proof in all_verifier_proofs) == 2
# Now test query params
proofs_sent = await acme_client.get(
f"{VERIFIER_BASE_PATH}/proofs?state=request-sent"
)
for proof in proofs_sent.json():
assert proof["state"] == "request-sent"
proofs_done = await acme_client.get(f"{VERIFIER_BASE_PATH}/proofs?state=done")
for proof in proofs_done.json():
assert proof["state"] == "done"
proofs_role = await acme_client.get(f"{VERIFIER_BASE_PATH}/proofs?role=verifier")
for proof in proofs_role.json():
assert proof["role"] == "verifier"
proofs_prover = await acme_client.get(f"{VERIFIER_BASE_PATH}/proofs?role=prover")
assert len(proofs_prover.json()) == 0
proofs = await acme_client.get(
f"{VERIFIER_BASE_PATH}/proofs?connection_id={acme_connection_id}&state=done"
)
assert len(proofs.json()) >= 1
proofs = await acme_client.get(
f"{VERIFIER_BASE_PATH}/proofs?connection_id={acme_connection_id}&state=request-sent"
)
assert len(proofs.json()) >= 1
proofs = await acme_client.get(
f"{VERIFIER_BASE_PATH}/proofs?connection_id={acme_connection_id}&thread_id={thread_id}"
)
assert len(proofs.json()) == 1
proofs = await acme_client.get(
f"{VERIFIER_BASE_PATH}/proofs?connection_id={acme_connection_id}&thread_id={thread_id_2}"
)
assert len(proofs.json()) == 1
with pytest.raises(HTTPException) as exc:
await acme_client.get(
f"{VERIFIER_BASE_PATH}/proofs?connection_id=123&state=invalid&role=invalid&thread_id=invalid"
)
assert exc.value.status_code == 422
assert len(json.loads(exc.value.detail)["detail"]) == 3
@pytest.mark.anyio
@pytest.mark.parametrize("protocol_version", ["v1", "v2"])
async def test_delete_proof(
acme_and_alice_connection: AcmeAliceConnect,
acme_client: RichAsyncClient,
protocol_version: str,
):
request_body = {
"connection_id": acme_and_alice_connection.acme_connection_id,
"protocol_version": protocol_version,
"indy_proof_request": indy_proof_request.to_dict(),
}
send_proof_response = await send_proof_request(acme_client, request_body)
proof_id = send_proof_response["proof_id"]
response = await acme_client.delete(
VERIFIER_BASE_PATH + f"/proofs/{proof_id}",
)
assert response.status_code == 204
@pytest.mark.anyio
@pytest.mark.parametrize("protocol_version", ["v1", "v2"])
async def test_get_credentials_for_request(
issue_credential_to_alice: CredentialExchange, # pylint: disable=unused-argument
acme_and_alice_connection: AcmeAliceConnect,
acme_client: RichAsyncClient,
alice_member_client: RichAsyncClient,
protocol_version: str,
):
request_body = {
"connection_id": acme_and_alice_connection.acme_connection_id,
"protocol_version": protocol_version,
"indy_proof_request": indy_proof_request.to_dict(),
}
send_proof_response = await send_proof_request(acme_client, request_body)
thread_id = send_proof_response["thread_id"]
assert thread_id
alice_exchange = await check_webhook_state(
client=alice_member_client,
topic="proofs",
state="request-received",
filter_map={
"thread_id": thread_id,
},
)
assert alice_exchange["protocol_version"] == protocol_version
proof_id = alice_exchange["proof_id"]
response = await alice_member_client.get(
f"{VERIFIER_BASE_PATH}/proofs/{proof_id}/credentials",
)
result = response.json()[0]
assert "cred_info" in result
assert [
attr
in ["attrs", "cred_def_info", "referent", "interval", "presentation_referents"]
for attr in result["cred_info"]
]
@pytest.mark.anyio
@pytest.mark.parametrize("protocol_version", ["v1", "v2"])
@pytest.mark.parametrize(
"meld_co_and_alice_connection", ["trust_registry", "default"], indirect=True
)
async def test_accept_proof_request_verifier_has_issuer_role(
meld_co_issue_credential_to_alice: CredentialExchange, # pylint: disable=unused-argument
alice_member_client: RichAsyncClient,
meld_co_client: RichAsyncClient,
meld_co_and_alice_connection: MeldCoAliceConnect,
protocol_version: str,
):
request_body = {
"connection_id": meld_co_and_alice_connection.meld_co_connection_id,
"protocol_version": protocol_version,
"indy_proof_request": indy_proof_request.to_dict(),
}
send_proof_response = await send_proof_request(meld_co_client, request_body)
meld_co_proof_id = send_proof_response["proof_id"]
alice_payload = await check_webhook_state(
client=alice_member_client,
topic="proofs",
state="request-received",
)
alice_proof_id = alice_payload["proof_id"]
requested_credentials = await alice_member_client.get(
f"{VERIFIER_BASE_PATH}/proofs/{alice_proof_id}/credentials"
)
assert await check_webhook_state(
client=alice_member_client,
topic="proofs",
state="request-received",
filter_map={
"proof_id": alice_proof_id,
},
)
referent = requested_credentials.json()[0]["cred_info"]["referent"]
indy_request_attrs = IndyRequestedCredsRequestedAttr(
cred_id=referent, revealed=True
)
proof_accept = AcceptProofRequest(
proof_id=alice_proof_id,
indy_presentation_spec=IndyPresSpec(
requested_attributes={"0_speed_uuid": indy_request_attrs},
requested_predicates={},
self_attested_attributes={},
),
)
response = await alice_member_client.post(
VERIFIER_BASE_PATH + "/accept-request",
json=proof_accept.model_dump(),
)
assert await check_webhook_state(
client=alice_member_client,
topic="proofs",
state="done",
filter_map={
"proof_id": alice_proof_id,
},
look_back=5,
)
assert await check_webhook_state(
client=meld_co_client,
state="done",
filter_map={
"proof_id": meld_co_proof_id,
},
topic="proofs",
look_back=5,
)
pres_exchange_result = PresentationExchange(**response.json())
assert isinstance(pres_exchange_result, PresentationExchange)
@pytest.mark.anyio
@pytest.mark.parametrize("protocol_version", ["v1", "v2"])
@pytest.mark.parametrize("acme_save_exchange_record", [False, True])
@pytest.mark.parametrize("alice_save_exchange_record", [False, True])
async def test_saving_of_presentation_exchange_records(
issue_credential_to_alice: CredentialExchange, # pylint: disable=unused-argument
alice_member_client: RichAsyncClient,
acme_client: RichAsyncClient,
acme_and_alice_connection: AcmeAliceConnect,
protocol_version: str,
acme_save_exchange_record: bool,
alice_save_exchange_record: bool,
):
request_body = {
"connection_id": acme_and_alice_connection.acme_connection_id,
"protocol_version": protocol_version,
"indy_proof_request": indy_proof_request.to_dict(),
"save_exchange_record": acme_save_exchange_record,
}
send_proof_response = await send_proof_request(acme_client, request_body)
acme_proof_id = send_proof_response["proof_id"]
thread_id = send_proof_response["thread_id"]
alice_payload = await check_webhook_state(
client=alice_member_client,
topic="proofs",
state="request-received",
filter_map={
"thread_id": thread_id,
},
)
alice_proof_id = alice_payload["proof_id"]
requested_credentials = await alice_member_client.get(
f"{VERIFIER_BASE_PATH}/proofs/{alice_proof_id}/credentials"
)
referent = requested_credentials.json()[0]["cred_info"]["referent"]
indy_request_attrs = IndyRequestedCredsRequestedAttr(
cred_id=referent, revealed=True
)
proof_accept = AcceptProofRequest(
proof_id=alice_proof_id,
indy_presentation_spec=IndyPresSpec(
requested_attributes={"0_speed_uuid": indy_request_attrs},
requested_predicates={},
self_attested_attributes={},
),
save_exchange_record=alice_save_exchange_record,
)
response = await alice_member_client.post(
VERIFIER_BASE_PATH + "/accept-request",
json=proof_accept.model_dump(),
)
assert await check_webhook_state(
client=alice_member_client,
topic="proofs",
state="done",
filter_map={
"proof_id": alice_proof_id,
},
look_back=5,
)
assert await check_webhook_state(
client=acme_client,
topic="proofs",
state="done",
filter_map={
"proof_id": acme_proof_id,
},
look_back=5,
)
result = response.json()
pres_exchange_result = PresentationExchange(**result)
assert isinstance(pres_exchange_result, PresentationExchange)
assert response.status_code == 200
# get exchange records from alice side
if alice_save_exchange_record:
# Save record is True, should be 1 record
alice_pres_ex_record = (
await alice_member_client.get(
f"{VERIFIER_BASE_PATH}/proofs/{alice_proof_id}"
)
).json()
assert alice_pres_ex_record
else:
# default is to remove records
with pytest.raises(HTTPException) as exc:
await alice_member_client.get(
f"{VERIFIER_BASE_PATH}/proofs/{alice_proof_id}"
)
assert exc.value.status_code == 404
# get exchange records from acme side
if acme_save_exchange_record:
# Save record is True, should be 1 record
acme_pres_ex_record = (
await acme_client.get(f"{VERIFIER_BASE_PATH}/proofs/{acme_proof_id}")
).json()
assert acme_pres_ex_record
else:
# default is to remove records
with pytest.raises(HTTPException) as exc:
await acme_client.get(f"{VERIFIER_BASE_PATH}/proofs/{acme_proof_id}")
assert exc.value.status_code == 404
@pytest.mark.anyio
@pytest.mark.skipif(
TestMode.clean_run in TestMode.fixture_params,
reason="Run only in regression mode",
)
async def test_regression_proof_valid_credential(
get_or_issue_regression_cred_valid: ReferentCredDef,
acme_client: RichAsyncClient,
alice_member_client: RichAsyncClient,
acme_and_alice_connection: AcmeAliceConnect,
):
unix_timestamp = int(time.time())
referent = get_or_issue_regression_cred_valid.referent
credential_definition_id_revocable = (
get_or_issue_regression_cred_valid.cred_def_revocable
)
# Do proof request
request_body = {
"protocol_version": "v2",
"comment": "Test cred is not revoked",
"type": "indy",
"indy_proof_request": {
"non_revoked": {"to": unix_timestamp},
"requested_attributes": {
"THE_SPEED": {
"name": "speed",
"restrictions": [
{"cred_def_id": credential_definition_id_revocable}
],
}
},
"requested_predicates": {},
},
"save_exchange_record": True,
"connection_id": acme_and_alice_connection.acme_connection_id,
}
send_proof_response = await send_proof_request(acme_client, request_body)
acme_proof_exchange_id = send_proof_response["proof_id"]
alice_payload = await check_webhook_state(
client=alice_member_client,
topic="proofs",
state="request-received",
filter_map={
"thread_id": send_proof_response["thread_id"],
},
look_back=5,
)
alice_proof_exchange_id = alice_payload["proof_id"]
# Send proof
await alice_member_client.post(
f"{VERIFIER_BASE_PATH}/accept-request",
json={
"proof_id": alice_proof_exchange_id,
"type": "indy",
"indy_presentation_spec": {
"requested_attributes": {
"THE_SPEED": {"cred_id": referent, "revealed": True}
},
"requested_predicates": {},
"self_attested_attributes": {},
},
"dif_presentation_spec": {},
},
)
await check_webhook_state(
client=acme_client,
topic="proofs",
state="done",
filter_map={
"proof_id": acme_proof_exchange_id,
},
look_back=5,
)
# Check proof
proof = (
await acme_client.get(f"{VERIFIER_BASE_PATH}/proofs/{acme_proof_exchange_id}")
).json()
assert proof["verified"] is True