Skip to content

PolarisAuthzTestBase: fix insufficient privilege set tests#3691

Open
adutra wants to merge 1 commit intoapache:mainfrom
adutra:fix-authz-insufficient-test
Open

PolarisAuthzTestBase: fix insufficient privilege set tests#3691
adutra wants to merge 1 commit intoapache:mainfrom
adutra:fix-authz-insufficient-test

Conversation

@adutra
Copy link
Contributor

@adutra adutra commented Feb 6, 2026

The method doTestInsufficientPrivilegeSets() was incorrectly testing that each privilege in the set was individually insufficient.

But this is not the intent of a privilege set negative test: the test is expected to fail even if all privileges in the set are granted.

See for instance PolicyCatalogHandlerAuthzTest.testDetachPolicyFromNamespaceInsufficientPrivilege(): the intent is to verify that it is insufficient to have both POLICY_DETACH and CATALOG_DETACH_POLICY.

Checklist

  • 🛡️ Don't disclose security issues! (contact security@apache.org)
  • 🔗 Clearly explained why the changes are needed, or linked related issues: Fixes #
  • 🧪 Added/updated tests with good coverage, or manually tested (and explained how)
  • 💡 Added comments for complex logic
  • 🧾 Updated CHANGELOG.md (if needed)
  • 📚 Updated documentation in site/content/in-dev/unreleased (if needed)

The method `doTestInsufficientPrivilegeSets()` was incorrectly testing that each privilege in the set was *individually* insufficient.

But this is not the intent of a privilege set negative test: the test is expected to fail even if *all* privileges in the set are granted.

See for instance `PolicyCatalogHandlerAuthzTest.testDetachPolicyFromNamespaceInsufficientPrivilege()`: the intent is to verify that it is insufficient to have *both* `POLICY_DETACH` and `CATALOG_DETACH_POLICY`.
@adutra
Copy link
Contributor Author

adutra commented Feb 6, 2026

Pinging @collado-mike and @HonahX – let me know if my analyzis is correct!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant