Skip to content

Commit d05a7ff

Browse files
committed
Fix automatic inversion of attribute map files
In order for automatic inversion of attribute maps to work, we need to accept definitions of attribute maps with only one of `to` or `fro`.
1 parent f8aca94 commit d05a7ff

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/saml2/attribute_converter.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,9 @@ def _find_maps_in_module(module):
9898
for key, item in module.__dict__.items():
9999
if key.startswith("__"):
100100
continue
101-
if isinstance(item, dict) and "to" in item and "fro" in item:
101+
if isinstance(item, dict) and "identifier" in item and (
102+
"to" in item or "fro" in item
103+
):
102104
yield item
103105

104106

0 commit comments

Comments
 (0)