File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change
1
+ require 'github/ldap/members/classic'
1
2
require 'github/ldap/members/recursive'
2
3
3
4
module GitHub
@@ -13,6 +14,7 @@ class Ldap
13
14
module Members
14
15
# Internal: Mapping of strategy name to class.
15
16
STRATEGIES = {
17
+ :classic => GitHub ::Ldap ::Members ::Classic ,
16
18
:recursive => GitHub ::Ldap ::Members ::Recursive
17
19
}
18
20
end
Original file line number Diff line number Diff line change
1
+ module GitHub
2
+ class Ldap
3
+ module Members
4
+ # Look up group members using the existing `Group#members` and
5
+ # `Group#subgroups` API.
6
+ class Classic
7
+ # Internal: The GitHub::Ldap object to search domains with.
8
+ attr_reader :ldap
9
+
10
+ # Public: Instantiate new search strategy.
11
+ #
12
+ # - ldap: GitHub::Ldap object
13
+ # - options: Hash of options (unused)
14
+ def initialize ( ldap , options = { } )
15
+ @ldap = ldap
16
+ @options = options
17
+ end
18
+
19
+ # Public: Performs search for group members, including groups and
20
+ # members of subgroups recursively.
21
+ #
22
+ # Returns Array of Net::LDAP::Entry objects.
23
+ def perform ( group_entry )
24
+ group = ldap . load_group ( group_entry )
25
+ group . members + group . subgroups
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
You can’t perform that action at this time.
0 commit comments