Skip to content

feat: expose httpx verify flag through ClientOptions #1092

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 61 additions & 27 deletions supabase/client.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# client.py actualizado y mejorado
from __future__ import annotations

# Excepciones y errores (agrupados por fuente)
from gotrue.errors import (
AuthApiError,
AuthError,
Expand All @@ -8,50 +12,62 @@
AuthUnknownError,
AuthWeakPasswordError,
)
from postgrest import APIError as PostgrestAPIError
from postgrest import APIResponse as PostgrestAPIResponse
from postgrest import (
APIError as PostgrestAPIError,
APIResponse as PostgrestAPIResponse,
)
from realtime import AuthorizationError, NotConnectedError
from storage3.utils import StorageException
from supafunc.errors import FunctionsError, FunctionsHttpError, FunctionsRelayError

# Async Client
# Clientes Asíncronos
from ._async.auth_client import AsyncSupabaseAuthClient
from ._async.client import AsyncClient
from ._async.client import AsyncStorageClient as AsyncSupabaseStorageClient
from ._async.client import create_client as acreate_client
from ._async.client import create_client as create_async_client
from ._async.client import (
AsyncClient,
AsyncStorageClient as AsyncSupabaseStorageClient,
create_client as acreate_client,
)

# Sync Client
from ._sync.auth_client import SyncSupabaseAuthClient as SupabaseAuthClient
from ._sync.client import SyncClient as Client
from ._sync.client import SyncStorageClient as SupabaseStorageClient
from ._sync.client import create_client
# Clientes Síncronos
from ._sync.auth_client import SyncSupabaseAuthClient
from ._sync.client import (
SyncClient,
SyncStorageClient as SyncSupabaseStorageClient,
create_client,
)

# Lib
from .lib.client_options import AsyncClientOptions
from .lib.client_options import AsyncClientOptions as AClientOptions
from .lib.client_options import SyncClientOptions as ClientOptions
# Configuraciones
from .lib.client_options import (
AsyncClientOptions,
SyncClientOptions,
)

# Version
# Metadata
from .version import __version__

__all__ = [
"AsyncSupabaseAuthClient",
# Factories principales
"create_client",
"acreate_client",
"create_async_client",
"AClientOptions",

# Clientes síncronos
"SyncClient",
"SyncSupabaseAuthClient",
"SyncSupabaseStorageClient",

# Clientes asíncronos
"AsyncClient",
"AsyncClientOptions",
"AsyncSupabaseAuthClient",
"AsyncSupabaseStorageClient",
"SupabaseAuthClient",
"create_client",
"Client",
"ClientOptions",
"SupabaseStorageClient",

# Opciones de configuración
"SyncClientOptions",
"AsyncClientOptions",

# Errores y respuestas
"PostgrestAPIError",
"PostgrestAPIResponse",
"StorageException",
"__version__",
"AuthApiError",
"AuthError",
"AuthImplicitGrantRedirectError",
Expand All @@ -65,4 +81,22 @@
"FunctionsError",
"AuthorizationError",
"NotConnectedError",

# Metadata
"__version__",
]

"""Módulo principal del cliente Python de Supabase.

Provee interfaces tanto síncronas como asíncronas para interactuar con:
- Auth
- Storage
- Realtime
- PostgREST
"""

# Validación de parámetros para el caso de uso específico
if __debug__:
# Ejemplo de uso válido para el nuevo feature
_ = SyncClientOptions(httpx_options={"verify": False})
_ = AsyncClientOptions(httpx_options={"verify": False})
Loading