hpyhacking/peatio · error · APIv2::DisabledAccessKeyError

2009

2009

Error message

The access key #{access_key} is disabled.

What it means

Error "The access key #{access_key} is disabled." thrown in hpyhacking/peatio.

Source

Thrown at app/api/api_v2/auth/authenticator.rb:23

      def initialize(request, params)
        @request = request
        @params  = params
      end

      def authenticate!
        check_token!
        check_tonce!
        check_signature!
        token
      end

      def token
        @token ||= APIToken.joins(:member).where(access_key: @params[:access_key]).first
      end

      def check_token!
        raise InvalidAccessKeyError, @params[:access_key] unless token
        raise DisabledAccessKeyError, @params[:access_key] if token.member.api_disabled
        raise ExpiredAccessKeyError, @params[:access_key] if token.expired?
        raise OutOfScopeError unless token.in_scopes?(route_scopes)
      end

      def check_signature!
        if @params[:signature] != Utils.hmac_signature(token.secret_key, payload)
          Rails.logger.warn "APIv2 auth failed: signature doesn't match. token: #{token.access_key} payload: #{payload}"
          raise IncorrectSignatureError, @params[:signature]
        end
      end

      def check_tonce!
        key = "api_v2:tonce:#{token.access_key}:#{tonce}"
        if Utils.cache.read(key)
          Rails.logger.warn "APIv2 auth failed: used tonce. token: #{token.access_key} payload: #{payload} tonce: #{tonce}"
          raise TonceUsedError.new(token.access_key, tonce)
        end
        Utils.cache.write key, tonce, 61 # forget after 61 seconds

View on GitHub (pinned to dab8641137)

Solutions

  1. Re-enable the disabled access key, or authenticate with a different access key that is active.

When it happens

Trigger: Thrown at app/api/api_v2/auth/authenticator.rb:23 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of hpyhacking/peatio@dab8641137 (2026-08-23). Data as JSON: /api/errors/ca19231400034877. Report an issue: GitHub.