Skip to content

Commit d7d4815

Browse files
authored
🎨 Use correct model for sending AnonCreds presentation (openwallet-foundation#3618)
* 🐛 Correct AnonCreds presentation schema Signed-off-by: ff137 <[email protected]> * 🎨 Update validation error Signed-off-by: ff137 <[email protected]> --------- Signed-off-by: ff137 <[email protected]>
1 parent 1527027 commit d7d4815

File tree

1 file changed

+5
-3
lines changed
  • acapy_agent/protocols/present_proof/v2_0

1 file changed

+5
-3
lines changed

acapy_agent/protocols/present_proof/v2_0/routes.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
from ....admin.request_context import AdminRequestContext
1919
from ....anoncreds.holder import AnonCredsHolder, AnonCredsHolderError
2020
from ....anoncreds.models.presentation_request import AnoncredsPresentationRequestSchema
21+
from ....anoncreds.models.proof import AnoncredsPresSpecSchema
2122
from ....connections.models.conn_record import ConnRecord
2223
from ....indy.holder import IndyHolder, IndyHolderError
2324
from ....indy.models.cred_precis import IndyCredPrecisSchema
@@ -233,7 +234,8 @@ def validate_fields(self, data, **kwargs):
233234
"""
234235
if not any(f.api in data for f in V20PresFormat.Format):
235236
raise ValidationError(
236-
"V20PresRequestByFormatSchema requires indy, dif, or both"
237+
"V20PresRequestByFormatSchema requires at least one of: "
238+
"anoncreds, indy, dif"
237239
)
238240

239241

@@ -310,7 +312,7 @@ class V20PresSpecByFormatRequestSchema(AdminAPIMessageTracingSchema):
310312
"""Presentation specification schema by format, for send-presentation request."""
311313

312314
anoncreds = fields.Nested(
313-
IndyPresSpecSchema,
315+
AnoncredsPresSpecSchema,
314316
required=False,
315317
metadata={"description": "Presentation specification for anoncreds"},
316318
)
@@ -1236,7 +1238,7 @@ async def present_proof_send_presentation(request: web.BaseRequest):
12361238
raise web.HTTPBadRequest(
12371239
reason=(
12381240
"No presentation format specification provided, "
1239-
"either dif or indy must be included. "
1241+
"either dif, anoncreds or indy must be included. "
12401242
"In case of DIF, if no additional specification "
12411243
'needs to be provided then include "dif": {}'
12421244
)

0 commit comments

Comments
 (0)