Fix user delete flow 6
This commit is contained in:
@@ -66,20 +66,26 @@ async def startup_event():
|
||||
"""Application startup"""
|
||||
logger.info("Starting API Gateway")
|
||||
|
||||
# Start metrics server
|
||||
|
||||
metrics_collector.register_counter(
|
||||
"gateway_auth_requests_total",
|
||||
"Total authentication requests through gateway"
|
||||
"Total authentication requests"
|
||||
)
|
||||
metrics_collector.register_counter(
|
||||
"gateway_auth_responses_total",
|
||||
"Total authentication responses through gateway"
|
||||
"Total authentication responses"
|
||||
)
|
||||
metrics_collector.register_histogram(
|
||||
"gateway_request_duration_seconds",
|
||||
"Gateway request duration"
|
||||
metrics_collector.register_counter(
|
||||
"gateway_auth_errors_total",
|
||||
"Total authentication errors"
|
||||
)
|
||||
|
||||
metrics_collector.register_histogram(
|
||||
"gateway_request_duration_seconds",
|
||||
"Request duration in seconds"
|
||||
)
|
||||
|
||||
logger.info("Metrics registered successfully")
|
||||
|
||||
metrics_collector.start_metrics_server(8080)
|
||||
|
||||
|
||||
@@ -203,9 +203,12 @@ class AuthMiddleware(BaseHTTPMiddleware):
|
||||
}
|
||||
|
||||
if payload.get("service"):
|
||||
base_context["service"] = payload["service"]
|
||||
service_name = payload["service"]
|
||||
base_context["service"] = service_name
|
||||
base_context["type"] = "service"
|
||||
base_context["role"] = "service"
|
||||
base_context["user_id"] = f"{service_name}-service"
|
||||
base_context["email"] = f"{service_name}-service@internal"
|
||||
logger.debug(f"Service authentication: {payload['service']}")
|
||||
|
||||
return base_context
|
||||
|
||||
Reference in New Issue
Block a user