
Research
/Security News
Critical Vulnerability in NestJS Devtools: Localhost RCE via Sandbox Escape
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
5x-redshift-auth-manager
Advanced tools
A simple Python library for creating an AWS Redshift connection using environment variables.
A simple Python library for managing AWS Redshift connections using environment variables. This library provides an easy way to authenticate and connect to AWS Redshift clusters with comprehensive error handling and connection management.
pip install 5x-redshift-auth-manager
Set the following environment variables:
export FIVEX_REDSHIFT_HOST="your-redshift-cluster.region.redshift.amazonaws.com"
export FIVEX_REDSHIFT_PORT="5439" # Optional, defaults to 5439
export FIVEX_REDSHIFT_DATABASE="your_database"
export FIVEX_REDSHIFT_USER="your_username"
export FIVEX_REDSHIFT_PASSWORD="your_password"
from redshift_auth import RedshiftConnectionManager
# Create connection manager
manager = RedshiftConnectionManager()
# Get connection
connection = manager.get_connection()
# Execute queries
with manager.get_cursor() as cursor:
cursor.execute("SELECT * FROM your_table LIMIT 10")
results = cursor.fetchall()
print(results)
# Close connection when done
manager.close_connection()
from redshift_auth import RedshiftConnectionManager
# Use context manager for automatic connection cleanup
with RedshiftConnectionManager() as manager:
connection = manager.get_connection()
with manager.get_cursor() as cursor:
cursor.execute("SELECT version()")
version = cursor.fetchone()
print(f"Redshift version: {version[0]}")
from redshift_auth import RedshiftConnectionManager
try:
manager = RedshiftConnectionManager()
connection = manager.get_connection()
print("Successfully connected to Redshift!")
except ValueError as e:
print(f"Configuration error: {e}")
except ConnectionError as e:
print(f"Connection error: {e}")
except Exception as e:
print(f"Unexpected error: {e}")
Variable | Required | Default | Description |
---|---|---|---|
FIVEX_REDSHIFT_HOST | ✅ | - | Redshift cluster endpoint |
FIVEX_REDSHIFT_PORT | ❌ | 5439 | Redshift port number |
FIVEX_REDSHIFT_DATABASE | ✅ | - | Database name |
FIVEX_REDSHIFT_USER | ✅ | - | Database username |
FIVEX_REDSHIFT_PASSWORD | ✅ | - | Database password |
__init__()
: Initialize the connection managerget_connection()
: Get or create a Redshift connectionget_cursor()
: Get a database cursor for executing queriesclose_connection()
: Close the connection__enter__()
/ __exit__()
: Context manager supportThe library provides specific error handling for:
This project is licensed under the MIT License.
🚀 Developed by 5X | Powering Secure & Scalable Data Platforms
FAQs
A simple Python library for creating an AWS Redshift connection using environment variables.
We found that 5x-redshift-auth-manager demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.