Create KafkaCredentialStore - #530
Conversation
| import java.security.MessageDigest | ||
| import scala.annotation.tailrec | ||
|
|
||
| package object security { |
There was a problem hiding this comment.
Maybe we could consider moving it to a separate module?
There was a problem hiding this comment.
Thanks @LMnet, I did wonder about that. It just seemed like it wasn't that separate from the core. Happy to move it out if that's what people want 👍
There was a problem hiding this comment.
Actually, this code is blatantly copied from Secret in ciris. Perhaps it should be its own library, because I'm sure I've seen code very similar to this in a few different places.
There was a problem hiding this comment.
I initially agreed with @LMnet, but I think it's better to keep it in the same module so we can have the withCredentials helpers on the settings classes.
|
Thanks for this! I'll take a look soon |
Co-authored-by: Ben Plommer <ben.plommer@gmail.com>
|
I assume you're happy for this code to be copied over @vlovgr? |
Absolutely. 👍 |
|
Kafka 2.7.0 adds support for textual SSL credentials, so we may not need this after all: apache/kafka#9345 |
Happy to adapt this PR so that it can handle textual SSL creds or the code in this PR, if that would help |
Thanks, that would be great! I guess you saw the snippet I posted on Slack, but if not here it is: consumerSettings
.withProperties(Map(
"security.protocol" -> "SSL",
"ssl.truststore.type" -> "PEM",
"ssl.truststore.certificates" ->
"""
-----BEGIN CERTIFICATE-----
// CA certificate
-----END CERTIFICATE-----
|""".replace('\n', ' '),
"ssl.keystore.type" -> "PEM",
"ssl.keystore.key" ->
"""
-----BEGIN PRIVATE KEY-----
// access key
-----END PRIVATE KEY-----""".replace('\n', ' ')
,
"ssl.keystore.certificate.chain" ->
"""
-----BEGIN CERTIFICATE-----
// access certificate
-----END CERTIFICATE-----
""".replace('\n', ' ')
)) |
Cool, I'll add a few |
|
I haven’t forgotten about this! I’ll get to it this weekend. |
|
I don't think |
Fix for #521
Moving the code in https://github.com/ovotech/ciris-aiven-kafka for credential loading.
Example code using ciris would now be: