spring-projects / spring-projects/spring-ldap

LDAP-307: Inability to enable ApacheDS schemas

Open
#342 2 comments 0 reactions 1 assignee View on GitHub

@rwinch is already working on this.

Since Oct 4, 2016.

status: waiting-for-feedback
Dominant language
Java
Stars
375
Forks
501
Avg merge
6h 4m
Merged PRs (30d)
63

Description

Franjo Žilić (Migrated from LDAP-307) said:

When adding custom LDAP schemas to the ldifFile attribute for embedded server there is no way to enable built in schemas that are not enabled by default.

For example, custom object class definition has defined mandatory attribute homeDirectory.

dn: m-oid=1.3.6.1.4.1.90009.99.1.1, ou=objectclasses, cn=example, ou=schema
objectclass: metaObjectClass
objectclass: metaTop
objectclass: top
m-oid: 1.3.6.1.4.1.90009.99.1.1
m-name: customObjectClass
m-supObjectClass: inetOrgPerson
m-typeObjectClass: STRUCTURAL
m-must: cn
m-must: sn
m-must: uid
m-must: mail
m-must: userPassword
m-must: homeDirectory

Attribute homeDirectory is provided in ApacheDS 1.5.5 within nis schema with definition:
dn: m-oid=1.3.6.1.1.1.1.3,ou=attributeTypes,cn=nis,ou=schema
objectClass: metaAttributeType
objectClass: metaTop
objectClass: top
m-oid: 1.3.6.1.1.1.1.3
m-collective: FALSE
m-description: The absolute path to the home directory
m-equality: caseExactIA5Match
m-name: homeDirectory
m-noUserModification: FALSE
m-obsolete: FALSE
m-singleValue: TRUE
m-syntax: 1.3.6.1.4.1.1466.115.121.1.26
m-usage: USER_APPLICATIONS

Before any LDAP entry can use that attribute, or before custom object class can be created, it is necessary to enable nis schema (provided with ApacheDS, but disabled by default).

In order to enable nis schema main ldif should have
dn: cn=nis,ou=schema
changetype: modify
replace: m-disabled
m-disabled: FALSE

Since org.springframework.ldap.ldif.parser.LdifParser doesn't support change operations suggested code change provided in gist would solve the problem far simpler then changing LdifParser.

Patch file provided as well, documentation should be updated

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.