Class: ROM::LDAP::Client Private
- Inherits:
-
Object
- Object
- ROM::LDAP::Client
- Extended by:
- Initializer
- Includes:
- Authentication, Operations
- Defined in:
- lib/rom/ldap/client.rb,
lib/rom/ldap/client/operations.rb,
lib/rom/ldap/client/authentication.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Defined Under Namespace
Modules: Authentication, Operations
Instance Attribute Summary collapse
- #host ⇒ String readonly
- #socket ⇒ Object readonly private
Instance Method Summary collapse
- #alive? ⇒ Boolean private
- #close ⇒ NilClass private
- #closed? ⇒ Boolean private
-
#open {|Socket| ... } ⇒ Object
private
Create connection (encrypted) and authenticate.
Methods included from Authentication
Methods included from Operations
#add, #delete, #password_modify, #rename, #search, #update
Instance Attribute Details
#host ⇒ String (readonly)
26 |
# File 'lib/rom/ldap/client.rb', line 26 option :host, reader: :private, type: Types::Strict::String |
#socket ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
37 38 39 |
# File 'lib/rom/ldap/client.rb', line 37 def socket @socket end |
Instance Method Details
#alive? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
# File 'lib/rom/ldap/client.rb', line 77 def alive? return false if closed? if IO.select([socket], nil, nil, 0) begin !socket.eof? rescue StandardError false end else true end rescue IOError false end |
#close ⇒ NilClass
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
68 69 70 71 72 73 |
# File 'lib/rom/ldap/client.rb', line 68 def close return if socket.nil? socket.close @socket = nil end |
#closed? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
62 63 64 |
# File 'lib/rom/ldap/client.rb', line 62 def closed? socket.nil? || (socket.is_a?(::Socket) && socket.closed?) end |
#open {|Socket| ... } ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Create connection (encrypted) and authenticate.
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/rom/ldap/client.rb', line 44 def open unless alive? @socket = Socket.new().call # tls if ssl start_tls sasl_bind # (mechanism:, credentials:, challenge:) end bind(auth) unless auth.nil? # simple auth end yield(@socket) end |