challengers Package

challengers Package

The ChallengerInterface class.

class tiddlyweb.web.challengers.ChallengerInterface

Bases: object

An interface for challenging users for authentication purposes. The chalenger basically does whatever is required and may result in doing something to a response that causes the user agent’s next request to pass an extractor.

Though there is no requirement for there to be a one to one correspondence between a Challenger and an Extractor, it will often be the case that a Challenger will need a particular Extractor in order to be effective.

A Challenger is a WSGI application.

challenge_get(environ, start_response)

Respond to a GET request.

challenge_post(environ, start_response)

Respond to a POST request.

cookie_form Module

A challenger that presents or validates a form for getting a username and password.

class tiddlyweb.web.challengers.cookie_form.Challenger

Bases: tiddlyweb.web.challengers.ChallengerInterface

A simple login challenger that asks the user agent, via an HTML form, for a username and password and vaidates it against a User entity in the store.

If valid, a cookie is set in the response. This is used in subsequent requests by the simple_cookie credentials extractor.

challenge_get(environ, start_response)

Respond to a GET request by sending a form.

challenge_post(environ, start_response)

Respond to a POST by processing data sent from a form. The form should include a username and password. If it does not, send the form aagain. If it does, validate the data.

desc = 'TiddlyWeb username and password'