Skip to content

Conversation

@iamh2o
Copy link
Contributor

@iamh2o iamh2o commented Jan 30, 2026

Summary

Fixes a security issue in email domain whitelist handling and fixes pre-existing f-string syntax errors.

Domain Whitelist Fix (Security)

  • Issue: Empty COGNITO_WHITELIST_DOMAINS="" was allowing all domains instead of blocking all
  • Fix: Empty string now blocks all domains using __BLOCK_ALL__ sentinel pattern
  • Added: Support for * as alternative to all for allowing all domains

F-string Syntax Fix

  • Issue: Nested quotes in f-strings on lines 3224, 3228 caused syntax error
  • Fix: Changed to double-quoted f-strings with properly escaped quotes
  • Bonus: Removed redundant lstrip('/') calls (path already stripped earlier)

Behavior

Config Value Behavior
"" (empty string) Block all domains
"all" or "*" Allow all domains
"lsmc.bio,lsmc.com" Only allow listed domains

Testing

  • Python syntax check passes (python3 -m py_compile main.py)

Pull Request opened by Augment Code with guidance from the PR author

Domain whitelist fix:
- Empty COGNITO_WHITELIST_DOMAINS='' now blocks all domains
- Previously empty string allowed all (security issue)
- Added '*' as alternative to 'all' for allowing all domains
- Uses __BLOCK_ALL__ sentinel to distinguish from allow-all

F-string syntax fix:
- Fixed nested quote syntax error on lines 3224, 3228
- Removed redundant lstrip('/') calls (already stripped)
- Changed to double-quoted f-strings with escaped quotes

Behavior:
- Empty string '' = block all domains
- 'all' or '*' = allow all domains
- 'lsmc.bio,lsmc.com' = whitelist specific domains
@iamh2o iamh2o merged commit e6bee4e into main Jan 30, 2026
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants