]> 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 17:54:10 +0000 (18:54 +0100)
commit433f6bdf5747824f25c882ea765f9490633c71f4
tree6cf6b7dd795e1e2f1cdc08bc890389d7fbabfe83
parent92ab209ab5c19fae48ec807b5566376eae89d7ba
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>
(cherry picked from commit 7abb20a1ead8b84dcf0620c11c72462d315f92ac)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/PVE/Auth/LDAP.pm