reviewboard.accounts.forms.auth¶
- class ActiveDirectorySettingsForm(siteconfig: SiteConfiguration, *args, **kwargs)[source]¶
Bases:
SiteSettingsForm
A form for configuring the Active Directory authentication backend.
- class Meta[source]¶
Bases:
object
- fieldsets = ((None, {'fields': ('auth_ad_domain_name', 'auth_ad_use_tls', 'auth_ad_find_dc_from_dns', 'auth_ad_domain_controller')}), ('Access Control Settings', {'fields': ('auth_ad_ou_name', 'auth_ad_group_name')}), ('Advanced Settings', {'fields': ('auth_ad_search_root', 'auth_ad_recursion_depth')}))[source]¶
- __annotations__ = {}¶
- 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>}¶
- class StandardAuthSettingsForm(*args, **kwargs)[source]¶
Bases:
SiteSettingsForm
A form for configuring the builtin authentication backend.
- __init__(*args, **kwargs)[source]¶
Initialize the form.
- Parameters:
siteconfig (
djblets.siteconfig.models.SiteConfiguration
) – The site configuration to work with on the form.*args (
tuple
) – Positional arguments to pass to the parent constructor.**kwargs (
dict
) – Keyword arguments to pass to the parent constructor.
- 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.
- __annotations__ = {}¶
- 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>}¶
- class HTTPBasicSettingsForm(siteconfig: SiteConfiguration, *args, **kwargs)[source]¶
Bases:
SiteSettingsForm
A form for configuring the HTTP Digest authentication backend.
- __annotations__ = {}¶
- declared_fields = {'auth_digest_file_location': <django.forms.fields.CharField object>, 'auth_digest_realm': <django.forms.fields.CharField object>}¶
- class LDAPSettingsForm(*args, **kwargs)[source]¶
Bases:
SiteSettingsForm
A form for configuring the LDAP authentication backend.
- __init__(*args, **kwargs)[source]¶
Initialize the form.
- Parameters:
siteconfig (
djblets.siteconfig.models.SiteConfiguration
) – The site configuration to work with on the form.*args (
tuple
) – Positional arguments to pass to the parent constructor.**kwargs (
dict
) – Keyword arguments to pass to the parent constructor.
- class Meta[source]¶
Bases:
object
- fieldsets = ((None, {'fields': ('auth_ldap_uri', 'auth_ldap_tls', 'auth_ldap_anon_bind_uid', 'auth_ldap_anon_bind_passwd', 'auth_ldap_base_dn')}), ('User Lookups', {'fields': ('auth_ldap_uid', 'auth_ldap_given_name_attribute', 'auth_ldap_surname_attribute', 'auth_ldap_full_name_attribute', 'auth_ldap_email_attribute', 'auth_ldap_email_domain', 'auth_ldap_uid_mask')}))[source]¶
- __annotations__ = {}¶
- 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>}¶
- class LegacyAuthModuleSettingsForm(siteconfig: SiteConfiguration, *args, **kwargs)[source]¶
Bases:
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.
- __annotations__ = {}¶
- declared_fields = {'custom_backends': <django.forms.fields.CharField object>}¶
- class NISSettingsForm(siteconfig: SiteConfiguration, *args, **kwargs)[source]¶
Bases:
SiteSettingsForm
A form for configuring the NIS authentication backend.
- __annotations__ = {}¶
- declared_fields = {'auth_nis_email_domain': <django.forms.fields.CharField object>}¶
- class X509SettingsForm(siteconfig: SiteConfiguration, *args, **kwargs)[source]¶
Bases:
SiteSettingsForm
A form for configuring the X509 certificate authentication backend.
- __annotations__ = {}¶
- 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>}¶
- 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.
- 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:
- Raises:
django.core.exceptions.ValidationError – The data in the form was not valid.
- class AuthenticationForm(request=None, *args, **kwargs)[source]¶
Bases:
ReviewBoardAuthenticationFormMixin
,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.
- __annotations__ = {}¶
- declared_fields = {'password': <django.forms.fields.CharField object>, 'username': <django.contrib.auth.forms.UsernameField object>}¶