From dba739914546c4b2c51644dc229de22f34acd4ea Mon Sep 17 00:00:00 2001 From: divit <27228526+delgado3d@users.noreply.github.com> Date: Thu, 14 Mar 2024 18:46:15 +0530 Subject: [PATCH] feat: use empty allow list for restrict all access (#22023) --- .../Database/NetworkRestrictions/DisallowAllModal.tsx | 4 ++-- .../Database/NetworkRestrictions/NetworkRestrictions.tsx | 5 +---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/apps/studio/components/interfaces/Settings/Database/NetworkRestrictions/DisallowAllModal.tsx b/apps/studio/components/interfaces/Settings/Database/NetworkRestrictions/DisallowAllModal.tsx index bec2b653ee3..6f88f8c5468 100644 --- a/apps/studio/components/interfaces/Settings/Database/NetworkRestrictions/DisallowAllModal.tsx +++ b/apps/studio/components/interfaces/Settings/Database/NetworkRestrictions/DisallowAllModal.tsx @@ -18,8 +18,8 @@ const DisallowAllModal = ({ visible, onClose }: DisallowAllModalProps) => { if (!ref) return console.error('Project ref is required') await applyNetworkRestrictions({ projectRef: ref, - dbAllowedCidrs: ['127.0.0.1/32'], - dbAllowedCidrsV6: ['::1/128'], + dbAllowedCidrs: [], + dbAllowedCidrsV6: [], }) } diff --git a/apps/studio/components/interfaces/Settings/Database/NetworkRestrictions/NetworkRestrictions.tsx b/apps/studio/components/interfaces/Settings/Database/NetworkRestrictions/NetworkRestrictions.tsx index e9ca3edfdf1..f6e070acf78 100644 --- a/apps/studio/components/interfaces/Settings/Database/NetworkRestrictions/NetworkRestrictions.tsx +++ b/apps/studio/components/interfaces/Settings/Database/NetworkRestrictions/NetworkRestrictions.tsx @@ -112,10 +112,7 @@ const NetworkRestrictions = () => { const hasApplyError = restrictionStatus === 'stored' const isUninitialized = restrictedIps.length === 0 && restrictionStatus.length === 0 const isAllowedAll = restrictedIps.includes('0.0.0.0/0') && restrictedIps.includes('::/0') - const isDisallowedAll = - restrictedIps.length === 2 && - restrictedIps.includes('127.0.0.1/32') && - restrictedIps.includes('::1/128') + const isDisallowedAll = restrictedIps.length === 0 if (!hasAccessToRestrictions) return <>