EndPointBlank for Python

Authorize service-to-service calls and report every request from Flask, Django or any WSGI app. pip install end-point-blank-py and wrap your app.

Package
end-point-blank-py
Requires
Python 3.10 or later
Works with
Flask, Django and any WSGI app

1. Install

Published on PyPI.

pip install end-point-blank-py

2. Configure and report every request

Use the client ID and secret of an application environment you created in EndPointBlank.

import os
import end_point_blank as epb
from end_point_blank.middleware.report_interaction import ReportInteractionMiddleware

epb.configure(
    client_id=os.environ["ENDPOINTBLANK_CLIENT_ID"],
    client_secret=os.environ["ENDPOINTBLANK_CLIENT_SECRET"],
    app_name="orders-service",
    environment="production",
)

app.wsgi_app = ReportInteractionMiddleware(app.wsgi_app)

The middleware reports every request and response that passes through the wrapped app, and sends unhandled exceptions as error reports.

3. Protect a route

from end_point_blank.flask import authorized

@app.route("/orders")
@authorized
def list_orders():
    ...

authorized checks the caller against your grants before the view runs. A refusal raises UnauthorizedError carrying intake's status: 401 when the credential was not accepted, 403 when no grant covers the endpoint.

Next

The README covers every setting: masking rules, the authorization cache, authorizing outbound calls and the management API client. The quickstart walks through creating the application and credentials this page assumes.

Ready to deprecate with confidence?

Sign up in under a minute. No credit card, no sales call.