Skip to content

Commit f34e01d

Browse files
author
Michal Zelencik
committed
Smart Integration: Fix wellknownschemas group name mapping suggestions
- Use dynamic resource name prefix instead of hardcoded 'ldap:' or 'ad:' - Fix bug: use 'input' variable instead of attribute name in script - Suggest both as-is and prefixed mappings (both STRONG strength) - Applies to GroupOfNamesLdapMappingProvider and GroupActiveDirectoryMappingProvider The prefixed mapping now generates: resource.name + '-' + input Example: "MyLDAP-administrators" instead of "ldap:administrators"
1 parent 296f8f8 commit f34e01d

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

model/smart-impl/src/main/java/com/evolveum/midpoint/smart/impl/wellknownschemas/ad/GroupActiveDirectoryMappingProvider.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,12 @@ public Map<ItemPath, ItemPath> suggestSchemaMatches() {
4646
public List<SystemMappingSuggestion> suggestInboundMappings() {
4747
List<SystemMappingSuggestion> mappings = new ArrayList<>();
4848
mappings.add(SystemMappingSuggestion.createAsIsSuggestion("sAMAccountName", AbstractRoleType.F_IDENTIFIER));
49+
mappings.add(SystemMappingSuggestion.createAsIsSuggestion("sAMAccountName", RoleType.F_NAME, MappingStrengthType.STRONG));
4950
mappings.add(SystemMappingSuggestion.createScriptSuggestion(
5051
"sAMAccountName",
5152
RoleType.F_NAME,
52-
"'ad:' + sAMAccountName",
53-
"Inbound: group-sync-methodology name with prefix (ad:<sAMAccountName>)",
53+
"resource.name + '-' + input",
54+
"Inbound: group name with resource prefix (<resource>-<sAMAccountName>)",
5455
MappingStrengthType.STRONG));
5556
return mappings;
5657
}

model/smart-impl/src/main/java/com/evolveum/midpoint/smart/impl/wellknownschemas/ldap/GroupOfNamesLdapMappingProvider.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,12 @@ public Map<ItemPath, ItemPath> suggestSchemaMatches() {
4646
public List<SystemMappingSuggestion> suggestInboundMappings() {
4747
List<SystemMappingSuggestion> mappings = new ArrayList<>();
4848
mappings.add(SystemMappingSuggestion.createAsIsSuggestion("cn", AbstractRoleType.F_IDENTIFIER));
49+
mappings.add(SystemMappingSuggestion.createAsIsSuggestion("cn", RoleType.F_NAME, MappingStrengthType.STRONG));
4950
mappings.add(SystemMappingSuggestion.createScriptSuggestion(
5051
"cn",
5152
RoleType.F_NAME,
52-
"'ldap:' + cn",
53-
"Inbound: group-sync-methodology name with prefix (ldap:<cn>)",
53+
"resource.name + '-' + input",
54+
"Inbound: group name with resource prefix (<resource>-<cn>)",
5455
MappingStrengthType.STRONG));
5556
return mappings;
5657
}

0 commit comments

Comments
 (0)