Class LDAP::Conn
In: lib/ldap/schema.rb
Parent: Object

Methods

root_dse   schema  

Public Instance methods

Fetch the root DSE (DSA-specific Entry) for the connection. DSA stands for Directory System Agent and simply refers to the LDAP server you are using.

attrs, if given, is an array of attributes that should be returned from the server. The default list is subschemaSubentry, namingContexts, monitorContext, altServer, supportedControl, supportedExtension, supportedFeatures, supportedSASLMechanisms and supportedLDAPVersion.

sec and usec can be used to specify a time-out for the search in seconds and microseconds, respectively.

[Source]

     # File lib/ldap/schema.rb, line 111
111:     def root_dse(attrs = nil, sec = 0, usec = 0)
112:       attrs ||= [
113:         'subschemaSubentry',
114:         'namingContexts',
115:         'monitorContext',
116:         'altServer',
117:         'supportedControl',
118:         'supportedExtension',
119:         'supportedFeatures',
120:         'supportedSASLMechanisms',
121:         'supportedLDAPVersion',
122:       ]
123: 
124:       entries = search2('', LDAP_SCOPE_BASE, '(objectClass=*)',
125:                         attrs, false, sec, usec)
126:       return entries
127:     end

Fetch the schema data for the connection.

If base is given, it gives the base DN for the search. attrs, if given, is an array of attributes that should be returned from the server. The default list is objectClasses, attributeTypes, matchingRules, matchingRuleUse, dITStructureRules, dITContentRules, nameForms and ldapSyntaxes.

sec and usec can be used to specify a time-out for the search in seconds and microseconds, respectively.

[Source]

    # File lib/ldap/schema.rb, line 80
80:     def schema(base = nil, attrs = nil, sec = 0, usec = 0)
81:       attrs ||= [
82:         'objectClasses',
83:         'attributeTypes',
84:         'matchingRules',
85:         'matchingRuleUse',
86:         'dITStructureRules',
87:         'dITContentRules',
88:         'nameForms',
89:         'ldapSyntaxes',
90:       ]
91:       base ||= root_dse(['subschemaSubentry'], sec, usec)[0]['subschemaSubentry'][0]
92:       base ||= 'cn=schema'
93:       ent = search2(base, LDAP_SCOPE_BASE, '(objectClass=subschema)',
94:                     attrs, false, sec, usec)
95:       return Schema.new(ent[0])
96:     end

[Validate]