Skip to main content

indus-cloudauth is a secure, unified solution for generating and validating authentication tokens across multiple cloud platforms.

Project description

indus-cloudauth

indus-cloudauth is a secure, unified solution for generating and validating authentication tokens across multiple cloud platforms.

Features

  • Standardizes authentication with a consistent interface for token management and authentication.
  • Simplifies secret key retrieval from AWS Secrets Manager. Azure Key Vault, GCP Secret Manager and more coming soon.
  • Enhances security by eliminating manual credential handling.
  • Provided option to encrypt more information using auth_id and set token expiry using expiry_seconds.
  • Reduces boilerplate code with easy-to-use methods for token generation and validation.

Requirements

Python 3.9+

Usage

You can use the indus-cloudauth package in your Python code to generate authentication token using cloud provider of your choice for accessing the secret.

Example 1 - using secret key stored in aws secret manager

It uses your local aws credentials and configs from ~/.aws see Using Boto3. Only key stored as plaintext will work.

from indus_cloudauth import cloud_provider, auth

keyname = "keyname_in_your_aws_secret_manager"
_auth = auth.use_hmac256_token(keyname=keyname, cloud=cloud_provider.AWS) # initializes the auth module
token = _auth.generate_token() # generates your token
valid, auth_id, message = _auth.validate_token(token) # validates your token

Example 2 - using secret key stored in environment variable

from indus_cloudauth import cloud_provider, auth

keyname = "keyname_in_your_enviroment"
_auth = auth.use_hmac256_token(keyname=keyname, cloud=cloud_provider.LOCAL) # initializes the auth module
token = _auth.generate_token() # generates your token
valid, auth_id, message = _auth.validate_token(token) # validates your token

Example 3 - using secret key directly

from indus_cloudauth import cloud_provider, auth

secret_key = "anysecretkeyyoucanpass"
_auth = auth.use_hmac256_token(secretkey=secretkey) # initializes the auth module
token = _auth.generate_token() # generates your token
valid, auth_id, message = _auth.validate_token(token) # validates your token

Example 4 - using token expiry_time and auth_id

By default the token expiry time set to 1 hour. You can encrypt any useful information using auth_id.

from indus_cloudauth import cloud_provider, auth

keyname = "keyname_in_your_enviroment"
auth_id = "userid_etc"
expiry = 60 # 1 minute
_auth = auth.use_hmac256_token(keyname=keyname, cloud=cloud_provider.LOCAL) # initializes the auth module
token = _auth.generate_token(auth_id=authid, expiry_seconds=expiry) # generates your token
valid, auth_id, message = _auth.validate_token(token) # validates your token

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

indus_cloudauth-0.1.1.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

indus_cloudauth-0.1.1-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file indus_cloudauth-0.1.1.tar.gz.

File metadata

  • Download URL: indus_cloudauth-0.1.1.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for indus_cloudauth-0.1.1.tar.gz
Algorithm Hash digest
SHA256 f4edc82f87707633ca4f85f72331280404b13610d8d31c6459f08b4fe961a963
MD5 067cbd194cfd3f921332c16eb81abf25
BLAKE2b-256 a234ba1a832bf5432dfb1569cff8cf4b340a1baeeeb59270974d1a2e112e10c0

See more details on using hashes here.

File details

Details for the file indus_cloudauth-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for indus_cloudauth-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6a377c512eac2d2e6d83bc574e11a8905abb7d3149bd9c749b6856c68b5c8139
MD5 d083a194a7ac9d81ed5793bd0e8c97e2
BLAKE2b-256 a89232ee3329d6133c0eff279fe9f523ba5ca11a02438bea905db0b1ecd139f1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page