feat: use empty allow list for restrict all access (#22023)

This commit is contained in:
divit authored and GitHub committed 2024-03-14 18:46:15 +05:30
1 parent a775e3ba69
commit dba7399145
2 files changed
+3 -6

No files matched your search

@@ -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: [],
})
}
@@ -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 <></>