Skip to main content

Bearer Agent

Project description

Bearer Agent

Build Status

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bearer-agent-1.0.2.tar.gz (21.6 kB view details)

Uploaded Source

Built Distribution

bearer_agent-1.0.2-py3-none-any.whl (31.6 kB view details)

Uploaded Python 3

File details

Details for the file bearer-agent-1.0.2.tar.gz.

File metadata

  • Download URL: bearer-agent-1.0.2.tar.gz
  • Upload date:
  • Size: 21.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7

File hashes

Hashes for bearer-agent-1.0.2.tar.gz
Algorithm Hash digest
SHA256 89bc4fd3237035af843087225b826e71f8edb51d3548ae8355ca79d5c9438c40
MD5 10b2f0b2a2a1257dd8a3554e4fde61c2
BLAKE2b-256 b1875b93f2ae39b0b1c1646e4c022d81579e2e1434a485e21c92f3dc7859538c

See more details on using hashes here.

Provenance

File details

Details for the file bearer_agent-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: bearer_agent-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 31.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7

File hashes

Hashes for bearer_agent-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9d81570afc9a72bbbbfb5ee28e0db02e3e83480c1436666b08e5c55897d70ad8
MD5 89f6e3ecc29b8a299c43890b94ff96f6
BLAKE2b-256 1a3e30a32985f4e0beb69dea912a5805a3a51be01b9e83d8aa28177fd9afb457

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page