From a97c80bb35f8dc589443b9f301ada3702bd69b71 Mon Sep 17 00:00:00 2001 From: Daniel Bluhm Date: Thu, 9 May 2024 20:28:04 -0400 Subject: [PATCH] fix(interop): overly strict validation This change relaxes some overly strict validation that was preventing presenting proof using LDP-VC from Credo 0.5.X based agents. Signed-off-by: Daniel Bluhm --- aries_cloudagent/protocols/present_proof/dif/pres_exch.py | 2 -- .../protocols/present_proof/v2_0/formats/dif/handler.py | 3 +-- aries_cloudagent/vc/vc_ld/models/linked_data_proof.py | 3 --- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/aries_cloudagent/protocols/present_proof/dif/pres_exch.py b/aries_cloudagent/protocols/present_proof/dif/pres_exch.py index cc7ae20645..de3def8b78 100644 --- a/aries_cloudagent/protocols/present_proof/dif/pres_exch.py +++ b/aries_cloudagent/protocols/present_proof/dif/pres_exch.py @@ -824,12 +824,10 @@ class Meta: id = fields.Str( required=False, - validate=UUID4_VALIDATE, metadata={"description": "ID", "example": UUID4_EXAMPLE}, ) definition_id = fields.Str( required=False, - validate=UUID4_VALIDATE, metadata={"description": "DefinitionID", "example": UUID4_EXAMPLE}, ) descriptor_maps = fields.List( diff --git a/aries_cloudagent/protocols/present_proof/v2_0/formats/dif/handler.py b/aries_cloudagent/protocols/present_proof/v2_0/formats/dif/handler.py index af8e6f00de..82726993bd 100644 --- a/aries_cloudagent/protocols/present_proof/v2_0/formats/dif/handler.py +++ b/aries_cloudagent/protocols/present_proof/v2_0/formats/dif/handler.py @@ -5,7 +5,6 @@ from typing import Mapping, Optional, Sequence, Tuple from uuid import uuid4 -from marshmallow import RAISE from ......messaging.base_handler import BaseResponder from ......messaging.decorators.attach_decorator import AttachDecorator @@ -75,7 +74,7 @@ def validate_fields(cls, message_type: str, attachment_data: Mapping): Schema = mapping[message_type] # Validate, throw if not valid - Schema(unknown=RAISE).load(attachment_data) + Schema().load(attachment_data) def get_format_identifier(self, message_type: str) -> str: """Get attachment format identifier for format and message combination. diff --git a/aries_cloudagent/vc/vc_ld/models/linked_data_proof.py b/aries_cloudagent/vc/vc_ld/models/linked_data_proof.py index 40e5a2b7db..6787e82be7 100644 --- a/aries_cloudagent/vc/vc_ld/models/linked_data_proof.py +++ b/aries_cloudagent/vc/vc_ld/models/linked_data_proof.py @@ -105,9 +105,6 @@ class Meta: domain = fields.Str( required=False, - # TODO the domain can be more than a Uri, provide a less restrictive validation - # https://www.w3.org/TR/vc-data-integrity/#defn-domain - validate=Uri(), metadata={ "description": ( "A string value specifying the restricted domain of the signature."