Skip to main content

Flask integration for the Bella Baxter secret management SDK

Project description

bella-baxter-flask

Flask extension for the Bella Baxter secrets management platform. Attaches a BaxterClient to your Flask app as app.bella.

Installation

pip install bella-baxter-flask

Quickstart

from flask import Flask
from bella_baxter_flask import BellaBaxter

app = Flask(__name__)
bella = BellaBaxter(app, api_key="bax-...")

@app.route("/health")
def health():
    secrets = app.bella.get_all_secrets()
    return {"database": secrets.secrets.get("DATABASE_URL")}

Application factory pattern

# extensions.py
from bella_baxter_flask import BellaBaxter

bella = BellaBaxter()  # not bound to an app yet

# app.py
from flask import Flask
from extensions import bella

def create_app():
    app = Flask(__name__)
    app.config["BELLA_BAXTER_API_KEY"] = "bax-..."
    bella.init_app(app)
    return app
# routes.py
from extensions import bella

@app.route("/secrets")
def get_secrets():
    resp = bella.get_all_secrets()
    return resp.secrets

Configuration

Pass api_key= directly to the constructor, or set it in app.config:

Config key Required Default Description
BELLA_BAXTER_API_KEY API key (bax-...)
BELLA_BAXTER_URL https://api.bella-baxter.io Base URL of the Baxter API
app.config["BELLA_BAXTER_API_KEY"] = os.environ["BELLA_BAXTER_API_KEY"]
app.config["BELLA_BAXTER_URL"] = os.environ.get("BELLA_BAXTER_URL", "https://api.bella-baxter.io")

bella = BellaBaxter()
bella.init_app(app)

Accessing the underlying client

# Full BaxterClient API available via .client
kiota = app.bella.client.client  # Kiota-generated HTTP client

# Or via the extension directly
resp = bella.get_all_secrets()
version = bella.get_secrets_version()

Authentication

Generate an API key via the CLI or the Bella WebApp:

bella api-keys create --env production --name "Flask Production"

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

bella_baxter_flask-0.1.1rc74.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bella_baxter_flask-0.1.1rc74-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file bella_baxter_flask-0.1.1rc74.tar.gz.

File metadata

  • Download URL: bella_baxter_flask-0.1.1rc74.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for bella_baxter_flask-0.1.1rc74.tar.gz
Algorithm Hash digest
SHA256 45dd03ef0ba2ec1b0f87dd82265f8a24ef7a9e1cdfff8f18b62151130c193145
MD5 4677baf00aee97d69fea1f52392f8dc0
BLAKE2b-256 d79f16a88bbc8e9458758f6904d42557de42e21534468d40b44783f5b2619e76

See more details on using hashes here.

Provenance

The following attestation bundles were made for bella_baxter_flask-0.1.1rc74.tar.gz:

Publisher: publish.yml on Cosmic-Chimps/bella-baxter-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bella_baxter_flask-0.1.1rc74-py3-none-any.whl.

File metadata

File hashes

Hashes for bella_baxter_flask-0.1.1rc74-py3-none-any.whl
Algorithm Hash digest
SHA256 5143570f1aaec85f0bd43271dd863dbd990d9c70524c4b8ab14884128fbd4331
MD5 b5dc0d081604ca8e4115ba05e17bda65
BLAKE2b-256 bf6fc2aa4b280dcff3556d6fe99cbc918622bcac72629d882c979e8a91c67379

See more details on using hashes here.

Provenance

The following attestation bundles were made for bella_baxter_flask-0.1.1rc74-py3-none-any.whl:

Publisher: publish.yml on Cosmic-Chimps/bella-baxter-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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