[server] Add authorization to Remote Log & Tiering RPCs#3301
Open
vaibhavk1992 wants to merge 3 commits into
Open
[server] Add authorization to Remote Log & Tiering RPCs#3301vaibhavk1992 wants to merge 3 commits into
vaibhavk1992 wants to merge 3 commits into
Conversation
This commit adds CLUSTER/WRITE authorization checks for remote log and tiering internal RPCs as specified in issue apache#3251: Server Changes: - TabletService: Add authorization to notifyRemoteLogOffsets - CoordinatorService: Add authorization to commitRemoteLogManifest and lakeTieringHeartbeat - All methods check CLUSTER/WRITE permission before processing requests - Internal sessions automatically bypass authorization via session.isInternal() Test Coverage: - Add comprehensive test testRemoteLogAndTieringAuthorization() - Test 1-3: Verify AuthorizationException when client lacks CLUSTER/WRITE permission - Test 4: Grant CLUSTER/WRITE permission and verify operations succeed - Test 5: Verify internal server-to-server calls bypass authorization - Tests all 3 remote log/tiering operations with complete authorization lifecycle These are internal server-to-server RPCs used for: - notifyRemoteLogOffsets: Notify TabletServers about remote log tier offsets - commitRemoteLogManifest: Commit remote log manifests to CoordinatorServer - lakeTieringHeartbeat: Lake tiering service heartbeats to CoordinatorServer The authorization prevents external clients from calling internal cluster management APIs while allowing legitimate internal operations to proceed. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…st objects The test was failing because Protocol Buffer request objects require certain fields to be set before validation. Added required fields to all remote log and tiering RPC requests: - NotifyRemoteLogOffsetsRequest: tableId, bucketId, coordinatorEpoch, remoteStartOffset, remoteEndOffset - CommitRemoteLogManifestRequest: tableId, bucketId, remoteLogManifestPath, remoteLogStartOffset, remoteLogEndOffset, coordinatorEpoch, bucketLeaderEpoch - LakeTieringHeartbeatRequest: (no required fields) 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:
notifyRemoteLogOffsets- Added CLUSTER/WRITE authorization checkCoordinatorService.java:
commitRemoteLogManifest- Added CLUSTER/WRITE authorization checklakeTieringHeartbeat- Added CLUSTER/WRITE authorization checkTest Coverage
FlussAuthorizationITCase.java:
testRemoteLogAndTieringAuthorization()with comprehensive coverage:Technical Details
These are internal server-to-server RPCs used for remote log tiering and lake tiering operations:
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 tiering state, consistent with other internal cluster management operations.
Test Plan
mvn compile test-compile -pl fluss-server,fluss-client -amCloses #3251