Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
midPoint
connector-ldap
Commits
31be844d
Commit
31be844d
authored
Jul 30, 2019
by
Ing. František DVOŘÁK
Browse files
LDAP attribute options: fix operational attributes usage (Active Directory password)
parent
2e479685
Pipeline
#1734
passed with stage
in 2 minutes and 36 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/com/evolveum/polygon/connector/ldap/AbstractLdapConnector.java
View file @
31be844d
...
...
@@ -866,6 +866,7 @@ public abstract class AbstractLdapConnector<C extends AbstractLdapConfiguration>
}
else
{
List
<
Value
>
ldapValues
=
shcemaTranslator
.
toLdapValues
(
ldapAttributeType
,
connIdAttrValues
);
// Do NOT set attributeType here. The attributeType may not match the type of the value.
LOG
.
info
(
"create: connIdAttr.name {0}, ldapAttributeType.name {1}"
,
connIdAttr
.
getName
(),
ldapAttributeType
.
getName
());
entry
.
put
(
connIdAttr
.
getName
(),
ldapValues
.
toArray
(
new
Value
[
ldapValues
.
size
()]));
// no simple way how to check if he attribute was added. It may end up with ERR_04451. So let's just
// hope that it worked well. It should - unless there is a connector bug.
...
...
@@ -1187,8 +1188,10 @@ public abstract class AbstractLdapConnector<C extends AbstractLdapConfiguration>
if
(
schemaTranslator
.
isPolyAttribute
(
ldapAttributeType
,
connIdValues
))
{
addLdapModificationPoly
(
dn
,
ldapModifications
,
modOp
,
ldapAttributeType
,
connIdValues
);
}
else
{
}
else
if
(
schemaTranslator
.
isTaggedAttribute
(
nativeName
))
{
addLdapModificationSimple
(
dn
,
ldapModifications
,
modOp
,
nativeName
,
ldapAttributeType
,
connIdValues
);
}
else
{
addLdapModificationSimple
(
dn
,
ldapModifications
,
modOp
,
ldapAttributeType
.
getName
(),
ldapAttributeType
,
connIdValues
);
}
}
...
...
@@ -1202,11 +1205,13 @@ public abstract class AbstractLdapConnector<C extends AbstractLdapConfiguration>
// Do NOT set AttributeType here
// The attributeType might not match the Value class
// e.g. human-readable jpegPhoto attribute will expect StringValue
LOG
.
info
(
"addLdapModificationSimple/empty: nativeName {0}, ldapAttributeType.name {1}"
,
nativeName
,
ldapAttributeType
.
getName
());
ldapModifications
.
add
(
new
DefaultModification
(
modOp
,
nativeName
));
}
else
{
// Do NOT set AttributeType here
// The attributeType might not match the Value class
// e.g. human-readable jpegPhoto attribute will expect StringValue
LOG
.
info
(
"addLdapModificationSimple/non-empty: nativeName {0}, ldapAttributeType.name {1}"
,
nativeName
,
ldapAttributeType
.
getName
());
DefaultAttribute
ldapAttribute
=
new
DefaultAttribute
(
nativeName
,
ldapValues
.
toArray
(
new
Value
[
ldapValues
.
size
()]));
ldapModifications
.
add
(
new
DefaultModification
(
modOp
,
ldapAttribute
));
}
...
...
src/main/java/com/evolveum/polygon/connector/ldap/LdapSchemaTranslator.java
View file @
31be844d
...
...
@@ -137,6 +137,11 @@ public class LdapSchemaTranslator extends AbstractSchemaTranslator<LdapConfigura
return
Map
.
class
.
isAssignableFrom
(
connIdAttributeInfo
.
getType
());
}
@Override
public
boolean
isTaggedAttribute
(
String
name
)
{
return
name
!=
null
&&
name
.
contains
(
";"
);
}
@Override
public
Map
<
String
,
List
<
Value
>>
toLdapPolyValues
(
AttributeType
ldapAttributeType
,
List
<
Object
>
connIdValues
)
{
Map
<
String
,
List
<
Value
>>
ldapValueMap
=
new
HashMap
<>();
...
...
src/main/java/com/evolveum/polygon/connector/ldap/schema/AbstractSchemaTranslator.java
View file @
31be844d
...
...
@@ -554,6 +554,10 @@ public abstract class AbstractSchemaTranslator<C extends AbstractLdapConfigurati
return
false
;
}
public
boolean
isTaggedAttribute
(
String
name
)
{
return
false
;
}
public
List
<
Value
>
toLdapValues
(
AttributeType
ldapAttributeType
,
List
<
Object
>
icfAttributeValues
)
{
List
<
Value
>
ldapValues
=
new
ArrayList
<>(
icfAttributeValues
.
size
());
for
(
Object
icfValue:
icfAttributeValues
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment