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.5.tar.gz (22.8 kB view details)

Uploaded Source

Built Distribution

bearer_agent-1.0.5-py3-none-any.whl (32.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: bearer-agent-1.0.5.tar.gz
  • Upload date:
  • Size: 22.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.1.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.2

File hashes

Hashes for bearer-agent-1.0.5.tar.gz
Algorithm Hash digest
SHA256 4dc2f454cdf7894ee375624b90ebe3e6ee74f856bccea1c756b2318b76d063ba
MD5 e82d71784a97dce91896507fdd89c383
BLAKE2b-256 3ac78af7771253810c32bda327528bb6674c3b0ed529f237343737f4a081bec0

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: bearer_agent-1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 32.0 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/49.1.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.2

File hashes

Hashes for bearer_agent-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 3047734c8ea6c78da73595193fc91aed7dceea9ddce9d7bb554f815bbda9d35e
MD5 5d28a9fe99b21a94707dbe0870ea1cee
BLAKE2b-256 b155d464a7d1c44c3a5e438c4c5149d3b0f841295ad81d2d168ce7f0c35a1a8e

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