{"record":{"id":"9010a581cb6f10f4","repo":"flippercloud/flipper","slug":"secret-should-be-a-string","errorCode":null,"errorMessage":"secret should be a string","messagePattern":"secret should be a string","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/flipper/cloud/message_verifier.rb","lineNumber":21,"sourceCode":"\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}\")\n      end\n\n      def header(signature, timestamp)\n        self.class.header(signature, timestamp, @version)\n      end\n\n      # Public: Verifies the signature header for a given payload.\n      #\n      # Raises a InvalidSignature in the following cases:","sourceCodeStart":3,"sourceCodeEnd":39,"githubUrl":"https://github.com/flippercloud/flipper/blob/1f86de3ec91521585b156445e156642938b19cb0/lib/flipper/cloud/message_verifier.rb#L3-L39","documentation":"Error \"secret should be a string\" thrown in flippercloud/flipper.","triggerScenarios":"Thrown at lib/flipper/cloud/message_verifier.rb:21 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide the webhook secret as a String, e.g. ENV['FLIPPER_CLOUD_WEBHOOK_SECRET']","Check that the configured secret is not being passed as a Symbol or other object","Load the secret from your credentials store as a plain string before constructing the verifier"],"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"}