{"record":{"id":"5fbbba468a023519","repo":"hpyhacking/peatio","slug":"2010","errorCode":"2010","errorMessage":"The access key #{access_key} has expired.","messagePattern":"The access key #(.+?) has expired\\.","errorType":"exception","errorClass":"APIv2::ExpiredAccessKeyError","httpStatus":401,"severity":"error","filePath":"app/api/api_v2/auth/authenticator.rb","lineNumber":24,"sourceCode":"        @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\n","sourceCodeStart":6,"sourceCodeEnd":42,"githubUrl":"https://github.com/hpyhacking/peatio/blob/dab8641137c008928c835409342519bfef4eae7f/app/api/api_v2/auth/authenticator.rb#L6-L42","documentation":"Error \"The access key #{access_key} has expired.\" thrown in hpyhacking/peatio.","triggerScenarios":"Thrown at app/api/api_v2/auth/authenticator.rb:24 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Extend the expiry of the access key or issue a new access key and update the client to use it."],"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"}