Fix: Remove unnecessary pattern check for password in ConfigValidationUtils #16082
+1
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR removes the unnecessary pattern check for
passwordinConfigValidationUtils.checkParameterName.Problem:
Previously,
checkParameterNamevalidated all parameters (exceptbackup) usingPATTERN_NAME_HAS_SYMBOL, which disallowed many special characters commonly used in passwords (e.g.,@,!,#). This caused issues when using Nacos with complex passwords configured via parameters.Fix:
Added
PASSWORD_KEYto theignoreCheckKeyslist incheckParameterName, ensuring passwords are exempted from pattern validation (length check invalidateRegistryConfigremains).Fixes: #16073
描述 (Chinese)
修复
ConfigValidationUtils中对password参数进行不必要的正则校验问题。问题:
此前
checkParameterName会对所有参数(除backup外)使用PATTERN_NAME_HAS_SYMBOL进行校验,该正则不支持密码中常见的特殊字符(如@、!、#),导致 Nacos 等注册中心使用复杂密码时校验失败。修复:
将
PASSWORD_KEY加入checkParameterName的忽略列表,跳过正则检查(长度检查仍保留)。修复: #16073