WSO2IS - deployment.toml - 无效的转义序列
WSO2IS - deployment.toml - Invalid escape sequence
我在将 user-mgt.xml 文件从 wso2is:5.8.0 版本转换为 wso2is:5.10.0 版本时遇到了一些问题。我在 user-mgt.xml 中使用 ldap 对主要用户存储进行了一些配置,现在当我使用 deployment.toml 时,我无法启动服务器。
docker 容器日志:
[2021-03-01 21:42:19,627] ERROR {org.wso2.config.mapper.TomlParser} - Invalid escape sequence '\.' (line 44, column 53)
[2021-03-01 21:42:19,627] ERROR {org.wso2.config.mapper.TomlParser} - Invalid escape sequence '\.' (line 45, column 59)
[2021-03-01 21:42:19,627] ERROR {org.wso2.config.mapper.TomlParser} - Invalid escape sequence '\S' (line 47, column 24)
[2021-03-01 21:42:19,628] ERROR {org.wso2.config.mapper.TomlParser} - Invalid escape sequence '\S' (line 48, column 30)
[2021-03-01 21:42:19,628] ERROR {org.wso2.config.mapper.TomlParser} - Invalid escape sequence '\-' (line 50, column 34)
[2021-03-01 21:42:19,628] ERROR {org.wso2.config.mapper.TomlParser} - Invalid escape sequence '\S' (line 51, column 30)
user-mgt.xml 来自旧版本 5.8.0
<UserStoreManager class="org.wso2.carbon.user.core.ldap.ReadWriteLDAPUserStoreManager">
<Property name="UsernameJavaRegEx">^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$</Property>
<Property name="UsernameJavaScriptRegEx">^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$</Property>
<Property name="UsernameJavaRegExViolationErrorMsg">Username pattern policy violated</Property>
<Property name="PasswordJavaRegEx">^[\S]{5,30}$</Property>
<Property name="PasswordJavaScriptRegEx">^[\S]{5,30}$</Property>
<Property name="PasswordJavaRegExViolationErrorMsg">Password length should be within 5 to 30 characters</Property>
<Property name="RolenameJavaRegEx">[a-zA-Z0-9._\-|//]{3,30}$</Property>
<Property name="RolenameJavaScriptRegEx">^[\S]{3,30}$</Property>
</UserStoreManager>
deployment.toml 来自较新的版本 5.10.0:
[user_store.properties]
...
UsernameJavaRegEx = "^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$"
UsernameJavaScriptRegEx = "^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$"
UsernameJavaRegExViolationErrorMsg = "Username pattern policy violated"
PasswordJavaRegEx = "^[\S]{5,30}$"
PasswordJavaScriptRegEx = "^[\S]{5,30}$"
PasswordJavaRegExViolationErrorMsg = "Password length should be within 5 to 30 characters"
RolenameJavaRegEx = "[a-zA-Z0-9._\-|//]{3,30}$"
RolenameJavaScriptRegEx = "^[\S]{3,30}$"
....
我该如何解决这个问题?
为了在配置中使用\
,您需要使用转义字符(\
)。 (例如:^[\S]{5,30}$
)
试试这些。
[user_store]
username_java_regex = "^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$"
username_java_script_regex = "^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$"
username_java_regex_violation_error_msg = "Username pattern policy violated"
password_java_regex = "^[\S]{5,30}$"
password_java_script_regex = "^[\S]{5,30}$"
password_java_regrx_violation_error_msg = "Password length should be within 5 to 30 characters"
rolename_java_regex = "[a-zA-Z0-9._\-|//]{3,30}$"
rolename_java_script_regex = "^[\S]{3,30}$"
我在将 user-mgt.xml 文件从 wso2is:5.8.0 版本转换为 wso2is:5.10.0 版本时遇到了一些问题。我在 user-mgt.xml 中使用 ldap 对主要用户存储进行了一些配置,现在当我使用 deployment.toml 时,我无法启动服务器。
docker 容器日志:
[2021-03-01 21:42:19,627] ERROR {org.wso2.config.mapper.TomlParser} - Invalid escape sequence '\.' (line 44, column 53)
[2021-03-01 21:42:19,627] ERROR {org.wso2.config.mapper.TomlParser} - Invalid escape sequence '\.' (line 45, column 59)
[2021-03-01 21:42:19,627] ERROR {org.wso2.config.mapper.TomlParser} - Invalid escape sequence '\S' (line 47, column 24)
[2021-03-01 21:42:19,628] ERROR {org.wso2.config.mapper.TomlParser} - Invalid escape sequence '\S' (line 48, column 30)
[2021-03-01 21:42:19,628] ERROR {org.wso2.config.mapper.TomlParser} - Invalid escape sequence '\-' (line 50, column 34)
[2021-03-01 21:42:19,628] ERROR {org.wso2.config.mapper.TomlParser} - Invalid escape sequence '\S' (line 51, column 30)
user-mgt.xml 来自旧版本 5.8.0
<UserStoreManager class="org.wso2.carbon.user.core.ldap.ReadWriteLDAPUserStoreManager">
<Property name="UsernameJavaRegEx">^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$</Property>
<Property name="UsernameJavaScriptRegEx">^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$</Property>
<Property name="UsernameJavaRegExViolationErrorMsg">Username pattern policy violated</Property>
<Property name="PasswordJavaRegEx">^[\S]{5,30}$</Property>
<Property name="PasswordJavaScriptRegEx">^[\S]{5,30}$</Property>
<Property name="PasswordJavaRegExViolationErrorMsg">Password length should be within 5 to 30 characters</Property>
<Property name="RolenameJavaRegEx">[a-zA-Z0-9._\-|//]{3,30}$</Property>
<Property name="RolenameJavaScriptRegEx">^[\S]{3,30}$</Property>
</UserStoreManager>
deployment.toml 来自较新的版本 5.10.0:
[user_store.properties]
...
UsernameJavaRegEx = "^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$"
UsernameJavaScriptRegEx = "^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$"
UsernameJavaRegExViolationErrorMsg = "Username pattern policy violated"
PasswordJavaRegEx = "^[\S]{5,30}$"
PasswordJavaScriptRegEx = "^[\S]{5,30}$"
PasswordJavaRegExViolationErrorMsg = "Password length should be within 5 to 30 characters"
RolenameJavaRegEx = "[a-zA-Z0-9._\-|//]{3,30}$"
RolenameJavaScriptRegEx = "^[\S]{3,30}$"
....
我该如何解决这个问题?
为了在配置中使用\
,您需要使用转义字符(\
)。 (例如:^[\S]{5,30}$
)
试试这些。
[user_store]
username_java_regex = "^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$"
username_java_script_regex = "^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$"
username_java_regex_violation_error_msg = "Username pattern policy violated"
password_java_regex = "^[\S]{5,30}$"
password_java_script_regex = "^[\S]{5,30}$"
password_java_regrx_violation_error_msg = "Password length should be within 5 to 30 characters"
rolename_java_regex = "[a-zA-Z0-9._\-|//]{3,30}$"
rolename_java_script_regex = "^[\S]{3,30}$"