{"record":{"id":"e110c27f20946dc8","repo":"apache/dolphinscheduler","slug":"datasource-other-params-entry-getkey-illega","errorCode":null,"errorMessage":"datasource other params: + entry.getKey() + illegal","messagePattern":"datasource other params: \\+ entry\\.getKey\\(\\) \\+ illegal","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-api/src/main/java/org/apache/dolphinscheduler/plugin/datasource/api/datasource/AbstractDataSourceProcessor.java","lineNumber":105,"sourceCode":"    }\n\n    /**\n     * check other is valid\n     *\n     * @param other other\n     */\n    protected void checkOther(Map<String, String> other) {\n        if (MapUtils.isEmpty(other)) {\n            return;\n        }\n\n        if (!Sets.intersection(other.keySet(), POSSIBLE_MALICIOUS_KEYS).isEmpty()) {\n            throw new IllegalArgumentException(\"Other params include possible malicious keys.\");\n        }\n\n        for (Map.Entry<String, String> entry : other.entrySet()) {\n            if (!PARAMS_PATTER.matcher(entry.getKey()).matches()) {\n                throw new IllegalArgumentException(\"datasource other params: \" + entry.getKey() + \" illegal\");\n            }\n        }\n    }\n\n    protected Map<String, String> transformOtherParamToMap(String other) {\n        if (StringUtils.isBlank(other)) {\n            return Collections.emptyMap();\n        }\n        return JSONUtils.parseObject(other, new TypeReference<Map<String, String>>() {\n        });\n    }\n\n    @Override\n    public String getDatasourceUniqueId(ConnectionParam connectionParam, DbType dbType) {\n        BaseConnectionParam baseConnectionParam = (BaseConnectionParam) connectionParam;\n        return MessageFormat.format(\"{0}@{1}@{2}@{3}\", dbType.getName(), baseConnectionParam.getUser(),\n                PasswordUtils.encodePassword(baseConnectionParam.getPassword()), baseConnectionParam.getJdbcUrl());\n    }","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-api/src/main/java/org/apache/dolphinscheduler/plugin/datasource/api/datasource/AbstractDataSourceProcessor.java#L87-L123","documentation":"Generic validation guard in AbstractDataSourceProcessor.checkOther: fires when an entry key in the datasource 'other' params map does not match PARAMS_PATTER — the offending extra-connection-parameter key (entry.getKey(), embedded in the message) contains characters outside the allowed pattern. A sibling check rejects keys in POSSIBLE_MALICIOUS_KEYS to prevent JDBC-url injection.","triggerScenarios":"Other params JSON with keys containing spaces, slashes, special characters, or empty keys.","commonSituations":"Malformed JSON keys, keys with dashes or dots pasted from vendor docs, accidentally duplicated header text as a key.","solutions":["Rename the param key to match PARAMS_PATTER (word characters only)","Verify the other params JSON parses and keys are clean identifiers","Move non-identifier options to the JDBC URL instead"],"exampleFix":"// before\n{\"connect.timeout\":\"5000\"}\n// after\n{\"connectTimeout\":\"5000\"}","handlingStrategy":"validation","validationCode":"boolean keysOk = other == null || other.keySet().stream().allMatch(k -> k.matches(\"^[a-zA-Z0-9_]+$\"));","typeGuard":null,"tryCatchPattern":"try { processor.checkDatasourceParam(dto); } catch (IllegalArgumentException e) { /* e.getMessage() names the illegal key */ }","preventionTips":["Use camelCase or snake_case identifier keys","Validate other-params JSON before submission","Replace dotted keys with legal alternatives"],"tags":["validation","datasource","jdbc"],"backgroundTag":"invalid-identifier-format","analyzedSha":"02eac45a1b6676e639fcbfb4be2243de5771b05d","analyzedAt":"2026-09-06T17:43:00.555Z","contentChangedAt":"2026-09-06T17:43:00.555Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}