Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[LDAP-37] Provide configuration for any-object attributes #15

Merged
merged 2 commits into from
Oct 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 56 additions & 25 deletions src/main/java/net/tirasa/connid/bundles/ldap/LdapConfiguration.java
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,13 @@ public void validate() {
checkNotEmpty(groupConfig.getShortNameLdapAttributes(), "groupNameAttributes.notEmpty");
checkNoBlankValues(groupConfig.getShortNameLdapAttributes(), "groupNameAttributes.noBlankValues");

checkNotEmpty(allConfig.getLdapClasses(), "anyObjectClasses.notEmpty");
checkNoBlankValues(allConfig.getLdapClasses(), "anyObjectClasses.noBlankValues");

checkNotEmpty(allConfig.getShortNameLdapAttributes(), "anyObjectNameAttributes.notEmpty");
checkNoBlankValues(allConfig.getShortNameLdapAttributes(), "anyObjectNameAttributes.noBlankValues");


checkNotBlank(groupMemberAttribute, "groupMemberAttribute.notBlank");

checkNotBlank(vlvSortAttribute, "vlvSortAttribute.notBlank");
Expand Down Expand Up @@ -562,6 +569,30 @@ public void setAddPrincipalToNewGroups(boolean addPrincipalToNewGroups) {
}

@ConfigurationProperty(order = 18,
displayMessageKey = "anyObjectClasses.display",
helpMessageKey = "anyObjectClasses.help")
public String[] getAnyObjectClasses() {
List<String> ldapClasses = allConfig.getLdapClasses();
return ldapClasses.toArray(new String[ldapClasses.size()]);
}

public void setAnyObjectClasses(String... anyObjectClasses) {
allConfig.setLdapClasses(Arrays.asList(anyObjectClasses));
}

@ConfigurationProperty(order = 19,
displayMessageKey = "anyObjectNameAttributes.display",
helpMessageKey = "anyObjectNameAttributes.help")
public String[] getAnyObjectNameAttributes() {
List<String> shortNameLdapAttributes = allConfig.getShortNameLdapAttributes();
return shortNameLdapAttributes.toArray(new String[shortNameLdapAttributes.size()]);
}

public void setAnyObjectNameAttributes(String... anyObjectNameAttributes) {
allConfig.setShortNameLdapAttributes(Arrays.asList(anyObjectNameAttributes));
}

@ConfigurationProperty(order = 20,
displayMessageKey = "passwordHashAlgorithm.display",
helpMessageKey = "passwordHashAlgorithm.help")
public String getPasswordHashAlgorithm() {
Expand All @@ -572,7 +603,7 @@ public void setPasswordHashAlgorithm(String passwordHashAlgorithm) {
this.passwordHashAlgorithm = passwordHashAlgorithm;
}

@ConfigurationProperty(order = 19,
@ConfigurationProperty(order = 21,
displayMessageKey = "respectResourcePasswordPolicyChangeAfterReset.display",
helpMessageKey = "respectResourcePasswordPolicyChangeAfterReset.help")
public boolean isRespectResourcePasswordPolicyChangeAfterReset() {
Expand All @@ -583,7 +614,7 @@ public void setRespectResourcePasswordPolicyChangeAfterReset(boolean respectReso
this.respectResourcePasswordPolicyChangeAfterReset = respectResourcePasswordPolicyChangeAfterReset;
}

@ConfigurationProperty(order = 20,
@ConfigurationProperty(order = 22,
displayMessageKey = "useVlvControls.display",
helpMessageKey = "useVlvControls.help")
public boolean isUseVlvControls() {
Expand All @@ -594,7 +625,7 @@ public void setUseVlvControls(boolean useVlvControls) {
this.useVlvControls = useVlvControls;
}

@ConfigurationProperty(order = 21,
@ConfigurationProperty(order = 23,
displayMessageKey = "vlvSortAttribute.display",
helpMessageKey = "vlvSortAttribute.help")
public String getVlvSortAttribute() {
Expand All @@ -605,7 +636,7 @@ public void setVlvSortAttribute(String vlvSortAttribute) {
this.vlvSortAttribute = vlvSortAttribute;
}

@ConfigurationProperty(order = 22,
@ConfigurationProperty(order = 24,
displayMessageKey = "uidAttribute.display",
helpMessageKey = "uidAttribute.help")
public String getUidAttribute() {
Expand All @@ -616,7 +647,7 @@ public void setUidAttribute(final String uidAttribute) {
this.uidAttribute = uidAttribute;
}

@ConfigurationProperty(order = 23,
@ConfigurationProperty(order = 25,
displayMessageKey = "gidAttribute.display",
helpMessageKey = "gidAttribute.help")
public String getGidAttribute() {
Expand All @@ -627,7 +658,7 @@ public void setGidAttribute(final String gidAttribute) {
this.gidAttribute = gidAttribute;
}

@ConfigurationProperty(order = 23,
@ConfigurationProperty(order = 26,
displayMessageKey = "readSchema.display",
helpMessageKey = "readSchema.help")
public boolean isReadSchema() {
Expand All @@ -639,7 +670,7 @@ public void setReadSchema(boolean readSchema) {
}

// Sync properties getters and setters.
@ConfigurationProperty(order = 24, operations = { SyncOp.class },
@ConfigurationProperty(order = 27, operations = { SyncOp.class },
displayMessageKey = "baseContextsToSynchronize.display",
helpMessageKey = "baseContextsToSynchronize.help")
public String[] getBaseContextsToSynchronize() {
Expand All @@ -650,7 +681,7 @@ public void setBaseContextsToSynchronize(String... baseContextsToSynchronize) {
this.baseContextsToSynchronize = baseContextsToSynchronize.clone();
}

@ConfigurationProperty(order = 25, operations = { SyncOp.class },
@ConfigurationProperty(order = 28, operations = { SyncOp.class },
displayMessageKey = "objectClassesToSynchronize.display",
helpMessageKey = "objectClassesToSynchronize.help")
public String[] getObjectClassesToSynchronize() {
Expand All @@ -661,7 +692,7 @@ public void setObjectClassesToSynchronize(String... objectClassesToSynchronize)
this.objectClassesToSynchronize = objectClassesToSynchronize.clone();
}

@ConfigurationProperty(order = 26, operations = { SyncOp.class },
@ConfigurationProperty(order = 29, operations = { SyncOp.class },
displayMessageKey = "attributesToSynchronize.display",
helpMessageKey = "attributesToSynchronize.help")
public String[] getAttributesToSynchronize() {
Expand All @@ -672,7 +703,7 @@ public void setAttributesToSynchronize(String... attributesToSynchronize) {
this.attributesToSynchronize = attributesToSynchronize.clone();
}

@ConfigurationProperty(order = 27, operations = { SyncOp.class },
@ConfigurationProperty(order = 30, operations = { SyncOp.class },
displayMessageKey = "modifiersNamesToFilterOut.display",
helpMessageKey = "modifiersNamesToFilterOut.help")
public String[] getModifiersNamesToFilterOut() {
Expand All @@ -683,7 +714,7 @@ public void setModifiersNamesToFilterOut(String... modifiersNamesToFilterOut) {
this.modifiersNamesToFilterOut = modifiersNamesToFilterOut.clone();
}

@ConfigurationProperty(order = 28, operations = { SyncOp.class },
@ConfigurationProperty(order = 31, operations = { SyncOp.class },
displayMessageKey = "accountSynchronizationFilter.display",
helpMessageKey = "accountSynchronizationFilter.help")
public String getAccountSynchronizationFilter() {
Expand All @@ -694,7 +725,7 @@ public void setAccountSynchronizationFilter(String accountSynchronizationFilter)
this.accountSynchronizationFilter = accountSynchronizationFilter;
}

@ConfigurationProperty(order = 29, operations = { SyncOp.class },
@ConfigurationProperty(order = 32, operations = { SyncOp.class },
displayMessageKey = "changeLogBlockSize.display",
helpMessageKey = "changeLogBlockSize.help")
public int getChangeLogBlockSize() {
Expand All @@ -705,7 +736,7 @@ public void setChangeLogBlockSize(int changeLogBlockSize) {
this.changeLogBlockSize = changeLogBlockSize;
}

@ConfigurationProperty(order = 30, operations = { SyncOp.class },
@ConfigurationProperty(order = 33, operations = { SyncOp.class },
displayMessageKey = "changeNumberAttribute.display",
helpMessageKey = "changeNumberAttribute.help")
public String getChangeNumberAttribute() {
Expand All @@ -716,7 +747,7 @@ public void setChangeNumberAttribute(String changeNumberAttribute) {
this.changeNumberAttribute = changeNumberAttribute;
}

@ConfigurationProperty(order = 31, operations = { SyncOp.class },
@ConfigurationProperty(order = 34, operations = { SyncOp.class },
displayMessageKey = "filterWithOrInsteadOfAnd.display",
helpMessageKey = "filterWithOrInsteadOfAnd.help")
public boolean isFilterWithOrInsteadOfAnd() {
Expand All @@ -727,7 +758,7 @@ public void setFilterWithOrInsteadOfAnd(boolean filterWithOrInsteadOfAnd) {
this.filterWithOrInsteadOfAnd = filterWithOrInsteadOfAnd;
}

@ConfigurationProperty(order = 32, operations = { SyncOp.class },
@ConfigurationProperty(order = 35, operations = { SyncOp.class },
displayMessageKey = "removeLogEntryObjectClassFromFilter.display",
helpMessageKey = "removeLogEntryObjectClassFromFilter.help")
public boolean isRemoveLogEntryObjectClassFromFilter() {
Expand All @@ -738,7 +769,7 @@ public void setRemoveLogEntryObjectClassFromFilter(boolean removeLogEntryObjectC
this.removeLogEntryObjectClassFromFilter = removeLogEntryObjectClassFromFilter;
}

@ConfigurationProperty(order = 33, operations = { SyncOp.class },
@ConfigurationProperty(order = 36, operations = { SyncOp.class },
displayMessageKey = "synchronizePasswords.display",
helpMessageKey = "synchronizePasswords.help")
public boolean isSynchronizePasswords() {
Expand All @@ -749,7 +780,7 @@ public void setSynchronizePasswords(boolean synchronizePasswords) {
this.synchronizePasswords = synchronizePasswords;
}

@ConfigurationProperty(order = 34, operations = { SyncOp.class },
@ConfigurationProperty(order = 37, operations = { SyncOp.class },
displayMessageKey = "passwordAttributeToSynchronize.display",
helpMessageKey = "passwordAttributeToSynchronize.help")
public String getPasswordAttributeToSynchronize() {
Expand All @@ -760,7 +791,7 @@ public void setPasswordAttributeToSynchronize(String passwordAttributeToSynchron
this.passwordAttributeToSynchronize = passwordAttributeToSynchronize;
}

@ConfigurationProperty(order = 35, operations = { SyncOp.class }, confidential = true,
@ConfigurationProperty(order = 38, operations = { SyncOp.class }, confidential = true,
displayMessageKey = "passwordDecryptionKey.display",
helpMessageKey = "passwordDecryptionKey.help")
public GuardedByteArray getPasswordDecryptionKey() {
Expand All @@ -772,7 +803,7 @@ public void setPasswordDecryptionKey(GuardedByteArray passwordDecryptionKey) {
copy() : null;
}

@ConfigurationProperty(order = 36, operations = { SyncOp.class }, confidential = true,
@ConfigurationProperty(order = 39, operations = { SyncOp.class }, confidential = true,
displayMessageKey = "passwordDecryptionInitializationVector.display",
helpMessageKey = "passwordDecryptionInitializationVector.help")
public GuardedByteArray getPasswordDecryptionInitializationVector() {
Expand All @@ -785,7 +816,7 @@ public void setPasswordDecryptionInitializationVector(GuardedByteArray passwordD
copy() : null;
}

@ConfigurationProperty(order = 37,
@ConfigurationProperty(order = 40,
displayMessageKey = "statusManagementClass.display",
helpMessageKey = "statusManagementClass.help")
public String getStatusManagementClass() {
Expand All @@ -796,7 +827,7 @@ public void setStatusManagementClass(String statusManagementClass) {
this.statusManagementClass = statusManagementClass;
}

@ConfigurationProperty(order = 38,
@ConfigurationProperty(order = 41,
displayMessageKey = "retrievePasswordsWithSearch.display",
helpMessageKey = "retrievePasswordsWithSearch.help")
public boolean getRetrievePasswordsWithSearch() {
Expand All @@ -807,7 +838,7 @@ public void setRetrievePasswordsWithSearch(boolean retrievePasswordsWithSearch)
this.retrievePasswordsWithSearch = retrievePasswordsWithSearch;
}

@ConfigurationProperty(order = 39,
@ConfigurationProperty(order = 42,
displayMessageKey = "dnAttribute.display",
helpMessageKey = "dnAttribute.help")
public String getDnAttribute() {
Expand All @@ -818,7 +849,7 @@ public void setDnAttribute(String dnAttribute) {
this.dnAttribute = dnAttribute;
}

@ConfigurationProperty(order = 40,
@ConfigurationProperty(order = 43,
displayMessageKey = "groupSearchFilter.display",
helpMessageKey = "groupSearchFilter.help")
public String getGroupSearchFilter() {
Expand All @@ -829,7 +860,7 @@ public void setGroupSearchFilter(String groupSearchFilter) {
this.groupSearchFilter = groupSearchFilter;
}

@ConfigurationProperty(order = 41,
@ConfigurationProperty(order = 44,
displayMessageKey = "readTimeout.display",
helpMessageKey = "readTimeout.help")
public long getReadTimeout() {
Expand All @@ -840,7 +871,7 @@ public void setReadTimeout(long readTimeout) {
this.readTimeout = readTimeout;
}

@ConfigurationProperty(order = 42,
@ConfigurationProperty(order = 45,
displayMessageKey = "connectTimeout.display",
helpMessageKey = "connectTimeout.help")
public long getConnectTimeout() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ groupObjectClasses.display=Group Object Classes
groupObjectClasses.help=The group class or classes that will be used when creating new group objects in the LDAP tree. When entering more than one object class, each entry should be on its own line; do not use commas or semi-colons to separate multiple group classes. Some group classes may require that you specify all group classes in the class hierarchy.
groupNameAttributes.display=Group Name Attributes
groupNameAttributes.help=Attribute or attributes which holds the group''s name. Default is "cn".
anyObjectClasses.display=Any-object Object Classes
anyObjectClasses.help=The object class or classes that will be used when creating new any-object objects in the LDAP tree. When entering more than one object class, each entry should be on its own line; do not use commas or semi-colons to separate multiple object classes. Some classes may require that you specify all object classes in the class hierarchy.
anyObjectNameAttributes.display=Any-object Name Attributes
anyObjectNameAttributes.help=Attribute or attributes which holds the any-object''s name.

dnAttribute.display=Entry DN attribute name
dnAttribute.help=Entry DN attribute name (default: entryDN)
Expand All @@ -120,6 +124,10 @@ groupObjectClasses.notEmpty=The list of group object classes cannot be empty
groupObjectClasses.noBlankValues=The list of group object classes cannot contain blank values
groupNameAttributes.notEmpty=The list of group name attributes cannot be empty
groupNameAttributes.noBlankValues=The list of group name attributes cannot contain blank values
anyObjectClasses.notEmpty=The list of any-object object classes cannot be empty
anyObjectClasses.noBlankValues=The list of any-object object classes cannot contain blank values
anyObjectNameAttributes.notEmpty=The list of any-object name attributes cannot be empty
anyObjectNameAttributes.noBlankValues=The list of any-object name attributes cannot contain blank values
groupMemberAttribute.notBlank=The group member attribute cannot be blank
vlvSortAttribute.notBlank=The VLV sort attribute cannot be blank
uidAttribute.notBlank=The attribute to map to Uid cannot be blank
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ groupObjectClasses.notEmpty=The list of group object classes cannot be empty
groupObjectClasses.noBlankValues=The list of group object classes cannot contain blank values
groupNameAttributes.notEmpty=The list of group name attributes cannot be empty
groupNameAttributes.noBlankValues=The list of group name attributes cannot contain blank values
anyObjectClasses.notEmpty=The list of any-object object classes cannot be empty
anyObjectClasses.noBlankValues=The list of any-object object classes cannot contain blank values
anyObjectNameAttributes.notEmpty=The list of any-object name attributes cannot be empty
anyObjectNameAttributes.noBlankValues=The list of any-object name attributes cannot contain blank values
groupMemberAttribute.notBlank=Das Gruppenmitgliedattribut darf nicht leer sein
vlvSortAttribute.notBlank=Das VLV-Sortierattribut darf nicht leer sein
uidAttribute.notBlank=Das zur UID zuzuordnende Attribut darf nicht leer sein
Expand Down Expand Up @@ -138,6 +142,11 @@ groupObjectClasses.help=The group class or classes that will be used when creati
groupNameAttributes.display=Group Name Attributes
groupNameAttributes.help=Attribute or attributes which holds the group''s name.

anyObjectClasses.display=Any-object Object Classes
anyObjectClasses.help=The object class or classes that will be used when creating new any-object objects in the LDAP tree. When entering more than one object class, each entry should be on its own line; do not use commas or semi-colons to separate multiple object classes. Some classes may require that you specify all object classes in the class hierarchy.
anyObjectNameAttributes.display=Any-object Name Attributes
anyObjectNameAttributes.help=Attribute or attributes which holds the any-object''s name.

dnAttribute.display=Entry DN attribute name
dnAttribute.help=Entry DN attribute name (default: entryDN)
useVlvControls.display=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ groupObjectClasses.notEmpty=The list of group object classes cannot be empty
groupObjectClasses.noBlankValues=The list of group object classes cannot contain blank values
groupNameAttributes.notEmpty=The list of group name attributes cannot be empty
groupNameAttributes.noBlankValues=The list of group name attributes cannot contain blank values
anyObjectClasses.notEmpty=The list of any-object object classes cannot be empty
anyObjectClasses.noBlankValues=The list of any-object object classes cannot contain blank values
anyObjectNameAttributes.notEmpty=The list of any-object name attributes cannot be empty
anyObjectNameAttributes.noBlankValues=The list of any-object name attributes cannot contain blank values
groupMemberAttribute.notBlank=El atributo de miembro de grupo no puede quedar en blanco
vlvSortAttribute.notBlank=El atributo de ordenaci\u00f3n de VLV no puede quedar en blanco
uidAttribute.notBlank=El atributo de asignaci\u00f3n a Uid no puede quedar en blanco
Expand Down Expand Up @@ -136,6 +140,10 @@ groupObjectClasses.display=Group Object Classes
groupObjectClasses.help=The group class or classes that will be used when creating new group objects in the LDAP tree. When entering more than one object class, each entry should be on its own line; do not use commas or semi-colons to separate multiple group classes. Some group classes may require that you specify all group classes in the class hierarchy.
groupNameAttributes.display=Group Name Attributes
groupNameAttributes.help=Attribute or attributes which holds the group''s name.
anyObjectClasses.display=Any-object Object Classes
anyObjectClasses.help=The object class or classes that will be used when creating new any-object objects in the LDAP tree. When entering more than one object class, each entry should be on its own line; do not use commas or semi-colons to separate multiple object classes. Some classes may require that you specify all object classes in the class hierarchy.
anyObjectNameAttributes.display=Any-object Name Attributes
anyObjectNameAttributes.help=Attribute or attributes which holds the any-object''s name.

dnAttribute.display=Entry DN attribute name
dnAttribute.help=Entry DN attribute name (default: entryDN)
Expand Down
Loading