diff --git a/supabase/_async/client.py b/supabase/_async/client.py index 1f593135..fee425b5 100644 --- a/supabase/_async/client.py +++ b/supabase/_async/client.py @@ -58,12 +58,6 @@ def __init__( if not re.match(r"^(https?)://.+", supabase_url): raise SupabaseException("Invalid URL") - # Check if the key is a valid JWT - if not re.match( - r"^[A-Za-z0-9-_=]+\.[A-Za-z0-9-_=]+\.?[A-Za-z0-9-_.+/=]*$", supabase_key - ): - raise SupabaseException("Invalid API key") - if options is None: options = ClientOptions(storage=AsyncMemoryStorage()) diff --git a/supabase/_sync/client.py b/supabase/_sync/client.py index a945716c..eae5bff1 100644 --- a/supabase/_sync/client.py +++ b/supabase/_sync/client.py @@ -57,12 +57,6 @@ def __init__( if not re.match(r"^(https?)://.+", supabase_url): raise SupabaseException("Invalid URL") - # Check if the key is a valid JWT - if not re.match( - r"^[A-Za-z0-9-_=]+\.[A-Za-z0-9-_=]+\.?[A-Za-z0-9-_.+/=]*$", supabase_key - ): - raise SupabaseException("Invalid API key") - if options is None: options = ClientOptions(storage=SyncMemoryStorage()) diff --git a/tests/test_client.py b/tests/test_client.py index b0105c4a..ef51f6bd 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -1,26 +1,11 @@ from __future__ import annotations import os -from typing import Any from unittest.mock import MagicMock -import pytest from gotrue import SyncMemoryStorage -from supabase import Client, ClientOptions, SupabaseException, create_client - - -@pytest.mark.xfail( - reason="None of these values should be able to instantiate a client object" -) -@pytest.mark.parametrize("url", ["", None, "valeefgpoqwjgpj", 139, -1, {}, []]) -@pytest.mark.parametrize("key", ["", None, "valeefgpoqwjgpj", 139, -1, {}, []]) -def test_incorrect_values_dont_instantiate_client(url: Any, key: Any) -> None: - """Ensure we can't instantiate client with invalid values.""" - try: - _: Client = create_client(url, key) - except SupabaseException as e: - pass +from supabase import ClientOptions, create_client def test_function_initialization() -> None: