The Python Agent for testbolt
Project description
BOLT API Security
Secure Your API.
Installation
Currently BOLT's Python Agent supports 2 servers:
- Django
- Flask
It can be installed from pypi by running :
pip install testbolt
Configuration
Django
Once installed, Bolt's middleware can be added by modifying middlewares list (in the projects settings.py) like so:
MIDDLEWARE = [
...,
"bolt.django.BoltDjango",
]
and configuring a BOLT_CONFIG attribute in the projects settings.py like this :
BOLT_CONFIG = {
"API_KEY": "<YOUR_BOLT_API_KEY>",
"BOLT_HOST": "<YOUR_BOLT_COLLECTOR_URL>"
}
BOLT_CONFIG can take an optional key-value pair representing the max number of workers for communicating with Bolt.
Flask
Once installed, Bolt middleware can be added simply like:
from flask import Flask
...
from bolt.flask import BoltFlask
app = Flask(__name__)
BoltFlask(app, "<YOUR_BOLT_COLLECTOR_URL>", "<YOUR_BOLT_API_KEY>")
The Flask Middleware takes the flask app, Bolt collector url, and the Bolt API Key as parameters. As an optional parameter, a named value can be passed for max number of workers for communicating with Bolt.
BoltFlask(app, "<YOUR_BOLT_COLLECTOR_URL>", "<YOUR_BOLT_API_KEY>", workers="<WORKER-COUNT>")
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file testbolt-0.0.17.tar.gz.
File metadata
- Download URL: testbolt-0.0.17.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3fdd34181b08c716abe6f11cad1c6dbbd079da759f5251ca08f7d838a668561c
|
|
| MD5 |
044d464f304b889c8805ec4c7d795533
|
|
| BLAKE2b-256 |
4311b2d96dacb9b55d30e8962ce7920e459d05b44e58a8cd16378cdfa69e72be
|
File details
Details for the file testbolt-0.0.17-py3-none-any.whl.
File metadata
- Download URL: testbolt-0.0.17-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b9a3feb2d6681b3239b5d1b31beea3817f37a584574e0a89523abf7096161ffa
|
|
| MD5 |
16b5d15660c6048a15c1da4a538446ed
|
|
| BLAKE2b-256 |
a7b3b7ac84aad1aedaf29256a5c4af65f763e47e9689afc60d9b8a0d59e0857a
|