Sha256: d71c4806b9a485cc986ac686efc24c18e52d5a61e826c36020fc295911f39dd8

Contents?: true

Size: 496 Bytes

Versions: 28

Compression:

Stored size: 496 Bytes

Contents

module Shipit
  class SimpleMessageVerifier < ActiveSupport::MessageVerifier
    def initialize(secret, options = {})
      options[:serializer] ||= ToS
      secret += Rails.application.secrets.secret_key_base
      super(secret, options)
    end

    private

    def encode(data)
      data.to_s
    end

    def decode(data)
      data
    end

    module ToS
      def self.dump(object)
        object.to_s
      end

      def self.load(payload)
        payload
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
shipit-engine-0.7.0 lib/shipit/simple_message_verifier.rb
shipit-engine-0.6.4 lib/shipit/simple_message_verifier.rb
shipit-engine-0.6.3 lib/shipit/simple_message_verifier.rb
shipit-engine-0.6.2 lib/shipit/simple_message_verifier.rb
shipit-engine-0.6.1 lib/shipit/simple_message_verifier.rb
shipit-engine-0.6.0 lib/shipit/simple_message_verifier.rb
shipit-engine-0.5.2 lib/shipit/simple_message_verifier.rb
shipit-engine-0.5.1 lib/shipit/simple_message_verifier.rb
shipit-engine-0.5.0 lib/shipit/simple_message_verifier.rb
shipit-engine-0.4.10 lib/shipit/simple_message_verifier.rb
shipit-engine-0.4.9 lib/shipit/simple_message_verifier.rb
shipit-engine-0.4.8 lib/shipit/simple_message_verifier.rb
shipit-engine-0.4.7 lib/shipit/simple_message_verifier.rb
shipit-engine-0.4.6 lib/shipit/simple_message_verifier.rb
shipit-engine-0.4.5 lib/shipit/simple_message_verifier.rb
shipit-engine-0.4.4 lib/shipit/simple_message_verifier.rb
shipit-engine-0.4.3 lib/shipit/simple_message_verifier.rb
shipit-engine-0.4.2 lib/shipit/simple_message_verifier.rb
shipit-engine-0.4.1 lib/shipit/simple_message_verifier.rb
shipit-engine-0.4.0 lib/shipit/simple_message_verifier.rb