Sha256: a4811d96647cda107b710f49f898170e670d7d0011c3e973b15a260abe1f2332
Contents?: true
Size: 554 Bytes
Versions: 4
Compression:
Stored size: 554 Bytes
Contents
module Diesel module Middleware module Auth class APIKey def initialize(app, options) @app = app @id = options[:id] @in = options[:in] @name = options[:name] end def call(env) context = env[:context] value = context.options[@id] if @in == :header env[:request_headers][@name] = value elsif @in == :query env[:params][@name] = value end @app.call(env) end end end end end
Version data entries
4 entries across 4 versions & 1 rubygems