-
Notifications
You must be signed in to change notification settings - Fork 289
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cli(ticdc): allow client authentication to be enabled without tls (#1…
- Loading branch information
1 parent
ba6db07
commit 36e9e1b
Showing
8 changed files
with
37 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ SINK_TYPE=$1 | |
TLS_DIR=$(cd $CUR/../_certificates && pwd) | ||
|
||
export TICDC_USER=ticdc | ||
export TICDC_PASSWORD=ticdc_password | ||
export TICDC_PASSWORD=ticdc_secret | ||
export TICDC_CA_PATH=$TLS_DIR/ca.pem | ||
export TICDC_CERT_PATH=$TLS_DIR/client.pem | ||
export TICDC_KEY_PATH=$TLS_DIR/client-key.pem | ||
|
@@ -27,10 +27,18 @@ function check_changefeed_count() { | |
} | ||
|
||
function run() { | ||
# TODO: enable pulsar in the future. | ||
if [ "$SINK_TYPE" == "pulsar" ]; then | ||
exit 0 | ||
fi | ||
rm -rf $WORK_DIR && mkdir -p $WORK_DIR | ||
|
||
start_tidb_cluster --workdir $WORK_DIR --multiple-upstream-pd true | ||
start_tls_tidb_cluster --workdir $WORK_DIR --tlsdir $TLS_DIR | ||
run_sql "CREATE USER 'ticdc'@'%' IDENTIFIED BY 'ticdc_secret';" ${TLS_TIDB_HOST} ${TLS_TIDB_PORT} \ | ||
--ssl-ca=$TLS_DIR/ca.pem \ | ||
--ssl-cert=$TLS_DIR/server.pem \ | ||
--ssl-key=$TLS_DIR/server-key.pem | ||
|
||
cd $WORK_DIR | ||
pd_addr="https://$TLS_PD_HOST:$TLS_PD_PORT" | ||
|
@@ -53,6 +61,8 @@ function run() { | |
cert-path = \"$TLS_DIR/server.pem\" | ||
key-path = \"$TLS_DIR/server-key.pem\" | ||
cert-allowed-cn = [\"fake_cn\"] | ||
client-user-required = true | ||
client-allowed-user = [\"ticdc\"] | ||
" >$WORK_DIR/server.toml | ||
run_cdc_server \ | ||
--workdir $WORK_DIR \ | ||
|
@@ -69,7 +79,10 @@ function run() { | |
case $SINK_TYPE in | ||
kafka) SINK_URI="kafka://127.0.0.1:9092/$TOPIC_NAME?protocol=open-protocol&partition-num=4&kafka-version=${KAFKA_VERSION}&max-message-bytes=10485760" ;; | ||
storage) SINK_URI="file://$WORK_DIR/storage_test/$TOPIC_NAME?protocol=canal-json&enable-tidb-extension=true" ;; | ||
pulsar) SINK_URI="pulsar://127.0.0.1:6650/$TOPIC_NAME?protocol=canal-json&enable-tidb-extension=true" ;; | ||
pulsar) | ||
run_pulsar_cluster $WORK_DIR normal | ||
SINK_URI="pulsar://127.0.0.1:6650/$TOPIC_NAME?protocol=canal-json&enable-tidb-extension=true" | ||
;; | ||
*) SINK_URI="mysql://normal:[email protected]:3306/" ;; | ||
esac | ||
|
||
|
@@ -180,7 +193,6 @@ EOF | |
} | ||
|
||
trap stop_tidb_cluster EXIT | ||
# TODO(CharlesCheung): enable this test after release-8.0 | ||
# run $* | ||
run $* | ||
check_logs $WORK_DIR | ||
echo "[$(date)] <<<<<< run test case $TEST_NAME success! >>>>>>" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters