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

Added SCRAM-SHA-512 support to dataflow kafka-to-bigquery #2181

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

vgnanasekaran
Copy link

Added SCRAM-SHA-512 support to dataflow kafka-to-bigquery

@vgnanasekaran
Copy link
Author

@an2x As discussed, I have created the PR to support scram-sha-512 in Dataflow Kaka2BQ. Request you to review and share your comments.

Thank you,
Venkat

@an2x an2x self-requested a review February 13, 2025 14:33
@@ -215,4 +217,62 @@ final class Offset {
String getKafkaReadKeyPasswordSecretId();

void setKafkaReadKeyPasswordSecretId(String sourceKeyPasswordSecretId);

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but can you please rename the new parameters from getKafkaReadSASLScram512* to getKafkaReadSaslScram* (e.g. getKafkaReadSASLScram512UsernameSecretId to getKafkaReadSaslScramUsernameSecretId), and rename the corresponding variables in KafkaConfig accordingly?

The reason for "SASL" -> "Sasl" change is that by convention, in all the Java identifiers in this project only the first latter in each word is capitalized, even if this is an abbreviation.

The reason for removing "512" is to allow extending this to support SASL SCRAM 256 auth as well in the future (if needed) without the need to introduce another set of ``getKafkaReadSaslScram256*` parameters (we'll just re-use these).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@an2x thank you for reviewing the PR and sharing your feedback. My understanding is the parameter prompts in the UI is based on the parent name and parentTriggerValues. For example if the chosen authentication mode is KafkaAuthenticationMethod.SASL_PLAIN then only two input fields will be displayed in the UI (Username and password). To address any differences in inputs, between SASL SCRAM 256 & SASL SCRAM 512, I thought of keeping them separate. If you think that is not required, I will rename the parameters as recommended.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vgnanasekaran It looks like one change is still missing: to rename "SASL" -> "Sasl" in the parameter names, could you please change that as well?
Sorry for nitpicking, but the parameter names are case-sensitive and this is inconsistent with pretty much every other parameter and may be confusing for the users.

Copy link
Author

@vgnanasekaran vgnanasekaran Feb 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@an2x not a problem at all. I would definitely stick to the standards followed by your team. Sorry for having missed the parameter case issue. I was more focused on the 512 name change. I have addressed the issue now.

@an2x
Copy link
Member

an2x commented Feb 18, 2025

Note: the checks are failing because of some recent changes in GitHub actions. Please also update the PR to pick up the most recent changes from the main branch, this should've been fixed in 023b53e.

@vgnanasekaran
Copy link
Author

@an2x per your feedback, I have updated the parameter names and also have merged the recent changes.

@@ -215,4 +217,62 @@ final class Offset {
String getKafkaReadKeyPasswordSecretId();

void setKafkaReadKeyPasswordSecretId(String sourceKeyPasswordSecretId);

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vgnanasekaran It looks like one change is still missing: to rename "SASL" -> "Sasl" in the parameter names, could you please change that as well?
Sorry for nitpicking, but the parameter names are case-sensitive and this is inconsistent with pretty much every other parameter and may be confusing for the users.

Copy link

codecov bot commented Feb 20, 2025

Codecov Report

Attention: Patch coverage is 0% with 18 lines in your changes missing coverage. Please review.

Project coverage is 47.04%. Comparing base (b51c933) to head (c430c12).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
...gle/cloud/teleport/v2/kafka/utils/KafkaConfig.java 0.00% 18 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #2181      +/-   ##
============================================
- Coverage     47.05%   47.04%   -0.02%     
- Complexity     4049     4375     +326     
============================================
  Files           876      876              
  Lines         52230    52246      +16     
  Branches       5507     5508       +1     
============================================
+ Hits          24578    24580       +2     
- Misses        25892    25905      +13     
- Partials       1760     1761       +1     
Components Coverage Δ
spanner-templates 68.91% <ø> (-0.01%) ⬇️
spanner-import-export 65.70% <ø> (-0.02%) ⬇️
spanner-live-forward-migration 76.48% <ø> (ø)
spanner-live-reverse-replication 78.80% <ø> (ø)
spanner-bulk-migration 87.94% <ø> (ø)
Files with missing lines Coverage Δ
...ud/teleport/v2/kafka/options/KafkaReadOptions.java 0.00% <ø> (ø)
...ort/v2/kafka/values/KafkaAuthenticationMethod.java 0.00% <ø> (ø)
...gle/cloud/teleport/v2/kafka/utils/KafkaConfig.java 0.00% <0.00%> (ø)

... and 2 files with indirect coverage changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants