yuxiqian commented on code in PR #4568:
URL: https://github.com/apache/flink-cdc/pull/4568#discussion_r4344271691
##########
flink-cdc-connect/flink-cdc-source-connectors/flink-connector-mongodb-cdc/src/main/java/org/apache/flink/cdc/connectors/mongodb/internal/MongoDBEnvelope.java:
##########
@@ -148,7 +148,8 @@ public class MongoDBEnvelope {
public static String encodeValue(String value) {
Review Comment:
This method (in MongoDBEnvelope) doesn't specifically implies that it's for
MongoDB credentials only. Modifying this may affect other callers, which isn't
ideal.
##########
flink-cdc-connect/flink-cdc-source-connectors/flink-connector-mongodb-cdc/src/main/java/org/apache/flink/cdc/connectors/mongodb/internal/MongoDBEnvelope.java:
##########
@@ -148,7 +148,8 @@ public class MongoDBEnvelope {
public static String encodeValue(String value) {
Review Comment:
I think the root cause is how we build connection string here:
```java
if (StringUtils.isNotEmpty(username) && StringUtils.isNotEmpty(password)) {
sb.append(encodeValue(username)).append(":").append(encodeValue(password)).append("@");
}
```
Shall we consider reusing the
[MongoCredential](https://www.javadoc.io/static/org.mongodb/mongo-java-driver/3.12.14/com/mongodb/MongoCredential.html#createPlainCredential(java.lang.String,java.lang.String,char%5B%5D))
utility class provided by MongoDB SDK?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]