Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

realtime: Remove realtime authorization flag (#28437)

Filipe Cabaçod5fa457bce45
diff --git a/apps/studio/components/interfaces/Realtime/Inspector/ChooseChannelPopover/index.tsx b/apps/studio/components/interfaces/Realtime/Inspector/ChooseChannelPopover/index.tsx
index 28575b47fb0..40026ff7e0c 100644
--- a/apps/studio/components/interfaces/Realtime/Inspector/ChooseChannelPopover/index.tsx
+++ b/apps/studio/components/interfaces/Realtime/Inspector/ChooseChannelPopover/index.tsx
@@ -36,7 +36,6 @@ export const ChooseChannelPopover = ({ config, onChangeConfig }: ChooseChannelPo
const [open, setOpen] = useState(false)
const telemetryProps = useTelemetryProps()
const router = useRouter()
- const authzEnabled = useFlag('authzRealtime')
const form = useForm<z.infer<typeof FormSchema>>({
mode: 'onBlur',
@@ -142,33 +141,31 @@ export const ChooseChannelPopover = ({ config, onChangeConfig }: ChooseChannelPo
)}
/>
- {authzEnabled ? (
- <FormField_Shadcn_
- key="isPrivate"
- control={form.control}
- name="isPrivate"
- render={({ field }) => (
- <FormItem_Shadcn_ className="">
- <div className="flex flex-row items-center gap-x-2">
- <FormControl_Shadcn_>
- <Switch
- checked={field.value}
- onCheckedChange={field.onChange}
- disabled={field.disabled}
- />
- </FormControl_Shadcn_>
- <FormLabel_Shadcn_ className="text-xs">
- Is channel private?
- </FormLabel_Shadcn_>
- </div>
- <FormDescription_Shadcn_ className="text-xs text-foreground-lighter mt-2">
- If the channel is marked as private, it will use RLS policies to filter
- messages.
- </FormDescription_Shadcn_>
- </FormItem_Shadcn_>
- )}
- />
- ) : null}
+ <FormField_Shadcn_
+ key="isPrivate"
+ control={form.control}
+ name="isPrivate"
+ render={({ field }) => (
+ <FormItem_Shadcn_ className="">
+ <div className="flex flex-row items-center gap-x-2">
+ <FormControl_Shadcn_>
+ <Switch
+ checked={field.value}
+ onCheckedChange={field.onChange}
+ disabled={field.disabled}
+ />
+ </FormControl_Shadcn_>
+ <FormLabel_Shadcn_ className="text-xs">
+ Is channel private?
+ </FormLabel_Shadcn_>
+ </div>
+ <FormDescription_Shadcn_ className="text-xs text-foreground-lighter mt-2">
+ If the channel is marked as private, it will use RLS policies to filter
+ messages.
+ </FormDescription_Shadcn_>
+ </FormItem_Shadcn_>
+ )}
+ />
<Button asChild type="default" className="w-min" icon={<ExternalLink />}>
<a
diff --git a/apps/studio/components/layouts/RealtimeLayout/RealtimeLayout.tsx b/apps/studio/components/layouts/RealtimeLayout/RealtimeLayout.tsx
index 2653b3fce13..60bbd19599c 100644
--- a/apps/studio/components/layouts/RealtimeLayout/RealtimeLayout.tsx
+++ b/apps/studio/components/layouts/RealtimeLayout/RealtimeLayout.tsx
@@ -18,15 +18,11 @@ const RealtimeLayout = ({ title, children }: PropsWithChildren<RealtimeLayoutPro
const router = useRouter()
const page = router.pathname.split('/')[4]
- const authzEnabled = useFlag('authzRealtime')
-
return (
<ProjectLayout
title={title}
product="Realtime"
- productMenu={
- <ProductMenu page={page} menu={generateRealtimeMenu(project!, { authzEnabled })} />
- }
+ productMenu={<ProductMenu page={page} menu={generateRealtimeMenu(project!)} />}
>
{children}
</ProjectLayout>
diff --git a/apps/studio/components/layouts/RealtimeLayout/RealtimeMenu.utils.ts b/apps/studio/components/layouts/RealtimeLayout/RealtimeMenu.utils.ts
index cad5482e8f2..70bda5eebc5 100644
--- a/apps/studio/components/layouts/RealtimeLayout/RealtimeMenu.utils.ts
+++ b/apps/studio/components/layouts/RealtimeLayout/RealtimeMenu.utils.ts
@@ -1,10 +1,7 @@
import type { ProductMenuGroup } from 'components/ui/ProductMenu/ProductMenu.types'
import type { Project } from 'data/projects/project-detail-query'
-export const generateRealtimeMenu = (
- project: Project,
- { authzEnabled }: { authzEnabled: boolean }
-): ProductMenuGroup[] => {
+export const generateRealtimeMenu = (project: Project): ProductMenuGroup[] => {
const ref = project?.ref ?? 'default'
return [
@@ -19,20 +16,16 @@ export const generateRealtimeMenu = (
},
],
},
- ...(authzEnabled
- ? [
- {
- title: 'Configuration',
- items: [
- {
- name: 'Policies',
- key: 'policies',
- url: `/project/${ref}/realtime/policies`,
- items: [],
- },
- ],
- },
- ]
- : []),
+ {
+ title: 'Configuration',
+ items: [
+ {
+ name: 'Policies',
+ key: 'policies',
+ url: `/project/${ref}/realtime/policies`,
+ items: [],
+ },
+ ],
+ },
]
}