#516 [ENGINE/Data] Sensitive keyword patterns should use frozenset

closed low Created 2025-12-17 14:59 · Updated 2025-12-17 15:56

Description

Edit
**Files:** - engine/apps/executor.py:841 - engine/services/event_gateway_service.py:625 **Problem:** List literals for sensitive keywords created repeatedly in loops. Should be module-level frozenset for O(1) lookup. **Current:** ```python if any(s in key_lower for s in ["secret", "password", "token", "key", "auth"]): ``` **Fix:** ```python # Module level _SENSITIVE_KEY_PATTERNS = frozenset(["secret", "password", "token", "key", "auth"]) # In function if any(s in key_lower for s in _SENSITIVE_KEY_PATTERNS): ``` **Impact:** Minor performance improvement, better code style.

Comments

Loading comments...

Context

Loading context...

Audit History

View All
Loading audit history...