-
Notifications
You must be signed in to change notification settings - Fork 27
Support querying Active Directory Global Catalog #94
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
Conversation
b75644e
to
a00750f
Compare
@@ -315,6 +347,9 @@ def configure_member_search_strategy(strategy = nil) | |||
def active_directory_capability? | |||
capabilities[:supportedcapabilities].include?(ACTIVE_DIRECTORY_V51_OID) | |||
end | |||
private :active_directory_capability? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made this public since Domain
now needs to pivot on whether the server is an AD or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't true anymore, is it?
5b54b07
to
3af0a88
Compare
@@ -5,4 +5,5 @@ gemspec | |||
|
|||
group :test, :development do | |||
gem "byebug", :platforms => [:mri_20, :mri_21] | |||
gem "mocha" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the use case for adding mocha in development?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mainly as a convenience for cases like this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, you mean split the group block.
👍
|
||
group :test do | ||
gem "mocha" | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
base: "CN=HI,CN=McDunnough", | ||
filter: kind_of(Net::LDAP::Filter) | ||
)) | ||
results = @default_user_search.perform("","CN=HI,CN=McDunnough","",{}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
results =
here isn't used.
No critical blockers, this is super close! |
# When doing a global search for a user's DN, set the search base to blank | ||
def options | ||
super.merge(base: "") | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 looks good.
@@ -69,6 +73,10 @@ class Ldap | |||
def initialize(options = {}) | |||
@uid = options[:uid] || "sAMAccountName" | |||
|
|||
# Keep a reference to these as default auth for a Global Catalog if needed | |||
@admin_user = options[:admin_user] | |||
@admin_password = options[:admin_password] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a blocker but it might be worth passing these into configure_user_search_strategy
(by passing through the options
hash) to let that method decide if it needs these, so we don't have Global Catalog concerns leaking out unnecessarily.
@davesims wouldn't consider anything ☝️ above as blocking feedback. |
Just noticing that builds were't enabled. Would like to kick off a build to verify these changes. |
This was shadowed by merging #95 first. Closing. |
For Active Directory deployments, in some cases, like authentication or simple entry searches, it will make sense to search the Global Catalog rather than the default configured Domain Controller. This PR will initialize a Global Catalog connection object when requested, and provides an interface to directly query the catalog.
GitHub::Ldap::Domain
will now use the Global Catalog foruser?
, if the server is an Active Directory, and the configured Domain Controller is a Global Catalog, or if the user has provided global catalog settings in the initializer options.TODO:
GitHub::Ldap::Domain#user?
use the catalog if server is AD & catalog is presentThis begins an alternative approach to #91. To fully replace that, we'll have to also implement referral chasing to be able to search for groups that aren't configured to be Active Directory "universal" groups. I'll do that in a separate PR.
/cc @mtodd @jch @sbryant @lildude @timmjd
/cc @github/ldap