]> git.proxmox.com Git - pve-access-control.git/commit - src/PVE/API2/Domains.pm
fix #3668: realm-sync: replace 'full' & 'purge' with 'remove-vanished'
authorDominik Csapak <d.csapak@proxmox.com>
Mon, 28 Mar 2022 12:38:03 +0000 (14:38 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 26 Apr 2022 11:00:26 +0000 (13:00 +0200)
commit98df2ebc53e5b017089890e9788ce70cace83a41
tree9374ee987da6beb5c3df717e1fa1c36c6be535cf
parentdcdf57891b90efae34321e6b4ead4348aa7c7c74
fix #3668: realm-sync: replace 'full' & 'purge' with 'remove-vanished'

Both, 'full' & 'purge', configure what is removed when an entry
(or property) is not returned anymore from the sync result. For users
it may be thus easier to understand setting a single property without
wondering about the interaction of the two specific ones.

The new 'remove-vanished' is a list of things to remove, namely:
 * 'acl'
 * 'entry'
 * 'properties'.

The old 'full' gets mapped to 'entry;properties' and an old 'purge'
to the 'acl'

Keep the old properties for backwards-compatibility but transform to
the new list on edit. Add a deprecation notice to the description
with a TODO reminder to remove with 8.0

Note, this commit changes two things slightly:
* 'purge' (now remove-vanished -> acl) does now remove ACLs for
  vanished entries even when we keep those entries. Previously those
  were only deleted when we also removed the entries (this can be
  seen by the changed regression test)
* since 'remove-vanished' is empty by default, only the scope must be
  given explicitly on sync or the sync-default. Previously 'full' and
  'purge' must have been configured explicitly (no big deal, since
  the default is to not remove anything)

Bug #3668 is fixed when not selecting 'properties' for the sync, so
that existing (custom) properties are not deleted on update

Suggested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
[ T: some commit message typos/wording ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/PVE/API2/Domains.pm
src/PVE/Auth/Plugin.pm
src/test/realm_sync_test.pl