Helper for db based domain auth
Installation
pip install spkcspider-domainauth
settings:
...
INSTALLED_APPS = [
...
spider_domainauth
...
]
DOMAINAUTH_URL = 'spider_domainauth:domainauth-db'
Usage:
url based:
from django.conf import settings
from django.shortcuts import resolve_url
response = requests.post(
resolve_url(settings.DOMAINAUTH_URL),
{
"urls": "http://foo/component/list/"
}
)
token = response.json["tokens"]["foo"]
Module based:
from spider_domainauth.models import ReverseToken
from django.shortcuts import resolve_url
# overloaded create method
rtoken = ReverseToken.objects.create()
"http://foo/token/list/?intent=domain&referrer={referrer}&payload={token}".format(
referrer=resolve_url(settings.DOMAINAUTH_URL),
token=rtoken.token
)
e.refresh_from_db()
# note: it is not token but secret, reason: token is reused and prefixed with id (for uniqueness)
e.secret
Settings:
- DOMAINAUTH_RATELIMIT_FUNC: ratelimit access tries, can be also used to limit number of tokens
- DOMAINAUTH_LIFETIME: token lifetime (default 1 hour) (Note: if "url based"-method is used, the token is automatically deleted afterwards)
- DOMAINAUTH_URL: url to domain auth view (required for external users)
TODO:
- overload other manager methods
- better examples
Metadata
Release files for spkcspider-domainauth 0.6.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| spkcspider-domainauth-0.6.2.tar.gz | 6.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| spkcspider_domainauth-0.6.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.5 kB
Release files / spkcspider-domainauth-0.6.2.tar.gz
| Download URL | spkcspider-domainauth-0.6.2.tar.gz |
|---|---|
| Size | 6.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
39fa6339e087f3fd283f44beb3e1eb33774f74c88b6cee985c66ada1376ac058
|
|
BLAKE2b-256 checksum How to use checksums |
b7391313734ca2d4f67928c48c150dbdef7da84d2f05cf99d5ede6000c5056e3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/0.12.17 CPython/3.7.4 Linux/5.3.6-arch1-1-ARCH
|
Release files / spkcspider_domainauth-0.6.2-py3-none-any.whl
| Download URL | spkcspider_domainauth-0.6.2-py3-none-any.whl |
|---|---|
| Size | 7.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
25c729faca4295c5b30e49a8e1bedc1628da73ef38d1e077eb6ef4be59ba74cd
|
|
BLAKE2b-256 checksum How to use checksums |
f9accb40998097176a3e0ed5fcada4db6f7d0570940d220dbc317c1278cf9a8f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/0.12.17 CPython/3.7.4 Linux/5.3.6-arch1-1-ARCH
|
Security for spkcspider-domainauth 0.6.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.