Skip to main content

A simple CLI utility for automating token generations with kubernetes.

Project description

Configure Azure CLI from CLI or Environment Variables

# 1. Authenticate with Azure CLI Creds from Terminal -- Temporal
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
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> \
        --btoken ronaldo-express-003


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

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

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

tokengen-0.1.0.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

tokengen-0.1.0-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file tokengen-0.1.0.tar.gz.

File metadata

  • Download URL: tokengen-0.1.0.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.1

File hashes

Hashes for tokengen-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b8304140ab24f958161b964121a4bce5db2568bfa67777b826472416c9aa840a
MD5 17540cfc71bef5b3f8606b2d392354ba
BLAKE2b-256 4783d67a8471f85bea6b747b6d5d5cd1407e6c34efd19456c711fd385f8214d8

See more details on using hashes here.

File details

Details for the file tokengen-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: tokengen-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.1

File hashes

Hashes for tokengen-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3b8417a6484a5808107529dc4b402f4825f023b7ede3345365822dd65ca9ff28
MD5 e9f1ac14ffbf8b6a0f4510e792735834
BLAKE2b-256 29487505f2cef5f31403ed9a11eda2c1be1c6eba745b50f6c167164a71424b1b

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