Skip to main content

Configure Azure CLI from CLI or Environment Variables

# 1. Authenticate with Azure CLI Creds from Terminal 
az login 

# 2. Authenticate with Environmental variables
export AZURE_CLIENT_ID="*******"
export AZURE_TENANT_ID="*******"
export AZURE_CLIENT_SECRET="*******"

# Make sure Role has Azurekeyvault read/write permissions

Authenticate with Gitlab Registry

# In order not to be passing flags for the gitlab credentials, export them once on your terminal session
export username="*******"
export email="*******"
export password="*******"

How to Setup

# Create virtual environment -- Optional
python -m venv venv && source venv/bin/activate

# Install via pip
pip install tokengen

# Check commands and subcommands
tokengen -h

# Available subcommands
tokengen generate               # To create 4 Tokens at Once
tokengen bridgetoken            # To optionally create Bridgetoken later

How to generate tokens

# Create and Store 4 Tokens in Azurekeyvault at ONCE -- Optional(bridgetoken)
# 1. AIFI_API_TOKEN and PEPPER Token as retailere>-cloud-oasis-api-retailer-token
# 2. KEYCLOAK credentials as <retailer>-cloud-keycloak-admin
# 3. RETAILER_TOKEN and oasis-api-token secret as <retailer>-cloud-oasis-api-token
# 4. RETAILER_BRIDGE_TOKEN as <store-id>-retailer-bridge-token

Generate 4 Tokens at ONCE

# --btoken is optional if you want to generate a Bridgetoken, else just elimimate it from the --flags
tokengen generate --vault <vault_name> \
        --vault_url <vault_url> \
        --secret <secret_name> \
        --domain <store-domain-prefix> \
        --btoken ronaldo-express-003


# To Use Default credentials of keyvault, Run
tokengen generate --secret <retailer_name_example_zucchini> --domain holtebar

Generate Bridgetoken separately

# tokengen bridgetoken --btoken <store-id>
tokengen bridgetoken --btoken umari-express-0001

Why Python Secrets?

# From Python Docs
The secrets module is used for generating cryptographically strong random numbers suitable for managing data such as passwords, account authentication, security tokens, and related secrets.

In particularly, secrets should be used in preference to the default pseudo-random number generator in the random module, which is designed for modelling and simulation, not security or cryptography.

To Contribute, Setup Environment

# create venv
python3 -m venv venv

# Activate the venv
source venv/bin/activate

# Install packages
pip install -r requirements.txt

# Switch to developer mode
python3 setup.py develop

# To test with your Azure keyvault, pass these flags to bypass default flags set for keyvault
--vault
--vault_url

Metadata

Release files for tokengen 0.1.1

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

Source distribution (sdist)

Source distribution for tokengen 0.1.1
File Size Uploaded Provenance Actions
tokengen-0.1.1.tar.gz 9.6 kB Without provenance Details for tokengen-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tokengen 0.1.1
File Interpreter ABI Platform Actions
tokengen-0.1.1-py3-none-any.whl Python 3 none any Details for tokengen-0.1.1-py3-none-any.whl

Total release size: 17.0 kB

Release files / tokengen-0.1.1.tar.gz

Download URL tokengen-0.1.1.tar.gz
Size 9.6 kB
Tags Source
SHA-256 checksum
How to use checksums
08d1e9c0847b9d3478c3a039f85059ede14054d07ed27cd47ee00ba8d2f317ee
BLAKE2b-256 checksum
How to use checksums
cf7533a0ec7d483d37245bd99b0f72de1c097146ddde85f831080b4770e5777b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.1

Release files / tokengen-0.1.1-py3-none-any.whl

Download URL tokengen-0.1.1-py3-none-any.whl
Size 7.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a32028374d8554f4b3121e631e3b0c05425cfcb62927ea33f934af95b2efcb94
BLAKE2b-256 checksum
How to use checksums
88a0d3f78dcf8185b3516ea872cbe25ae5e9c11a303c96f80697153b6ac7f572
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.1

Security for tokengen 0.1.1

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.

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