AuthKit

 

basic

HTTP basic authentication middleware

This implementation is identical to the paste.auth.basic implemenation.

Note:: If users are prompted to sign in this also seems to have the effect of
signing them out.

Attributes

a ACCEPT

<_MultiValueHeader Accept (RFC 2616, 14.1)>

a ACCEPT_CHARSET

<_MultiValueHeader Accept-Charset (RFC 2616, 14.2)>

a ACCEPT_ENCODING

<_MultiValueHeader Accept-Encoding (RFC 2616, 14.3)>

a ACCEPT_LANGUAGE

<_AcceptLanguage Accept-Language (RFC 2616, 14.4)>

a ACCEPT_RANGES

<_AcceptRanges Accept-Ranges (RFC 2616, 14.5)>

a AGE

<_SingleValueHeader Age (RFC 2616, 14.6)>

a ALLOW

<_MultiValueHeader Allow (RFC 2616, 14.7)>

a AUTHORIZATION

<_Authorization Authorization (RFC 2617)>

a AUTH_TYPE

<EnvironVariable AUTH_TYPE>

a CACHE_CONTROL

<_CacheControl Cache-Control (RFC 2616, 14.9)>

a CONNECTION

<_MultiValueHeader Connection (RFC 2616, 14.10)>

a CONTENT_DISPOSITION

<_ContentDisposition Content-Disposition (RFC 2183)>

a CONTENT_ENCODING

<_MultiValueHeader Content-Encoding (RFC 2616, 14.11)>

a CONTENT_LANGUAGE

<_MultiValueHeader Content-Language (RFC 2616, 14.12)>

a CONTENT_LENGTH

<_ContentLength Content-Length (RFC 2616, 14.13)>

a CONTENT_LOCATION

<_SingleValueHeader Content-Location (RFC 2616, 14.14)>

a CONTENT_MD5

<_SingleValueHeader Content-MD5 (RFC 2616, 14.15)>

a CONTENT_RANGE

<_ContentRange Content-Range (RFC 2616, 14.6)>

a CONTENT_TYPE

<_ContentType Content-Type (RFC 2616, 14.17)>

a COOKIE

<_MultiValueHeader Cookie (RFC 2109/Netscape)>

a DATE

<_DateHeader Date (RFC 2616, 14.18)>

a ETAG

<_SingleValueHeader ETag (RFC 2616, 14.19)>

a EXPECT

<_MultiValueHeader Expect (RFC 2616, 14.20)>

a EXPIRES

<_DateHeader Expires (RFC 2616, 14.21)>

a FROM

<_SingleValueHeader From (RFC 2616, 14.22)>

a HOST

<_SingleValueHeader Host (RFC 2616, 14.23)>

a IF_MATCH

<_MultiValueHeader If-Match (RFC 2616, 14.24)>

a IF_MODIFIED_SINCE

<_IfModifiedSince If-Modified-Since (RFC 2616, 14.25)>

a IF_NONE_MATCH

<_MultiValueHeader If-None-Match (RFC 2616, 14.26)>

a IF_RANGE

<_SingleValueHeader If-Range (RFC 2616, 14.27)>

a IF_UNMODIFIED_SINCE

<_DateHeader If-Unmodified-Since (RFC 2616, 14.28)>

a LAST_MODIFIED

<_DateHeader Last-Modified (RFC 2616, 14.29)>

a LOCATION

<_SingleValueHeader Location (RFC 2616, 14.30)>

a MAX_FORWARDS

<_SingleValueHeader Max-Forwards (RFC 2616, 14.31)>

a PATH_INFO

<EnvironVariable PATH_INFO>

a PRAGMA

<_MultiValueHeader Pragma (RFC 2616, 14.32)>

a PROXY_AUTHENTICATE

<_MultiValueHeader Proxy-Authenticate (RFC 2616, 14.33)>

a PROXY_AUTHORIZATION

<_SingleValueHeader Proxy-Authorization (RFC 2616, 14.34)>

a RANGE

<_Range Range (RFC 2616, 14.35)>

a REFERER

<_SingleValueHeader Referer (RFC 2616, 14.36)>

a REMOTE_SESSION

<EnvironVariable REMOTE_SESSION>

a REMOTE_USER

<EnvironVariable REMOTE_USER>

a REQUEST_METHOD

<EnvironVariable REQUEST_METHOD>

a RETRY_AFTER

<_SingleValueHeader Retry-After (RFC 2616, 14.37)>

a SCRIPT_NAME

<EnvironVariable SCRIPT_NAME>

a SERVER

<_SingleValueHeader Server (RFC 2616, 14.38)>

a SET_COOKIE

<_MultiEntryHeader Set-Cookie (RFC 2109/Netscape)>

a TE

<_MultiValueHeader TE (RFC 2616, 14.39)>

a TRAILER

<_MultiValueHeader Trailer (RFC 2616, 14.40)>

a TRANSFER_ENCODING

<_MultiValueHeader Transfer-Encoding (RFC 2616, 14.41)>

a UPGRADE

<_MultiValueHeader Upgrade (RFC 2616, 14.42)>

a USER_AGENT

<_SingleValueHeader User-Agent (RFC 2616, 14.43)>

a VARY

<_MultiValueHeader Vary (RFC 2616, 14.44)>

a VIA

<_MultiValueHeader Via (RFC 2616, 14.45)>

a WARNING

<_MultiEntryHeader Warning (RFC 2616, 14.46)>

a WWW_AUTHENTICATE

<_MultiEntryHeader WWW-Authenticate (RFC 2616, 14.47)>

Functions

f load_basic_config(app, auth_conf, app_conf=None, global_conf=None, prefix='authkit.basic') ...

f make_basic_auth_handler(app, auth_conf, app_conf=None, global_conf=None, prefix='authkit.basic') ...

f make_basic_handler(app, auth_conf, app_conf=None, global_conf=None, prefix='authkit.basic') ...

Classes

C AuthBasicAuthenticator(...) ...

implements Basic authentication details

This class contains 5 members.

C AuthBasicHandler(...) ...

HTTP/1.0 Basic authentication middleware

Parameters:

application

The application object is called only upon successful authentication, and can assume environ['REMOTE_USER'] is set. If the REMOTE_USER is already set, this middleware is simply pass-through.

realm

This is a identifier for the authority that is requesting authorization. It is shown to the user and should be unique within the domain it is being used.

authfunc

This is a mandatory user-defined function which takes a username and password for its first and second arguments respectively. It should return True if the user is authenticated.

This class contains 2 members.

C BasicAuthHandler(...) ...

HTTP/1.0 Basic authentication middleware

Parameters:

application

The application object is called only upon successful authentication, and can assume environ['REMOTE_USER'] is set. If the REMOTE_USER is already set, this middleware is simply pass-through.

realm

This is a identifier for the authority that is requesting authorization. It is shown to the user and should be unique within the domain it is being used.

authfunc

This is a mandatory user-defined function which takes a username and password for its first and second arguments respectively. It should return True if the user is authenticated.

This class contains 2 members.

C BasicUserSetter(...) ...

This class contains 2 members.

C TryToAddUsername(...) ...

This class contains 2 members.

C middleware(...) ...

HTTP/1.0 Basic authentication middleware

Parameters:

application

The application object is called only upon successful authentication, and can assume environ['REMOTE_USER'] is set. If the REMOTE_USER is already set, this middleware is simply pass-through.

realm

This is a identifier for the authority that is requesting authorization. It is shown to the user and should be unique within the domain it is being used.

authfunc

This is a mandatory user-defined function which takes a username and password for its first and second arguments respectively. It should return True if the user is authenticated.

This class contains 2 members.

See the source for more information.