Catalog PyPI
Back to packageRELEASE DETAILS

0.3.2

PyPI

aicsapi-tool-python

Toolkit for Python backend template

Published2 Aug 2019
Direct dependencies5
Transitive dependenciesNot calculated

README

Version 0.3.2 documentation

aicsapi-tool-python

|   .gitignore
|   .kvvars    # specifies environment variables needed by "keyvault_certgen.py" & "keyvault_utils.py"
|   LICENSE   
|   README.md
|   requirements.txt    # package dependencies
|   requirements_dev.txt    # required for packaging
|   setup.py    # for wrapping into a PyPI package
|
+---aicsapi_tool_python    # actual codes
|       appinsight_transport.py    # for logging custom events w/ correlation id to Azure Appinsights
|       keyvault_certgen.py    # provides utilities to generate X509v3 cert and upload to Azure KV
|       keyvault_tokenCache.py    # for caching credentials to save login time
|       keyvault_utils.py    # device-code sign in to Azure, get/import secret & cert to Azure KV
|       __init__.py
|
\---tests        # test_*.py performs unit test for the corresponding module
        test_appinsight_transport.py
        test_keyvault_certgen.py
        test_keyvault_tokenCache.py
        test_keyvault_utils.py  

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
AZURE_TENANT_ID

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"
AZURE_TENANT_ID="your azure tenant id"
  • 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

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

generate_v3cert( asus_account, cert_name )
upload_v3cert_to_kv( cert_name + '.pfx' )

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 5

Native requirements
5 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
applicationinsights
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": "",
  "evaluation": "NOT_EVALUATED"
}
applicationinsights (==0.11.9)runtime
adal
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": "",
  "evaluation": "NOT_EVALUATED"
}
adal (==1.0.2)runtime
python-dotenv
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": "",
  "evaluation": "NOT_EVALUATED"
}
python-dotenv (==0.10.3)runtime
azure-keyvault
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": "",
  "evaluation": "NOT_EVALUATED"
}
azure-keyvault (==1.1.0)runtime
pyOpenSSL
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": "",
  "evaluation": "NOT_EVALUATED"
}
pyOpenSSL (==19.0.0)runtime

Distribution files

2 collected
aicsapi_tool_python-0.3.2-py3-none-any.whl

bdist_wheel · 8.07 KB · Python py3

Source file
aicsapi-tool-python-0.3.2.tar.gz

sdist · 5.66 KB · Python source

Source file

Repository

PENDING
asus-aics/aicsapi-tool-python

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 21 Oct, 10:20 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:ba4b8a1399d794bd2a5a96a8a58f320d764a93b3a4afac756294bc70560243f0

Other collected versions

View all collected versions →