mirror of
https://github.com/mblanke/StrikePackageGPT.git
synced 2026-03-01 14:20:21 -05:00
Address code review feedback: improve security, error handling, and documentation
Co-authored-by: mblanke <9078342+mblanke@users.noreply.github.com>
This commit is contained in:
@@ -195,8 +195,21 @@ def _check_common_issues(config_data: Dict[str, Any]) -> Tuple[List[str], List[s
|
||||
errors = []
|
||||
warnings = []
|
||||
|
||||
# Validate that config_data is a dict and not too large
|
||||
if not isinstance(config_data, dict):
|
||||
errors.append("Configuration must be a dictionary")
|
||||
return errors, warnings
|
||||
|
||||
if len(config_data) > 1000:
|
||||
warnings.append("Configuration has unusually large number of keys (>1000)")
|
||||
|
||||
# Check for null/undefined values
|
||||
for key, value in config_data.items():
|
||||
# Validate key is a string
|
||||
if not isinstance(key, str):
|
||||
warnings.append(f"Configuration key {key} is not a string")
|
||||
continue
|
||||
|
||||
if value is None:
|
||||
warnings.append(f"Value for '{key}' is null - will use default")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user