Class: ROM::LDAP::Directory::ENV Private
- Inherits:
-
Object
- Object
- ROM::LDAP::Directory::ENV
- Extended by:
- Initializer
- Defined in:
- lib/rom/ldap/directory/env.rb
Overview
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.
Parse uri and options received by the gateway configuration.
rubocop:disable Lint/UriEscapeUnescape
Instance Method Summary collapse
-
#auth ⇒ Hash, NilClass
private
Username and password.
-
#base ⇒ String
private
Global search base.
- #inspect ⇒ String private
- #ssl ⇒ Hash, NilClass private
- #to_h ⇒ Hash private
-
#uri ⇒ URI::LDAP, URI::LDAPS
private
Build LDAP URL with encoded spaces.
Instance Method Details
#auth ⇒ Hash, 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.
Username and password.
66 67 68 |
# File 'lib/rom/ldap/directory/env.rb', line 66 def auth { username: bind_dn, password: bind_pw } if bind_dn end |
#base ⇒ String
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.
Global search base. The value is derived in this order:
1. Gateway Options
2. ENVs
3. URI (unless this is a socket) defaults ""
4. an empty string
56 57 58 59 60 |
# File 'lib/rom/ldap/directory/env.rb', line 56 def base config.fetch(:base) do ::ENV['LDAPBASE'] || (path ? EMPTY_STRING : uri.dn.to_s) end end |
#inspect ⇒ String
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.
84 85 86 |
# File 'lib/rom/ldap/directory/env.rb', line 84 def inspect "<#{self.class.name} #{connection} />" end |
#ssl ⇒ Hash, 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.
72 73 74 |
# File 'lib/rom/ldap/directory/env.rb', line 72 def ssl config[:ssl] if uri.scheme.eql?('ldaps') end |
#to_h ⇒ Hash
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.
78 79 80 |
# File 'lib/rom/ldap/directory/env.rb', line 78 def to_h { host: host, port: port, path: path, ssl: ssl, auth: auth } end |
#uri ⇒ URI::LDAP, URI::LDAPS
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.
Build LDAP URL with encoded spaces.
41 42 43 |
# File 'lib/rom/ldap/directory/env.rb', line 41 def uri URI(connection.gsub(SPACE, PERCENT_SPACE)) end |