Skip to content

Commit b7bf0c7

Browse files
authored
Merge pull request #404 from italia/presentation-submission-regex-fix
Presentation submission regex fix
2 parents e7e9684 + 742f6a8 commit b7bf0c7

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

pyeudiw/openid4vp/presentation_submission/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def _validate_submission(self, submission: dict[str, Any]) -> PresentationSubmis
9696
except ValidationError as e:
9797
raise SubmissionValidationError(f"Submission validation failed: {e}")
9898

99-
def _extract_position(self, path: str) -> tuple[str, str]:
99+
def _extract_position(self, path: str) -> int:
100100
"""
101101
Extract the position and path from the descriptor path.
102102
@@ -108,8 +108,8 @@ def _extract_position(self, path: str) -> tuple[str, str]:
108108
:return: Tuple of position and path.
109109
:rtype: tuple[str, str]
110110
"""
111-
pattern = r'\$\[(\d+)\]'
112-
match = re.search(pattern, path)
111+
pattern = r"\$[a-z_\-\.]*\[(\d+)\]"
112+
match = re.match(pattern, path, re.I)
113113
if match:
114114
position = int(match.group(1))
115115
return position

requirements-dev.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,5 @@ html-linter
1616
sphinx
1717
sphinx_rtd_theme
1818
playwright
19+
freezegun
20+
pytest-mock

0 commit comments

Comments
 (0)