Module: Dragonfly::OpenSSL::Config

Defined in:
lib/dragonfly-openssl/config.rb

Class Method Summary collapse

Class Method Details

.apply_configuration(app, opts = {}) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/dragonfly-openssl/config.rb', line 5

def self.apply_configuration(app, opts = {})
  app.configure do |c|
    c.encoder.register(Encoder) do |e|
      e.key = opts[:key] if opts.has_key?(:key)
    end

    c.job :encrypt do |options|
      options ||= {}
      encode(:encrypt, options)
    end

    c.job :decrypt do |options|
      options ||= {}
      encode(:decrypt, options)
    end
  end
end