No project description provided
Project description
aboutcode.api_auth
Secured APIToken model and related APITokenAuthentication class.
Install
pip install aboutcode.api_auth
Define the APIToken model
In your main models.py module:
from aboutcode.api_auth import AbstractAPIToken
class APIToken(AbstractAPIToken):
class Meta:
verbose_name = "API Token"
Generate and apply schema migration:
$ ./manage.py makemigrations
$ ./manage.py migrate
Authenticator settings
Declare your APIToken model location in the API_TOKEN_MODEL setting:
API_TOKEN_MODEL = "app.APIToken" # noqa: S105
Declare the APITokenAuthentication authentication class as one of the
REST_FRAMEWORK.DEFAULT_AUTHENTICATION_CLASSES:
REST_FRAMEWORK = {
"DEFAULT_AUTHENTICATION_CLASSES": (
"aboutcode.api_auth.APITokenAuthentication",
),
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aboutcode_api_auth-0.1.0.tar.gz.
File metadata
- Download URL: aboutcode_api_auth-0.1.0.tar.gz
- Upload date:
- Size: 15.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3f186f1b53cb14087b0e3c99fba6a4812679b3a810f2ca8645955bb0838b1771
|
|
| MD5 |
78c8500e61e3d8cc2145a72fa04666da
|
|
| BLAKE2b-256 |
941a0786b8dd83b4f7b84797ce5fe84b3363bfc7995f0a77afb957fa87e7a46f
|
Provenance
The following attestation bundles were made for aboutcode_api_auth-0.1.0.tar.gz:
Publisher:
publish-pypi-release-aboutcode-api-auth.yml on aboutcode-org/dejacode
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aboutcode_api_auth-0.1.0.tar.gz -
Subject digest:
3f186f1b53cb14087b0e3c99fba6a4812679b3a810f2ca8645955bb0838b1771 - Sigstore transparency entry: 1035296739
- Sigstore integration time:
-
Permalink:
aboutcode-org/dejacode@78662f826d42245546ee6eed3295879cc5147a16 -
Branch / Tag:
refs/tags/aboutcode.api_auth/0.1.0 - Owner: https://github.com/aboutcode-org
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi-release-aboutcode-api-auth.yml@78662f826d42245546ee6eed3295879cc5147a16 -
Trigger Event:
push
-
Statement type:
File details
Details for the file aboutcode_api_auth-0.1.0-py3-none-any.whl.
File metadata
- Download URL: aboutcode_api_auth-0.1.0-py3-none-any.whl
- Upload date:
- Size: 17.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ee17edb5811167642affadb28e17187b5b226de99b861135600c5794ef127bee
|
|
| MD5 |
8b7f6fdbb94ccf0f78bb83ff35a85a85
|
|
| BLAKE2b-256 |
0be156c2622c69095e78e6a3c313d52a25b39c81c0cea3c9b2718669327f9fc5
|
Provenance
The following attestation bundles were made for aboutcode_api_auth-0.1.0-py3-none-any.whl:
Publisher:
publish-pypi-release-aboutcode-api-auth.yml on aboutcode-org/dejacode
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aboutcode_api_auth-0.1.0-py3-none-any.whl -
Subject digest:
ee17edb5811167642affadb28e17187b5b226de99b861135600c5794ef127bee - Sigstore transparency entry: 1035296808
- Sigstore integration time:
-
Permalink:
aboutcode-org/dejacode@78662f826d42245546ee6eed3295879cc5147a16 -
Branch / Tag:
refs/tags/aboutcode.api_auth/0.1.0 - Owner: https://github.com/aboutcode-org
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi-release-aboutcode-api-auth.yml@78662f826d42245546ee6eed3295879cc5147a16 -
Trigger Event:
push
-
Statement type: