forked from username/flaskpaste
fix lint errors (unused vars, line length, formatting)
This commit is contained in:
@@ -104,9 +104,7 @@ class Config:
|
||||
# Maximum unique IPs tracked in rate limit storage (RATE-001: memory DoS protection)
|
||||
RATE_LIMIT_MAX_ENTRIES = int(os.environ.get("FLASKPASTE_RATE_MAX_ENTRIES", "10000"))
|
||||
# RATE-002: Cleanup threshold (0.0-1.0) - trigger cleanup when entries exceed this ratio
|
||||
RATE_LIMIT_CLEANUP_THRESHOLD = float(
|
||||
os.environ.get("FLASKPASTE_RATE_CLEANUP_THRESHOLD", "0.8")
|
||||
)
|
||||
RATE_LIMIT_CLEANUP_THRESHOLD = float(os.environ.get("FLASKPASTE_RATE_CLEANUP_THRESHOLD", "0.8"))
|
||||
|
||||
# ENUM-001: Rate limiting for paste lookups (prevents enumeration attacks)
|
||||
# Separate from creation limits - allows more reads but prevents brute-force
|
||||
|
||||
@@ -276,9 +276,7 @@ class PKI:
|
||||
Raises:
|
||||
PKIError: If unable to generate unique serial after max retries
|
||||
"""
|
||||
existing_serials = {
|
||||
cert["serial"] for cert in self._certificates.values()
|
||||
}
|
||||
existing_serials = {cert["serial"] for cert in self._certificates.values()}
|
||||
|
||||
for _ in range(_SERIAL_MAX_RETRIES):
|
||||
serial = x509.random_serial_number()
|
||||
|
||||
Reference in New Issue
Block a user