Class: GitHub::Ldap::ReferralChaser::Referral
- Inherits:
-
Object
- Object
- GitHub::Ldap::ReferralChaser::Referral
- Defined in:
- lib/github/ldap/referral_chaser.rb
Overview
Represents a referral entry from an LDAP search result. Constructs a corresponding GitHub::Ldap object from the paramaters on the referral_url and provides a #search method to continue the search on the referred domain.
Instance Attribute Summary collapse
-
#connection ⇒ Object
readonly
Returns the value of attribute connection.
-
#search_base ⇒ Object
readonly
Returns the value of attribute search_base.
Instance Method Summary collapse
-
#initialize(referral_url, admin_user, admin_password, port = nil) ⇒ Referral
constructor
A new instance of Referral.
-
#search(options) ⇒ Object
Search the referred domain controller with options, merging in the referred search base DN onto options.
Constructor Details
#initialize(referral_url, admin_user, admin_password, port = nil) ⇒ Referral
Returns a new instance of Referral.
73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/github/ldap/referral_chaser.rb', line 73 def initialize(referral_url, admin_user, admin_password, port=nil) url = GitHub::Ldap::URL.new(referral_url) @search_base = url.dn = { host: url.host, port: port || url.port, scope: url.scope, admin_user: admin_user, admin_password: admin_password } @connection = GitHub::Ldap::ConnectionCache.get_connection() end |
Instance Attribute Details
#connection ⇒ Object (readonly)
Returns the value of attribute connection.
94 95 96 |
# File 'lib/github/ldap/referral_chaser.rb', line 94 def connection @connection end |
#search_base ⇒ Object (readonly)
Returns the value of attribute search_base.
94 95 96 |
# File 'lib/github/ldap/referral_chaser.rb', line 94 def search_base @search_base end |
Instance Method Details
#search(options) ⇒ Object
Search the referred domain controller with options, merging in the referred search base DN onto options.
90 91 92 |
# File 'lib/github/ldap/referral_chaser.rb', line 90 def search() connection.search(.merge(base: search_base)) end |