Skip to content

Commit

Permalink
fix(cdc-connector): allow empty passwords (#15411)
Browse files Browse the repository at this point in the history
  • Loading branch information
fuyufjh authored Mar 4, 2024
1 parent f263d2d commit 9f527ac
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,17 @@ public static ConnectorServiceProto.ValidateSourceResponse validateResponse(Stri
}

private static void ensurePropNotBlank(Map<String, String> props, String name) {
ensurePropsExists(props, name);
if (StringUtils.isBlank(props.get(name))) {
throw ValidatorUtils.invalidArgument(
String.format("'%s' not found, please check the WITH properties", name));
String.format("'%s' cannot be empty. Please check the WITH properties", name));
}
}

private static void ensurePropsExists(Map<String, String> props, String name) {
if (!props.containsKey(name)) {
throw ValidatorUtils.invalidArgument(
String.format("'%s' is not found. Please check the WITH properties", name));
}
}

Expand All @@ -74,7 +82,7 @@ static void ensureRequiredProps(Map<String, String> props, boolean isMultiTableS
ensurePropNotBlank(props, DbzConnectorConfig.PORT);
ensurePropNotBlank(props, DbzConnectorConfig.DB_NAME);
ensurePropNotBlank(props, DbzConnectorConfig.USER);
ensurePropNotBlank(props, DbzConnectorConfig.PASSWORD);
ensurePropsExists(props, DbzConnectorConfig.PASSWORD);
// ensure table name is passed by user in non-sharing mode
if (!isMultiTableShared) {
ensurePropNotBlank(props, DbzConnectorConfig.TABLE_NAME);
Expand Down

0 comments on commit 9f527ac

Please sign in to comment.