truelayer-signing
Python package to produce & verify TrueLayer API requests signatures.
Install
pip install truelayer-signing
Generating a signature
tl_signature = sign_with_pem(KID, PRIVATE_KEY) \
.set_method(HttpMethod.POST) \
.set_path(path) \
.add_header("Idempotency-Key", idempotency_key) \
.set_body(body) \
.sign()
See full example.
Verifying webhooks
The verify_with_jwks function may be used to verify webhook Tl-Signature header signatures.
# `jku` field is included in webhook signatures
jws_header = extract_jws_header(webhook_signature).jku
# check `jku` is an allowed TrueLayer url & fetch jwks JSON (not provided by this lib)
ensure_jku_allowed(jku)
jwks = fetch_jwks(jku)
# jwks may be used directly to verify a signature
verify_with_jwks(jwks, jws_header) \
.set_method(HttpMethod.POST) \
.set_path(path) \
.add_headers(headers) \
.set_body(body) \
.verify(tl_signature)
Metadata
Release files for truelayer-signing 0.4.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 | |
|---|---|---|---|
| truelayer_signing-0.4.0.tar.gz | 10.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| truelayer_signing-0.4.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 24.7 kB
Release files / truelayer_signing-0.4.0.tar.gz
| Download URL | truelayer_signing-0.4.0.tar.gz |
|---|---|
| Size | 10.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8b1fb067b23feb8af1ad3a929bf48b69a9dc357ed60bd56615fecca3b9d8c5aa
|
|
BLAKE2b-256 checksum How to use checksums |
807e221b0ee24b5a04ecb2f0bf9de18e7a4ee9a513570dff8a96977d8538c407
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.4.1 CPython/3.10.20 Linux/6.17.0-1018-azure
|
Release files / truelayer_signing-0.4.0-py3-none-any.whl
| Download URL | truelayer_signing-0.4.0-py3-none-any.whl |
|---|---|
| Size | 13.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a97ca087bcc3fae64642bab24daafb76cbd2e3af4d30d5550551792629182e0c
|
|
BLAKE2b-256 checksum How to use checksums |
712daaa3742647f71eb6dea320ce7127c8ede8ebe786bb9a039f1c73efabb25b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.4.1 CPython/3.10.20 Linux/6.17.0-1018-azure
|