Repository navigation
Add SSL, mTLS and SASL support to KafkaCancellationNotifier (4.5.0) - #237
Merged
Merged
Conversation
Add a new AddKafkaCancellationNotifier(IConfiguration) overload that binds the Conductor:KafkaCancellationNotifier section, including security settings for SSL, mTLS (PEM files or PKCS#12 keystore), SASL_SSL and SASL_PLAINTEXT (PLAIN, SCRAM-SHA-256, SCRAM-SHA-512). Settings are validated on startup. Security settings are optional and only passed to librdkafka when configured, so existing setups produce the same client config as before. The existing AddKafkaCancellationNotifier method is unchanged and does not run the new validation. The admin client used for topic creation now shares the consumer's connection settings. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…SKILL.md Keep all packages on the same version as KafkaCancellationNotifier, and describe the new IConfiguration overload and security settings in the SKILL.md Kafka section. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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
Adds support for secured Kafka connections to
ConductorSharp.KafkaCancellationNotifier: SSL, mTLS (PEM files or PKCS#12 keystore), SASL_SSL and SASL_PLAINTEXT (PLAIN, SCRAM-SHA-256, SCRAM-SHA-512).What changed
AddKafkaCancellationNotifier(IConfiguration section)binds theConductor:KafkaCancellationNotifiersection, including the new security settings, into the internalKafkaOptions. Works with appsettings, environment variables, user secrets and vault-backed configuration.KafkaOptions(still internal) gains optionalSecurityProtocol,SaslMechanism,SaslUsername,SaslPassword,SslCaLocation,SslCertificateLocation,SslKeyLocation,SslKeyPassword,SslKeystoreLocation,SslKeystorePassword,EnableSslCertificateVerificationandSslEndpointIdentificationAlgorithm.KafkaClientConfigFactorybuilds both the consumer config and the admin client config (used forCreateTopicOnStartup), so topic creation also works against secured brokers. Optional settings are only passed to librdkafka when configured.KafkaOptionsValidatorruns on startup (ValidateOnStart) for the new overload only and reports all problems at once:BootstrapServers,TopicName,GroupIdare requiredSaslMechanism,SaslUsernameandSaslPasswordSslCertificateLocationandSslKeyLocationmust be configured togetherSslKeystoreLocationcannot be combined with certificate/keySsl*settings are configured but the protocol is notSsl/SaslSsl.Microsoft.Extensions.Options.ConfigurationExtensions8.0.0 (matches the 8.0Microsoft.Extensions.*packages Engine already uses).Backward compatibility
Drop-in upgrade from 4.4.1:
AddKafkaCancellationNotifier(bootstrapServers, topicName, groupId, createTopicOnStartup)is unchanged and not deprecated. It keeps its null-only argument checks and does not run the new startup validation.KafkaOptionsstays internal, so no new public types; enums come from Confluent.Kafka. Confluent.Kafka stays at 2.8.0.Notes for reviewers
Ssl*validation (file existence, cert/key pairing, keystore exclusivity) only applies when the protocol isSslorSaslSsl; otherwise those settings are ignored with a warning instead of failing startup.Testing
37 new unit tests in
ConductorSharp.Engine.Tests(110 total, all passing):IConfigurationbinding, defaults, and startup validation viaIStartupValidatorNot tested against a live secured broker.
🤖 Generated with Claude Code