Jump to >

reviewboard.accounts.middleware

Middleware for account-related functionality.

class TimezoneMiddleware[source]

Bases: object

Middleware that activates the user’s local timezone.

process_request(request)[source]

Activate the user’s selected timezone for this request.

class UpdateLastLoginMiddleware[source]

Bases: object

Middleware that updates a user’s last login time more frequently.

This will update the user’s stored login time if it’s been more than 30 minutes since they last made a request. This helps turn the login time into a recent activity time, providing a better sense of how often people are actively using Review Board.

UPDATE_PERIOD_SECS = 1800[source]

The smallest period of time between login time updates.

process_request(request)[source]

Process the request and update the login time.

Parameters:request (django.http.HttpRequest) – The HTTP request from the client.
class X509AuthMiddleware[source]

Bases: object

Middleware that authenticates a user using X.509 certificates.

If Review Board is configured to use the X.509 authentication backend, this will automatically authenticate the user using the environment variables set by mod_ssl.

Apache needs to be configured with mod_ssl. For Review Board to be usable with X.509 client certificate authentication, the SSLVerifyClient configuration directive should be set to optional. This will ensure that basic authentication will still work, allowing clients to work with a username and password.

process_request(request)[source]

Log in users by their certificate if using X.509 authentication.

This will only log in a user if the request environment (not the headers) are populated with a pre-verified username, and the request is being handled over HTTPS.

Parameters:request (django.http.HttpRequest) – The HTTP request from the client.