Skip to content

Commit 01c8c0a

Browse files
authored
Merge pull request #30 from Indicio-tech/refactor/mso-mdoc-align-patterns
feat(mso_mdoc): trust anchor registry, signing key registry, and mDOC revocation
2 parents 2784799 + b1a985b commit 01c8c0a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+2448
-8875
lines changed

oid4vc/integration/conformance/setup_acapy.py

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,15 @@ async def admin_post(
110110
return resp.json()
111111

112112

113+
async def admin_put(
114+
client: httpx.AsyncClient, base: str, path: str, body: dict | None = None
115+
) -> Any:
116+
"""PUT to ACA-Py admin API."""
117+
resp = await client.put(f"{base}{path}", json=body or {}, timeout=30.0)
118+
resp.raise_for_status()
119+
return resp.json()
120+
121+
113122
async def create_did_jwk(client: httpx.AsyncClient, base: str, key_type: str) -> str:
114123
"""Create a did:jwk and return the DID string."""
115124
result = await admin_post(client, base, "/did/jwk/create", {"key_type": key_type})
@@ -507,14 +516,26 @@ async def upload_trust_anchor(
507516
cert_pem: bytes,
508517
*,
509518
anchor_type: str = "mso_mdoc",
519+
supported_cred_id: str | None = None,
520+
label: str | None = None,
510521
) -> None:
511-
"""Upload a trust anchor certificate to an ACA-Py instance."""
522+
"""Upload a trust anchor certificate to an ACA-Py instance.
523+
524+
Trust anchors are stored as TrustAnchorRecord objects in the Askar wallet
525+
and retrieved at verification time via the /mso-mdoc/trust-anchors registry.
526+
The supported_cred_id parameter is accepted for backward compatibility but
527+
is no longer used; anchors are tenant-scoped, not credential-scoped.
528+
"""
512529
cert_str = cert_pem.decode()
513530
await admin_post(
514531
client,
515532
base,
516-
f"/{anchor_type}/trust-anchors",
517-
{"certificate_pem": cert_str},
533+
"/mso-mdoc/trust-anchors",
534+
{
535+
"certificate_pem": cert_str,
536+
"purpose": "iaca",
537+
"label": label or anchor_type,
538+
},
518539
)
519540
logger.info(f"Uploaded trust anchor to {base} ({anchor_type})")
520541

oid4vc/integration/tests/base.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,16 @@ async def mdoc_config_template(self):
113113
},
114114
}
115115

116+
@pytest_asyncio.fixture
117+
async def credential_flow(
118+
self, acapy_issuer_admin, credo_client, setup_issuer_certs
119+
):
120+
"""Credential issuance flow helper with mDOC signing keys pre-configured."""
121+
return CredentialFlowHelper(
122+
acapy_issuer_admin,
123+
credo_client,
124+
)
125+
116126

117127
class BaseDCQLTest(BaseOID4VCTest):
118128
"""Base class for DCQL (Digital Credentials Query Language) tests.

0 commit comments

Comments
 (0)