Sha256: a403adee5b9855d9389f9c2d1c2ae61c7d5861202b4fc1865aa1aefc56a9e2a0

Contents?: true

Size: 605 Bytes

Versions: 8

Compression:

Stored size: 605 Bytes

Contents

module Rails
  module Auth
    module Credentials
      # A middleware for injecting an arbitrary credentials hash into the Rack environment
      # This is intended for development and testing purposes where you would like to
      # simulate a given X.509 certificate being used in a request or user logged in
      class InjectorMiddleware
        def initialize(app, credentials)
          @app = app
          @credentials = credentials
        end

        def call(env)
          env[Rails::Auth::CREDENTIALS_ENV_KEY] = @credentials
          @app.call(env)
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
rails-auth-1.3.0 lib/rails/auth/credentials/injector_middleware.rb
rails-auth-1.2.0 lib/rails/auth/credentials/injector_middleware.rb
rails-auth-1.1.0 lib/rails/auth/credentials/injector_middleware.rb
rails-auth-1.0.0 lib/rails/auth/credentials/injector_middleware.rb
rails-auth-0.5.3 lib/rails/auth/credentials/injector_middleware.rb
rails-auth-0.5.2 lib/rails/auth/credentials/injector_middleware.rb
rails-auth-0.5.1 lib/rails/auth/credentials/injector_middleware.rb
rails-auth-0.5.0 lib/rails/auth/credentials/injector_middleware.rb