Skip to content

Expand ActiveDirectory capability support to v51 (Windows Server 2003 and above) #80

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 2, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/github/ldap.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Ldap

# Internal: The capability required to use ActiveDirectory features.
# See: http://msdn.microsoft.com/en-us/library/cc223359.aspx.
ACTIVE_DIRECTORY_V61_R2_OID = "1.2.840.113556.1.4.2080".freeze
ACTIVE_DIRECTORY_V51_OID = "1.2.840.113556.1.4.1670".freeze

# Utility method to get the last operation result with a human friendly message.
#
Expand Down Expand Up @@ -313,7 +313,7 @@ def configure_member_search_strategy(strategy = nil)
#
# Returns true if the host is an ActiveDirectory server, false otherwise.
def active_directory_capability?
capabilities[:supportedcapabilities].include?(ACTIVE_DIRECTORY_V61_R2_OID)
capabilities[:supportedcapabilities].include?(ACTIVE_DIRECTORY_V51_OID)
end
private :active_directory_capability?
end
Expand Down
2 changes: 1 addition & 1 deletion test/ldap_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def test_search_strategy_defaults

def test_search_strategy_detects_active_directory
caps = Net::LDAP::Entry.new
caps[:supportedcapabilities] = [GitHub::Ldap::ACTIVE_DIRECTORY_V61_R2_OID]
caps[:supportedcapabilities] = [GitHub::Ldap::ACTIVE_DIRECTORY_V51_OID]

@ldap.stub :capabilities, caps do
@ldap.configure_search_strategy :detect
Expand Down