ee/lib/ee/gitlab/auth/ldap/access.rb
# Remove ssh keys that do not exist in LDAP any more
Remove ssh keys that do not exist in LDAP any more
Remove ssh keys that do not exist in LDAP any more
def remove_old_ssh_keys
            keys = user.keys.ldap.where.not(key: ldap_user.ssh_keys)
            keys.each do |deleted_key|
              ::Rails.logger.info "#{self.class.name}: removing LDAP SSH key #{deleted_key.key} from #{user.name} (#{user.id})"
              unless deleted_key.destroy
                ::Rails.logger.error "#{self.class.name}: failed to remove LDAP SSH key #{key.inspect} from #{user.name} (#{user.id})"
              end
            end
          end
def remove_old_ssh_keys keys = user . keys . ldap . where . not ( key : ldap_user . ssh_keys ) keys . each do | deleted_key | :: Rails . logger . info "#{self.class.name}: removing LDAP SSH key #{deleted_key.key} from #{user.name} (#{user.id})" unless deleted_key . destroy :: Rails . logger . error "#{self.class.name}: failed to remove LDAP SSH key #{key.inspect} from #{user.name} (#{user.id})" end end end
Remove ssh keys that do not exist in LDAP any more
Remove ssh keys that do not exist in LDAP any more