-
Notifications
You must be signed in to change notification settings - Fork 60
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
Adding enum for kafka protocols #100
Conversation
src/main/java/io/aiven/klaw/service/EnvsClustersTenantsControllerService.java
Outdated
Show resolved
Hide resolved
src/main/java/io/aiven/klaw/service/EnvsClustersTenantsControllerService.java
Outdated
Show resolved
Hide resolved
return new ResponseEntity<>( | ||
envsClustersTenantsControllerService.getSchemaRegEnvsStatus(), HttpStatus.OK); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since it is an endpoint which could be used by users should the migration process somehow be described anywhere?
Like what to use instead after upgrading to Klaw 1+?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, but this is an unused endpoint which is being removed here. It is not called from anywhere. There was some code related to PLAINTEXT protocol and hence found. It's just part of cleanup.
Map<String, String> protocolValues = new HashMap<>(); | ||
protocolValues.put("name", kafkaSupportedProtocol.getName()); | ||
protocolValues.put("value", kafkaSupportedProtocol.getValue()); | ||
supportedProtocols.add(protocolValues); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the contract for supportedProtocols
? Which maps should be added there?
Is it ok to add NON modifiable maps?
I'm asking because if it is ok to add NON modifiable map then the cycle it could be a bit simplified like
for (KafkaSupportedProtocol kafkaSupportedProtocol : KafkaSupportedProtocol.values()) {
supportedProtocols.add(
Map.of("name", kafkaSupportedProtocol.getName(),
"value", kafkaSupportedProtocol.getValue()));
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed this is a NON modifiable map, updated the code. thanks.
About this change - What it does
Replaces all string representation of protocol with Enum, and adds new protocol SCRAM SHA-512
Resolves: #84
Why this way
Enum representation is better than strings