DGS-24022 SPIRE Trust Manager Only#707
Open
Dhiraj Suri (DhirajSuri27) wants to merge 5 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new SPIRE “trust-manager-only” SSL mode so the server can continue using the configured keystore for its KeyManager while sourcing peer verification (TrustManager) from SPIRE.
Changes:
- Introduces
ssl.spire.trust.only.enabledconfig and exposes it viaSslConfig. - Refactors
SslFactoryto select between: non-SPIRE, SPIRE full mode, and SPIRE trust-only mode (TrustManager override). - Adds unit tests covering SPIRE trust-only behavior and the “ignored when SPIRE disabled” case.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| core/src/main/java/io/confluent/rest/SslFactory.java | Adds server-factory selection logic and a trust-only SPIRE path that overrides TrustManagers. |
| core/src/main/java/io/confluent/rest/SslConfig.java | Exposes the new SPIRE trust-only config toggle. |
| core/src/main/java/io/confluent/rest/RestConfig.java | Defines and documents the new ssl.spire.trust.only.enabled setting in the config definition. |
| core/src/test/java/io/confluent/rest/SslFactoryTest.java | Adds tests for trust-only mode and SPIRE-disabled behavior; introduces new imports. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+200
to
+210
| private static SslContextFactory.Server createServerFactory( | ||
| SslConfig sslConfig, X509Source x509Source) { | ||
| if (!sslConfig.getIsSpireEnabled()) { | ||
| return new SslContextFactory.Server(); | ||
| } | ||
| if (sslConfig.getIsSpireTrustOnlyEnabled()) { | ||
| return createSpireTrustOnlyServer(x509Source); | ||
| } | ||
| SslContextFactory.Server factory = new SslContextFactory.Server(); | ||
| configureSpiffeSslContext(factory, x509Source); | ||
| return factory; |
Comment on lines
210
to
212
| @@ -211,6 +211,14 @@ public class RestConfig extends AbstractConfig { | |||
| "Whether to enable SPIRE SSL; once enabled, all keystore and truststore settings " | |||
| + "are ignored because SPIRE will handle the certificate and key management"; | |||
| import java.nio.file.Path; | ||
| import java.nio.file.Paths; | ||
| import java.security.KeyStore; | ||
| import java.security.cert.CRL; |
Comment on lines
+205
to
+206
| @Test | ||
| public void testSpireTrustOnlyUsesKeystoreKeyManagerAndSpireTrustManager() throws Exception { |
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.
Create a mode to run the server with SPIRE TrustManager-only and default KeyManager.
Confirmed that client TLS REQUESTED (instead of REQUIRED) works as expected,