Skip to main content

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


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)

Uploaded Source

Built Distribution

ship_it_validate-0.4.0-py3-none-any.whl (2.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page