Three isolated services (alert scraper, apply HTTP worker, web UI+DB) with argon2 auth, signed cookies, CSRF, rate-limited login, kill switch, apply circuit breaker, audit log, and strict CSP. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
12 lines
335 B
Python
12 lines
335 B
Python
import logging
|
|
|
|
logger = logging.getLogger("flat-apply")
|
|
|
|
def str_to_preview(string, max_length):
|
|
if not max_length > 3:
|
|
raise ValueError('max_length must be greater than 3')
|
|
|
|
first_line = string.split('\n')[0]
|
|
if len(first_line) > max_length:
|
|
return first_line[:max_length-3] + '...'
|
|
return first_line
|