From a2a94d1f7402d07dbfd43246b46b562be140f05c Mon Sep 17 00:00:00 2001 From: Joshen Lim Date: Tue, 15 Oct 2024 15:51:23 +0800 Subject: [PATCH] Revert "Update auth hooks to use new endpoint and add perms checking" (#29893) Revert "Update auth hooks to use new endpoint and add perms checking (#29870)" This reverts commit a3e1fb2a0e40a5aedac13be6813f336a56a81770. --- .../interfaces/Auth/Hooks/AddHookDropdown.tsx | 9 +- .../interfaces/Auth/Hooks/CreateHookSheet.tsx | 167 +++++------ .../interfaces/Auth/Hooks/HookCard.tsx | 10 +- .../interfaces/Auth/Hooks/HooksListing.tsx | 91 +++--- .../EdgeFunctionSecrets.tsx | 4 +- .../data/auth/auth-hooks-update-mutation.ts | 54 ---- apps/studio/package.json | 2 +- package-lock.json | 8 +- packages/api-types/types/api.d.ts | 263 +----------------- 9 files changed, 158 insertions(+), 450 deletions(-) delete mode 100644 apps/studio/data/auth/auth-hooks-update-mutation.ts diff --git a/apps/studio/components/interfaces/Auth/Hooks/AddHookDropdown.tsx b/apps/studio/components/interfaces/Auth/Hooks/AddHookDropdown.tsx index 12e55e0c8b2..f2802eafb60 100644 --- a/apps/studio/components/interfaces/Auth/Hooks/AddHookDropdown.tsx +++ b/apps/studio/components/interfaces/Auth/Hooks/AddHookDropdown.tsx @@ -16,6 +16,7 @@ import { DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, + SheetSection, } from 'ui' import { HOOKS_DEFINITIONS, HOOK_DEFINITION_TITLE, Hook } from './hooks.constants' import { extractMethod, isValidHook } from './hooks.utils' @@ -37,7 +38,7 @@ export const AddHookDropdown = ({ { enabled: IS_PLATFORM } ) const { data: authConfig } = useAuthConfigQuery({ projectRef }) - const canUpdateAuthHook = useCheckPermissions(PermissionAction.AUTH_EXECUTE, '*') + const canUpdateConfig = useCheckPermissions(PermissionAction.UPDATE, 'custom_config_gotrue') const hooks: Hook[] = HOOKS_DEFINITIONS.map((definition) => { return { @@ -56,7 +57,7 @@ export const AddHookDropdown = ({ const isTeamsOrEnterprisePlan = subscription?.plan.id === 'team' || subscription?.plan.id === 'enterprise' - if (!canUpdateAuthHook) { + if (!canUpdateConfig) { return ( - +
{nonEnterpriseHookOptions.map((h) => ( onSelectHook(h.title)}> @@ -86,7 +87,7 @@ export const AddHookDropdown = ({ ))}
- + {!isTeamsOrEnterprisePlan && ( diff --git a/apps/studio/components/interfaces/Auth/Hooks/CreateHookSheet.tsx b/apps/studio/components/interfaces/Auth/Hooks/CreateHookSheet.tsx index ca32ae51599..5a25cd7643f 100644 --- a/apps/studio/components/interfaces/Auth/Hooks/CreateHookSheet.tsx +++ b/apps/studio/components/interfaces/Auth/Hooks/CreateHookSheet.tsx @@ -14,7 +14,7 @@ import CodeEditor from 'components/ui/CodeEditor/CodeEditor' import FunctionSelector from 'components/ui/FunctionSelector' import SchemaSelector from 'components/ui/SchemaSelector' import { AuthConfigResponse } from 'data/auth/auth-config-query' -import { useAuthHooksUpdateMutation } from 'data/auth/auth-hooks-update-mutation' +import { useAuthConfigUpdateMutation } from 'data/auth/auth-config-update-mutation' import { executeSql } from 'data/sql/execute-sql-query' import { useFlag } from 'hooks/ui/useFlag' import { @@ -42,10 +42,10 @@ import { extractMethod, getRevokePermissionStatements, isValidHook } from './hoo interface CreateHookSheetProps { visible: boolean - title: HOOK_DEFINITION_TITLE | null - authConfig: AuthConfigResponse onClose: () => void onDelete: () => void + title: HOOK_DEFINITION_TITLE | null + authConfig: AuthConfigResponse } export function generateAuthHookSecret() { @@ -109,13 +109,14 @@ const FormSchema = z export const CreateHookSheet = ({ visible, - title, - authConfig, onClose, onDelete, + title, + authConfig, }: CreateHookSheetProps) => { const { ref: projectRef } = useParams() const { project } = useProjectContext() + const { mutate: updateAuthConfig, isLoading: isUpdatingConfig } = useAuthConfigUpdateMutation() const httpsAuthHooksEnabled = useFlag('httpsAuthHooksEnabled') const definition = useMemo( @@ -154,79 +155,6 @@ export const CreateHookSheet = ({ }, }) - const values = form.watch() - - const statements = useMemo(() => { - let permissionChanges: string[] = [] - if (hook.method.type === 'postgres') { - if ( - hook.method.schema !== '' && - hook.method.functionName !== '' && - hook.method.functionName !== values.postgresValues.functionName - ) { - permissionChanges = getRevokePermissionStatements( - hook.method.schema, - hook.method.functionName - ) - } - } - - if (values.postgresValues.functionName !== '') { - permissionChanges = [ - ...permissionChanges, - `-- Grant access to function to supabase_auth_admin\ngrant execute on function ${values.postgresValues.schema}.${values.postgresValues.functionName} to supabase_auth_admin;`, - `-- Grant access to schema to supabase_auth_admin\ngrant usage on schema ${values.postgresValues.schema} to supabase_auth_admin;`, - `-- Revoke function permissions from authenticated, anon and public\nrevoke execute on function ${values.postgresValues.schema}.${values.postgresValues.functionName} from authenticated, anon, public;`, - ] - } - return permissionChanges - }, [hook, values.postgresValues.schema, values.postgresValues.functionName]) - - const { mutate: updateAuthHooks, isLoading: isUpdatingAuthHooks } = useAuthHooksUpdateMutation({ - onSuccess: () => { - toast.success(`Successfully created ${values.hookType}.`) - if (statements.length > 0) { - executeSql({ - projectRef, - connectionString: project!.connectionString, - sql: statements.join('\n'), - }) - } - onClose() - }, - onError: (error) => { - toast.error(`Failed to create hook: ${error.message}`) - }, - }) - - const onSubmit: SubmitHandler> = async (values) => { - if (!project) return console.error('Project is required') - const definition = HOOKS_DEFINITIONS.find((d) => values.hookType === d.title) - - if (!definition) { - return - } - - const enabledLabel = definition.enabledKey - const uriLabel = definition.uriKey - const secretsLabel = definition.secretsKey - - let url = '' - if (values.selectedType === 'postgres') { - url = `pg-functions://postgres/${values.postgresValues.schema}/${values.postgresValues.functionName}` - } else { - url = values.httpsValues.url - } - - const payload = { - [enabledLabel]: values.enabled, - [uriLabel]: url, - [secretsLabel]: values.selectedType === 'https' ? values.httpsValues.secret : null, - } - - updateAuthHooks({ projectRef: projectRef!, config: payload }) - } - useEffect(() => { if (visible) { if (definition) { @@ -266,6 +194,81 @@ export const CreateHookSheet = ({ } }, [authConfig, title, visible, definition]) + const values = form.watch() + + const statements = useMemo(() => { + let permissionChanges: string[] = [] + if (hook.method.type === 'postgres') { + if ( + hook.method.schema !== '' && + hook.method.functionName !== '' && + hook.method.functionName !== values.postgresValues.functionName + ) { + permissionChanges = getRevokePermissionStatements( + hook.method.schema, + hook.method.functionName + ) + } + } + + if (values.postgresValues.functionName !== '') { + permissionChanges = [ + ...permissionChanges, + `-- Grant access to function to supabase_auth_admin\ngrant execute on function ${values.postgresValues.schema}.${values.postgresValues.functionName} to supabase_auth_admin;`, + `-- Grant access to schema to supabase_auth_admin\ngrant usage on schema ${values.postgresValues.schema} to supabase_auth_admin;`, + `-- Revoke function permissions from authenticated, anon and public\nrevoke execute on function ${values.postgresValues.schema}.${values.postgresValues.functionName} from authenticated, anon, public;`, + ] + } + return permissionChanges + }, [hook, values.postgresValues.schema, values.postgresValues.functionName]) + + const onSubmit: SubmitHandler> = async (values) => { + if (!project) return console.error('Project is required') + const definition = HOOKS_DEFINITIONS.find((d) => values.hookType === d.title) + + if (!definition) { + return + } + + const enabledLabel = definition.enabledKey + const uriLabel = definition.uriKey + const secretsLabel = definition.secretsKey + + let url = '' + if (values.selectedType === 'postgres') { + url = `pg-functions://postgres/${values.postgresValues.schema}/${values.postgresValues.functionName}` + } else { + url = values.httpsValues.url + } + + const payload = { + [enabledLabel]: values.enabled, + [uriLabel]: url, + [secretsLabel]: values.selectedType === 'https' ? values.httpsValues.secret : null, + } + + updateAuthConfig( + { projectRef: projectRef!, config: payload }, + { + onSuccess: () => { + toast.success(`Successfully created ${values.hookType}.`) + if (statements.length > 0) { + executeSql({ + projectRef, + connectionString: project.connectionString, + sql: statements.join('\n'), + }) + } + onClose() + }, + onError: (error) => { + toast.error(`Failed to create hook: ${error.message}`) + onClose() + }, + } + ) + } + return ( onClose()}> @@ -489,16 +492,16 @@ export const CreateHookSheet = ({ )} - diff --git a/apps/studio/components/interfaces/Auth/Hooks/HookCard.tsx b/apps/studio/components/interfaces/Auth/Hooks/HookCard.tsx index 9850a9a51da..38e78f349cc 100644 --- a/apps/studio/components/interfaces/Auth/Hooks/HookCard.tsx +++ b/apps/studio/components/interfaces/Auth/Hooks/HookCard.tsx @@ -1,20 +1,18 @@ -import { PermissionAction } from '@supabase/shared-types/out/constants' import { Check, Webhook } from 'lucide-react' import { Badge, Input } from 'ui' import { ButtonTooltip } from 'components/ui/ButtonTooltip' -import { useCheckPermissions } from 'hooks/misc/useCheckPermissions' import { copyToClipboard } from 'lib/helpers' import { Hook } from './hooks.constants' interface HookCardProps { hook: Hook + canUpdateConfig: boolean + onToggle: (enabled: boolean) => void onSelect: () => void } -export const HookCard = ({ hook, onSelect }: HookCardProps) => { - const canUpdateAuthHook = useCheckPermissions(PermissionAction.AUTH_EXECUTE, '*') - +export const HookCard = ({ hook, canUpdateConfig, onToggle, onSelect }: HookCardProps) => { return (
@@ -95,7 +93,7 @@ export const HookCard = ({ hook, onSelect }: HookCardProps) => {
onSelect()} tooltip={{ content: { diff --git a/apps/studio/components/interfaces/Auth/Hooks/HooksListing.tsx b/apps/studio/components/interfaces/Auth/Hooks/HooksListing.tsx index 37c469af4ac..86e4149705d 100644 --- a/apps/studio/components/interfaces/Auth/Hooks/HooksListing.tsx +++ b/apps/studio/components/interfaces/Auth/Hooks/HooksListing.tsx @@ -1,21 +1,23 @@ +import { PermissionAction } from '@supabase/shared-types/out/constants' import { useState } from 'react' import { toast } from 'sonner' import { useParams } from 'common' -import { useProjectContext } from 'components/layouts/ProjectLayout/ProjectContext' import AlertError from 'components/ui/AlertError' -import CodeEditor from 'components/ui/CodeEditor/CodeEditor' import { FormHeader } from 'components/ui/Forms/FormHeader' import { useAuthConfigQuery } from 'data/auth/auth-config-query' -import { useAuthHooksUpdateMutation } from 'data/auth/auth-hooks-update-mutation' -import { executeSql } from 'data/sql/execute-sql-query' -import { cn } from 'ui' +import { useAuthConfigUpdateMutation } from 'data/auth/auth-config-update-mutation' +import { useCheckPermissions } from 'hooks/misc/useCheckPermissions' import ConfirmationModal from 'ui-patterns/Dialogs/ConfirmationModal' import { AddHookDropdown } from './AddHookDropdown' import { CreateHookSheet } from './CreateHookSheet' import { HookCard } from './HookCard' import { HOOKS_DEFINITIONS, HOOK_DEFINITION_TITLE, Hook } from './hooks.constants' import { extractMethod, getRevokePermissionStatements, isValidHook } from './hooks.utils' +import { executeSql } from 'data/sql/execute-sql-query' +import { useProjectContext } from 'components/layouts/ProjectLayout/ProjectContext' +import CodeEditor from 'components/ui/CodeEditor/CodeEditor' +import { cn } from 'ui' export const HooksListing = () => { const { ref: projectRef } = useParams() @@ -25,27 +27,8 @@ export const HooksListing = () => { const [selectedHook, setSelectedHook] = useState(null) const [selectedHookForDeletion, setSelectedHookForDeletion] = useState(null) - const { mutate: updateAuthHooks, isLoading: isDeletingAuthHook } = useAuthHooksUpdateMutation({ - onSuccess: async () => { - if (!selectedHookForDeletion) return - - const { method } = selectedHookForDeletion - if (method.type === 'postgres') { - const revokeStatements = getRevokePermissionStatements(method.schema, method.functionName) - await executeSql({ - projectRef, - connectionString: project!.connectionString, - sql: revokeStatements.join('\n'), - }) - } - toast.success(`${selectedHookForDeletion.title} has been deleted.`) - setSelectedHookForDeletion(null) - setSelectedHook(null) - }, - onError: (error) => { - toast.error(`Failed to delete hook: ${error.message}`) - }, - }) + const { mutateAsync: updateAuthConfig } = useAuthConfigUpdateMutation() + const canUpdateConfig = useCheckPermissions(PermissionAction.UPDATE, 'custom_config_gotrue') const hooks: Hook[] = HOOKS_DEFINITIONS.map((definition) => { return { @@ -95,7 +78,16 @@ export const HooksListing = () => { setSelectedHook(hook.title)} + canUpdateConfig={canUpdateConfig} + onToggle={(enabled) => + updateAuthConfig({ + projectRef: projectRef!, + config: { [hook.enabledKey]: enabled }, + }) + } + onSelect={() => { + setSelectedHook(hook.title) + }} /> ) })} @@ -106,7 +98,9 @@ export const HooksListing = () => { visible={!!selectedHook} onDelete={() => { const hook = hooks.find((h) => h.title === selectedHook) - if (hook) setSelectedHookForDeletion(hook) + if (hook) { + setSelectedHookForDeletion(hook) + } }} onClose={() => setSelectedHook(null)} authConfig={authConfig!} @@ -116,14 +110,16 @@ export const HooksListing = () => { visible={!!selectedHookForDeletion} size="large" variant="destructive" - loading={isDeletingAuthHook} - title={`Confirm to delete ${selectedHookForDeletion?.title}`} + title="Confirm to delete" confirmLabel="Delete" confirmLabelLoading="Deleting" onCancel={() => setSelectedHookForDeletion(null)} - onConfirm={() => { - if (!selectedHookForDeletion) return - updateAuthHooks({ + onConfirm={async () => { + if (!selectedHookForDeletion) { + return + } + + await updateAuthConfig({ projectRef: projectRef!, config: { [selectedHookForDeletion.enabledKey]: false, @@ -131,20 +127,35 @@ export const HooksListing = () => { [selectedHookForDeletion.secretsKey]: null, }, }) + + const { method } = selectedHookForDeletion + + if (method.type === 'postgres') { + const revokeStatements = getRevokePermissionStatements( + method.schema, + method.functionName + ) + await executeSql({ + projectRef, + connectionString: project!.connectionString, + sql: revokeStatements.join('\n'), + }) + } + toast.success(`${selectedHookForDeletion.title} has been deleted.`) + setSelectedHookForDeletion(null) + setSelectedHook(null) }} >
-

- Are you sure you want to delete the {selectedHookForDeletion?.title}? +

+ {`Are you sure you want to delete the ${selectedHookForDeletion?.title}?`}

{selectedHookForDeletion?.method.type === 'postgres' && ( <> -

- The following statements will be executed on the{' '} - {selectedHookForDeletion?.method.schema}. - {selectedHookForDeletion?.method.functionName} function: +

+ {`The following statements will be executed on the ${selectedHookForDeletion?.method.schema}.${selectedHookForDeletion?.method.functionName} function:`}

-
+
{ const [showCreateSecret, setShowCreateSecret] = useState(false) const [selectedSecret, setSelectedSecret] = useState() - const canReadSecrets = useCheckPermissions(PermissionAction.SECRETS_READ, '*') - const canUpdateSecrets = useCheckPermissions(PermissionAction.SECRETS_WRITE, '*') + const canReadSecrets = useCheckPermissions(PermissionAction.FUNCTIONS_READ, '*') + const canUpdateSecrets = useCheckPermissions(PermissionAction.FUNCTIONS_WRITE, '*') const { data, error, isLoading, isSuccess, isError } = useSecretsQuery({ projectRef: projectRef, diff --git a/apps/studio/data/auth/auth-hooks-update-mutation.ts b/apps/studio/data/auth/auth-hooks-update-mutation.ts deleted file mode 100644 index 8b8ebecffe6..00000000000 --- a/apps/studio/data/auth/auth-hooks-update-mutation.ts +++ /dev/null @@ -1,54 +0,0 @@ -import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query' -import { toast } from 'sonner' - -import type { components } from 'data/api' -import { handleError, patch } from 'data/fetchers' -import type { ResponseError } from 'types' -import { authKeys } from './keys' - -export type AuthHooksUpdateVariables = { - projectRef: string - config: components['schemas']['UpdateGoTrueConfigHooksBody'] -} - -export async function updateAuthHooks({ projectRef, config }: AuthHooksUpdateVariables) { - const { data, error } = await patch('/platform/auth/{ref}/config/hooks', { - params: { path: { ref: projectRef } }, - body: config, - }) - - if (error) handleError(error) - return data -} - -type AuthHooksUpdateData = Awaited> - -export const useAuthHooksUpdateMutation = ({ - onSuccess, - onError, - ...options -}: Omit< - UseMutationOptions, - 'mutationFn' -> = {}) => { - const queryClient = useQueryClient() - - return useMutation( - (vars) => updateAuthHooks(vars), - { - async onSuccess(data, variables, context) { - const { projectRef } = variables - await queryClient.invalidateQueries(authKeys.authConfig(projectRef)) - await onSuccess?.(data, variables, context) - }, - async onError(data, variables, context) { - if (onError === undefined) { - toast.error(`Failed to update auth hooks: ${data.message}`) - } else { - onError(data, variables, context) - } - }, - ...options, - } - ) -} diff --git a/apps/studio/package.json b/apps/studio/package.json index 6131743e9b8..55ad9b69b3d 100644 --- a/apps/studio/package.json +++ b/apps/studio/package.json @@ -40,7 +40,7 @@ "@supabase/auth-js": "2.64.2", "@supabase/pg-meta": "*", "@supabase/realtime-js": "2.10.2", - "@supabase/shared-types": "0.1.73", + "@supabase/shared-types": "0.1.70", "@supabase/supabase-js": "^2.44.3", "@tanstack/react-query": "4.35.7", "@tanstack/react-query-devtools": "4.35.7", diff --git a/package-lock.json b/package-lock.json index 82c222e368b..884657ab1ac 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1826,7 +1826,7 @@ "@supabase/auth-js": "2.64.2", "@supabase/pg-meta": "*", "@supabase/realtime-js": "2.10.2", - "@supabase/shared-types": "0.1.73", + "@supabase/shared-types": "0.1.70", "@supabase/supabase-js": "^2.44.3", "@tanstack/react-query": "4.35.7", "@tanstack/react-query-devtools": "4.35.7", @@ -14739,9 +14739,9 @@ } }, "node_modules/@supabase/shared-types": { - "version": "0.1.73", - "resolved": "https://registry.npmjs.org/@supabase/shared-types/-/shared-types-0.1.73.tgz", - "integrity": "sha512-5BhGYrJ/ICBlIWdAZL3lRD2w6ZUAYvjpulvIkHfVKNcXpF3LpZ+2ONRDkm0B8dlWp+ZE1bm7DbFgJvoW+AT3XA==" + "version": "0.1.70", + "resolved": "https://registry.npmjs.org/@supabase/shared-types/-/shared-types-0.1.70.tgz", + "integrity": "sha512-Z/JBbISlxMcOjFcomZdB5AGKrQdTy/dy3HQ8EpHx3xKz1yktbUDrzVcEFUKidRPrQu1GAt9JSW6qBsBlXHcyLA==" }, "node_modules/@supabase/sql-to-rest": { "version": "0.1.6", diff --git a/packages/api-types/types/api.d.ts b/packages/api-types/types/api.d.ts index 3a85142fd88..15d57c796ef 100644 --- a/packages/api-types/types/api.d.ts +++ b/packages/api-types/types/api.d.ts @@ -101,10 +101,6 @@ export interface paths { /** Updates GoTrue config */ patch: operations['GoTrueConfigController_updateGoTrueConfig'] } - '/platform/auth/{ref}/config/hooks': { - /** Updates GoTrue config hooks */ - patch: operations['GoTrueConfigController_updateGoTrueConfigHooks'] - } '/platform/auth/{ref}/invite': { /** Sends an invite to the given email */ post: operations['AuthInviteController_sendInvite'] @@ -126,24 +122,10 @@ export interface paths { get: operations['TemplateController_getTemplate'] } '/platform/auth/{ref}/users': { - /** - * Gets users - * @deprecated - */ + /** Gets users */ get: operations['UsersController_getUsers'] - /** Creates user */ - post: operations['UsersController_createUser'] - /** - * Delete user with given ID - * @deprecated - */ - delete: operations['UsersController_deleteUser'] - } - '/platform/auth/{ref}/users/{id}': { /** Delete user with given ID */ - delete: operations['UsersController_deleteUserById'] - /** Updates user with given ID */ - patch: operations['UsersController_updateUserById'] + delete: operations['UsersController_deleteUser'] } '/platform/auth/{ref}/users/{id}/factors': { /** Delete all factors associated to a user */ @@ -1308,10 +1290,6 @@ export interface paths { /** Updates GoTrue config */ patch: operations['GoTrueConfigController_updateGoTrueConfig'] } - '/v0/auth/{ref}/config/hooks': { - /** Updates GoTrue config hooks */ - patch: operations['GoTrueConfigController_updateGoTrueConfigHooks'] - } '/v0/auth/{ref}/invite': { /** Sends an invite to the given email */ post: operations['AuthInviteController_sendInvite'] @@ -1333,24 +1311,10 @@ export interface paths { get: operations['TemplateController_getTemplate'] } '/v0/auth/{ref}/users': { - /** - * Gets users - * @deprecated - */ + /** Gets users */ get: operations['UsersController_getUsers'] - /** Creates user */ - post: operations['UsersController_createUser'] - /** - * Delete user with given ID - * @deprecated - */ - delete: operations['UsersController_deleteUser'] - } - '/v0/auth/{ref}/users/{id}': { /** Delete user with given ID */ - delete: operations['UsersController_deleteUserById'] - /** Updates user with given ID */ - patch: operations['UsersController_updateUserById'] + delete: operations['UsersController_deleteUser'] } '/v0/auth/{ref}/users/{id}/factors': { /** Delete all factors associated to a user */ @@ -3062,11 +3026,6 @@ export interface components { table: string table_id?: number } - CreateUserBody: { - email: string - email_confirm: boolean - password: string - } CreateUserContentFolderResponse: { id: string name: string @@ -3074,43 +3033,6 @@ export interface components { parent_id?: string | null project_id: number } - CreateUserReponse: { - aud?: string - banned_until?: string - confirmation_sent_at?: string - confirmation_token?: string - confirmed_at?: string - created_at?: string - deleted_at?: string - email?: string - email_change?: string - email_change_confirm_status?: number - email_change_sent_at?: string - email_change_token_current?: string - email_change_token_new?: string - email_confirmed_at?: string - encrypted_password?: string - id?: string - instance_id?: string - invited_at?: string - is_anonymous?: boolean - is_sso_user?: boolean - is_super_admin?: boolean - last_sign_in_at?: string - phone?: string - phone_change?: string - phone_change_sent_at?: string - phone_change_token?: string - phone_confirmed_at?: string - raw_app_meta_data?: Record - raw_user_meta_data?: Record - reauthentication_sent_at?: string - reauthentication_token?: string - recovery_sent_at?: string - recovery_token?: string - role?: string - updated_at?: string - } CreateVercelConnectionResponse: { env_sync_error?: components['schemas']['SyncVercelEnvError'] id: string @@ -6280,23 +6202,6 @@ export interface components { SMTP_USER?: string URI_ALLOW_LIST?: string } - UpdateGoTrueConfigHooksBody: { - HOOK_CUSTOM_ACCESS_TOKEN_ENABLED?: boolean - HOOK_CUSTOM_ACCESS_TOKEN_SECRETS?: string - HOOK_CUSTOM_ACCESS_TOKEN_URI?: string - HOOK_MFA_VERIFICATION_ATTEMPT_ENABLED?: boolean - HOOK_MFA_VERIFICATION_ATTEMPT_SECRETS?: string - HOOK_MFA_VERIFICATION_ATTEMPT_URI?: string - HOOK_PASSWORD_VERIFICATION_ATTEMPT_ENABLED?: boolean - HOOK_PASSWORD_VERIFICATION_ATTEMPT_SECRETS?: string - HOOK_PASSWORD_VERIFICATION_ATTEMPT_URI?: string - HOOK_SEND_EMAIL_ENABLED?: boolean - HOOK_SEND_EMAIL_SECRETS?: string - HOOK_SEND_EMAIL_URI?: string - HOOK_SEND_SMS_ENABLED?: boolean - HOOK_SEND_SMS_SECRETS?: string - HOOK_SEND_SMS_URI?: string - } UpdateMemberBody: { role_id: number } @@ -6515,46 +6420,6 @@ export interface components { table?: string table_id?: number } - UpdateUserBody: { - ban_duration?: string - } - UpdateUserReponse: { - aud?: string - banned_until?: string - confirmation_sent_at?: string - confirmation_token?: string - confirmed_at?: string - created_at?: string - deleted_at?: string - email?: string - email_change?: string - email_change_confirm_status?: number - email_change_sent_at?: string - email_change_token_current?: string - email_change_token_new?: string - email_confirmed_at?: string - encrypted_password?: string - id?: string - instance_id?: string - invited_at?: string - is_anonymous?: boolean - is_sso_user?: boolean - is_super_admin?: boolean - last_sign_in_at?: string - phone?: string - phone_change?: string - phone_change_sent_at?: string - phone_change_token?: string - phone_confirmed_at?: string - raw_app_meta_data?: Record - raw_user_meta_data?: Record - reauthentication_sent_at?: string - reauthentication_token?: string - recovery_sent_at?: string - recovery_token?: string - role?: string - updated_at?: string - } UpdateVercelConnectionsBody: { env_sync_targets?: ('production' | 'preview' | 'development')[] public_env_var_prefix?: string @@ -7275,34 +7140,6 @@ export interface operations { } } } - /** Updates GoTrue config hooks */ - GoTrueConfigController_updateGoTrueConfigHooks: { - parameters: { - path: { - /** @description Project ref */ - ref: string - } - } - requestBody: { - content: { - 'application/json': components['schemas']['UpdateGoTrueConfigHooksBody'] - } - } - responses: { - 200: { - content: { - 'application/json': components['schemas']['GoTrueConfigResponse'] - } - } - 403: { - content: never - } - /** @description Failed to update GoTrue config hooks */ - 500: { - content: never - } - } - } /** Sends an invite to the given email */ AuthInviteController_sendInvite: { parameters: { @@ -7441,10 +7278,7 @@ export interface operations { } } } - /** - * Gets users - * @deprecated - */ + /** Gets users */ UsersController_getUsers: { parameters: { query: { @@ -7473,38 +7307,7 @@ export interface operations { } } } - /** Creates user */ - UsersController_createUser: { - parameters: { - path: { - /** @description Project ref */ - ref: string - } - } - requestBody: { - content: { - 'application/json': components['schemas']['CreateUserBody'] - } - } - responses: { - 201: { - content: { - 'application/json': components['schemas']['CreateUserReponse'] - } - } - 403: { - content: never - } - /** @description Failed to create user */ - 500: { - content: never - } - } - } - /** - * Delete user with given ID - * @deprecated - */ + /** Delete user with given ID */ UsersController_deleteUser: { parameters: { path: { @@ -7532,57 +7335,6 @@ export interface operations { } } } - /** Delete user with given ID */ - UsersController_deleteUserById: { - parameters: { - path: { - /** @description Project ref */ - ref: string - id: string - } - } - responses: { - 200: { - content: never - } - 403: { - content: never - } - /** @description Failed to delete user */ - 500: { - content: never - } - } - } - /** Updates user with given ID */ - UsersController_updateUserById: { - parameters: { - path: { - /** @description Project ref */ - ref: string - id: string - } - } - requestBody: { - content: { - 'application/json': components['schemas']['UpdateUserBody'] - } - } - responses: { - 200: { - content: { - 'application/json': components['schemas']['UpdateUserReponse'] - } - } - 403: { - content: never - } - /** @description Failed to update user with given ID */ - 500: { - content: never - } - } - } /** Delete all factors associated to a user */ FactorsController_deleteFactors: { parameters: { @@ -12423,9 +12175,6 @@ export interface operations { 'application/json': components['schemas']['UpdateSecretsResponse'] } } - 403: { - content: never - } /** @description Failed to update project's secrets config */ 500: { content: never