low-code authentication and billing
Project description
Ship It Validate
This package can be used to easily validate headers signed by Ship It.
Install
pip install ship-it-validate
Usage
Make sure to set the SHIP_IT_PUBLIC_KEY
environment variable to the base64 encoded public key provided in the Ship It site configuration page.
Flask
from ship_it_validate import validate
from flask import request
@app.before_request
def before_request():
try:
validate(
request.headers.get('X-PROXY-SIGNATURE'),
request.headers.get('X-USER-SUB'),
request.headers.get('X-PROXY-TIMESTAMP'),
)
except ValueError as e:
app.logger.warning('Invalid Ship It signature: %s', e)
return "Unauthorized", 401
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ship_it_validate-0.4.0.tar.gz
(1.8 kB
view hashes)
Built Distribution
Close
Hashes for ship_it_validate-0.4.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3cc9ae26d625ae366f8e597ec7b48ca2ddb4502aa6dc83243b7617804de8af63 |
|
MD5 | 64cabd77336057eecdd807dab5999a51 |
|
BLAKE2b-256 | 9dc065ceeaec22edef6d5f113ef6b4c595fec1d9628f9eeabcd74cca62d7dd99 |