sources/ldap: add limited support for attributes as object_fields on LDAPPropertyMappings

This commit is contained in:
Jens Langhammer 2020-09-15 21:08:10 +02:00
parent 1e97af772f
commit 6292049c74

View file

@ -169,7 +169,13 @@ class Connector:
value = mapping.evaluate(user=None, request=None, ldap=attributes)
if value is None:
continue
properties[mapping.object_field] = value
object_field = mapping.object_field
if object_field.startswith("attributes."):
properties["attributes"][
object_field.replace("attributes.", "")
] = value
else:
properties[object_field] = value
except PropertyMappingExpressionException as exc:
LOGGER.warning("Mapping failed to evaluate", exc=exc, mapping=mapping)
continue