Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated isSecured #515

Merged
merged 1 commit into from
May 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions src/main/java/kafdrop/Kafdrop.java
Original file line number Diff line number Diff line change
Expand Up @@ -147,21 +147,9 @@ public void onApplicationEvent(ApplicationEnvironmentPreparedEvent event) {

LOG.info("Initializing JAAS config");
final String env = environment.getProperty("kafka.env");
final boolean isSecured = environment.getProperty("kafka.isSecured", Boolean.class);
LOG.info("env: {} .isSecured kafka: {}", env, isSecured);
if (isSecured && Strings.isNullOrEmpty(env)) {
throw new IllegalArgumentException("Value of 'env' cannot be null if connecting to secured kafka.");
}

LOG.info("Env: {}", env);
String path;

if (isSecured) {
path = environment.getProperty("user.dir") + "/kaas_" + env.toLowerCase() + "_jaas.conf";
LOG.info("PATH: {}", path);
System.setProperty("java.security.auth.login.config", path);
}

if (environment.containsProperty(SM_CONFIG_DIR)) {
Stream.of("kafdrop", "global")
.map(name -> readProperties(environment, name))
Expand Down
7 changes: 1 addition & 6 deletions src/main/java/kafdrop/config/KafkaConfiguration.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ public final class KafkaConfiguration {
private static final Logger LOG = LoggerFactory.getLogger(KafkaConfiguration.class);

private String brokerConnect;
private boolean isSecured = false;
private String saslMechanism;
private String securityProtocol;
private String truststoreFile;
Expand All @@ -31,12 +30,8 @@ public final class KafkaConfiguration {

public void applyCommon(Properties properties) {
properties.setProperty(CommonClientConfigs.BOOTSTRAP_SERVERS_CONFIG, brokerConnect);
if (isSecured) {
LOG.warn("The 'isSecured' property is deprecated; consult README.md on the preferred way to configure security");
properties.put(SaslConfigs.SASL_MECHANISM, saslMechanism);
}

if (isSecured || securityProtocol.equals("SSL")) {
if (securityProtocol.equals("SSL")) {
properties.put(CommonClientConfigs.SECURITY_PROTOCOL_CONFIG, securityProtocol);
}

Expand Down
1 change: 0 additions & 1 deletion src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ kafdrop.monitor:

kafka:
brokerConnect: localhost:9092
isSecured: false
saslMechanism: "PLAIN"
securityProtocol: "SASL_PLAINTEXT"
truststoreFile: "${KAFKA_TRUSTSTORE_FILE:kafka.truststore.jks}"
Expand Down