justinmclean commented on code in PR #7548:
URL: https://github.com/apache/gravitino/pull/7548#discussion_r2182118497
##########
catalogs/catalog-jdbc-common/src/main/java/org/apache/gravitino/catalog/jdbc/utils/DataSourceUtils.java:
##########
@@ -76,6 +100,61 @@ private static Properties getProperties(JdbcConfig
jdbcConfig) {
return properties;
}
+ private static String recursiveDecode(String url) {
+ String prev;
+ String decoded = url;
+ int max = 5;
+
+ do {
+ prev = decoded;
+ try {
+ decoded = java.net.URLDecoder.decode(prev, "UTF-8");
+ } catch (Exception e) {
+ throw new GravitinoRuntimeException("Unable to decode JDBC URL");
+ }
+ } while (!prev.equals(decoded) && --max > 0);
+
+ return decoded;
+ }
+
+ private static void checkUnsafeParameters(
+ String url, Map<String, String> config, List<String> unsafeParams,
String dbType) {
+
+ String lowerUrl = url.toLowerCase();
+
+ for (String param : unsafeParams) {
+ String lowerParam = param.toLowerCase();
+ if (lowerUrl.contains(lowerParam) || containsValueIgnoreCase(config,
param)) {
Review Comment:
I would still throw an exception - knowing what parameters are accepted for
which unsafe parameters is not really scalable
--
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]