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}"
)
)
Compatibility matrix
Python3 :
On Python 3.x (>= 3.5) bearer support the following:
- http.client for Python >= 3.6
- urllib3 :
- requests
- httpcore >= 0.9 (both HTTP 1.1 and HTTP 2)
- httpx >= 0.12
- Twisted >= 19.2
- aiohttp >= 3.6.2
On Python 2.7, bearer support the following client Library or application based on:
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
Metadata
Release files for bearer-agent 1.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| bearer-agent-1.1.2.tar.gz | 54.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| bearer_agent-1.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 138.1 kB
Release files / bearer-agent-1.1.2.tar.gz
| Download URL | bearer-agent-1.1.2.tar.gz |
|---|---|
| Size | 54.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f838ed4d05e16f890f605f653cd338406701f18b180d60b8575a6bf9699ffee8
|
|
BLAKE2b-256 checksum How to use checksums |
6eb0b6c7398abc01ff23384accada698e9ab4fa2674eda7ba519799b2eb6eb82
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.7
|
Release files / bearer_agent-1.1.2-py3-none-any.whl
| Download URL | bearer_agent-1.1.2-py3-none-any.whl |
|---|---|
| Size | 83.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8688250162d3baf47439dc07aef4877ea197c45d305fdb68c9d3b0b1f1a485df
|
|
BLAKE2b-256 checksum How to use checksums |
c12001dac65b8221aa1b406dc564d18c25a8eef42572ace864af05c1b2025579
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.7
|
Security for bearer-agent 1.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.