archivebox.api.auth
Module Contents
Classes
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 |
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: str | None, request: django.http.HttpRequest | None = None) django.contrib.auth.models.User | None[source]
Given an API token string, check if a corresponding non-expired APIToken exists, and return its user
- archivebox.api.auth.authenticated_user_from_request(request: django.http.HttpRequest) django.contrib.auth.models.User | None[source]
- archivebox.api.auth.auth_using_password(username: str | None, password: str | None, request: django.http.HttpRequest | None = None) django.contrib.auth.models.User | None[source]
Given a username and password, check if they are valid and return the corresponding user
- archivebox.api.auth._require_superuser(user: django.contrib.auth.models.User | None, request: django.http.HttpRequest, auth_method: str) django.contrib.auth.models.User | None[source]
- class archivebox.api.auth.HeaderTokenAuth[source]
Bases:
ninja.security.APIKeyHeaderAllow authenticating by passing X-API-Key=xyz as a request header
- class archivebox.api.auth.BearerTokenAuth[source]
Bases:
ninja.security.HttpBearerAllow authenticating by passing Bearer=xyz as a request header