Skip to content

Commit 149b3c0

Browse files
committed
Update OID4VC integration tests and Docker config
Updated Docker Compose health checks and test commands. Temporarily disabled mso_mdoc plugin in dev config. Updated OID4VP flow to use new API endpoints. Cleaned up error handling in test scripts and fixed imports. Signed-off-by: Adam Burdett <burdettadam@gmail.com>
1 parent bccbbf5 commit 149b3c0

File tree

7 files changed

+80
-55
lines changed

7 files changed

+80
-55
lines changed

oid4vc/docker/dev-verifier.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ endpoint:
1919
# plugins
2020
plugin:
2121
- oid4vc
22-
23-
# OID4VC plugin configuration - Use different ports for OID4VCI and OID4VP servers
22+
- sd_jwt_vc
23+
# Temporarily disabled due to missing libisomdl_uniffi.so dependency
24+
# - mso_mdoc# OID4VC plugin configuration - Use different ports for OID4VCI and OID4VP servers
2425
plugin-config-value:
2526
- oid4vci.host=0.0.0.0
2627
- oid4vci.port=8033

oid4vc/docker/dev.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ endpoint:
1919
# plugins
2020
plugin:
2121
- oid4vc
22+
- sd_jwt_vc
23+
# Temporarily disabled due to missing libisomdl_uniffi.so dependency
24+
# - mso_mdoc
2225

2326
# OID4VC plugin configuration - Use different port for OID4VCI server
2427
plugin-config-value:

oid4vc/integration/docker-compose.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ services:
1717
test: ["CMD", "curl", "-f", "http://localhost:3020/health"]
1818
interval: 10s
1919
timeout: 5s
20-
retries: 3
21-
start_period: 15s
20+
retries: 5
21+
start_period: 30s
2222

2323
# ACA-Py Issuer - Issues credentials via OID4VCI
2424
acapy-issuer:
@@ -82,7 +82,7 @@ services:
8282
- WAIT_HOSTS=credo-agent:3020,acapy-issuer:8021,acapy-verifier:8031
8383
- WAIT_HOSTS_TIMEOUT=300
8484
- WAIT_SLEEP_INTERVAL=5
85-
- WAIT_HTTP_RETRY_COUNT=10
85+
- WAIT_HTTP_RETRY_COUNT=15
8686
volumes:
8787
- ./test-results:/usr/src/app/test-results
8888
depends_on:
@@ -92,7 +92,15 @@ services:
9292
condition: service_healthy
9393
acapy-verifier:
9494
condition: service_healthy
95-
command: ["uv", "run", "pytest", "tests/test_docker_connectivity.py", "tests/test_acapy_oid4vc_simple.py", "-v"]
95+
command: [
96+
"sh", "-c",
97+
"echo 'Running essential OID4VC integration tests...' && \
98+
uv run pytest tests/test_docker_connectivity.py tests/test_acapy_oid4vc_simple.py \
99+
--verbose \
100+
--tb=short \
101+
--junit-xml=test-results/junit-quick.xml \
102+
--durations=5"
103+
]
96104

97105
volumes:
98106
test-results:

oid4vc/integration/tests/test_acapy_credo_oid4vc_flow.py

Lines changed: 41 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ async def test_acapy_oid4vci_credential_issuance_to_credo(
3636

3737
# Step 1: Create a supported credential on ACA-Py issuer
3838
credential_supported = {
39+
"id": "IdentityCredential",
3940
"format": "vc+sd-jwt",
4041
"scope": "IdentityCredential",
4142
"cryptographic_binding_methods_supported": ["did:key"],
@@ -142,14 +143,29 @@ async def test_acapy_oid4vp_presentation_verification_from_credo(
142143
],
143144
}
144145

145-
# Step 2: ACA-Py creates presentation request
146+
# Step 2: Create presentation definition first
147+
pres_def_data = {
148+
"pres_def": presentation_definition
149+
}
150+
151+
pres_def_response = await acapy_verifier_admin.post(
152+
"/oid4vp/presentation-definition", json=pres_def_data
153+
)
154+
assert "pres_def_id" in pres_def_response
155+
pres_def_id = pres_def_response["pres_def_id"]
156+
157+
# Step 3: ACA-Py creates presentation request
146158
presentation_request_data = {
147-
"presentation_definition": presentation_definition,
148-
"response_mode": "direct_post",
159+
"pres_def_id": pres_def_id,
160+
"vp_formats": {
161+
"vc+sd-jwt": {
162+
"sd-jwt_alg_values": ["EdDSA", "ES256K", "ES256"]
163+
}
164+
}
149165
}
150166

151167
presentation_request = await acapy_verifier_admin.post(
152-
"/oid4vp/create-request", json=presentation_request_data
168+
"/oid4vp/request", json=presentation_request_data
153169
)
154170

155171
assert "request_uri" in presentation_request
@@ -171,6 +187,7 @@ async def test_full_acapy_credo_oid4vc_flow(
171187

172188
# Step 1: Setup credential configuration on ACA-Py issuer
173189
credential_supported = {
190+
"id": "UniversityDegreeCredential",
174191
"format": "vc+sd-jwt",
175192
"scope": "UniversityDegree",
176193
"cryptographic_binding_methods_supported": ["did:key"],
@@ -273,13 +290,28 @@ async def test_full_acapy_credo_oid4vc_flow(
273290
],
274291
}
275292

293+
# Create presentation definition first
294+
pres_def_data = {
295+
"pres_def": presentation_definition
296+
}
297+
298+
pres_def_response = await acapy_verifier_admin.post(
299+
"/oid4vp/presentation-definition", json=pres_def_data
300+
)
301+
assert "pres_def_id" in pres_def_response
302+
pres_def_id = pres_def_response["pres_def_id"]
303+
276304
presentation_request_data = {
277-
"presentation_definition": presentation_definition,
278-
"response_mode": "direct_post",
305+
"pres_def_id": pres_def_id,
306+
"vp_formats": {
307+
"vc+sd-jwt": {
308+
"sd-jwt_alg_values": ["EdDSA", "ES256K", "ES256"]
309+
}
310+
}
279311
}
280312

281313
presentation_request = await acapy_verifier_admin.post(
282-
"/oid4vp/create-request", json=presentation_request_data
314+
"/oid4vp/request", json=presentation_request_data
283315
)
284316
request_uri = presentation_request["request_uri"]
285317

@@ -294,7 +326,7 @@ async def test_full_acapy_credo_oid4vc_flow(
294326

295327
# Step 6: Verify presentation was successful
296328
assert "presentation_submission" in presentation_result
297-
assert presentation_result.get("status") in ["success", "completed"]
329+
assert presentation_result.get("status") == "success"
298330

299331
# Step 7: Check that ACA-Py received and validated the presentation
300332
# Wait a moment for processing
@@ -306,7 +338,7 @@ async def test_full_acapy_credo_oid4vc_flow(
306338

307339
# Find our presentation
308340
latest_presentation = presentations[0] # Assuming most recent
309-
assert latest_presentation.get("state") in ["presentation-valid", "completed"]
341+
assert latest_presentation.get("state") == "presentation-valid"
310342

311343
print("✅ Full OID4VC flow completed successfully!")
312344
print(f" - ACA-Py issued credential: {config_id}")

oid4vc/integration/tests/test_acapy_oid4vc_simple.py

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,8 @@ async def test_simple_oid4vc_flow():
3838
async with httpx.AsyncClient(
3939
base_url=CREDO_AGENT_URL, timeout=10.0
4040
) as credo_client:
41-
try:
42-
credo_status = await credo_client.get("/health")
43-
print(f" Credo status: {credo_status.status_code}")
44-
except Exception as e:
45-
print(f" Credo error: {e}")
46-
return False
41+
credo_status = await credo_client.get("/health")
42+
print(f" Credo status: {credo_status.status_code}")
4743

4844
print("✅ All services are healthy!")
4945

@@ -66,22 +62,14 @@ async def test_simple_oid4vc_flow():
6662

6763
async def main():
6864
"""Main test runner."""
69-
try:
70-
success = await test_simple_oid4vc_flow()
71-
if success:
72-
print("\n✅ Test completed successfully!")
73-
else:
74-
print("\n❌ Test failed!")
75-
return 1
76-
except Exception as e:
77-
print(f"\n💥 Test crashed: {e}")
78-
import traceback
79-
80-
traceback.print_exc()
65+
success = await test_simple_oid4vc_flow()
66+
if success:
67+
print("\n✅ Test completed successfully!")
68+
return 0
69+
else:
70+
print("\n❌ Test failed!")
8171
return 1
8272

83-
return 0
84-
8573

8674
if __name__ == "__main__":
8775
exit_code = asyncio.run(main())

oid4vc/integration/tests/test_dcql.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import pytest
2-
from acapy_controller.controller import Controller
2+
from acapy_controller import Controller
33

44

55
@pytest.mark.asyncio

oid4vc/integration/tests/test_dual_endpoints.py

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -188,32 +188,25 @@ async def test_oid4vci_server_endpoints():
188188
if __name__ == "__main__":
189189
# Allow running this test file directly for debugging
190190
import sys
191-
import traceback
192191

193192
async def run_all_tests():
194-
try:
195-
print("🚀 Starting dual endpoint compatibility tests...\n")
193+
print("🚀 Starting dual endpoint compatibility tests...\n")
196194

197-
await test_acapy_services_health()
198-
print()
195+
await test_acapy_services_health()
196+
print()
199197

200-
await test_dual_oid4vci_endpoints()
201-
print()
198+
await test_dual_oid4vci_endpoints()
199+
print()
202200

203-
await test_credo_can_reach_underscore_endpoint()
204-
print()
201+
await test_credo_can_reach_underscore_endpoint()
202+
print()
205203

206-
await test_oid4vci_server_endpoints()
207-
print()
204+
await test_oid4vci_server_endpoints()
205+
print()
208206

209-
print(
210-
"🎉 All tests passed! Dual endpoint compatibility is working correctly."
211-
)
212-
213-
except Exception as e:
214-
print(f"❌ Test failed: {e}")
215-
traceback.print_exc()
216-
sys.exit(1)
207+
print(
208+
"🎉 All tests passed! Dual endpoint compatibility is working correctly."
209+
)
217210

218211
if len(sys.argv) > 1 and sys.argv[1] == "run":
219212
asyncio.run(run_all_tests())

0 commit comments

Comments
 (0)