shotover / shotover-proxy

L7 data-layer proxy
https://docs.shotover.io
Apache License 2.0
83 stars 16 forks source link

KafkaSinkCluster: authorize_scram_over_mtls #1605

Closed rukai closed 3 months ago

rukai commented 4 months ago

closes https://github.com/shotover/shotover-proxy/issues/1600

Possibly useful resources:

This PR introduces a new optional config to KafkaSinkCluster:

            authorize_scram_over_mtls:
              mtls_port_contact_points: ["172.16.1.2:9094"]
              tls:
                certificate_authority_path: "tests/test-configs/kafka/tls/certs/localhost_CA.crt"
                certificate_path: "tests/test-configs/kafka/tls/certs/localhost.crt"
                private_key_path: "tests/test-configs/kafka/tls/certs/localhost.key"
                verify_hostname: true

The documentation added in docs/src/transforms.md explains what this feature does and why we want it, so please refer to it.

In terms of implementation decisions:

I looked into two crates to provide the SCRAM implementation

In conclusion the sasl crate looked like a clear winner, so I went with it.

I've left the hardcoded 4 second delay in, it will be addressed along with caching delegation tokens in a follow up PR: https://github.com/shotover/shotover-proxy/issues/1618