Azure Integration
this package is an azure integration to use in the DTRG team.
for now, we just have vault integration in the package.
HOW TO USE
- From pypi
first, you need to install the package. to do so create a personal access token and then connect to the feed according to these instructions. (choose pip)
then install the package:
$ pip install azure-integration # this will install latest version.
you need to set these env variables to access to azure:
AZURE_CLIENT_ID=YOUR_CLIENT_ID
AZURE_CLIENT_SECRET=YOUR_CLIENT_SECRET
AZURE_TENANT_ID=YOUR_TENANT_ID
Secret Client
to use secret client you can do something like this:
from keyvault import SecretClient
client = SecretClient(VAULT_NAME)
client.get_secret(SECRET_NAME) # this returns KeyVaultSecret object
client.get_secret(SECRET_NAME).value # this returns secret value as string
also, you can get a dict of secrets wherever you need, ex setting.py:
from keyvault import SecretClient
[... whatever settings ...]
client = SecretClient(VAULT_NAME)
needed_secrets = {
"SECRET_NAME": "SECRET_VERSION", # you can leave version blank
"SECOND_SECRET_NAME": "SECOND_SECRET_VERSION"
}
c.get_secrets(needed_secrets) # this will return results as KeyVaultSecret
c.get_secrets_values(needed_secrets) # this will return results as str
note that you don't need to assign get_secrets and get_secrets_values functions' return value and that's because it will modify the given dict object and you can access the values within it.
Service Name Finder
this utility is implemented to use in dtrg projects.
this utility will help you find needed credentials such as key vault name, postgres server address and postgres admin password secret name. remember in development environment you should set WEBSITE_SITE_NAME to a valid website name according to patterns we use in dtrg project.
you can use it simply:
from dtrg_specified import ServiceNameFinder
service_name_finder = ServiceNameFinder()
service_name_finder.kv_name # will return key vault name
service_name_finder.psql_host # will return postgres host host
service_name_finder.psql_password_secret_name # will return postgres password secret name
HOW TO BUILD
if you want to build the module yourself follow the steps:
- clone this repository.
- create a venv inside it.
- install requirements by running:
$ pip install -r requirements.txt
- then build it:
$ python -m build
Metadata
Release files for azure-integration 0.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| azure-integration-0.0.4.tar.gz | 4.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| azure_integration-0.0.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.1 kB
Release files / azure-integration-0.0.4.tar.gz
| Download URL | azure-integration-0.0.4.tar.gz |
|---|---|
| Size | 4.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
810f88a4036f2127141a3f727a5315711a5a47712712dad6f7dbccb1875f8324
|
|
BLAKE2b-256 checksum How to use checksums |
4206a07ff16469337a0e269ccb28719264c6e40e87576f2a89daa5715ab70676
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4
|
Release files / azure_integration-0.0.4-py3-none-any.whl
| Download URL | azure_integration-0.0.4-py3-none-any.whl |
|---|---|
| Size | 4.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
770c1f5d4d1b788353fd258112171e9fb250016624cc5e3fac6dbf9bac193c6f
|
|
BLAKE2b-256 checksum How to use checksums |
602bfea8d16c38cb456c9b555322e3e69c4d401eafa07976635a2be6ca1aeef1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4
|
Security for azure-integration 0.0.4
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.