Skip to content

CORE-15456 Support Group ACLs in Schema Registry#29476

Merged
michael-redpanda merged 2 commits into
redpanda-data:devfrom
michael-redpanda:gbac/core-15456-sr-acl
Feb 2, 2026
Merged

CORE-15456 Support Group ACLs in Schema Registry#29476
michael-redpanda merged 2 commits into
redpanda-data:devfrom
michael-redpanda:gbac/core-15456-sr-acl

Conversation

@michael-redpanda

Copy link
Copy Markdown
Contributor

Enable Group principal support for Schema Registry ACLs with comprehensive testing.

This PR ensures that Group-based ACLs work correctly for enterprise customers with the group_based_authorization feature enabled. It includes a bug fix, extensive C++ unit tests, and Python integration tests for end-to-end validation.

Backports Required

  • none - not a bug fix
  • none - this is a backport
  • none - issue does not exist in previous branches
  • none - papercut/not impactful enough to backport
  • v25.3.x
  • v25.2.x
  • v25.1.x

Release Notes

  • none

Copilot AI review requested due to automatic review settings January 30, 2026 20:15
@michael-redpanda michael-redpanda self-assigned this Jan 30, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enables Group principal support for Schema Registry ACLs, allowing enterprise customers with the group_based_authorization feature to use Group-based ACLs. The change includes a bug fix in the C++ ACL parsing logic and comprehensive test coverage.

Changes:

  • Fixed from_string_view<principal_type> to correctly parse "group" principal type
  • Added C++ unit tests for Group principal parsing, authorization, and DENY precedence
  • Added Python integration tests covering Group ACL creation, querying, deletion, validation, mixed User/Group scenarios, and scale testing

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/v/security/acl.cc Added missing "group" case to principal type parser
src/v/security/tests/authorizer_test.cc Added comprehensive C++ unit tests for Group principal functionality
tests/rptest/tests/schema_registry_test.py Added Python integration tests for Group ACL operations in Schema Registry
src/go/rpk/go.mod Updated dependency versions for rpadmin and rpsr libraries

Comment thread tests/rptest/tests/schema_registry_test.py Outdated
Comment thread tests/rptest/tests/schema_registry_test.py
@michael-redpanda

Copy link
Copy Markdown
Contributor Author

Force push:

  • FOrgot to run go mod tidy

@michael-redpanda

Copy link
Copy Markdown
Contributor Author

Force push:

  • Addressed bot comment

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.

Comment on lines +7799 to +7800
wildcard_group_acl = [self._create_test_acl(principal="Group:*")]
response = self.sr_client.post_security_acls(wildcard_group_acl)

Copilot AI Jan 30, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Variable name wildcard_group_acl should be plural wildcard_group_acls since it contains a list of ACLs, for consistency with other test methods like group_acls, mixed_acls, and acls.

Suggested change
wildcard_group_acl = [self._create_test_acl(principal="Group:*")]
response = self.sr_client.post_security_acls(wildcard_group_acl)
wildcard_group_acls = [self._create_test_acl(principal="Group:*")]
response = self.sr_client.post_security_acls(wildcard_group_acls)

Copilot uses AI. Check for mistakes.
Comment on lines +7809 to +7810
empty_group_acl = [self._create_test_acl(principal="Group:")]
response = self.sr_client.post_security_acls(empty_group_acl)

Copilot AI Jan 30, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Variable name empty_group_acl should be plural empty_group_acls since it contains a list of ACLs, for consistency with other test methods.

Suggested change
empty_group_acl = [self._create_test_acl(principal="Group:")]
response = self.sr_client.post_security_acls(empty_group_acl)
empty_group_acls = [self._create_test_acl(principal="Group:")]
response = self.sr_client.post_security_acls(empty_group_acls)

Copilot uses AI. Check for mistakes.
@vbotbuildovich

vbotbuildovich commented Jan 30, 2026

Copy link
Copy Markdown
Collaborator

CI test results

test results on build#79910
test_class test_method test_arguments test_kind job_url test_status passed reason test_history
QuotaManagementUpgradeTest test_upgrade null integration https://buildkite.com/redpanda/redpanda/builds/79910#019c10a4-10e8-4500-b9cb-eebb953b3b01 FLAKY 28/31 Test PASSES after retries.No significant increase in flaky rate(baseline=0.0274, p0=0.1982, reject_threshold=0.0100. adj_baseline=0.1000, p1=0.4114, trust_threshold=0.5000) https://redpanda.metabaseapp.com/dashboard/87-tests?tab=142-dt-individual-test-history&test_class=QuotaManagementUpgradeTest&test_method=test_upgrade
test results on build#79953
test_class test_method test_arguments test_kind job_url test_status passed reason test_history
ShadowLinkingReplicationTests test_with_restart null integration https://buildkite.com/redpanda/redpanda/builds/79953#019c1eed-4817-41e9-9e11-b66c5f5d3344 FLAKY 10/11 Test PASSES after retries.No significant increase in flaky rate(baseline=0.0051, p0=1.0000, reject_threshold=0.0100. adj_baseline=0.1000, p1=0.3487, trust_threshold=0.5000) https://redpanda.metabaseapp.com/dashboard/87-tests?tab=142-dt-individual-test-history&test_class=ShadowLinkingReplicationTests&test_method=test_with_restart
ScalingUpTest test_moves_with_local_retention {"use_topic_property": true} integration https://buildkite.com/redpanda/redpanda/builds/79953#019c1eef-cb40-43cc-bd34-492954cb774a FLAKY 28/31 Test PASSES after retries.No significant increase in flaky rate(baseline=0.0178, p0=0.0992, reject_threshold=0.0100. adj_baseline=0.1000, p1=0.4114, trust_threshold=0.5000) https://redpanda.metabaseapp.com/dashboard/87-tests?tab=142-dt-individual-test-history&test_class=ScalingUpTest&test_method=test_moves_with_local_retention

@r-vasquez r-vasquez requested a review from graham-rp January 30, 2026 21:46
pgellert
pgellert previously approved these changes Feb 2, 2026

@pgellert pgellert left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, the main question I left is if we should move the scale test away from per-PR CI runs

Comment thread tests/rptest/tests/schema_registry_test.py Outdated
Comment thread tests/rptest/tests/schema_registry_test.py

@cluster(num_nodes=3)
@matrix(scale=[1, 100])
def test_group_acl_scale(self, scale):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How quick is this scale test? I'm wondering if it should go into the schema_registry_scale_test.py, which doesn't run on every CI run, but only in the nightly CDT I think.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This runs very quickly

- Fix missing group mapping in from_string_view<principal_type>
- Add C++ tests for group principal parsing and authorization
- Add Python integration tests for Schema Registry group ACL operations

This ensures group-based ACLs work correctly for enterprise customers
with the group_based_authorization feature enabled.

Signed-off-by: Michael Boquard <michael@redpanda.com>
Update rpsr to v0.1.3 which permits Group principal ACL creation for
Schema Registry ACLs.

Signed-off-by: Michael Boquard <michael@redpanda.com>
@michael-redpanda

Copy link
Copy Markdown
Contributor Author

Force push:

  • Addressed PR comments

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.

Comment on lines +7855 to +7856
assert acl["principal"].startswith("Group:team_"), (
f"Unexpected principal: {acl['principal']}"

Copilot AI Feb 2, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use self.assert_true() instead of assert for consistency with the rest of the test suite and to ensure proper test framework error reporting.

Suggested change
assert acl["principal"].startswith("Group:team_"), (
f"Unexpected principal: {acl['principal']}"
self.assert_true(
acl["principal"].startswith("Group:team_"),
f"Unexpected principal: {acl['principal']}",

Copilot uses AI. Check for mistakes.
EXPECT_THROW(acl_principal::from_string("Group:*"), acl_conversion_error);

// Test empty group name throws
EXPECT_THROW(acl_principal::from_string("Group:"), std::exception);

Copilot AI Feb 2, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using a more specific exception type (e.g., acl_conversion_error) instead of the generic std::exception for consistency with the wildcard test on line 3253.

Suggested change
EXPECT_THROW(acl_principal::from_string("Group:"), std::exception);
EXPECT_THROW(acl_principal::from_string("Group:"), acl_conversion_error);

Copilot uses AI. Check for mistakes.
@michael-redpanda

Copy link
Copy Markdown
Contributor Author

There's something wrong with the license checks here (https://redpandadata.slack.com/archives/C02PGU02EMR/p1767675745170899). Another PR (#29153) also had this problem, but I guess we can bypass it and it shouldn't block future PRs.

@michael-redpanda michael-redpanda merged commit 267115c into redpanda-data:dev Feb 2, 2026
25 of 29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants