(scope, limit=40, window=60)
| 2181 | |
| 2182 | |
| 2183 | def require_authenticated_download(scope, limit=40, window=60): |
| 2184 | if rate_limited(scope, limit=limit, window=window): |
| 2185 | return "Troppe richieste. Riprova tra poco.", 429 |
| 2186 | if not flask_session.get("admin_authenticated"): |
| 2187 | return "Sessione amministratore non valida.", 401 |
| 2188 | return None |
| 2189 | |
| 2190 | |
| 2191 | def public_error(message="Operazione non riuscita.", status=400): |
no test coverage detected