MCPcopy Create free account
hub / github.com/CScorza/IntelOSINT / require_sensitive_request

Function require_sensitive_request

IntelOSINT.py:2171–2180  ·  view source on GitHub ↗
(scope, limit=20, window=60)

Source from the content-addressed store, hash-verified

2169
2170
2171def require_sensitive_request(scope, limit=20, window=60):
2172 if rate_limited(scope, limit=limit, window=window):
2173 return jsonify({"status": "error", "message": "Troppe richieste. Riprova tra poco."}), 429
2174 csrf = request.headers.get("X-CSRF-Token", "")
2175 expected = flask_session.get("csrf_token", "")
2176 if not flask_session.get("admin_authenticated"):
2177 return jsonify({"status": "error", "message": "Sessione amministratore non valida."}), 401
2178 if not expected or not hmac.compare_digest(csrf, expected):
2179 return jsonify({"status": "error", "message": "CSRF token non valido."}), 403
2180 return None
2181
2182
2183def require_authenticated_download(scope, limit=40, window=60):

Callers 13

tg_start_monitoringFunction · 0.85
tg_check_statusFunction · 0.85
tg_stop_monitoringFunction · 0.85
tg_get_intelligence_logsFunction · 0.85
api_saveFunction · 0.85
tg_sendFunction · 0.85
tg_verifyFunction · 0.85
ghunt_loginFunction · 0.85
ghunt_smart_startFunction · 0.85
ghunt_installFunction · 0.85
ghunt_statusFunction · 0.85
ghunt_login_method2Function · 0.85

Calls 1

rate_limitedFunction · 0.85

Tested by

no test coverage detected