From d05a7fff90f84c27e1e8f3f8c2269e36bab5f2bc Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Mon, 10 Aug 2020 19:23:40 +0100 Subject: 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`. --- src/saml2/attribute_converter.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/saml2/attribute_converter.py') diff --git a/src/saml2/attribute_converter.py b/src/saml2/attribute_converter.py index 43c345ff..306dbfde 100644 --- a/src/saml2/attribute_converter.py +++ b/src/saml2/attribute_converter.py @@ -98,7 +98,9 @@ def _find_maps_in_module(module): for key, item in module.__dict__.items(): if key.startswith("__"): continue - if isinstance(item, dict) and "to" in item and "fro" in item: + if isinstance(item, dict) and "identifier" in item and ( + "to" in item or "fro" in item + ): yield item -- cgit v1.2.1