Skip to main content

Flask-KeyVault

A Flask extension to read and write secrets using Azure Key Vault.

Installation

$ pip install Flask-KeyVault

Usage

import os

from flask import Flask

from flask_keyvault import KeyVault
from flask_keyvault.exceptions import KeyVaultAuthenticationError

demo = Flask(__name__)

demo.config.update(
    AZURE_CLIENT_ID = os.getenv('AZURE_CLIENT_ID','YOUR-AZURE_CLIENT_ID'),
    AZURE_SECRET = os.getenv('AZURE_SECRET', 'YOUR-AZURE-SECRET'),
    AZURE_TENANT = os.getenv('AZURE_TENANT', 'YOUR-AZURE-TENANT')
)

keyvault = KeyVault()
keyvault.init_app(demo)

key_vault_url = 'https://mykeyvault.vault.azure.net/'

@demo.route('/')
def index():

    try:
        my_secret = keyvault.get(key_vault_url, "my_secret", 1)
        return my_secret
    except KeyVaultAuthenticationError:
        return "authentication error"

demo.run(debug=True)

Contributing

Questions, comments or improvements, please create an issue on Github.

To suggest a change to the code or documentation, please create a new pull request on GitHub. Also, please squash multiple commits into a single commit in your pull request by rebasing onto the master branch.

License

Flask-KeyVault is licensed under the MIT license.

Contact

Home: www.erikhoward.net

Twitter: @erik_howard

Metadata

Release files for Flask-KeyVault 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for Flask-KeyVault 0.6.0
File Size Uploaded Provenance Actions
Flask-KeyVault-0.6.0.tar.gz 3.5 kB Without provenance Details for Flask-KeyVault-0.6.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for Flask-KeyVault 0.6.0
File Interpreter ABI Platform Actions
Flask_KeyVault-0.6.0-py3-none-any.whl Python 3 none any Details for Flask_KeyVault-0.6.0-py3-none-any.whl

Total release size: 8.2 kB

Release files / Flask-KeyVault-0.6.0.tar.gz

Download URL Flask-KeyVault-0.6.0.tar.gz
Size 3.5 kB
Tags Source
SHA-256 checksum
How to use checksums
183a33873ff9ae1c5d2efb37005e2e1dbcc33f9264ffe5c407c05ad1a6e1ede2
BLAKE2b-256 checksum
How to use checksums
359c68d6e3c92745e07ddd436d0fe56b96b5134ba6f22a7fdc2052f521fb05d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.1

Release files / Flask_KeyVault-0.6.0-py3-none-any.whl

Download URL Flask_KeyVault-0.6.0-py3-none-any.whl
Size 4.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
314d214daef0f8687958cf6a279370e9329b84cd884b3b903637a28d212104be
BLAKE2b-256 checksum
How to use checksums
3d85040c6f5023ef5a3850de4d876ddb69faa8597a41a79f1e08c56c24c0b5cf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.1

Security for Flask-KeyVault 0.6.0

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.6.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page