Django Shirow
To connect to the RPC servers based on Shirow, clients have to be authenticated using the Django authentication system. Thus, the package provides the create_token_if_needed decorator which is intended for Django views. First, the decorator tries to obtain a token from Redis. Then, in case the try doesn’t succeed, create_token_if_needed will create and put it into Redis and the user’s session. Finally, the client can get the token from the session and prove the RPC server he/she is an authenticated user.
The decorator uses JWT for generating tokens. JWT (JSON Web Token) is the open standard defined in RFC 7519.
Installation
$ pip install django-shirow
Usage
This Django application uses the following configuration keys:
SECRET_KEY is a string which contains a secret. Django uses the configuration key for cryptographic signing, but create_token_if_needed uses it for signing the tokens, using the algorithm specified by TOKEN_ALGORITHM_ENCODING (see below).
TOKEN_TTL is a number which contains a time-in-seconds value. It indicates how long tokens are considered valid. If TOKEN_TTL is not set, then TTL is set to 900 (15 minutes).
TOKEN_ALGORITHM_ENCODING is a string which contains one of the algorithms used for signing tokens. If TOKEN_ALGORITHM_ENCODING is not set, then the algorithm is set to HS256.
REDIS_HOST is a string which contains the Redis host. If REDIS_HOST is not set, then the host is set to 127.0.0.1.
REDIS_PORT is a number which contains the port the Redis server listens on. If REDIS_PORT is not set, then the port is set to 6379.
Metadata
Release files for django-shirow 0.4
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 | |
|---|---|---|---|---|
| django-shirow-0.4.tar.gz | 3.2 kB | Without provenance | Details |
Release files / django-shirow-0.4.tar.gz
| Download URL | django-shirow-0.4.tar.gz |
|---|---|
| Size | 3.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9d84e3bdbb959a437bb4dd027d1709573771239e4e7c5665478886c703040ebb
|
|
BLAKE2b-256 checksum How to use checksums |
28ae6f3124119a4e951c38af137164d468c0452e921542b6d854a7a017bf0bff
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.0 CPython/3.6.7
|
Security for django-shirow 0.4
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.