mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-13 14:44:29 -04:00
change header auth to use X-ArchiveBox-API-Key so it doesnt conflict with other auth headers
Some checks are pending
CodeQL / Analyze (${{ matrix.language }}) (none, python) (push) Waiting to run
Build Debian package / build (push) Waiting to run
Build Docker image / buildx (push) Waiting to run
Build Homebrew package / build (push) Waiting to run
Build GitHub Pages website / build (push) Waiting to run
Build GitHub Pages website / deploy (push) Blocked by required conditions
Run linters / lint (push) Waiting to run
Build Pip package / build (push) Waiting to run
Run tests / python_tests (ubuntu-22.04, 3.11) (push) Waiting to run
Run tests / docker_tests (push) Waiting to run
Some checks are pending
CodeQL / Analyze (${{ matrix.language }}) (none, python) (push) Waiting to run
Build Debian package / build (push) Waiting to run
Build Docker image / buildx (push) Waiting to run
Build Homebrew package / build (push) Waiting to run
Build GitHub Pages website / build (push) Waiting to run
Build GitHub Pages website / deploy (push) Blocked by required conditions
Run linters / lint (push) Waiting to run
Build Pip package / build (push) Waiting to run
Run tests / python_tests (ubuntu-22.04, 3.11) (push) Waiting to run
Run tests / docker_tests (push) Waiting to run
This commit is contained in:
parent
09360fd191
commit
b90ba6c909
1 changed files with 9 additions and 9 deletions
|
@ -79,29 +79,29 @@ class UserPassAuthCheck:
|
||||||
|
|
||||||
### Django-Ninja-Provided Auth Methods
|
### Django-Ninja-Provided Auth Methods
|
||||||
|
|
||||||
class UsernameAndPasswordAuth(UserPassAuthCheck, HttpBasicAuth):
|
class HeaderTokenAuth(APITokenAuthCheck, APIKeyHeader):
|
||||||
"""Allow authenticating by passing username & password via HTTP Basic Authentication (not recommended)"""
|
"""Allow authenticating by passing X-API-Key=xyz as a request header"""
|
||||||
|
param_name = "X-ArchiveBox-API-Key"
|
||||||
|
|
||||||
|
class BearerTokenAuth(APITokenAuthCheck, HttpBearer):
|
||||||
|
"""Allow authenticating by passing Bearer=xyz as a request header"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
class QueryParamTokenAuth(APITokenAuthCheck, APIKeyQuery):
|
class QueryParamTokenAuth(APITokenAuthCheck, APIKeyQuery):
|
||||||
"""Allow authenticating by passing api_key=xyz as a GET/POST query parameter"""
|
"""Allow authenticating by passing api_key=xyz as a GET/POST query parameter"""
|
||||||
param_name = "api_key"
|
param_name = "api_key"
|
||||||
|
|
||||||
class HeaderTokenAuth(APITokenAuthCheck, APIKeyHeader):
|
class UsernameAndPasswordAuth(UserPassAuthCheck, HttpBasicAuth):
|
||||||
"""Allow authenticating by passing X-API-Key=xyz as a request header"""
|
"""Allow authenticating by passing username & password via HTTP Basic Authentication (not recommended)"""
|
||||||
param_name = "X-API-Key"
|
|
||||||
|
|
||||||
class BearerTokenAuth(APITokenAuthCheck, HttpBearer):
|
|
||||||
"""Allow authenticating by passing Bearer=xyz as a request header"""
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
### Enabled Auth Methods
|
### Enabled Auth Methods
|
||||||
|
|
||||||
API_AUTH_METHODS = [
|
API_AUTH_METHODS = [
|
||||||
QueryParamTokenAuth(),
|
|
||||||
HeaderTokenAuth(),
|
HeaderTokenAuth(),
|
||||||
BearerTokenAuth(),
|
BearerTokenAuth(),
|
||||||
|
QueryParamTokenAuth(),
|
||||||
django_auth_superuser,
|
django_auth_superuser,
|
||||||
UsernameAndPasswordAuth(),
|
UsernameAndPasswordAuth(),
|
||||||
]
|
]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue