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

Adding enum for kafka protocols #100

Merged
merged 7 commits into from
Oct 20, 2022
Merged

Adding enum for kafka protocols #100

merged 7 commits into from
Oct 20, 2022

Conversation

muralibasani
Copy link
Contributor

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

return new ResponseEntity<>(
envsClustersTenantsControllerService.getSchemaRegEnvsStatus(), HttpStatus.OK);
}

Copy link
Contributor

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+?

Copy link
Contributor Author

@muralibasani muralibasani Oct 20, 2022

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);
Copy link
Contributor

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()));
    }

Copy link
Contributor Author

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.

@muralibasani muralibasani merged commit 1b0903c into main Oct 20, 2022
@muralibasani muralibasani deleted the issue84-scramprotocol branch October 20, 2022 07:34
@muralibasani muralibasani restored the issue84-scramprotocol branch October 20, 2022 07:35
@muralibasani muralibasani deleted the issue84-scramprotocol branch October 20, 2022 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cluster authentication via SASL_SSL/SCRAM-SHA-512
2 participants