Skip to content

Commit

Permalink
Rename flag same-client-cert-enable to tls-same-client-cert-enable
Browse files Browse the repository at this point in the history
  • Loading branch information
everesio committed May 31, 2020
1 parent 251c596 commit 4ff48db
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ dist/
# Intellij
.idea/
out/
*.iml

# Binaries for programs and plugins
*.exe
Expand Down Expand Up @@ -64,6 +65,3 @@ Session.vim
# Auto-generated tag files
tags

#IntelliJ
kafka-proxy.iml
vendor/
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ See:
--tls-client-key-password string Password to decrypt rsa private key
--tls-enable Whether or not to use TLS when connecting to the broker
--tls-insecure-skip-verify It controls whether a client verifies the server's certificate chain and host name
--same-client-cert-enable Use only when mutual TLS is enabled on proxy and broker. It controls whether a proxy validates if proxy client certificate matches brokers client cert (tls-client-cert-file)
--tls-same-client-cert-enable Use only when mutual TLS is enabled on proxy and broker. It controls whether a proxy validates if proxy client certificate exactly matches brokers client cert (tls-client-cert-file)
### Usage example
Expand Down Expand Up @@ -229,7 +229,7 @@ Validate that client certificate used by proxy client is exactly the same as cli
--proxy-listener-cert-file server.crt \
--proxy-listener-key-password changeit \
--proxy-listener-ca-chain-cert-file ca.crt \
--same-client-cert-enable
--tls-same-client-cert-enable
### Kafka Gateway example
Expand Down
4 changes: 2 additions & 2 deletions cmd/kafka-proxy/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ func initFlags() {
Server.Flags().StringVar(&c.Kafka.TLS.ClientKeyPassword, "tls-client-key-password", "", "Password to decrypt rsa private key")
Server.Flags().StringVar(&c.Kafka.TLS.CAChainCertFile, "tls-ca-chain-cert-file", "", "PEM encoded CA's certificate file")

//Same TLS client cert
Server.Flags().BoolVar(&c.Kafka.TLS.SameClientCertEnable, "same-client-cert-enable", false, "Use only when mutual TLS is enabled on proxy and broker. It controls whether a proxy validates if proxy client certificate matches brokers client cert (tls-client-cert-file)")
//Same TLS client cert tls-same-client-cert-enable
Server.Flags().BoolVar(&c.Kafka.TLS.SameClientCertEnable, "tls-same-client-cert-enable", false, "Use only when mutual TLS is enabled on proxy and broker. It controls whether a proxy validates if proxy client certificate exactly matches brokers client cert (tls-client-cert-file)")

// SASL by Proxy
Server.Flags().BoolVar(&c.Kafka.SASL.Enable, "sasl-enable", false, "Connect using SASL")
Expand Down
8 changes: 4 additions & 4 deletions cmd/kafka-proxy/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ func TestSameClientCertEnabledWithRequiredFlags(t *testing.T) {
"--bootstrap-server-mapping", "192.168.99.100:32402,0.0.0.0:32402",
"--bootstrap-server-mapping", "192.168.99.100:32402,0.0.0.0:32403",
//same client enabled attributes
"--same-client-cert-enable", "",
"--tls-same-client-cert-enable", "",
"--proxy-listener-tls-enable", "",
"--tls-enable", "",
"--tls-client-cert-file", "client.crt",
Expand All @@ -182,7 +182,7 @@ func TestSameClientCertEnabledWithMissingFlags(t *testing.T) {
"--bootstrap-server-mapping", "192.168.99.100:32402,0.0.0.0:32402",
"--bootstrap-server-mapping", "192.168.99.100:32402,0.0.0.0:32403",
//same client enabled attributes
"--same-client-cert-enable", "",
"--tls-same-client-cert-enable", "",
"--tls-enable", "",
"--tls-client-cert-file", "client.crt",
//other necessary tls arguments
Expand All @@ -195,7 +195,7 @@ func TestSameClientCertEnabledWithMissingFlags(t *testing.T) {
"--bootstrap-server-mapping", "192.168.99.100:32402,0.0.0.0:32402",
"--bootstrap-server-mapping", "192.168.99.100:32402,0.0.0.0:32403",
//same client enabled attributes
"--same-client-cert-enable", "",
"--tls-same-client-cert-enable", "",
"--proxy-listener-tls-enable", "",
//other necessary tls arguments
"--proxy-listener-key-file", "server.pem",
Expand All @@ -207,7 +207,7 @@ func TestSameClientCertEnabledWithMissingFlags(t *testing.T) {
"--bootstrap-server-mapping", "192.168.99.100:32402,0.0.0.0:32402",
"--bootstrap-server-mapping", "192.168.99.100:32402,0.0.0.0:32403",
//same client enabled attributes
"--same-client-cert-enable", "",
"--tls-same-client-cert-enable", "",
"--proxy-listener-tls-enable", "",
"--tls-enable", "",
//other necessary tls arguments
Expand Down

0 comments on commit 4ff48db

Please sign in to comment.