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
Release files for bearer-agent 1.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| bearer-agent-1.0.4.tar.gz | 22.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| bearer_agent-1.0.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 54.5 kB
Release files / bearer-agent-1.0.4.tar.gz
| Download URL | bearer-agent-1.0.4.tar.gz |
|---|---|
| Size | 22.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fe92148c766c087e447c02c0dbad15cc9940efb455e992317ceb5f22e7c4a6df
|
|
BLAKE2b-256 checksum How to use checksums |
5080711dc697f3c04db8927916c21d4adea77f70e8079077184bc2975e6c1f14
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Release files / bearer_agent-1.0.4-py3-none-any.whl
| Download URL | bearer_agent-1.0.4-py3-none-any.whl |
|---|---|
| Size | 31.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d6a254d0dab33036906fd43b9a02aba54193ff8d6b1a7092ba8a5a5e70147044
|
|
BLAKE2b-256 checksum How to use checksums |
a5e8c7b77b14467ab948101003770753163c179e94cdcbe7f7332d2267d660a0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|