Skip to content

Loosen net-ldap requirement this allows for ldap 0.17.0 #106

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 8 commits into from
Jun 1, 2021
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: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ addons:
- ad1.ghe.dev
- ad2.ghe.dev

before_install:
- echo "deb http://ftp.br.debian.org/debian stable main" | sudo tee -a /etc/apt/sources.list
- sudo apt-get update

install:
- if [ "$TESTENV" = "openldap" ]; then ./script/install-openldap; fi
- bundle install
Expand Down
2 changes: 1 addition & 1 deletion github-ldap.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Gem::Specification.new do |spec|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ["lib"]

spec.add_dependency 'net-ldap', '~> 0.16.0'
spec.add_dependency 'net-ldap', '> 0.16.0'

spec.add_development_dependency "bundler", "~> 1.3"
spec.add_development_dependency 'ladle'
Expand Down
2 changes: 1 addition & 1 deletion lib/github/ldap.rb
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ def capabilities
instrument "capabilities.github_ldap" do |payload|
begin
@connection.search_root_dse
rescue Net::LDAP::LdapError => error
rescue Net::LDAP::Error => error
payload[:error] = error
# stubbed result
Net::LDAP::Entry.new
Expand Down
2 changes: 0 additions & 2 deletions script/install-openldap
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@ TMPDIR=$(mktemp -d)
cd $TMPDIR

# Delete data and reconfigure.
sudo cp -v /var/lib/ldap/DB_CONFIG ./DB_CONFIG
sudo rm -rf /etc/ldap/slapd.d/*
sudo rm -rf /var/lib/ldap/*
sudo cp -v ./DB_CONFIG /var/lib/ldap/DB_CONFIG
sudo slapadd -F /etc/ldap/slapd.d -b "cn=config" -l $BASE_PATH/slapd.conf.ldif
# Load memberof and ref-int overlays and configure them.
sudo slapadd -F /etc/ldap/slapd.d -b "cn=config" -l $BASE_PATH/memberof.ldif
Expand Down
3 changes: 2 additions & 1 deletion test/domain_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,8 @@ def test_membership_for_posixGroups

class GitHubLdapActiveDirectoryGroupsTest < GitHub::Ldap::Test
def run(*)
self.class.test_env == "activedirectory" ? super : self
return super if self.class.test_env == "activedirectory"
Minitest::Result.from(self)
end

def test_filter_groups
Expand Down
6 changes: 4 additions & 2 deletions test/member_search/active_directory_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
class GitHubLdapActiveDirectoryMemberSearchStubbedTest < GitHub::Ldap::Test
# Only run when AD integration tests aren't run
def run(*)
self.class.test_env != "activedirectory" ? super : self
return super if self.class.test_env != "activedirectory"
Minitest::Result.from(self)
end

def find_group(cn)
Expand Down Expand Up @@ -46,7 +47,8 @@ def test_finds_deeply_nested_group_members
class GitHubLdapActiveDirectoryMemberSearchIntegrationTest < GitHub::Ldap::Test
# Only run this test suite if ActiveDirectory is configured
def run(*)
self.class.test_env == "activedirectory" ? super : self
return super if self.class.test_env == "activedirectory"
Minitest::Result.from(self)
end

def find_group(cn)
Expand Down
6 changes: 4 additions & 2 deletions test/membership_validators/active_directory_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
class GitHubLdapActiveDirectoryMembershipValidatorsStubbedTest < GitHub::Ldap::Test
# Only run when AD integration tests aren't run
def run(*)
self.class.test_env != "activedirectory" ? super : self
return super if self.class.test_env != "activedirectory"
Minitest::Result.from(self)
end

def setup
Expand Down Expand Up @@ -72,7 +73,8 @@ def test_does_not_validate_user_not_in_any_group
class GitHubLdapActiveDirectoryMembershipValidatorsIntegrationTest < GitHub::Ldap::Test
# Only run this test suite if ActiveDirectory is configured
def run(*)
self.class.test_env == "activedirectory" ? super : self
return super if self.class.test_env == "activedirectory"
Minitest::Result.from(self)
end

def setup
Expand Down
5 changes: 3 additions & 2 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
require 'minitest/mock'
require 'minitest/autorun'

require 'mocha/mini_test'
require 'mocha/minitest'

if ENV.fetch('TESTENV', "apacheds") == "apacheds"
# Make sure we clean up running test server
Expand All @@ -31,8 +31,9 @@ def self.test_env

def self.run(reporter, options = {})
start_server
super
result = super
stop_server
result
end

def self.stop_server
Expand Down
2 changes: 1 addition & 1 deletion test/user_search/active_directory_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def test_global_catalog_returns_array_of_results
mock_global_catalog_connection = mock("GitHub::Ldap::UserSearch::GlobalCatalog")
stub_entry = mock("Net::LDAP::Entry")

mock_global_catalog_connection.expects(:search).returns(stub_entry)
mock_global_catalog_connection.expects(:search).returns([stub_entry])
ad_user_search.expects(:global_catalog_connection).returns(mock_global_catalog_connection)

results = ad_user_search.perform("login", "CN=Joe", "uid", {})
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy