wyacznie auth na read only endpointach

This commit is contained in:
Mateusz Gruszczyński 2025-03-06 15:31:07 +01:00
parent fa73c9ea6d
commit e3f26f546e
3 changed files with 3 additions and 6 deletions

4
app.py
View File

@ -102,7 +102,7 @@ def update_hosts():
# Endpoint /health zwraca status usługi
@app.route('/health', methods=['GET'])
def health():
require_auth()
#require_auth()
uptime = time.time() - psutil.boot_time()
now = datetime.now(timezone.utc).isoformat()
logger.info(f"/health check from {request.remote_addr}")
@ -111,7 +111,7 @@ def health():
# Endpoint /metrics zwraca metryki
@app.route('/metrics', methods=['GET'])
def metrics_endpoint():
require_auth()
#require_auth()
avg_time = metrics["total_time"] / metrics["total_requests"] if metrics["total_requests"] > 0 else 0.0
ep_data = {}
for ep, data in metrics["endpoints"].items():

View File

@ -1,8 +1,5 @@
Flask
Flask-SSLify
Flask-SQLAlchemy
paramiko
croniter
tzlocal
gunicorn
psutil