Sha256: 5b870370e85a220cc6981052cd01760f5c79f6319364d1a47521abf34ed2dcf1

Contents?: true

Size: 609 Bytes

Versions: 8

Compression:

Stored size: 609 Bytes

Contents

module Rails
  module Auth
    class 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::Env::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-2.1.4 lib/rails/auth/credentials/injector_middleware.rb
rails-auth-2.1.3 lib/rails/auth/credentials/injector_middleware.rb
rails-auth-2.1.2 lib/rails/auth/credentials/injector_middleware.rb
rails-auth-2.1.1 lib/rails/auth/credentials/injector_middleware.rb
rails-auth-2.1.0 lib/rails/auth/credentials/injector_middleware.rb
rails-auth-2.0.3 lib/rails/auth/credentials/injector_middleware.rb
rails-auth-2.0.2 lib/rails/auth/credentials/injector_middleware.rb
rails-auth-2.0.1 lib/rails/auth/credentials/injector_middleware.rb