File tree Expand file tree Collapse file tree 3 files changed +7
-0
lines changed
lib/github/ldap/membership_validators Expand file tree Collapse file tree 3 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,9 @@ module MembershipValidators
15
15
# nested groups, performed on the server side.
16
16
class ActiveDirectory < Base
17
17
def perform ( entry )
18
+ # short circuit validation if there are no groups to check against
19
+ return true if groups . empty?
20
+
18
21
# search for the entry on the condition that the entry is a member
19
22
# of one of the groups or their subgroups.
20
23
#
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ module MembershipValidators
7
7
# it consistently with the new approach.
8
8
class Classic < Base
9
9
def perform ( entry )
10
+ # short circuit validation if there are no groups to check against
10
11
return true if groups . empty?
11
12
12
13
domains . each do |domain |
Original file line number Diff line number Diff line change @@ -22,6 +22,9 @@ class Recursive < Base
22
22
ATTRS = %w( dn cn )
23
23
24
24
def perform ( entry , depth = DEFAULT_MAX_DEPTH )
25
+ # short circuit validation if there are no groups to check against
26
+ return true if groups . empty?
27
+
25
28
domains . each do |domain |
26
29
# find groups entry is an immediate member of
27
30
membership = domain . search ( filter : member_filter ( entry ) , attributes : ATTRS )
You can’t perform that action at this time.
0 commit comments