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_idand set token expiry usingexpiry_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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f4edc82f87707633ca4f85f72331280404b13610d8d31c6459f08b4fe961a963
|
|
| MD5 |
067cbd194cfd3f921332c16eb81abf25
|
|
| BLAKE2b-256 |
a234ba1a832bf5432dfb1569cff8cf4b340a1baeeeb59270974d1a2e112e10c0
|
File details
Details for the file indus_cloudauth-0.1.1-py3-none-any.whl.
File metadata
- Download URL: indus_cloudauth-0.1.1-py3-none-any.whl
- Upload date:
- Size: 9.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6a377c512eac2d2e6d83bc574e11a8905abb7d3149bd9c749b6856c68b5c8139
|
|
| MD5 |
d083a194a7ac9d81ed5793bd0e8c97e2
|
|
| BLAKE2b-256 |
a89232ee3329d6133c0eff279fe9f523ba5ca11a02438bea905db0b1ecd139f1
|