A very simple library to help generate signed requests.
INSTALLATION
pip install apysigner
USAGE
For a GET request
>>> import apysigner >>> private_key = 'UHJpdmF0ZSBLZXk=' >>> url = 'http://www.example.com/api-endpoint?q=find+my+thing' >>> apysigner.get_signature(private_key, url) 'zMxf77eY-xuORInBIA0azhxHPg2bzhsjz-huP-OuYKk='
For a POST request
>>> import apysigner
>>> private_key = 'UHJpdmF0ZSBLZXk='
>>> payload = {'do': 'something', 'name': 'Johnny'}
>>> url = 'http://www.example.com/api-endpoint'
>>> apysigner.get_signature(private_key, url, payload)
'CFNmvPrjW_Z1x5XO-tQzJzhs6GjeJH0k0SxOuuhJ3YA='
Just the basics to create the HMAC signature. You’ll need combine this with other things like actually adding the signature on the URL and making the request, but those responsibilities intentionally live elsewhere.
See the django-request-signer project for examples if you need the rest.
Metadata
Release files for apysigner 4.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| apysigner-4.0.0.tar.gz | 3.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| apysigner-4.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.6 kB
Release files / apysigner-4.0.0.tar.gz
| Download URL | apysigner-4.0.0.tar.gz |
|---|---|
| Size | 3.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4e9b540b71d2e4980f95980f95a1a65cfe4f8faceaf92cef6e67f6ee5a391c84
|
|
BLAKE2b-256 checksum How to use checksums |
ed6525c7557689f801e1ae1c409ccdb698ab02df342f9bf611dff9aea27c65de
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.0
|
Release files / apysigner-4.0.0-py3-none-any.whl
| Download URL | apysigner-4.0.0-py3-none-any.whl |
|---|---|
| Size | 3.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1fa4986f93cf07c57003e00b6b3e16463984ca1273067ab5639553bce4eb299d
|
|
BLAKE2b-256 checksum How to use checksums |
2c737a7900dd2b549825edf55851467d81e556f4005141bb6754b0065b7e7177
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.0
|