{"record":{"id":"ca19231400034877","repo":"hpyhacking/peatio","slug":"2009","errorCode":"2009","errorMessage":"The access key #{access_key} is disabled.","messagePattern":"The access key #(.+?) is disabled\\.","errorType":"exception","errorClass":"APIv2::DisabledAccessKeyError","httpStatus":401,"severity":"error","filePath":"app/api/api_v2/auth/authenticator.rb","lineNumber":23,"sourceCode":"      def initialize(request, params)\n        @request = request\n        @params  = params\n      end\n\n      def authenticate!\n        check_token!\n        check_tonce!\n        check_signature!\n        token\n      end\n\n      def token\n        @token ||= APIToken.joins(:member).where(access_key: @params[:access_key]).first\n      end\n\n      def check_token!\n        raise InvalidAccessKeyError, @params[:access_key] unless token\n        raise DisabledAccessKeyError, @params[:access_key] if token.member.api_disabled\n        raise ExpiredAccessKeyError, @params[:access_key] if token.expired?\n        raise OutOfScopeError unless token.in_scopes?(route_scopes)\n      end\n\n      def check_signature!\n        if @params[:signature] != Utils.hmac_signature(token.secret_key, payload)\n          Rails.logger.warn \"APIv2 auth failed: signature doesn't match. token: #{token.access_key} payload: #{payload}\"\n          raise IncorrectSignatureError, @params[:signature]\n        end\n      end\n\n      def check_tonce!\n        key = \"api_v2:tonce:#{token.access_key}:#{tonce}\"\n        if Utils.cache.read(key)\n          Rails.logger.warn \"APIv2 auth failed: used tonce. token: #{token.access_key} payload: #{payload} tonce: #{tonce}\"\n          raise TonceUsedError.new(token.access_key, tonce)\n        end\n        Utils.cache.write key, tonce, 61 # forget after 61 seconds","sourceCodeStart":5,"sourceCodeEnd":41,"githubUrl":"https://github.com/hpyhacking/peatio/blob/dab8641137c008928c835409342519bfef4eae7f/app/api/api_v2/auth/authenticator.rb#L5-L41","documentation":"Error \"The access key #{access_key} is disabled.\" thrown in hpyhacking/peatio.","triggerScenarios":"Thrown at app/api/api_v2/auth/authenticator.rb:23 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-enable the disabled access key, or authenticate with a different access key that is active."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"dab8641137c008928c835409342519bfef4eae7f","analyzedAt":"2026-08-23T09:59:18.005Z","schemaVersion":2},"datasetVersion":"2026-08-23T13:39:53.451Z"}