Skip to content

HDDS-16842. Check admin rights in OM bootstrap RPC - #11502

Merged
jojochuang merged 4 commits into
apache:masterfrom
andyhuangdev:HDDS-16842
Oct 15, 2026
Merged

jojochuang merged 4 commits into
apache:masterfrom
andyhuangdev:HDDS-16842

Conversation

@andyhuangdev

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

This patch adds an administrator authorization check to OMInterServiceProtocolServerSideImpl.bootstrap() before adding an OM to the Ratis ring, consistent with the checks in decommission() and getOMConfiguration().

The check uses the existing admin authorization helpers and error response handling. Normal bootstrap already calls getOMConfiguration() with administrator privileges before requesting membership changes. When admin authorization is disabled, behavior remains unchanged. No configuration or Protobuf changes are required.

A regression test verifies that non-admin bootstrap callers are rejected. The existing bootstrap test now enables admin authorization to verify that legitimate OMs can still join.

What is the link to the Apache JIRA

HDDS-16842

How was this patch tested?

The new bootstrapNonAdminIsDenied regression test was run before the fix and failed because the expected authorization denial was missing.

After the fix, all tests passed:

  • TestOMAdminRpcAuthorization: 5 tests
  • TestAddRemoveOzoneManager: 8 tests
  • TestOMInstallSnapshotDuringBootstrapping: 1 test
  • TestOMAdminProtocolServerSideImpl: 1 test

The project checkstyle script completed with zero violations, and git diff --check passed.

Require administrator privileges before adding an OM to the Ratis ring when admin authorization is enabled, consistent with decommission and getOMConfiguration.

Add a non-admin bootstrap regression test and enable authorization in the existing bootstrap test.

Tests: Confirmed regression test fails before the fix; 14 integration
tests and 1 unit test pass after the fix. Checkstyle passes.
@github-actions github-actions Bot added the om label Oct 13, 2026

@smengcl smengcl 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

…lict.

Keep bootstrap admin authorization tests from HDDS-16842 together with
safe mode and echo RPC authorization tests added on master.

Co-authored-by: Cursor <cursoragent@cursor.com>
Change-Id: I56f53aced3f813dd38f0e14cc20b8005f3dcdec5

@jojochuang jojochuang 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.

Merged current master into HDDS-16842 and resolved the conflict in TestOMAdminRpcAuthorization.java by keeping both:

  • bootstrap admin authorization coverage (HDDS-16842)
  • safe mode + echo RPC authorization tests from master

@jojochuang
jojochuang merged commit 347e210 into apache:master Oct 15, 2026
55 checks passed
@jojochuang

Copy link
Copy Markdown
Contributor

Merged. Thanks @andyhuangdev @smengcl

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants