mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-06-16 01:35:36 -04:00
Harden note reminder dispatch ownership (#2999)
This commit is contained in:
@@ -18,12 +18,20 @@ _SECRET_KEY_PATTERNS = (
|
||||
"_credential", "_credentials", "_key",
|
||||
)
|
||||
_SECRET_KEY_ALLOW = ("google_pse_cx",) # public identifiers, not secrets
|
||||
_SENSITIVE_KEY_EXACT = (
|
||||
# A stable global integration id is a capability handle for routes that can
|
||||
# trigger outbound webhook sends; do not expose it to non-admin settings
|
||||
# callers even though it is not secret-shaped.
|
||||
"reminder_webhook_integration_id",
|
||||
)
|
||||
|
||||
|
||||
def is_secret_key(name: str) -> bool:
|
||||
n = (name or "").lower()
|
||||
if n in _SECRET_KEY_ALLOW:
|
||||
return False
|
||||
if n in _SENSITIVE_KEY_EXACT:
|
||||
return True
|
||||
return any(n.endswith(p) or n == p.lstrip("_") for p in _SECRET_KEY_PATTERNS)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user