{"record":{"id":"7af61dbd2f40c48a","repo":"hpyhacking/peatio","slug":"2008","errorCode":"2008","errorMessage":"The access key #{access_key} does not exist.","messagePattern":"The access key #(.+?) does not exist\\.","errorType":"exception","errorClass":"APIv2::InvalidAccessKeyError","httpStatus":401,"severity":"error","filePath":"app/api/api_v2/auth/authenticator.rb","lineNumber":22,"sourceCode":"\n      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","sourceCodeStart":4,"sourceCodeEnd":40,"githubUrl":"https://github.com/hpyhacking/peatio/blob/dab8641137c008928c835409342519bfef4eae7f/app/api/api_v2/auth/authenticator.rb#L4-L40","documentation":"Error \"The access key #{access_key} does not exist.\" thrown in hpyhacking/peatio.","triggerScenarios":"Thrown at app/api/api_v2/auth/authenticator.rb:22 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the access key ID sent in the request is correct and that a matching key record exists in the database."],"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"}