summaryrefslogtreecommitdiff
path: root/lib/gitlab/auth/too_many_ips.rb
blob: ee4d80e6b899331a26384b53eabddd65fc300cb1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# frozen_string_literal: true

module Gitlab
  module Auth
    class TooManyIps < StandardError
      attr_reader :user_id, :ip, :unique_ips_count

      def initialize(user_id, ip, unique_ips_count)
        @user_id = user_id
        @ip = ip
        @unique_ips_count = unique_ips_count
      end

      def message
        "User #{user_id} from IP: #{ip} tried logging from too many ips: #{unique_ips_count}"
      end
    end
  end
end