Basic
A package for creating and reading config files for basic authentication.
Purpose
A lot of APIs use basic authentication, this is where you concatenate username and password separated by a : and encode them with base64 then prefix with Basic. So username:password encoded with base64 becomes Basic dXNlcm5hbWU6cGFzc3dvcmQ=. This package manages the encoding and storing of this configuration so it can be easily retrieve and used.
Usage
Getting started is easy, first install the package using pip install basic
Next you can create your auth dict
form basic_auth import Auth
CONFIG = Auth().basic_config("url", Auth().encode("username", "password"))
Write it to file
Auth().create_config("basic_config.json", CONFIG)
To read it in your own scripts
CONFIG = Auth().read_config("basic_config.json")
Have a read of simple.py
There's some examples in the Examples directory
general.py supports both interactive input and arguments.
python3 Examples/general.py -url example.com -username user1 -password hunter2
and
python3 Examples/general.py
WSO.py shows how to use it and insert your own custom fields too.
Details
This will create a folder called config and store the config in a json file with the following structure
{
"url": "url",
"authorization": "Basic dXNlcm5hbWU6cGFzc3dvcmQ="
}
Metadata
Release files for basic-auth 0.0.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 | Actions |
|---|---|---|---|---|
| basic_auth-0.0.2.tar.gz | 6.0 kB | Without provenance | Details for basic_auth-0.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| basic_auth-0.0.2-py3-none-any.whl | Python 3 | none | any | Details for basic_auth-0.0.2-py3-none-any.whl |
Total release size: 18.6 kB
Release files / basic_auth-0.0.2.tar.gz
| Download URL | basic_auth-0.0.2.tar.gz |
|---|---|
| Size | 6.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
212ddd50b242bd7b19bbcd4a811cfc4e5d9137dcf4d4e8d054b3b152cda17442
|
|
BLAKE2b-256 checksum How to use checksums |
ffa0c56116cf6fe3ccc617b5cc96e4a10ca94bc0f5393b300433839a3979a977
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.8.0
|
Release files / basic_auth-0.0.2-py3-none-any.whl
| Download URL | basic_auth-0.0.2-py3-none-any.whl |
|---|---|
| Size | 12.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1d29659242184c13931eece26a165b152255e8dc8dbf22be2f149e152d9ae789
|
|
BLAKE2b-256 checksum How to use checksums |
560685e78cb41d22db06c4905f5b3dc99848edbf06afdf637747d8578e4a89a8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.8.0
|
Security for basic-auth 0.0.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.