auth (certego_saas.apps.auth)

backend.py


class certego_saas.apps.auth.backend.CachedCookieTokenAuthentication[source]

Bases: durin.auth.CachedTokenAuthentication

Extends durin.auth.CachedTokenAuthentication.

Authentication backend that checks for auth token inside both: - Cookie with key TOKEN_COOKIE_NAME (default CERTEGO_SAAS_AUTH_TOKEN) - Header with key Authorization

authenticate(request: rest_framework.request.Request)[source]

Authenticate the request and return a two-tuple of (user, token).

class certego_saas.apps.auth.backend.CookieTokenAuthentication[source]

Bases: durin.auth.TokenAuthentication

Extends durin.auth.TokenAuthentication.

Authentication backend that checks for auth token inside both: - Cookie with key TOKEN_COOKIE_NAME (default CERTEGO_SAAS_AUTH_TOKEN) - Header with key Authorization

authenticate(request: rest_framework.request.Request)[source]

Authenticate the request and return a two-tuple of (user, token).

views.py


class certego_saas.apps.auth.views.LoginView(**kwargs)[source]

Bases: durin.views.LoginView

Extends durin.views.LoginView.

Responds with Set-cookie header and empty response data.

get_client_obj(request) → durin.models.Client[source]

To get and return the associated durin.models.Client object.

:raises rest_framework.exceptions.ValidationError

class certego_saas.apps.auth.views.LogoutView(**kwargs)[source]

Bases: durin.views.LogoutView

Extends durin.views.LogoutView.

Responds with Set-cookie header and empty response data.