diff --git a/src/auth.rs b/src/auth.rs index 1cbea27a..97b39548 100644 --- a/src/auth.rs +++ b/src/auth.rs @@ -36,7 +36,7 @@ impl AuthSettings { #[derive(Clone, Debug, Default, Deserialize)] pub struct APIKey { pub key: String, - pub user_address: String, + pub user: String, pub query_status: QueryStatus, #[serde_as(as = "Option>")] #[serde(rename = "max_budget")] @@ -105,7 +105,7 @@ impl AuthContext { Ok(AuthSettings { key: api_key.key.clone(), - user: api_key.user_address.clone(), + user: api_key.user.clone(), authorized_subgraphs: api_key.subgraphs.clone(), budget_usd: api_key.max_budget_usd, }) diff --git a/src/client_query.rs b/src/client_query.rs index a7c7bc15..a715b8e0 100644 --- a/src/client_query.rs +++ b/src/client_query.rs @@ -482,7 +482,7 @@ async fn run_indexer_queries( response_time_ms, result, api_key: auth.key, - user_address: auth.user, + user: auth.user, grt_per_usd, indexer_requests, request_bytes: client_request_bytes, @@ -864,7 +864,7 @@ pub async fn handle_indexer_query( response_time_ms, result: report_result, api_key: auth.key, - user_address: auth.user, + user: auth.user, grt_per_usd, request_bytes: indexer_request.request.len() as u32, response_bytes: result.as_ref().map(|r| r.client_response.len() as u32).ok(), diff --git a/src/middleware/require_auth.rs b/src/middleware/require_auth.rs index a7b9edd9..4cc6fcc1 100644 --- a/src/middleware/require_auth.rs +++ b/src/middleware/require_auth.rs @@ -130,7 +130,7 @@ where return ResponseFuture::error(graphql::error_response(Error::Auth(err))); } }; - tracing::debug!(user_address = ?auth.user, api_key = %auth.key); + tracing::debug!(user = ?auth.user, api_key = %auth.key); // Insert the `AuthSettings` extension into the request req.extensions_mut().insert(auth); diff --git a/src/reports.rs b/src/reports.rs index 6bd630f8..a483e7ea 100644 --- a/src/reports.rs +++ b/src/reports.rs @@ -13,7 +13,7 @@ pub struct ClientRequest { pub response_time_ms: u16, pub result: Result<(), errors::Error>, pub api_key: String, - pub user_address: String, + pub user: String, pub grt_per_usd: NotNan, pub indexer_requests: Vec, pub request_bytes: u32, @@ -130,7 +130,7 @@ impl Reporter { "graph_env": &self.graph_env, "timestamp": timestamp, "api_key": &client_request.api_key, - "user": &client_request.user_address, + "user": &client_request.user, "deployment": client_request.indexer_requests.first().map(|i| i.deployment.to_string()).unwrap_or_default(), "indexed_chain": indexed_chain, "network": indexed_chain, @@ -176,7 +176,7 @@ impl Reporter { "graph_env": &self.graph_env, "timestamp": timestamp, "api_key": &client_request.api_key, - "user_address": &client_request.user_address, + "user": &client_request.user, "deployment": &indexer_request.deployment, "network": &indexer_request.subgraph_chain, "indexed_chain": &indexer_request.subgraph_chain, diff --git a/src/subgraph_studio.rs b/src/subgraph_studio.rs index 57278224..509a4fe7 100644 --- a/src/subgraph_studio.rs +++ b/src/subgraph_studio.rs @@ -75,7 +75,7 @@ impl Client { .map(|api_key| { let api_key = APIKey { key: api_key.key, - user_address: api_key.user_address, + user: api_key.user_address, query_status: api_key.query_status, domains: api_key.domains, max_budget_usd: api_key.max_budget.and_then(|b| b.try_into().ok()),