Class: LdapQuery::Connection

Inherits:
Object
  • Object
show all
Defined in:
lib/ldap_query/connection.rb

Overview

For establishing an LDAP connection (binding LDAP connection)

Constant Summary collapse

REQUIRED_KEYS =
%i[host port base auth].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(credentials, type: :basic) ⇒ Interface <Net::Ldap>

Used for creating the initial Ldap connection for querying with supplied parameters

Parameters:

  • credentials (Hash)


16
17
18
19
20
21
22
23
# File 'lib/ldap_query/connection.rb', line 16

def initialize(credentials, type: :basic)
  if type == :auth
    credentials = filter_auth_credentials(credentials)
  else
    valid_credentials?(credentials)
  end
  @link = bind_connection(credentials)
end

Instance Attribute Details

Returns the value of attribute link.



8
9
10
# File 'lib/ldap_query/connection.rb', line 8

def link
  @link
end