all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH access-control v3 0/2] fix: #6510: Allow deleting ACLs for non-existent entities & add API tests
@ 2026-07-31  9:43 Elias Huhsovitz
  2026-07-31  9:43 ` [PATCH access-control v3 1/2] test: api: acl: add tests for modification endpoint Elias Huhsovitz
  2026-07-31  9:43 ` [PATCH access-control v3 2/2] fix #6510: api: acl: allow deletion for non-existent entities Elias Huhsovitz
  0 siblings, 2 replies; 3+ messages in thread
From: Elias Huhsovitz @ 2026-07-31  9:43 UTC (permalink / raw)
  To: pve-devel; +Cc: Elias Huhsovitz

This series fixes Bug #6510, which prevents the deletion of
ACLs for non-existent users, groups, API tokens, and roles.

Edge cases, such as manual edits, can leave orphaned ACLs in
the cluster configuration. Deletion of an orphaned ACL is currently
prevented and an error is thrown (e.g., "user 'foo@pve' does
not exist"). This happens because the API endpoint strictly
validates the existence of the target entity, before processing any
request.

Patch 1/2 introduces automated tests for the
`PUT /access/acl` endpoint. The test suite verifies standard
creation, modification, and deletion workflows, enforces privilege
boundaries, validates input parameters, and specifically tests the
edge cases mentioned in the bug report.

Patch 2/2 modifies the `update_acl` API endpoint to bypass the
entity and role existence checks when the `delete` flag is set.
This allows administrators to clean up orphaned ACL entries.

Changes v2 -> v3:
-----------------
* Fix a bug that caused the API to crash or skip deletions
  when removing ACLs for non-existent roles.
* Remove dead `noop('cfs_update')` mock in the test suite.
* Rename test descriptions to consistently end with 'succeeds'
  or 'fails'.
* Add missing test cases for parameter validation, path
  validation, idempotent deletes, privilege regressions and
  deleting ACLs with non-existent roles.
* Reword commit message: Use plain prose instead of bullet lists.

Changes v1 -> v2:
-----------------
* Declare all tests up front in $tests.
* Run all tests using the same logic in loop.
* Evaluate test results using `Test::More::is_deeply`.
* Use redefine() instead of mock().
* Use `no_auto => 1` for MockModule to prvent auto loading.
* Run make tidy.

Previous Versions
-----------------
v2: https://lore.proxmox.com/pve-devel/20260723110939.84932-1-e.huhsovitz@proxmox.com/
v1: https://lore.proxmox.com/pve-devel/20260720134535.136172-1-e.huhsovitz@proxmox.com/

Summary of Changes
------------------

Elias Huhsovitz (2):
  test: api: acl: add tests for modification endpoint
  fix #6510: api: acl: allow deletion for non-existent entities

 src/PVE/API2/ACL.pm             |  13 +-
 src/test/api-tests.pl           |   2 +-
 src/test/api-update-acl-test.pl | 356 ++++++++++++++++++++++++++++++++
 3 files changed, 364 insertions(+), 7 deletions(-)
 create mode 100644 src/test/api-update-acl-test.pl

-- 
2.47.3





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-07-31  9:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-31  9:43 [PATCH access-control v3 0/2] fix: #6510: Allow deleting ACLs for non-existent entities & add API tests Elias Huhsovitz
2026-07-31  9:43 ` [PATCH access-control v3 1/2] test: api: acl: add tests for modification endpoint Elias Huhsovitz
2026-07-31  9:43 ` [PATCH access-control v3 2/2] fix #6510: api: acl: allow deletion for non-existent entities Elias Huhsovitz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal