diff options
Diffstat (limited to 'src/authorization')
| -rw-r--r-- | src/authorization/cedar_authorizer.rs | 10 | ||||
| -rw-r--r-- | src/authorization/server.rs | 19 |
2 files changed, 7 insertions, 22 deletions
diff --git a/src/authorization/cedar_authorizer.rs b/src/authorization/cedar_authorizer.rs index 662aafeb..940794b2 100644 --- a/src/authorization/cedar_authorizer.rs +++ b/src/authorization/cedar_authorizer.rs @@ -157,14 +157,12 @@ impl Authorizer for CedarAuthorizer { let decision = response.decision(); tracing::info!( - method = %http_request.method, - host = %http_request.host, - path = %http_request.path, - scheme = %http_request.scheme, - protocol = %http_request.protocol, decision = ?decision, diagnostics = ?response.diagnostics(), - "Processing HTTP request" + host = %http_request.host, + method = %http_request.method, + path = %http_request.path, + "http" ); matches!(decision, cedar_policy::Decision::Allow) diff --git a/src/authorization/server.rs b/src/authorization/server.rs index 759a550d..90d3edf6 100644 --- a/src/authorization/server.rs +++ b/src/authorization/server.rs @@ -36,22 +36,9 @@ impl Server { F: FnOnce(tonic::transport::Server) -> tonic::transport::server::Router, { let builder = tonic::transport::Server::builder() - .trace_fn(|req| { - tracing::info!( - method = %req.method(), - path = %req.uri().path(), - content_type = req.headers().get("content-type").map_or("unknown", |v| v.to_str().unwrap_or("unknown")), - user_agent = req.headers().get("user-agent").map_or("unknown", |v| v.to_str().unwrap_or("unknown")), - x_request_id = req.headers().get("x-request-id").map_or("none", |v| v.to_str().unwrap_or("none")), - "gRPC request" - ); - - tracing::info_span!( - "request", - method = %req.method(), - path = %req.uri().path(), - ) - }) + .trace_fn( + |req| tracing::info_span!("rpc", method = %req.method(), path = %req.uri().path()), + ) .timeout(std::time::Duration::from_secs(30)); let router = f(builder); Server { router } |
