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.0.tar.gz (9.3 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.0-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: indus_cloudauth-0.1.0.tar.gz
  • Upload date:
  • Size: 9.3 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.0.tar.gz
Algorithm Hash digest
SHA256 e052d9b4628589ad5ec0dfd23f6e0395fc816719e3b0467fe0878fd4dc8e90b7
MD5 9b643022ef660d334232d482944b67f4
BLAKE2b-256 a894485900a04ff4e238f55916cb1a727c34541b8a06c7537ee04950811e2e95

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for indus_cloudauth-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b879bfad87c0815e34925263c4b9ddd3b34d68310422bf387a24663530e3278c
MD5 ebe9fa7022be8797e8d2d62e43b44eeb
BLAKE2b-256 cc242f3a6de760459a4716bf8d5cf243609d90796c5639a26789bfb3b16c0b64

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