Metadata-Version: 2.1
Name: bearer-agent
Version: 1.0.0
Summary: Bearer Agent
Home-page: http://www.bearer.sh
Author: Bearer Team
Author-email: engineering+python@bearer.sh
License: Apache License 2.0
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Other Environment
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Internet
Classifier: Topic :: Utilities
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Internet :: WWW/HTTP
Requires-Python: >=3.5
Description-Content-Type: text/markdown
Requires-Dist: setuptools (>=3.0)
Requires-Dist: urllib3 (<2,>=1)
Requires-Dist: wrapt (<2,>=1)
Provides-Extra: tests
Requires-Dist: black ; extra == 'tests'
Requires-Dist: flake8 ; extra == 'tests'
Requires-Dist: pytest ; extra == 'tests'
Requires-Dist: requests ; extra == 'tests'
Requires-Dist: httpx ; extra == 'tests'

# Bearer Agent

[![Build Status](https://build.bearer.tech/api/badges/Bearer/python-agent/status.svg)](https://build.bearer.tech/Bearer/python-agent)

Observe, control and receive alerts on your third-party APIs by adding the
[Bearer agent](https://www.bearer.sh) 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:

```sh
$ pip install bearer-agent
```

Then set up the Bearer agent with your Secret Key (available on the
[Bearer dashboard](https://app.bearer.sh/keys)):

```python
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:

```python
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}"
    )
)
```


