You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ranger.apache.org by "kumaab (via GitHub)" <gi...@apache.org> on 2023/02/07 02:46:11 UTC

[GitHub] [ranger] kumaab opened a new pull request, #210: RANGER-4071: Support for LDAP/AD usernames and group names with special chars

kumaab opened a new pull request, #210:
URL: https://github.com/apache/ranger/pull/210

   Ranger usersync regards the forward slash ('/') as a separator character in the regex so it ignores it if you actually want to use it in your groupname. e.g. RRR/group_name_suffix (/ can be potentially used as a domain separator in AD groups)
   
   
   Using a different character like + in the regex works to get something like RRR+group_name_suffix but not RRR/group_name_suffix.
   
   Testing:
   Added unit test for the new feature.
   mvn clean package on ugsync module.


-- 
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: dev-unsubscribe@ranger.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ranger] rameeshm commented on a diff in pull request #210: RANGER-4071: Support for LDAP/AD usernames and group names with special chars

Posted by "rameeshm (via GitHub)" <gi...@apache.org>.
rameeshm commented on code in PR #210:
URL: https://github.com/apache/ranger/pull/210#discussion_r1098174354


##########
ugsync/src/main/java/org/apache/ranger/unixusersync/config/UserGroupSyncConfig.java:
##########
@@ -1332,6 +1335,18 @@ public boolean isUserSyncNameValidationEnabled() {
 		return isUserSyncNameValidationEnabled;
 	}
 
+	public String getRegexSeparator() throws RuntimeException {
+		String val = prop.getProperty(SYNC_MAPPING_SEPARATOR);
+		if(StringUtils.isNotEmpty(val)) {
+			if (val.length() == 1)
+				return val;
+			else{
+				throw new RuntimeException("More than one character found in RegEx Separator");
+			}
+		}
+		return DEFAULT_MAPPING_SEPARATOR;

Review Comment:
   We follow this pattern with in the Ranger Code for method returns, I would recommend to do the same
   String ret = DEFAULT_MAPPING_SEPARATOR;
   String val = prop.getProperty(SYNC_MAPPING_SEPARATOR);
   if (StringUtilts.isNotEmpty(val))  {
         if (val.length() == 1) {
                ret = val;
         } else {
                throw new RuntimeException("More than one character found in RegEx Separator");
           }
    }
     return ret;
   }
             



-- 
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: dev-unsubscribe@ranger.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ranger] kumaab commented on a diff in pull request #210: RANGER-4071: Support for LDAP/AD usernames and group names with special chars

Posted by "kumaab (via GitHub)" <gi...@apache.org>.
kumaab commented on code in PR #210:
URL: https://github.com/apache/ranger/pull/210#discussion_r1098175537


##########
ugsync/src/main/java/org/apache/ranger/unixusersync/config/UserGroupSyncConfig.java:
##########
@@ -1332,6 +1335,18 @@ public boolean isUserSyncNameValidationEnabled() {
 		return isUserSyncNameValidationEnabled;
 	}
 
+	public String getRegexSeparator() throws RuntimeException {
+		String val = prop.getProperty(SYNC_MAPPING_SEPARATOR);
+		if(StringUtils.isNotEmpty(val)) {
+			if (val.length() == 1)
+				return val;
+			else{
+				throw new RuntimeException("More than one character found in RegEx Separator");
+			}
+		}
+		return DEFAULT_MAPPING_SEPARATOR;

Review Comment:
   Sure, will update.
   



-- 
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: dev-unsubscribe@ranger.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ranger] kumaab merged pull request #210: RANGER-4071: Support for LDAP/AD usernames and group names with special chars

Posted by "kumaab (via GitHub)" <gi...@apache.org>.
kumaab merged PR #210:
URL: https://github.com/apache/ranger/pull/210


-- 
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: dev-unsubscribe@ranger.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org