Missing Validation on Environment Config #17
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Lines 138-191 load config but don't validate critical fields:
if key == 'TICKET_API_KEY':
cls.CONFIG['TICKET_API_KEY'] = value
# No validation that value is not empty!
Add validation:
if key == 'TICKET_API_KEY':
if not value or value == 'your_api_key_here':
logger.error("TICKET_API_KEY not properly configured in .env")
raise ValueError("Invalid TICKET_API_KEY")
cls.CONFIG['TICKET_API_KEY'] = value