Sha256: bc5667b09ca9f6c900effd7bc371fabbd1bdd9c7466a80087c8181f29b3c7697

Contents?: true

Size: 742 Bytes

Versions: 4

Compression:

Stored size: 742 Bytes

Contents

# frozen_string_literal: true

require "pakyow/support/extension"
require "pakyow/support/message_verifier"

module Pakyow
  module Environment
    module Behavior
      module Verifier
        extend Support::Extension

        class_methods do
          attr_reader :verifier
        end

        apply_extension do
          before :boot do
            config.secrets.reject! { |secret|
              secret.nil? || secret.empty?
            }

            if config.secrets.any?
              @verifier = Support::MessageVerifier.new(config.secrets[0])
            else
              raise "Pakyow will not boot without a secret configured in `Pakyow.config.secrets`"
            end
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
pakyow-core-1.0.0.rc5 lib/pakyow/environment/behavior/verifier.rb
pakyow-core-1.0.0.rc4 lib/pakyow/environment/behavior/verifier.rb
pakyow-core-1.0.0.rc3 lib/pakyow/environment/behavior/verifier.rb
pakyow-core-1.0.0.rc2 lib/pakyow/environment/behavior/verifier.rb