{"record":{"id":"2fe70d7e2d5818de","repo":"flippercloud/flipper","slug":"timestamp-should-be-an-instance-of-time","errorCode":null,"errorMessage":"timestamp should be an instance of Time","messagePattern":"timestamp should be an instance of Time","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/flipper/cloud/message_verifier.rb","lineNumber":12,"sourceCode":"require \"openssl\"\nrequire \"digest/sha2\"\n\nmodule Flipper\n  module Cloud\n    class MessageVerifier\n      class InvalidSignature < StandardError; end\n\n      DEFAULT_VERSION = \"v1\"\n\n      def self.header(signature, timestamp, version = DEFAULT_VERSION)\n        raise ArgumentError, \"timestamp should be an instance of Time\" unless timestamp.is_a?(Time)\n        raise ArgumentError, \"signature should be a string\" unless signature.is_a?(String)\n        \"t=#{timestamp.to_i},#{version}=#{signature}\"\n      end\n\n      def initialize(secret:, version: DEFAULT_VERSION)\n        @secret = secret\n        @version = version || DEFAULT_VERSION\n\n        raise ArgumentError, \"secret should be a string\" unless @secret.is_a?(String)\n        raise ArgumentError, \"secret should not be empty\" if @secret.empty?\n        raise ArgumentError, \"version should be a string\" unless @version.is_a?(String)\n      end\n\n      def generate(payload, timestamp)\n        raise ArgumentError, \"timestamp should be an instance of Time\" unless timestamp.is_a?(Time)\n        raise ArgumentError, \"payload should be a string\" unless payload.is_a?(String)\n\n        OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new(\"sha256\"), @secret, \"#{timestamp.to_i}.#{payload}\")","sourceCodeStart":1,"sourceCodeEnd":30,"githubUrl":"https://github.com/flippercloud/flipper/blob/1f86de3ec91521585b156445e156642938b19cb0/lib/flipper/cloud/message_verifier.rb#L1-L30","documentation":"Error \"timestamp should be an instance of Time\" thrown in flippercloud/flipper.","triggerScenarios":"Thrown at lib/flipper/cloud/message_verifier.rb:12 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a Time instance as the timestamp argument, not a String or Integer","Convert with Time.at(epoch) or Time.parse(string) before calling the verifier","Check the caller: message_verifier expects Time, so fix the type at the call site"],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"1f86de3ec91521585b156445e156642938b19cb0","analyzedAt":"2026-08-23T04:36:09.896Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}