Sha256: 856277b9e00d74c7817b566e9cb0920417830390364016386fe620ff54ed79c6

Contents?: true

Size: 894 Bytes

Versions: 17

Compression:

Stored size: 894 Bytes

Contents

# frozen_string_literal: true

require 'securerandom'

module DerailedBenchmarks
  # Base helper class. Can be used to authenticate different strategies
  # The root app will be wrapped by an authentication action
  class AuthHelper
    attr_reader   :app

    # Put any coded needed to set up or initialize your authentication module here
    def setup
      raise "Must subclass"
    end

    # Gets called for every request. Place all auth logic here.
    # Return value is expected to be an valid Rack response array.
    # If you do not manually `app.call(env)` here, the client app
    # will never be called.
    def call(env)
      raise "Must subclass"
    end

    # Returns self and sets the target app
    def add_app(app)
      raise "App is required argument" unless app
      @app = app
      setup
      self
    end
  end
end

require 'derailed_benchmarks/auth_helpers/devise'

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
derailed_benchmarks-2.2.1 lib/derailed_benchmarks/auth_helper.rb
derailed_benchmarks-2.2.0 lib/derailed_benchmarks/auth_helper.rb
derailed_benchmarks-2.1.2 lib/derailed_benchmarks/auth_helper.rb
derailed_benchmarks-2.1.1 lib/derailed_benchmarks/auth_helper.rb
derailed_benchmarks-2.1.0 lib/derailed_benchmarks/auth_helper.rb
derailed_benchmarks-2.0.1 lib/derailed_benchmarks/auth_helper.rb
derailed_benchmarks-2.0.0 lib/derailed_benchmarks/auth_helper.rb
derailed_benchmarks-1.8.1 lib/derailed_benchmarks/auth_helper.rb
derailed_benchmarks-1.8.0 lib/derailed_benchmarks/auth_helper.rb
derailed_benchmarks-1.7.0 lib/derailed_benchmarks/auth_helper.rb
gitlab-derailed_benchmarks-1.6.1 lib/derailed_benchmarks/auth_helper.rb
derailed_benchmarks-1.6.0 lib/derailed_benchmarks/auth_helper.rb
derailed_benchmarks-1.5.0 lib/derailed_benchmarks/auth_helper.rb
derailed_benchmarks-1.4.3 lib/derailed_benchmarks/auth_helper.rb
derailed_benchmarks-1.4.2 lib/derailed_benchmarks/auth_helper.rb
derailed_benchmarks-1.4.1 lib/derailed_benchmarks/auth_helper.rb
derailed_benchmarks-1.4.0 lib/derailed_benchmarks/auth_helper.rb