From 44829aef0b140d9ecf2a0c055a77a974b31db68d Mon Sep 17 00:00:00 2001 From: Albin Antony Date: Mon, 23 Sep 2024 17:44:15 +0530 Subject: [PATCH] Fix L3-iGrant/api#573: Update presentation definition and presentation submission schema definition to support mso_mdoc --- sdjwt/pex.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/sdjwt/pex.py b/sdjwt/pex.py index 64234ae..551113a 100644 --- a/sdjwt/pex.py +++ b/sdjwt/pex.py @@ -88,6 +88,25 @@ class PresentationDefinition(BaseModel): "id": {"type": "string"}, "name": {"type": "string"}, "purpose": {"type": "string"}, + "format": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Presentation Definition Claim Format Designations", + "type": "object", + "additionalProperties": False, + "patternProperties": { + "mso_mdoc": { + "type": "object", + "additionalProperties": False, + "properties": { + "alg": { + "type": "array", + "minItems": 1, + "items": {"type": "string", "enum": ["ES256"]}, + } + }, + } + }, + }, "constraints": { "type": "object", "additionalProperties": False, @@ -143,6 +162,17 @@ class PresentationDefinition(BaseModel): } }, }, + "mso_mdoc": { + "type": "object", + "additionalProperties": False, + "properties": { + "alg": { + "type": "array", + "minItems": 1, + "items": {"type": "string", "enum": ["ES256"]}, + } + }, + }, }, }, }, @@ -197,6 +227,7 @@ class PresentationDefinitionValidationError(Exception): "vc+sd-jwt", "vp+sd-jwt", "sd-jwt", + "mso_mdoc", ], }, },