Skip to content

RANGER-5719: Shared partition-plan library and SPIFFE header auth utilities - #1137

Open
ramackri wants to merge 4 commits into
apache:masterfrom
ramackri:RANGER-5719-patch
Open

RANGER-5719: Shared partition-plan library and SPIFFE header auth utilities#1137
ramackri wants to merge 4 commits into
apache:masterfrom
ramackri:RANGER-5719-patch

Conversation

@ramackri

@ramackri ramackri commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Summary

First PR in the RANGER-5655 series — Admin-managed Kafka audit partition plan.

JIRA: RANGER-5719

Split from closed #1135.

This PR adds the partition plan library only (+1,789 lines, 17 files). It does not change runtime behavior, SPIFFE auth, Admin REST, ingestor, or DB schema. Safe to merge independently.

SPIFFE header utilities and RangerRESTClient.setTrustedAuthHeaders() are in #1139 (RANGER-5723).

Partition plan library (agents-common)

Canonical JSON model stored in Admin x_ranger_global_state (RangerAuditPartitionPlan):

Component Purpose
PartitionPlan, PluginEntry, BufferEntry JSON model: topic, version, plugin → partition map, buffer slots
PartitionPlanAllocator Assigns Kafka partition numbers when plugins are promoted from buffer
PartitionPlanValidator Validates plan shape, version, and partition ranges
PartitionPlanRoutingUtils Resolves plugin ID → Kafka partition at ingestor runtime
PolicyDownloadAuthUsersUtil Extracts policy.download.auth.users per service for ingestor allow-lists
AuditPartitionPlanAdminConfig Reads Admin partition-count settings (partitions.per.plugin, per-plugin overrides)
AuditPartitionPlanConstants Shared defaults (ranger_audits topic, initial version, property names)

Tests: allocator, validator, routing, JSON round-trip, allow-list extraction.

Related PRs — RANGER-5655 merge order

PR JIRA Scope Depends on
This PR RANGER-5719 Partition plan library only
#1138 RANGER-5720 DB patch 078 (parallel)
#1139 RANGER-5723 SPIFFE utilities + audit-server destination outbound (parallel)
(future) RANGER-5721 Admin REST + AuditPartitionPlanMgr #1137, #1138
(future) RANGER-5722 Ingestor routing, inbound SPIFFE, Admin poller #1137, #1138, #1139

AuditPluginIdResolver deferred to RANGER-5721.

Test plan

  • mvn -pl agents-common -am test — partition plan unit tests pass
  • CI: build-17, plugins-docker-build, services-docker-build

ramackri pushed a commit to ramackri/ranger that referenced this pull request Aug 6, 2026
Wire PluginHeaderAuthConfig into RangerAuditServerDestination so plugins send
X-Spiffe-Id on audit POSTs when xasecure.audit.destination.auditserver.authn.header.enabled=true.
Requires RANGER-5719 (apache#1137) for PluginHeaderAuthConfig and setTrustedAuthHeaders().
@ramackri
ramackri requested review from mneethiraj and rameeshm August 6, 2026 02:31
…uting

Add agents-common partition plan model, allocator, validator, routing helpers,
and PolicyDownloadAuthUsersUtil for RANGER-5655. SPIFFE header utilities
move to RANGER-5723 (apache#1139).
@ramackri
ramackri force-pushed the RANGER-5719-patch branch from c4cf544 to 0ced753 Compare August 6, 2026 03:15
ramk added 3 commits August 6, 2026 13:02
Drop scalePlugin, replacePlan, isPromoteAlreadyApplied, sameContentAs,
toAllowedUserSets, hashToSlotIndex, and related helpers that no production
caller uses in the 5721/5722 design; can reintroduce when scaling or bulk
replace is wired.
Remove PluginEntry.empty(), the four-arg promotePlugin overload, and
DEFAULT_AUDIT_TOPIC (tests use the literal topic name).
No callers in apache#1137, rangerRelease 5721/5722, or tests; plans are built via plugins(map).
@ramackri
ramackri requested a review from kumaab August 7, 2026 16:38
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