[server] Add authorization to Snapshot Management RPCs#3300
Open
vaibhavk1992 wants to merge 3 commits into
Open
[server] Add authorization to Snapshot Management RPCs#3300vaibhavk1992 wants to merge 3 commits into
vaibhavk1992 wants to merge 3 commits into
Conversation
This commit adds CLUSTER/WRITE authorization checks for snapshot management internal RPCs as specified in issue apache#3250: Server Changes: - TabletService: Add authorization to notifyKvSnapshotOffset and notifyLakeTableOffset - CoordinatorService: Add authorization to commitKvSnapshot and commitLakeTableSnapshot - All methods check CLUSTER/WRITE permission before processing requests - Internal sessions automatically bypass authorization via session.isInternal() Test Coverage: - Add comprehensive test testSnapshotManagementAuthorization() - Test 1-4: Verify AuthorizationException when client lacks CLUSTER/WRITE permission - Test 5: Grant CLUSTER/WRITE permission and verify operations succeed - Test 6: Verify internal server-to-server calls bypass authorization - Tests all 4 snapshot management operations with complete authorization lifecycle These are internal server-to-server RPCs used for snapshot coordination. The authorization prevents external clients from calling internal APIs while allowing legitimate internal cluster operations to proceed. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…objects The test was failing because Protocol Buffer request objects require certain fields to be set before validation. Added required fields to all snapshot management RPC requests: - NotifyKvSnapshotOffsetRequest: tableId, bucketId, coordinatorEpoch, minRetainOffset - NotifyLakeTableOffsetRequest: coordinatorEpoch - CommitKvSnapshotRequest: completedSnapshot, coordinatorEpoch, bucketLeaderEpoch - CommitLakeTableSnapshotRequest: (no required fields, but keeping consistent) This ensures requests pass validation and reach the authorization check.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Changes
Server Side
TabletService.java:
notifyKvSnapshotOffset- Added CLUSTER/WRITE authorization checknotifyLakeTableOffset- Added CLUSTER/WRITE authorization checkCoordinatorService.java:
commitKvSnapshot- Added CLUSTER/WRITE authorization checkcommitLakeTableSnapshot- Added CLUSTER/WRITE authorization checkTest Coverage
FlussAuthorizationITCase.java:
testSnapshotManagementAuthorization()with comprehensive coverage:Technical Details
These are internal server-to-server RPCs used for snapshot coordination between CoordinatorServer and TabletServers. The authorization prevents external clients from calling internal cluster management APIs while allowing legitimate internal operations via
session.isInternal()bypass.All operations use CLUSTER/WRITE permission type because they modify cluster-wide snapshot state, consistent with other internal cluster management operations like rebalance and ISR adjustment.
Test Plan
mvn compile test-compile -pl fluss-server,fluss-client -amCloses #3250