Repository navigation
P09: Port SPIFFE identity compatibility to ZooKeeper 3.8.7 - #185
Merged
bellatrix007 merged 2 commits intoDec 3, 2026
Merged
bellatrix007 merged 2 commits into
bellatrix007 merged 2 commits into
Conversation
1 task
1 task
bellatrix007
force-pushed
the
adbansal/zk-387-p09-spiffe-identity
branch
from
November 27, 2026 06:10
29284e4 to
020f3e5
Compare
Port the fork's SPIFFE URI-SAN principal extraction (#142), one-way compatibility between SPIFFE application identities and legacy service-principal identities (#149), and legacy-form creator ACLs for SPIFFE clients (#158). SPIFFE v1/wl, v1 application/airflow and v2 URI SANs are extracted before configured SAN or Subject DN extraction and are retained as typed identity on the connection and request, including requests forwarded between quorum peers. Eligible SPIFFE application identities may match bare or formatted legacy service-principal ACLs, URI-domain mappings and superuser IDs; legacy identities do not gain reverse aliases. With setX509ClientIdAsAcl enabled, automatic ACLs store servicePrincipal(<app> for eligible SPIFFE creators. Adapted to 3.8.7: the String X509AuthenticationUtil.getClientId methods are kept and typed identities are exposed through getClientIdentity; the X509AuthenticationProvider.getClientId hook and its inline certificate trust checks are kept, and typed compatibility is used only when the hook returns the extracted ID. The exists ACL check also uses the request identity. Carried tests are converted to JUnit 5, with focused hook, SAN fallback and real TLS creator ACL regressions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Return ClientIdentity from getClientId, reuse the canonical certificate authentication path, and remove the protected identity hook. Update callers, tests and documentation while preserving target TLS setup, READ checks and volatile publication. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
bellatrix007
force-pushed
the
adbansal/zk-387-p09-spiffe-identity
branch
from
December 2, 2026 06:47
020f3e5 to
dc9dd7a
Compare
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.
Description
Port #142, #149 and #158 to ZooKeeper 3.8.7, stacked on #184:
x509:servicePrincipal(<app>creator ACL form whensetX509ClientIdAsAclis enabled, while retaining the original authenticated identity.Differences from
branch-3.6at9d245933379762dc83e8f44934ac1d80b7c55897:X509AuthenticationUtil.getClientId(...)returnsClientIdentity. The basic provider uses the shared certificate-validation helper and derives identity once, without a protected custom-ID hook or special hook-compatibility branch.branch-3.6's volatile/non-volatile choices for X509 configuration/mapping fields, together with the original lazy-initialization rationale and SpotBugs suppressions.An unmatched optional legacy SAN capture now falls back to Subject DN as in the fork, restoring behavior missing from the earlier P03 port. This is a restoration of source behavior, not a new fallback policy.
Tests
Added/adapted
X509AuthTest,X509SpiffeAuthIntegrationTest,X509DirectAclTest,X509CreatorAclTest,X509QuorumAuthInfoTest,QuorumX509IdentityTest,PrepRequestProcessorTest,X509GroupAclIntegrationTest,X509ZNodeGroupAclProviderTestandZkClientUriDomainMappingHelperTest.At
29284e4c, the selected baseline plus affected identity/ACL/request/TLS suites passed 234 cases per JDK on Java 8/11/17: 702 passed executions, zero failures/errors/skips/automatic reruns. The selection does not repeat every unchanged regression class from the earlier P09 runs.Callers and tests use the fork's typed identity API. Only the two tests for the removed protected identity hook were removed; permission-denial and persisted-ACL controls remain.
Real TLS group-ACL cases use CA-signed certificates and hostname verification on dedicated and unified listeners. They inspect persisted ACLs with
getACLand verify denied reads/writes. Certificate-parser tests and mocked quorum-relay tests are not presented as full-network interoperability tests.Java 11 assembly, RAT, Checkstyle including test sources, and SpotBugs passed using
clean package -DskipTests apache-rat:check checkstyle:check spotbugs:check -Dcheckstyle.includeTestSourceDirectory=true.Base P08: Port runtime TLS defaults to ZooKeeper 3.8.7 #184 has one failed full Java 11 CI job: the pre-existing
testMappingLifecycleAndReadAuthorizationtimed out waiting forSyncConnectedafter reconnect. Its duplicate full Java 11 job passed, and that case passed in this candidate's selected runs on all three JDKs. The CI timeout's cause remains unresolved; this PR does not claim to fix it.Full upstream, Linux/native, deployed-client, real SPIFFE multi-server and mixed-version rolling-upgrade/rollback qualification remain separate.
Local code review completed
Changes that Break Backward Compatibility (Optional)
ZooKeeperServer.checkACLremains callable, but production requests use the request-based overload. External subclasses overriding only the old method must account for that dispatch change. This caveat also exists in the current fork; it is not a new divergence frombranch-3.6.X509AuthenticationUtil.getClientId(...)now returnsClientIdentity, as in the fork. Consumers of the previous String-returning helper must adapt to.getId()and recompile. This is a server-side helper API change, not a change to ordinary ZooKeeper client APIs.X509AuthenticationProvider.getClientIdhook is removed, as in the fork. Existing custom subclasses relying on that hook must be adapted. Authentication failures now use the shared helper's logging path.Documentation (Optional)
Updated
zookeeperAdmin.mdwith one-way identity compatibility, creator-ACL representation, application-name scope and mixed-version quorum limits.🤖 Generated with GitHub Copilot CLI