Skip to main content

AuraProtector in-process agent for Python ASGI runtimes.

Project description

auraprotector-agent (Python)

Python in-process agent for ASGI runtimes (FastAPI/Starlette/etc).

Install

pip install auraprotector-agent

FastAPI usage

from fastapi import FastAPI
from ultimateprotector_agent.asgi import UltimateProtectorMiddleware

app = FastAPI()

app.add_middleware(
    UltimateProtectorMiddleware,
    license_key="UP_LIVE_...",
    api_url="https://YOUR_CLOUD/api",
)

Zero-code-ish usage (env wrapper)

If you can change how the app is created (but don't want to paste config into code), wrap the ASGI app using env vars:

import os
from fastapi import FastAPI
from ultimateprotector_agent import wrap_asgi_app

app = wrap_asgi_app(FastAPI())

# env:
# UP_LICENSE_KEY=UP_LIVE_...
# UP_API_URL=https://YOUR_CLOUD/api

Optional: sitecustomize bootstrap

The platform can generate a sitecustomize.py helper inside the Python auto bundle. If that file is on PYTHONPATH, Python auto-imports it on startup. Set UP_ASGI_APP="module:app" and it will best-effort wrap that object automatically (fail-open).

Options

  • license_key (required)
  • api_url (required) e.g. https://cloud.example/api
  • sync_interval_seconds (default: 60)
  • allow_sample_rate (default: 0.01)
  • only_paths: list[str] exact (/checkout) or prefix (/product/*)
  • except_paths: list[str]
  • only_regex: str (Python regex)

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

auraprotector_agent-0.1.0.tar.gz (15.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

auraprotector_agent-0.1.0-py3-none-any.whl (17.8 kB view details)

Uploaded Python 3

File details

Details for the file auraprotector_agent-0.1.0.tar.gz.

File metadata

  • Download URL: auraprotector_agent-0.1.0.tar.gz
  • Upload date:
  • Size: 15.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for auraprotector_agent-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a8c2d43f54d3ad21aaa39eba910184fc8b98b3ef5cc915d00c5ef467178a7448
MD5 779e00e5eb4d24487cc1c778e98389f0
BLAKE2b-256 eaffebbc2d59d1784f5ec81d7cc4506ca7a6a6ae94ad05c26480b33a9e287886

See more details on using hashes here.

File details

Details for the file auraprotector_agent-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for auraprotector_agent-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2a21ac6c953e24625e71d4bfb03358e14111659ba533e1bc173feae4d9b3c909
MD5 a2ef5e6b696c8998bfd178d5162bbf3d
BLAKE2b-256 e9b058ee1e3855975ada99ae91b84d76cf29eddb4fdccf509cc9173a78829a3a

See more details on using hashes here.

Supported by

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