Sha256: 49603214ea788281f5746f0001f0da815dfea043b39e4e78c75976ba28298681
Contents?: true
Size: 947 Bytes
Versions: 11
Compression:
Stored size: 947 Bytes
Contents
module GitHub class Ldap module MembershipValidators # Validates membership using `GitHub::Ldap::Domain#membership`. # # This is a simple wrapper for existing functionality in order to expose # it consistently with the new approach. class Classic < Base def perform(entry) # short circuit validation if there are no groups to check against return true if groups.empty? domains.each do |domain| membership = domain.membership(entry, group_names) if !membership.empty? entry[:groups] = membership return true end end false end # Internal: the group names to look up membership for. # # Returns an Array of String group names (CNs). def group_names @group_names ||= groups.map { |g| g[:cn].first } end end end end end
Version data entries
11 entries across 11 versions & 1 rubygems