0

There’re any tutorial to explain how can i create ‘object classes’ and ‘attributes types’ on DS 6.5 from command line?

I’d like to import by command line a ldif file which have the following structure:

dn: cn=schema
objectClass: subschema
objectClass: ldapSubentry
objectClass: top
cn: schema
objectClasses: ( test-user-oid NAME 'test-user' SUP inetOrgPerson STRUCTURAL MUST (test-status $ description) MAY ( test-lang $ ds-pwp-password-policy-dn $ test-modificationUserId  ) )
modifyTimestamp: 20130411155332Z
attributeTypes: ( test-visible-startDate-oid NAME 'test-visible-startDate' EQUALITY caseIgnoreMatch ORDERING caseIgnoreOrderingMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 USAGE userApplications )
ds-sync-state: 00000131f62eceea0a4000000001
ds-sync-generation-id: 8408
modifiersName: cn=Directory Manager,cn=Root DNs,cn=config

On openLDAP we a ldap file like this:

attributetype ( 1.3.6.1.4.1.18060.0.4.3.2.1 
        NAME 'test-user' 
        DESC 'test'
        EQUALITY integerMatch
        SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 
        SINGLE-VALUE 
 )

objectclass ( 1.3.6.1.4.1.18060.0.4.3.3.1 
        NAME 'ship'
        DESC 'test' 
        SUP top 
        STRUCTURAL 
        MUST cn 
        MAY ( test-user $ description ) 
 )

and apply the slaptest cmd.Is it similar on OpenDJ?

JMarques
  • 3,044
  • 4
  • 34
  • 55

1 Answers1

1

Extending schema over LDAP with OpenDJ and ForgeRock Directory Services is fully documented on https://backstage.forgerock.com/docs/ds. It is slightly different from openLDAP syntax and method: it’s a modify operation of the cn=schema suffix adding values of the attributeTypes and objectClasses attributes.

Here’s the above example ready to be added over LDAP to OpenDJ, ForgeRock Directory Services, SunDSEE...

dn: cn=schema
changetype: modify
add: attributeTypes
attributeTypes: ( test-visible-startDate-oid NAME 'test-visible-startDate' EQUALITY caseIgnoreMatch ORDERING caseIgnoreOrderingMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 USAGE userApplications )
-
add: objectClasses
objectClasses: ( test-user-oid NAME 'test-user' SUP inetOrgPerson STRUCTURAL MUST (test-status $ description) MAY ( test-lang $ ds-pwp-password-policy-dn $ test-modificationUserId  ) )
-

Note that you will need to add all attributeTypes used in the test-user objectclass. And you should not add the ds-pwp-password-policy-dn which is an operational attribute and can be part of any entry.

Ludovic Poitou
  • 4,788
  • 2
  • 21
  • 30
  • This part is on https://backstage.forgerock.com/docs/ds/6.5/admin-guide/#update-schema "create a schema file using a text editor, and add the file to the db/schema/ directory before starting the server" – JMarques Feb 21 '19 at 11:38
  • Extended the response above. I hope this clarifies. – Ludovic Poitou Feb 22 '19 at 09:46