Skip to content

Rack Middleware for authenticating requests via an http header

License

Notifications You must be signed in to change notification settings

bemurphy/rack-header-key

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rack::HeaderKey

Rack::HeaderKey is Rack Middleware for providing authorization for requests via an HTTP header. This is useful in instances where you want to authenticate some client of yours to an API where it's easier or preferrable over HTTP basic authentication.

Installation

install it via rubygems:

gem install rack-header-key

or put it in your Gemfile:

# Gemfile

gem 'rack-header-key', :require => 'rack/header_key'

Usage

In a Rack application:

# app.rb

use Rack::HeaderKey, :path => "/api", :key => "shared_key"

The optional :path value determines a specific path you choose to protect. Leaving it off will call the root path to be protected entirely.

Copyright

Copyright © 2011 Brendon Murphy. See MIT-LICENSE for details.

About

Rack Middleware for authenticating requests via an http header

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages