mirror of
https://gitlab.com/gitlab-org/gitlab-foss.git
synced 2025-07-29 12:00:32 +00:00
22 lines
475 B
Ruby
22 lines
475 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Gitlab
|
|
module RackAttack
|
|
class UserAllowlist
|
|
extend Forwardable
|
|
|
|
def_delegators :@set, :empty?, :include?, :to_a
|
|
|
|
def initialize(list)
|
|
@set = Set.new
|
|
|
|
list.to_s.split(',').each do |id|
|
|
@set << Integer(id) unless id.blank?
|
|
rescue ArgumentError
|
|
Gitlab::AuthLogger.error(message: 'ignoring invalid user allowlist entry', entry: id)
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|