Skip to content

Commit

Permalink
fix: rename user address to user
Browse files Browse the repository at this point in the history
  • Loading branch information
sahra-karakoc authored and i0n committed Oct 22, 2024
1 parent ad22e5d commit 63bca1e
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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_with::TryFromInto<f64>>")]
#[serde(rename = "max_budget")]
Expand Down Expand Up @@ -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,
})
Expand Down
4 changes: 2 additions & 2 deletions src/client_query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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(),
Expand Down
2 changes: 1 addition & 1 deletion src/middleware/require_auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions src/reports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<f64>,
pub indexer_requests: Vec<IndexerRequest>,
pub request_bytes: u32,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/subgraph_studio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
Expand Down

0 comments on commit 63bca1e

Please sign in to comment.