]> git.proxmox.com Git - pve-access-control.git/commit
LDAP sync: build valid-target-attribute list on the fly to avoid coupling
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 8 Feb 2024 11:10:31 +0000 (12:10 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 8 Feb 2024 14:58:20 +0000 (15:58 +0100)
commit7abb20a1ead8b84dcf0620c11c72462d315f92ac
treebc827d258f873f6dbba8ccf6f0d436582c9a381b
parentcb93636b55c26f641fdbedef10dbb6e80b4502b8
LDAP sync: build valid-target-attribute list on the fly to avoid coupling

Build the set of valid target attributes on the fly by using the
existing ldap => ours mapping. This avoids that one needs to adapt
both lists when changing this, which even though it should be caught
on testing, is needlessly adding friction.

The is-known-target-attr check could never trigger as this was already
checked in the parent before even calling the verify method, so just
remove it.

Rename the `verify_sync_attribute` to `verify_sync_attribute_value` to
clarify that it really only checks the value of an attribute, not the
attribute (key) itself.

As a side-benefit, this also makes the code shorter and avoids a
permanent global variable using up (a tiny amount of) space.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/PVE/Auth/LDAP.pm