Skip to content
This repository has been archived by the owner on May 9, 2023. It is now read-only.

Fix for KAFKA-4090: Add an SSL check before to create a client #136

Merged
merged 8 commits into from
Feb 6, 2023

Conversation

gurinderu
Copy link

No description provided.

@gurinderu gurinderu force-pushed the dt-2684-be-make-kafka-client-v331-cdk branch 5 times, most recently from 3394814 to a816525 Compare January 20, 2023 11:47
build.sbt Show resolved Hide resolved
@@ -0,0 +1,207 @@
#!/usr/bin/env bash

Choose a reason for hiding this comment

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

@gurinderu Did you implement this or did you copy it from somewhere?

Copy link
Author

Choose a reason for hiding this comment

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

Choose a reason for hiding this comment

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

Please add a comment telling where this scripts comes from :)

Copy link
Author

Choose a reason for hiding this comment

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

Removed

Choose a reason for hiding this comment

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

I'd prefer we keep this script and we just document its origin

Copy link
Author

Choose a reason for hiding this comment

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

Not sure that is a great idea in case of licenses

Comment on lines 34 to 39
val buf = ByteBuffer.allocate(5)
channel.write(buf)
buf.position(0)
channel.read(buf)
buf.position(0)
isTls(buf)

Choose a reason for hiding this comment

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

🌕 Can you please add a comment explaining what this is doing and you found this, please?

Copy link
Author

Choose a reason for hiding this comment

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

Fixed

Choose a reason for hiding this comment

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

Meh. Please see: #136 (comment)

Comment on lines +56 to +73
private def isTls(buf: ByteBuffer): Boolean = {
val tlsMessageType = buf.get()
tlsMessageType match {
case 20 | 21 | 22 | 23 | 255 =>
true
case _ => tlsMessageType >= 128
}
}

Choose a reason for hiding this comment

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

🌕 Can you please add a comment telling where this piece of code comes from, please?

Copy link

Choose a reason for hiding this comment

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

@gurinderu gurinderu force-pushed the dt-2684-be-make-kafka-client-v331-cdk branch from a816525 to 325f0d1 Compare January 24, 2023 06:58
ZIO.attempt(SocketChannel.open(addr))
)(channel => ZIO.attempt(channel.close()).orDie)
tls <- ZIO.attempt {
//make a simple request here and validate a server response
Copy link

@guizmaii guizmaii Jan 24, 2023

Choose a reason for hiding this comment

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

🌕 This comment is really not helping, sorry.
We know you're making a request and you validate the response.
The non obvious things are:

  • why 5 in ByteBuffer.allocate(5)?
  • where is piece of code/algorithm comes from?
  • is there any documentation that can explain this unusual piece of code?

@guizmaii guizmaii marked this pull request as ready for review February 6, 2023 10:00
@guizmaii guizmaii changed the title Add ssl check Fix for KAFKA-4090: Add an SSL check before to create a client Feb 6, 2023
@guizmaii guizmaii merged commit bcba295 into zio2-main Feb 6, 2023
@guizmaii guizmaii deleted the dt-2684-be-make-kafka-client-v331-cdk branch February 6, 2023 10:02
guizmaii added a commit that referenced this pull request Feb 9, 2023
* Add ssl check

* Review fixes

* Review fixes

* Review fixes

* Review fixes

* Review fixes

* Fmt

---------

Co-authored-by: Jules Ivanic <guizmaii@users.noreply.github.com>
guizmaii added a commit that referenced this pull request Feb 28, 2023
* Add ssl check

* Review fixes

* Review fixes

* Review fixes

* Review fixes

* Review fixes

* Fmt

---------

Co-authored-by: Jules Ivanic <guizmaii@users.noreply.github.com>
guizmaii added a commit that referenced this pull request Feb 28, 2023
* Add ssl check

* Review fixes

* Review fixes

* Review fixes

* Review fixes

* Review fixes

* Fmt

---------

Co-authored-by: Jules Ivanic <guizmaii@users.noreply.github.com>
guizmaii added a commit that referenced this pull request Feb 28, 2023
* Add ssl check

* Review fixes

* Review fixes

* Review fixes

* Review fixes

* Review fixes

* Fmt

---------

Co-authored-by: Jules Ivanic <guizmaii@users.noreply.github.com>
guizmaii added a commit that referenced this pull request Mar 1, 2023
* Add ssl check

* Review fixes

* Review fixes

* Review fixes

* Review fixes

* Review fixes

* Fmt

---------

Co-authored-by: Jules Ivanic <guizmaii@users.noreply.github.com>
guizmaii added a commit that referenced this pull request Mar 7, 2023
* Add ssl check

* Review fixes

* Review fixes

* Review fixes

* Review fixes

* Review fixes

* Fmt

---------

Co-authored-by: Jules Ivanic <guizmaii@users.noreply.github.com>
guizmaii added a commit that referenced this pull request Apr 3, 2023
* Add ssl check

* Review fixes

* Review fixes

* Review fixes

* Review fixes

* Review fixes

* Fmt

---------

Co-authored-by: Jules Ivanic <guizmaii@users.noreply.github.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants