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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: aicsapi-tool-python-0.2.6.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.6.tar.gz
Algorithm Hash digest
SHA256 d4e1209de78aa12afb3257467956cb83eee7d4a4176527e0363b1675f3a4037a
MD5 82295d69b7285cbf07904ffbdf26e885
BLAKE2b-256 0e3267a750516cb1074826b21fd35464b95f314d7c096f9fc434ce565af1c5cc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: aicsapi_tool_python-0.2.6-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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 9a8119679ee8c9ca8f668ae5d143a78d0d3b31af6cbb504bf6070b7eb0fcaac8
MD5 6e848de9679d4fa7e6ed0347e2df8841
BLAKE2b-256 a3a036274b49f17bdc5e9a2e76e66ab8feabae6a4cc541e63cb281165400e0a0

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