diff --git a/proxy/src/auth/backend/console_redirect.rs b/proxy/src/auth/backend/console_redirect.rs index b1b09f0260b3..ebd6f0e60dd4 100644 --- a/proxy/src/auth/backend/console_redirect.rs +++ b/proxy/src/auth/backend/console_redirect.rs @@ -92,9 +92,9 @@ impl BackendIpAllowlist for ConsoleRedirectBackend { user_info: &ComputeUserInfo, ) -> auth::Result> { 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()) } } diff --git a/proxy/src/auth/backend/mod.rs b/proxy/src/auth/backend/mod.rs index b24266d3b737..0f4888527231 100644 --- a/proxy/src/auth/backend/mod.rs +++ b/proxy/src/auth/backend/mod.rs @@ -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(), }; @@ -513,12 +510,12 @@ impl BackendIpAllowlist for Backend<'_, ()> { user_info: &ComputeUserInfo, ) -> auth::Result> { 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()) } } diff --git a/proxy/src/redis/notifications.rs b/proxy/src/redis/notifications.rs index 9bd9fecb3b17..84e3c580a9f4 100644 --- a/proxy/src/redis/notifications.rs +++ b/proxy/src/redis/notifications.rs @@ -211,10 +211,7 @@ impl MessageHandler { .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 @@ -248,7 +245,7 @@ fn invalidate_cache(cache: Arc, 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( diff --git a/proxy/src/serverless/backend.rs b/proxy/src/serverless/backend.rs index ba036364102b..0fb4a8a6cc70 100644 --- a/proxy/src/serverless/backend.rs +++ b/proxy/src/serverless/backend.rs @@ -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(), };