Skip to content

Commit

Permalink
Fix merge conflict and clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
awarus committed Jan 29, 2025
1 parent f851321 commit 81ee691
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 18 deletions.
4 changes: 2 additions & 2 deletions proxy/src/auth/backend/console_redirect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ impl BackendIpAllowlist for ConsoleRedirectBackend {
user_info: &ComputeUserInfo,
) -> auth::Result<Vec<auth::IpPattern>> {
self.api
.get_allowed_ips_and_secret(ctx, user_info)
.get_allowed_ips(ctx, user_info)
.await
.map(|(ips, _)| ips.as_ref().clone())
.map(|ips| ips.as_ref().clone())
.map_err(|e| e.into())
}
}
Expand Down
11 changes: 4 additions & 7 deletions proxy/src/auth/backend/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -305,10 +305,7 @@ async fn auth_quirks(
None => return Err(AuthError::MissingEndpointName),
Some(ConnectionInfoExtra::Aws { vpce_id }) => {
// Convert the vcpe_id to a string
match String::from_utf8(vpce_id.to_vec()) {
Ok(s) => s,
Err(_e) => String::new(),
}
String::from_utf8(vpce_id.to_vec()).unwrap_or_default()
}
Some(ConnectionInfoExtra::Azure { link_id }) => link_id.to_string(),
};
Expand Down Expand Up @@ -513,12 +510,12 @@ impl BackendIpAllowlist for Backend<'_, ()> {
user_info: &ComputeUserInfo,
) -> auth::Result<Vec<auth::IpPattern>> {
let auth_data = match self {
Self::ControlPlane(api, ()) => api.get_allowed_ips_and_secret(ctx, user_info).await,
Self::Local(_) => Ok((Cached::new_uncached(Arc::new(vec![])), None)),
Self::ControlPlane(api, ()) => api.get_allowed_ips(ctx, user_info).await,
Self::Local(_) => Ok(Cached::new_uncached(Arc::new(vec![]))),
};

auth_data
.map(|(ips, _)| ips.as_ref().clone())
.map(|ips| ips.as_ref().clone())
.map_err(|e| e.into())
}
}
Expand Down
7 changes: 2 additions & 5 deletions proxy/src/redis/notifications.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,7 @@ impl<C: ProjectInfoCache + Send + Sync + 'static> MessageHandler<C> {
.proxy
.redis_events_count
.inc(RedisEventsCount::AllowedVpcEndpointIdsUpdateForProjects);
} else if matches!(
msg,
Notification::AllowedVpcEndpointsUpdatedForOrg { .. }
) {
} else if matches!(msg, Notification::AllowedVpcEndpointsUpdatedForOrg { .. }) {
Metrics::get()
.proxy
.redis_events_count
Expand Down Expand Up @@ -248,7 +245,7 @@ fn invalidate_cache<C: ProjectInfoCache>(cache: Arc<C>, msg: Notification) {
match msg {
Notification::AllowedIpsUpdate { allowed_ips_update } => {
cache.invalidate_allowed_ips_for_project(allowed_ips_update.project_id);
},
}
Notification::BlockPublicOrVpcAccessUpdated {
block_public_or_vpc_access_updated,
} => cache.invalidate_block_public_or_vpc_access_for_project(
Expand Down
5 changes: 1 addition & 4 deletions proxy/src/serverless/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,7 @@ impl PoolingBackend {
None => String::new(),
Some(ConnectionInfoExtra::Aws { vpce_id }) => {
// Convert the vcpe_id to a string
match String::from_utf8(vpce_id.to_vec()) {
Ok(s) => s,
Err(_e) => String::new(),
}
String::from_utf8(vpce_id.to_vec()).unwrap_or_default()
}
Some(ConnectionInfoExtra::Azure { link_id }) => link_id.to_string(),
};
Expand Down

0 comments on commit 81ee691

Please sign in to comment.