Jump to >

reviewboard.accounts.forms.auth

class ActiveDirectorySettingsForm(siteconfig, *args, **kwargs)[source]

Bases: djblets.siteconfig.forms.SiteSettingsForm

A form for configuring the Active Directory authentication backend.

load()[source]

Load the data for the form.

class Meta[source]
title = u'Active Directory Authentication Settings'[source]
fieldsets = ((None, {u'fields': (u'auth_ad_domain_name', u'auth_ad_use_tls', u'auth_ad_find_dc_from_dns', u'auth_ad_domain_controller')}), (u'Access Control Settings', {u'fields': (u'auth_ad_ou_name', u'auth_ad_group_name')}), (u'Advanced Settings', {u'fields': (u'auth_ad_search_root', u'auth_ad_recursion_depth')}))[source]
declared_fields = {'auth_ad_domain_controller': <django.forms.fields.CharField object>, 'auth_ad_domain_name': <django.forms.fields.CharField object>, 'auth_ad_find_dc_from_dns': <django.forms.fields.BooleanField object>, 'auth_ad_group_name': <django.forms.fields.CharField object>, 'auth_ad_ou_name': <django.forms.fields.CharField object>, 'auth_ad_recursion_depth': <django.forms.fields.IntegerField object>, 'auth_ad_search_root': <django.forms.fields.CharField object>, 'auth_ad_use_tls': <django.forms.fields.BooleanField object>}[source]
class StandardAuthSettingsForm(*args, **kwargs)[source]

Bases: djblets.siteconfig.forms.SiteSettingsForm

A form for configuring the builtin authentication backend.

__init__(*args, **kwargs)[source]
clean_recaptcha_public_key()[source]

Validate that the reCAPTCHA public key is specified if needed.

clean_recaptcha_private_key()[source]

Validate that the reCAPTCHA private key is specified if needed.

class Meta[source]
title = u'Registration Settings'[source]
fieldsets = ((None, {u'fields': (u'auth_enable_registration',)}), (u'reCAPTCHA Settings', {u'fields': (u'auth_registration_show_captcha', u'recaptcha_public_key', u'recaptcha_private_key')}))[source]
declared_fields = {'auth_enable_registration': <django.forms.fields.BooleanField object>, 'auth_registration_show_captcha': <django.forms.fields.BooleanField object>, 'recaptcha_private_key': <django.forms.fields.CharField object>, 'recaptcha_public_key': <django.forms.fields.CharField object>}[source]
class HTTPBasicSettingsForm(siteconfig, *args, **kwargs)[source]

Bases: djblets.siteconfig.forms.SiteSettingsForm

A form for configuring the HTTP Digest authentication backend.

class Meta[source]
title = u'HTTP Digest Authentication Settings'[source]
declared_fields = {'auth_digest_file_location': <django.forms.fields.CharField object>, 'auth_digest_realm': <django.forms.fields.CharField object>}[source]
class LDAPSettingsForm(*args, **kwargs)[source]

Bases: djblets.siteconfig.forms.SiteSettingsForm

A form for configuring the LDAP authentication backend.

__init__(*args, **kwargs)[source]
load()[source]

Load the data for the form.

class Meta[source]
title = u'LDAP Authentication Settings'[source]
fieldsets = ((None, {u'fields': (u'auth_ldap_uri', u'auth_ldap_tls', u'auth_ldap_anon_bind_uid', u'auth_ldap_anon_bind_passwd', u'auth_ldap_base_dn')}), (u'User Lookups', {u'fields': (u'auth_ldap_uid', u'auth_ldap_given_name_attribute', u'auth_ldap_surname_attribute', u'auth_ldap_full_name_attribute', u'auth_ldap_email_attribute', u'auth_ldap_email_domain', u'auth_ldap_uid_mask')}))[source]
declared_fields = {'auth_ldap_anon_bind_passwd': <django.forms.fields.CharField object>, 'auth_ldap_anon_bind_uid': <django.forms.fields.CharField object>, 'auth_ldap_base_dn': <django.forms.fields.CharField object>, 'auth_ldap_email_attribute': <django.forms.fields.CharField object>, 'auth_ldap_email_domain': <django.forms.fields.CharField object>, 'auth_ldap_full_name_attribute': <django.forms.fields.CharField object>, 'auth_ldap_given_name_attribute': <django.forms.fields.CharField object>, 'auth_ldap_surname_attribute': <django.forms.fields.CharField object>, 'auth_ldap_tls': <django.forms.fields.BooleanField object>, 'auth_ldap_uid': <django.forms.fields.CharField object>, 'auth_ldap_uid_mask': <django.forms.fields.CharField object>, 'auth_ldap_uri': <django.forms.fields.CharField object>}[source]
class LegacyAuthModuleSettingsForm(siteconfig, *args, **kwargs)[source]

Bases: djblets.siteconfig.forms.SiteSettingsForm

A form for configuring old-style custom authentication backends.

Newer authentication backends are registered via the extensions framework, but there used to be a method by which users just put in a list of python module paths. This form allows that configuration to be edited.

load()[source]

Load the data for the form.

save()[source]

Save the form.

class Meta[source]
title = u'Legacy Authentication Module Settings'[source]
save_blacklist = (u'custom_backends',)[source]
declared_fields = {'custom_backends': <django.forms.fields.CharField object>}[source]
class NISSettingsForm(siteconfig, *args, **kwargs)[source]

Bases: djblets.siteconfig.forms.SiteSettingsForm

A form for configuring the NIS authentication backend.

class Meta[source]
title = u'NIS Authentication Settings'[source]
declared_fields = {'auth_nis_email_domain': <django.forms.fields.CharField object>}[source]
class X509SettingsForm(siteconfig, *args, **kwargs)[source]

Bases: djblets.siteconfig.forms.SiteSettingsForm

A form for configuring the X509 certificate authentication backend.

clean_auth_x509_username_regex()[source]

Validate that the specified regular expression is valid.

class Meta[source]
title = u'X.509 Client Certificate Authentication Settings'[source]
declared_fields = {'auth_x509_autocreate_users': <django.forms.fields.BooleanField object>, 'auth_x509_custom_username_field': <django.forms.fields.CharField object>, 'auth_x509_username_field': <django.forms.fields.ChoiceField object>, 'auth_x509_username_regex': <django.forms.fields.CharField object>}[source]
class ReviewBoardAuthenticationFormMixin[source]

Bases: object

Mixin for enhancing authentication forms.

This extends Django’s built-in AuthenticationForm implementation to allow users to specify their e-mail address in place of their username. In addition, it also tracks the number of failed login attempts for a given time frame, and informs the user whether the maximum number of attempts have been exceeded.

username = <django.forms.fields.CharField object>[source]
clean_username()[source]

Validate the ‘username’ field.

In case the given text is not a user found on the system, attempt a look-up using it as an e-mail address and change the user-entered text so that login can succeed.

clean()[source]

Validate the authentication form.

In case authentication has failed for the given user, Djblets’s rate limiting feature will increment the number of failed login attempts until the maximum number of attempts have been reached. The user will have to wait until the rate limit time period is over before trying again.

Returns:The cleaned data for all fields in the form.
Return type:dict
Raises:django.core.exceptions.ValidationError – The data in the form was not valid.
class AuthenticationForm(request=None, *args, **kwargs)[source]

Bases: reviewboard.accounts.forms.auth.ReviewBoardAuthenticationFormMixin, django.contrib.auth.forms.AuthenticationForm

Standard authentication form for Review Board.

This is the form used whenever a user is logging into Review Board. It will allow e-mail addresses or usernames for authentication, and will rate limit login attempts.

declared_fields = {'password': <django.forms.fields.CharField object>, 'username': <django.contrib.auth.forms.UsernameField object>}[source]