From 847ae8b15557961c000b09ffad073476b2999154 Mon Sep 17 00:00:00 2001 From: Philipp Haussleiter Date: Sun, 24 Dec 2017 01:46:24 +0100 Subject: [PATCH] some LDAP Attributes are read-only --- .../com/innoq/ldap/connector/LdapHelper.java | 18 ++---------------- .../com/innoq/ldap/connector/LdapNode.java | 12 ------------ 2 files changed, 2 insertions(+), 28 deletions(-) diff --git a/ldap-connector/src/main/java/com/innoq/ldap/connector/LdapHelper.java b/ldap-connector/src/main/java/com/innoq/ldap/connector/LdapHelper.java index 85f1d2a..b2ade70 100644 --- a/ldap-connector/src/main/java/com/innoq/ldap/connector/LdapHelper.java +++ b/ldap-connector/src/main/java/com/innoq/ldap/connector/LdapHelper.java @@ -1118,13 +1118,7 @@ private LdapUser fillAttributesInUser(LdapUser user, Attributes attributes) { if (userIdentifyer.equals(key)) { user.setUid(getAttributeOrNa(attributes, key)); } - if (LdapKeys.MODIFY_TIMESTAMP.equals(key)) { - user.setModifyTimestamp(getAttributeOrNa(attributes, key)); - } else if (LdapKeys.MODIFIERS_NAME.equals(key)) { - user.setModifiersName(getAttributeOrNa(attributes, key)); - } else if (LdapKeys.ENTRY_UUID.equals(key)) { - user.setEntryUUID(getAttributeOrNa(attributes, key)); - } else if (LdapKeys.USER_PASSWORD.equals(key)) { + if (LdapKeys.USER_PASSWORD.equals(key)) { user.addAttribute(new BasicAttribute(LdapKeys.USER_PASSWORD, null)); } else { user.addAttribute((BasicAttribute) attributes.get(key)); @@ -1144,15 +1138,7 @@ private LdapGroup fillAttributesInGroup(LdapGroup group, Attributes attributes) group = (LdapGroup) fillObjectClasses(group, attributes); while (keys.hasMoreElements()) { key = keys.nextElement(); - if (LdapKeys.MODIFY_TIMESTAMP.equals(key)) { - group.setModifyTimestamp(getAttributeOrNa(attributes, key)); - } else if (LdapKeys.MODIFIERS_NAME.equals(key)) { - group.setModifiersName(getAttributeOrNa(attributes, key)); - } else if (LdapKeys.ENTRY_UUID.equals(key)) { - group.setEntryUUID(getAttributeOrNa(attributes, key)); - } else { - group.addAttribute((BasicAttribute) attributes.get(key)); - } + group.addAttribute((BasicAttribute) attributes.get(key)); if (groupIdentifyer.equals(key)) { group.setCn(getAttributeOrNa(attributes, key)); } diff --git a/ldap-connector/src/main/java/com/innoq/ldap/connector/LdapNode.java b/ldap-connector/src/main/java/com/innoq/ldap/connector/LdapNode.java index e8ed8ef..25ff54d 100644 --- a/ldap-connector/src/main/java/com/innoq/ldap/connector/LdapNode.java +++ b/ldap-connector/src/main/java/com/innoq/ldap/connector/LdapNode.java @@ -188,22 +188,10 @@ public void setDn(final String dn) { this.dn = dn; } - public void setModifyTimestamp(final String modifyTimestamp) { - set(LdapKeys.MODIFY_TIMESTAMP, modifyTimestamp); - } - - public void setModifiersName(final String modifiersName) { - set(LdapKeys.MODIFIERS_NAME, modifiersName); - } - public String getEntryUUID() { return get(LdapKeys.ENTRY_UUID); } - public void setEntryUUID(String entryUUID) { - set(LdapKeys.ENTRY_UUID, entryUUID); - } - public String getModifiersName() { return get(LdapKeys.MODIFIERS_NAME); }