[
https://issues.apache.org/jira/browse/RANGER-684?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14959714#comment-14959714
]
Sailaja Polavarapu commented on RANGER-684:
-------------------------------------------
After discussing more on the suggested apporach, following is the high level
design:
1. Properties to configure the transformations are named as:
ranger.usersync.mapping.<attribute name>.<tranformation> where attribute name
is "username" or "groupname" and <transformation> is "regex".
2. To configure multiple transformations/mappings, new properties can be added
as: ranger.usersync.mapping.<attribute name>.<tranformation>.1,
ranger.usersync.mapping.<attribute name>.<tranformation>.2, etc...
3. All these mappings are applied in the configured order.
4. Another property (ranger.usersync.mapping.handler) will be provided to
specify the transformation class. The default value will be
"org.apache.ranger.usersync.mapper.RegEx". This value is used to call the
appropriate init() method from usersync (LdapUserGroupBuilder for regex
transformation).
5. An interface (Mapper) will be provided. Currently this interface will have
only 2 methods - init() and transform().
public interface Mapper {
public void init(String baseProperty); // where baseProperty should be
ranger.usersync.mapping.<attribute name>
public String transform(String attrValue); // attrValue is the value of
the attribute that needs to be transformed and the result is returned.
}
6. An abstract class (AbstractMapper) will be provided with default
implementation of the interface methods.
public abstract class AbstractMapper implements Mapper {
@Override
public abstract void init(String baseProperty);
@Override
public abstract String transform(String attrValue);
}
7. The default class that extends the AbstractMapper (RegEx) will be provided
which contains the actual implementation of regex transfomations.
> Ranger Usersync - Add Ability to transform user/group names
> -----------------------------------------------------------
>
> Key: RANGER-684
> URL: https://issues.apache.org/jira/browse/RANGER-684
> Project: Ranger
> Issue Type: Improvement
> Affects Versions: 0.4.0, 0.5.0
> Reporter: Velmurugan Periasamy
> Assignee: Sailaja Polavarapu
> Priority: Critical
> Fix For: 0.5.1, 0.6.0
>
>
> Ensure the UserSync is capable of transforming user/group names from LDAP/AD
> source. Probably by allowing custom mapping ( like space to underscore)
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)