Bearer Agent
Project description
Bearer Agent
Observe, control and receive alerts on your third-party APIs by adding the Bearer agent to your Python application.
Documentation
The documentation is hosted at https://python.docs.bearer.sh/
Installation
The Bearer agent requires Python 3.x >= 3.5.
Install from PyPI:
$ pip install bearer-agent
Then set up the Bearer agent with your Secret Key (available on the Bearer dashboard):
import bearer_agent
bearer_agent.init(secret_key="YOUR_BEARER_SECRET_KEY")
Keeping your data protected
We recommend you sanitize your data before sending it to the Bearer dashboard. We think it's best to setup the sanitization level that best suits your needs. An example using the default values is as follows:
bearer_agent.init(
strip_sensitive_data=True,
strip_sensitive_keys=(
"^authorization$|"
"^password$|"
"^secret$|"
"^passwd$|"
"^api.?key$|"
"^access.?token$|"
"^auth.?token$|"
"^credentials$|"
"^mysql_pwd$|"
"^stripetoken$|"
"^card.?number.?$|"
"^secret$|"
"^client.?id$|"
"^client.?secret$"
),
strip_sensitive_regex=(
r"[a-zA-Z0-9]{1}[a-zA-Z0-9.!#$%&’*+=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*|"
r"(?:\d[ -]*?){13,16}"
)
)
Development
Running tests
To run a format check (black), the linter (flake8) and tests (pytest):
$ tox
To only run the tests:
$ tox -e py37
Git hooks
There are Git hooks to format the code and run the linter when committing.
Install https://pre-commit.com/ and then run:
$ pre-commit install
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 bearer-agent-1.0.4.tar.gz.
File metadata
- Download URL: bearer-agent-1.0.4.tar.gz
- Upload date:
- Size: 22.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.2 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fe92148c766c087e447c02c0dbad15cc9940efb455e992317ceb5f22e7c4a6df
|
|
| MD5 |
b14068aec1f3753f4ec208cec0da909c
|
|
| BLAKE2b-256 |
5080711dc697f3c04db8927916c21d4adea77f70e8079077184bc2975e6c1f14
|
File details
Details for the file bearer_agent-1.0.4-py3-none-any.whl.
File metadata
- Download URL: bearer_agent-1.0.4-py3-none-any.whl
- Upload date:
- Size: 31.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.2 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d6a254d0dab33036906fd43b9a02aba54193ff8d6b1a7092ba8a5a5e70147044
|
|
| MD5 |
add030ee482f860167b28331a0534411
|
|
| BLAKE2b-256 |
a5e8c7b77b14467ab948101003770753163c179e94cdcbe7f7332d2267d660a0
|