archivebox.api.auth
Module Contents
Classes
The base class for authentication methods that use an api.models.APIToken |
|
The base class for authentication methods that use a username & password |
|
Allow authenticating by passing X-API-Key=xyz as a request header |
|
Allow authenticating by passing Bearer=xyz as a request header |
|
Allow authenticating by passing api_key=xyz as a GET/POST query parameter |
|
Allow authenticating by passing username & password via HTTP Basic Authentication (not recommended) |
Functions
Given an API token string, check if a corresponding non-expired APIToken exists, and return its user |
|
Given a username and password, check if they are valid and return the corresponding user |
Data
API
- archivebox.api.auth.auth_using_token(token, request: Optional[django.http.HttpRequest] = None) Optional[django.contrib.auth.models.AbstractBaseUser] [source]
Given an API token string, check if a corresponding non-expired APIToken exists, and return its user
- archivebox.api.auth.auth_using_password(username, password, request: Optional[django.http.HttpRequest] = None) Optional[django.contrib.auth.models.AbstractBaseUser] [source]
Given a username and password, check if they are valid and return the corresponding user
- class archivebox.api.auth.APITokenAuthCheck[source]
The base class for authentication methods that use an api.models.APIToken
- class archivebox.api.auth.UserPassAuthCheck[source]
The base class for authentication methods that use a username & password
- class archivebox.api.auth.HeaderTokenAuth[source]
Bases:
archivebox.api.auth.APITokenAuthCheck
,ninja.security.APIKeyHeader
Allow authenticating by passing X-API-Key=xyz as a request header
- class archivebox.api.auth.BearerTokenAuth[source]
Bases:
archivebox.api.auth.APITokenAuthCheck
,ninja.security.HttpBearer
Allow authenticating by passing Bearer=xyz as a request header
- class archivebox.api.auth.QueryParamTokenAuth[source]
Bases:
archivebox.api.auth.APITokenAuthCheck
,ninja.security.APIKeyQuery
Allow authenticating by passing api_key=xyz as a GET/POST query parameter
- class archivebox.api.auth.UsernameAndPasswordAuth[source]
Bases:
archivebox.api.auth.UserPassAuthCheck
,ninja.security.HttpBasicAuth
Allow authenticating by passing username & password via HTTP Basic Authentication (not recommended)