wyacznie auth na read only endpointach
This commit is contained in:
parent
fa73c9ea6d
commit
e3f26f546e
4
app.py
4
app.py
@ -102,7 +102,7 @@ def update_hosts():
|
|||||||
# Endpoint /health – zwraca status usługi
|
# Endpoint /health – zwraca status usługi
|
||||||
@app.route('/health', methods=['GET'])
|
@app.route('/health', methods=['GET'])
|
||||||
def health():
|
def health():
|
||||||
require_auth()
|
#require_auth()
|
||||||
uptime = time.time() - psutil.boot_time()
|
uptime = time.time() - psutil.boot_time()
|
||||||
now = datetime.now(timezone.utc).isoformat()
|
now = datetime.now(timezone.utc).isoformat()
|
||||||
logger.info(f"/health check from {request.remote_addr}")
|
logger.info(f"/health check from {request.remote_addr}")
|
||||||
@ -111,7 +111,7 @@ def health():
|
|||||||
# Endpoint /metrics – zwraca metryki
|
# Endpoint /metrics – zwraca metryki
|
||||||
@app.route('/metrics', methods=['GET'])
|
@app.route('/metrics', methods=['GET'])
|
||||||
def metrics_endpoint():
|
def metrics_endpoint():
|
||||||
require_auth()
|
#require_auth()
|
||||||
avg_time = metrics["total_time"] / metrics["total_requests"] if metrics["total_requests"] > 0 else 0.0
|
avg_time = metrics["total_time"] / metrics["total_requests"] if metrics["total_requests"] > 0 else 0.0
|
||||||
ep_data = {}
|
ep_data = {}
|
||||||
for ep, data in metrics["endpoints"].items():
|
for ep, data in metrics["endpoints"].items():
|
||||||
|
@ -1,8 +1,5 @@
|
|||||||
Flask
|
Flask
|
||||||
Flask-SSLify
|
Flask-SSLify
|
||||||
Flask-SQLAlchemy
|
|
||||||
paramiko
|
|
||||||
croniter
|
|
||||||
tzlocal
|
tzlocal
|
||||||
gunicorn
|
gunicorn
|
||||||
psutil
|
psutil
|
||||||
|
Loading…
x
Reference in New Issue
Block a user