Skip to main content

Toolkit for Python backend template

Project description

aicsapi-tool-python

Description

A package to help Python API template in:

  • Logging to Azure Application Insights
  • Fetching secret from Azure Key Vault
  • Generating self-signed certificate and upload it to Azure Key Vault
  • Caching credential token to save login time

Installation

This package has been published to PyPI, so you can use
pip install aicsapi-tool-python

Note

When calling methods in keyvault_utils or keyvault_certgen, be sure to have the following environment variables set:

KEY_VAULT_URL 
KEY_VAULT_SECRET_NAME 
KEY_VAULT_CERT_NAME

Example: Generate Self-signed Certification and Upload to Azure KV

  • Ensure required env. variables are loaded, create .kvvars under current working directory
KEY_VAULT_URL="https://[your keyvault name].vault.azure.net"  
KEY_VAULT_CERT_NAME="certificate name"  
  • Run the following code snippet with
    python certgen.py [your ASUS account name] [filename of generated key & cert]
# certgen.py

from aicsapi_tool_python.keyvault_certgen import generate_v3cert, upload_v3cert_to_kv
import sys, time

asus_account = sys.argv[1]
cert_name = sys.argv[2]

generate_v3cert( asus_account, cert_name )
time.sleep(1)     # Gives time to write files to disk
upload_v3cert_to_kv( cert_name + '.pfx' )

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

aicsapi-tool-python-0.2.5.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

aicsapi_tool_python-0.2.5-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file aicsapi-tool-python-0.2.5.tar.gz.

File metadata

  • Download URL: aicsapi-tool-python-0.2.5.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

File hashes

Hashes for aicsapi-tool-python-0.2.5.tar.gz
Algorithm Hash digest
SHA256 a0865aaec6290feec0e380de2a16ee0893984e6d8871c161a4787df383cc904f
MD5 3a360e5567fd122f762c384b6cad765a
BLAKE2b-256 13c9a26d44a5cff5f1b729881e5a9e4f88d498e944965929f60bea5ac45f0cd5

See more details on using hashes here.

File details

Details for the file aicsapi_tool_python-0.2.5-py3-none-any.whl.

File metadata

  • Download URL: aicsapi_tool_python-0.2.5-py3-none-any.whl
  • Upload date:
  • Size: 7.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

File hashes

Hashes for aicsapi_tool_python-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 9bad23558c718ba1e2daee1b53afbb103533a3ad33c7d3f114415fb0955e6baf
MD5 c5a46f710bfbbaa18c5d4aa1a98ee52b
BLAKE2b-256 fda69de919808e61625dc22655857885adb65a6450915347e0261cfd9e69030e

See more details on using hashes here.

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