intranet.apps.auth package¶
Subpackages¶
Submodules¶
intranet.apps.auth.apps module¶
intranet.apps.auth.backends module¶
-
class
intranet.apps.auth.backends.KerberosAuthenticationBackend[source]¶ Bases:
objectAuthenticate using Kerberos.
This is the default authentication backend.
-
authenticate(request, username=None, password=None)[source]¶ Authenticate a username-password pair.
Creates a new user if one is not already in the database.
- Parameters
username – The username of the User to authenticate.
password – The password of the User to authenticate.
- Returns
User
-
static
get_kerberos_ticket(username, password)[source]¶ Attempts to create a Kerberos ticket for a user.
- Parameters
username – The username.
password – The password.
- Returns
Boolean indicating success or failure of ticket creation
-
get_user(user_id)[source]¶ Returns a user, given his or her user id. Required for a custom authentication backend. :param user_id: The user id of the user to fetch.
- Returns
User or None
-
-
class
intranet.apps.auth.backends.KerberosAuthenticationResult[source]¶ Bases:
enum.EnumAn enumeration.
-
EXPIRED= -1¶
-
FAILURE= 0¶
-
SUCCESS= 1¶
-
-
class
intranet.apps.auth.backends.MasterPasswordAuthenticationBackend[source]¶ Bases:
objectAuthenticate as any user against a master password whose hash is in secret.py.
intranet.apps.auth.decorators module¶
Decorators that restrict views to certain types of users.
-
intranet.apps.auth.decorators.admin_required(group)[source]¶ Decorator that requires the user to be in a certain admin group.
For example, @admin_required(“polls”) would check whether a user is in the “admin_polls” group or in the “admin_all” group.
-
intranet.apps.auth.decorators.announcements_admin_required(view_func)¶ Restrict the wrapped view to announcements admins
-
intranet.apps.auth.decorators.attendance_taker_required(view_func)¶ Restrict the wrapped view to users who can take attendance
-
intranet.apps.auth.decorators.board_admin_required(view_func)¶ Restrict the wrapped view to board admins
-
intranet.apps.auth.decorators.eighth_admin_required(view_func)¶ Restrict the wrapped view to eighth admins
-
intranet.apps.auth.decorators.events_admin_required(view_func)¶ Restrict the wrapped view to events admins
intranet.apps.auth.forms module¶
-
class
intranet.apps.auth.forms.AuthenticateForm(request=None, *args, **kwargs)[source]¶ Bases:
django.contrib.auth.forms.AuthenticationFormImplements a login form.
-
username¶ The username text field.
-
password¶ The password text field.
-
declared_fields= {'password': <django.forms.fields.CharField object>, 'trust_device': <django.forms.fields.BooleanField object>, 'username': <django.forms.fields.CharField object>}¶
-
intranet.apps.auth.helpers module¶
intranet.apps.auth.rest_permissions module¶
intranet.apps.auth.signals module¶
intranet.apps.auth.tests module¶
-
class
intranet.apps.auth.tests.GrantAdminTest(methodName='runTest')[source]¶ Bases:
intranet.test.ion_test.IonTestCaseTests granting admin to an user.
-
class
intranet.apps.auth.tests.LoginViewTest(methodName='runTest')[source]¶ Bases:
intranet.test.ion_test.IonTestCaseTests of the login page (but not actually auth)
intranet.apps.auth.urls module¶
intranet.apps.auth.views module¶
-
class
intranet.apps.auth.views.LoginView(**kwargs)[source]¶ Bases:
django.views.generic.base.ViewLog in and redirect a user.
-
intranet.apps.auth.views.get_bg_pattern(request)[source]¶ Choose a background pattern image.
One will be selected at random.
-
intranet.apps.auth.views.get_week_sports_school_events() → Tuple[Container[intranet.apps.events.models.Event], Container[intranet.apps.events.models.Event]][source]¶ Lists the sports/school events for the next week. This information is cached.
- Returns
A 2-tuple of (sports events, school events) for the next week.