Module: ROM::LDAP::Directory::Root

Included in:
ROM::LDAP::Directory
Defined in:
lib/rom/ldap/directory/root.rb

Instance Method Summary collapse

Instance Method Details

#contextsString

Returns:

  • (String)


122
123
124
# File 'lib/rom/ldap/directory/root.rb', line 122

def contexts
  root['namingContexts'].sort
end

#schema_attribute_typesArray<String>

Query directory for all known attribute types

Returns:

  • (Array<String>)

    Attribute types known by directory



80
81
82
# File 'lib/rom/ldap/directory/root.rb', line 80

def schema_attribute_types
  sub_schema['attributeTypes'].sort
end

#schema_object_classesArray<String>

Returns Object classes known by directory.

Returns:

  • (Array<String>)

    Object classes known by directory



71
72
73
# File 'lib/rom/ldap/directory/root.rb', line 71

def schema_object_classes
  sub_schema['objectClasses'].sort
end

#sub_schema_entryString

Distinguished name of subschema

Returns:

  • (String)


64
65
66
# File 'lib/rom/ldap/directory/root.rb', line 64

def sub_schema_entry
  root.first('subschemaSubentry')
end

#supported_controlsArray<String>

Returns:

  • (Array<String>)


94
95
96
# File 'lib/rom/ldap/directory/root.rb', line 94

def supported_controls
  root['supportedControl'].sort
end

#supported_extensionsArray<String>

Returns:

  • (Array<String>)


87
88
89
# File 'lib/rom/ldap/directory/root.rb', line 87

def supported_extensions
  root['supportedExtension'].sort
end

#supported_featuresArray<String>

Returns:

  • (Array<String>)


108
109
110
# File 'lib/rom/ldap/directory/root.rb', line 108

def supported_features
  root['supportedFeatures'].sort
end

#supported_mechanismsArray<String>

Returns:

  • (Array<String>)


101
102
103
# File 'lib/rom/ldap/directory/root.rb', line 101

def supported_mechanisms
  root['supportedSASLMechanisms'].sort
end

#supported_versionsArray<Integer>

Returns:

  • (Array<Integer>)


115
116
117
# File 'lib/rom/ldap/directory/root.rb', line 115

def supported_versions
  root['supportedLDAPVersion'].sort.map(&:to_i)
end

#typeSymbol

Identify the LDAP server vendor, type determines vendor extension to load.



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/rom/ldap/directory/root.rb', line 15

def type
  case root.first('vendorName')
  when /389/        then :three_eight_nine
  when /Apache/     then :apache_ds
  when /Apple/      then :open_directory
  when /ForgeRock/  then :open_dj
  when /IBM/        then :ibm
  when /Netscape/   then :netscape
  when /Novell/     then :e_directory
  when /Oracle/     then :open_ds
  when /Sun/        then :sun_microsystems
  when nil
    return :active_directory if ad?
    return :open_ldap if od?
  else
    :unknown
  end
end

#vendorArray<String>

Examples:

[ 'Apple', '510.30' ]
[ 'Apache Software Foundation', '2.0.0-M24' ]

Returns:

  • (Array<String>)


55
56
57
# File 'lib/rom/ldap/directory/root.rb', line 55

def vendor
  [vendor_name, vendor_version]
end

#vendor_nameString

Returns:

  • (String)


37
38
39
# File 'lib/rom/ldap/directory/root.rb', line 37

def vendor_name
  root.first('vendorName')
end

#vendor_versionString

Returns:

  • (String)


44
45
46
# File 'lib/rom/ldap/directory/root.rb', line 44

def vendor_version
  root.first('vendorVersion')
end