Sha256: a851b82b94a5d8c59fb33f047b451d3741847ed97c82a4bd12e7e88db31b829e

Contents?: true

Size: 316 Bytes

Versions: 15

Compression:

Stored size: 316 Bytes

Contents

class CardController
  # add support for passing api key through header using X-API-Key
  module ApiKey
    def authenticators
      return {} unless request

      super.merge api_key: api_key_from_header || params[:api_key]
    end

    def api_key_from_header
      request.headers["X-API-Key"]
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
card-mod-api_key-0.18.1 lib/card_controller/api_key.rb
card-mod-api_key-0.18.0 lib/card_controller/api_key.rb
card-mod-api_key-0.17.0 lib/card_controller/api_key.rb
card-mod-api_key-0.16.0 lib/card_controller/api_key.rb
card-mod-api_key-0.15.6 lib/card_controller/api_key.rb
card-mod-api_key-0.15.5 lib/card_controller/api_key.rb
card-mod-api_key-0.15.4 lib/card_controller/api_key.rb
card-mod-api_key-0.15.3 lib/card_controller/api_key.rb
card-mod-api_key-0.15.2.pre1 lib/card_controller/api_key.rb
card-mod-api_key-0.15.1.1 lib/card_controller/api_key.rb
card-mod-api_key-0.15.1 lib/card_controller/api_key.rb
card-mod-api_key-0.15.0 lib/card_controller/api_key.rb
card-mod-api_key-0.14.2 lib/card_controller/api_key.rb
card-mod-api_key-0.14.1 lib/card_controller/api_key.rb
card-mod-api_key-0.14.0 lib/card_controller/api_key.rb