httpauth

Software Screenshot:
httpauth
Software Details:
Version: 0.1.1
Upload Date: 20 Feb 15
Developer: Jonas Haag
Distribution Type: Freeware
Downloads: 5

Rating: nan/5 (Total Votes: 0)

httpauth is a WSGI middleware that secures some/all routes using HTTP Digest Authentication.

Installation

pip install httpauth

Using with credentials dictionary

secured_wsgi_app = httpauth.DictHttpAuthMiddleware(
 {'user1': 'password1', 'user2': 'password2'},
 wsgi_app=unsecured_wsgi_app,
 #realm='Secured Content', # optional
)


Using with a .htdigest file

secured_wsgi_app = httpauth.DigestFileHttpAuthMiddleware(
 open('/path/to/your/.htdigest'),
 wsgi_app=unsecured_wsgi_app,
)


.htdigest files can be created using the htdigest Apache tool.

Securing only some URLs

If given, the routes parameter (a list of regular expressions) specifies the URLs to be secured. (By default, all URLs are secured.)

secured_wsgi_app = httpauth.DictHttpAuthMiddleware(
 {'user': 'password'},
 wsgi_app=unsecured_wsgi_app,
 routes=['^/admin/', '^/another/secret/page/$'],
)

Requirements:

  • Python

Other Software of Developer Jonas Haag

bjoern
bjoern

11 May 15

klaus
klaus

11 Mar 16

Comments to httpauth

Comments not found
Add Comment
Turn on images!