RANGER-5534: added validation logic for username and groupname for usersync process#903
RANGER-5534: added validation logic for username and groupname for usersync process#903sneethiraj wants to merge 3 commits intoapache:masterfrom
Conversation
|
|
||
| if (validateUserName) { | ||
| if (!isValidUserName(userName)) { | ||
| LOG.warn("Ignoring Unix Username: [{}]: failed to confirm to validation-pattern: [{}]", userName, regExUserNameValidator); |
There was a problem hiding this comment.
@sneethiraj - this could result in usernames having valid non-English characters (accent characters, CJK character sets) to be skipped with default configuration. This can break environments already have such user names and group names.
There was a problem hiding this comment.
Good catch. We can implement the following regex validations that supports international char sets:
private static final String DEFAULT_REGEX_USERNAME_VALIDATOR = "^[\\p{L}\\p{Mn}\\p{Nd}\\._-]{3,64}$" ;
private static final String DEFAULT_REGEX_GROUPNAME_VALIDATOR = "^[\\p{L}\\p{N}._\\-\\s]{1,256}$" ;
However, we need to document this as part of the upgrade to 2.8.1+ release that the username and groupname validations are defaulted to be ON with specific regex and customers are requested to review and modify if needed before deploying newer version of code.
Can you share your thoughts on the best approach to resolve this?
There was a problem hiding this comment.
I already fixed this issue as part of RANGER-5508 please check this fix and do let me know if it is completely different issue.
…ore generic regEx(s) that supports unicode based username and groupname
What changes were proposed in this pull request?
How was this patch tested?
Tested locally on Mac