ulif.openoffice.htaccess – WSGI authentication middleware

htaccess - Authenticate users against htaccess files

A plain WSGI middleware to authenticate users against regular Apache-style htaccess files.

Note

This middleware does not support MD5 hashes.

ulif.openoffice.htaccess.check_credentials(username, password, htaccess, auth_type='sha1')

Check password for user username in htaccess.

Check whether the file in path htaccess contains a line with a password for user username.

The password is clear text, while htaccess contains an encrypted (or plain text) password.

We support crypt, SHA1 and plain text passwords in htaccess. MD5 is not supported as the Apache algorithm for MD5 in htaccess files differs significantly from standard MD5 and is not available in Python standard libs.

The given htaccess file can be modified with the standard Apache htpasswd command (as long as you do not create MD5 entries).

ulif.openoffice.htaccess.make_htaccess(app, global_conf, realm, htaccess, auth_type='sha1', **kw)

Paste plugin providing the Htaccess evaluating middleware.

realm -
The realm for which basic auth access is granted.
htaccess -
Path to an Apache htacces-style file.