Sha256: 6a4bf26257677fa32838558dcf316defe1a832c01ba496fdcdd3f1927ace02da

Contents?: true

Size: 916 Bytes

Versions: 2

Compression:

Stored size: 916 Bytes

Contents

# frozen_string_literal: true

module ApiProxy
  class Config
    attr_accessor :api_key,
                  :api_secret,
                  :api_url,
                  :request_starts_with,
                  :request_allowed,
                  :custom_headers,
                  :reject_params,
                  :allowed_headers

    def initialize
      load_defaults
    end

    private

    def load_defaults
      @api_key = 'key'
      @api_secret = 'secret'

      @api_url = 'http://localhost:3000/api/v1'

      @request_starts_with = '/_ts'

      @request_allowed = ->(_env) { true }
      @custom_headers = ->(_env) { {} }

      @reject_params = %w[utf8 authenticity_token commit format controller action]

      @allowed_headers = %w[
        content-type
        etag
        cache-control
        content-length
        content-disposition
        content-transfer-encoding
      ]
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
api_proxy-0.2.9 lib/api_proxy/config.rb
api_proxy-0.2.8 lib/api_proxy/config.rb