0.0
No commit activity in last 3 years
No release in over 3 years
Regex constrained Basic Auth
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3

Runtime

~> 2.0
 Project Readme

Rack Regex Constrained BasicAuth Middleware

Rack::Auth::BasicPath implements basic auth for paths that match the specified RegEx.

Installation

Install the gem:

gem install rack-basic_path

Or in your Gemfile:

gem 'rack-basic_path'

Configuration

Rails Configuration

Put something similar to the code below in config/application.rb of your Rails application. This would require basic auth for anything under /webhooks/squanchy.

module YourApp
  class Application < Rails::Application
    # ...

    # Rails 5
    config.middleware.use Rack::Auth::BasicPath, "johnny_marbles@rickandmorty.com", "super-squanch", /\/webhooks\/squanchy\/.*/

  end
end