supabase_auth 2.31.0__tar.gz → 2.32.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {supabase_auth-2.31.0 → supabase_auth-2.32.0}/PKG-INFO +1 -1
- {supabase_auth-2.31.0 → supabase_auth-2.32.0}/pyproject.toml +1 -1
- {supabase_auth-2.31.0 → supabase_auth-2.32.0}/src/supabase_auth/_async/gotrue_client.py +1 -1
- {supabase_auth-2.31.0 → supabase_auth-2.32.0}/src/supabase_auth/_sync/gotrue_client.py +1 -1
- {supabase_auth-2.31.0 → supabase_auth-2.32.0}/src/supabase_auth/helpers.py +15 -8
- supabase_auth-2.32.0/src/supabase_auth/version.py +1 -0
- supabase_auth-2.31.0/src/supabase_auth/version.py +0 -1
- {supabase_auth-2.31.0 → supabase_auth-2.32.0}/README.md +0 -0
- {supabase_auth-2.31.0 → supabase_auth-2.32.0}/src/supabase_auth/__init__.py +0 -0
- {supabase_auth-2.31.0 → supabase_auth-2.32.0}/src/supabase_auth/_async/__init__.py +0 -0
- {supabase_auth-2.31.0 → supabase_auth-2.32.0}/src/supabase_auth/_async/gotrue_admin_api.py +0 -0
- {supabase_auth-2.31.0 → supabase_auth-2.32.0}/src/supabase_auth/_async/gotrue_admin_mfa_api.py +0 -0
- {supabase_auth-2.31.0 → supabase_auth-2.32.0}/src/supabase_auth/_async/gotrue_admin_oauth_api.py +0 -0
- {supabase_auth-2.31.0 → supabase_auth-2.32.0}/src/supabase_auth/_async/gotrue_base_api.py +0 -0
- {supabase_auth-2.31.0 → supabase_auth-2.32.0}/src/supabase_auth/_async/gotrue_mfa_api.py +0 -0
- {supabase_auth-2.31.0 → supabase_auth-2.32.0}/src/supabase_auth/_async/storage.py +0 -0
- {supabase_auth-2.31.0 → supabase_auth-2.32.0}/src/supabase_auth/_sync/__init__.py +0 -0
- {supabase_auth-2.31.0 → supabase_auth-2.32.0}/src/supabase_auth/_sync/gotrue_admin_api.py +0 -0
- {supabase_auth-2.31.0 → supabase_auth-2.32.0}/src/supabase_auth/_sync/gotrue_admin_mfa_api.py +0 -0
- {supabase_auth-2.31.0 → supabase_auth-2.32.0}/src/supabase_auth/_sync/gotrue_admin_oauth_api.py +0 -0
- {supabase_auth-2.31.0 → supabase_auth-2.32.0}/src/supabase_auth/_sync/gotrue_base_api.py +0 -0
- {supabase_auth-2.31.0 → supabase_auth-2.32.0}/src/supabase_auth/_sync/gotrue_mfa_api.py +0 -0
- {supabase_auth-2.31.0 → supabase_auth-2.32.0}/src/supabase_auth/_sync/storage.py +0 -0
- {supabase_auth-2.31.0 → supabase_auth-2.32.0}/src/supabase_auth/constants.py +0 -0
- {supabase_auth-2.31.0 → supabase_auth-2.32.0}/src/supabase_auth/errors.py +0 -0
- {supabase_auth-2.31.0 → supabase_auth-2.32.0}/src/supabase_auth/py.typed +0 -0
- {supabase_auth-2.31.0 → supabase_auth-2.32.0}/src/supabase_auth/timer.py +0 -0
- {supabase_auth-2.31.0 → supabase_auth-2.32.0}/src/supabase_auth/types.py +0 -0
|
@@ -1272,7 +1272,7 @@ class AsyncGoTrueClient(AsyncGoTrueBaseAPI):
|
|
|
1272
1272
|
decoded_jwt["raw"]["payload"],
|
|
1273
1273
|
)
|
|
1274
1274
|
|
|
1275
|
-
validate_exp(payload
|
|
1275
|
+
validate_exp(payload.get("exp"))
|
|
1276
1276
|
|
|
1277
1277
|
# if symmetric algorithm, fallback to get_user
|
|
1278
1278
|
if "kid" not in header or header["alg"] == "HS256":
|
|
@@ -1262,7 +1262,7 @@ class SyncGoTrueClient(SyncGoTrueBaseAPI):
|
|
|
1262
1262
|
decoded_jwt["raw"]["payload"],
|
|
1263
1263
|
)
|
|
1264
1264
|
|
|
1265
|
-
validate_exp(payload
|
|
1265
|
+
validate_exp(payload.get("exp"))
|
|
1266
1266
|
|
|
1267
1267
|
# if symmetric algorithm, fallback to get_user
|
|
1268
1268
|
if "kid" not in header or header["alg"] == "HS256":
|
|
@@ -163,18 +163,25 @@ def handle_exception(error: HTTPStatusError | RuntimeError) -> AuthError:
|
|
|
163
163
|
error_code = data.get("error_code")
|
|
164
164
|
|
|
165
165
|
if error_code is None:
|
|
166
|
+
# Legacy support for weak password errors, from before error codes
|
|
167
|
+
# existed: the reasons are only carried by the `weak_password` object.
|
|
168
|
+
weak_password = (
|
|
169
|
+
data.get("weak_password") if isinstance(data, dict) else None
|
|
170
|
+
)
|
|
171
|
+
reasons = (
|
|
172
|
+
weak_password.get("reasons")
|
|
173
|
+
if isinstance(weak_password, dict)
|
|
174
|
+
else None
|
|
175
|
+
)
|
|
166
176
|
if (
|
|
167
|
-
isinstance(
|
|
168
|
-
and
|
|
169
|
-
and isinstance(
|
|
170
|
-
and data.get("weak_password")
|
|
171
|
-
and isinstance(data.get("weak_password"), list)
|
|
172
|
-
and len(data["weak_password"])
|
|
177
|
+
isinstance(reasons, list)
|
|
178
|
+
and reasons
|
|
179
|
+
and all(isinstance(reason, str) for reason in reasons)
|
|
173
180
|
):
|
|
174
181
|
return AuthWeakPasswordError(
|
|
175
182
|
get_error_message(data),
|
|
176
183
|
error.response.status_code,
|
|
177
|
-
|
|
184
|
+
reasons,
|
|
178
185
|
)
|
|
179
186
|
elif error_code == "weak_password":
|
|
180
187
|
return AuthWeakPasswordError(
|
|
@@ -283,7 +290,7 @@ def is_http_url(url: str) -> bool:
|
|
|
283
290
|
return urlparse(url).scheme in {"https", "http"}
|
|
284
291
|
|
|
285
292
|
|
|
286
|
-
def validate_exp(exp: int) -> None:
|
|
293
|
+
def validate_exp(exp: Optional[int]) -> None:
|
|
287
294
|
if not exp:
|
|
288
295
|
raise AuthInvalidJwtError("JWT has no expiration time")
|
|
289
296
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "2.32.0" # {x-release-please-version}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "2.31.0" # {x-release-please-version}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{supabase_auth-2.31.0 → supabase_auth-2.32.0}/src/supabase_auth/_async/gotrue_admin_mfa_api.py
RENAMED
|
File without changes
|
{supabase_auth-2.31.0 → supabase_auth-2.32.0}/src/supabase_auth/_async/gotrue_admin_oauth_api.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{supabase_auth-2.31.0 → supabase_auth-2.32.0}/src/supabase_auth/_sync/gotrue_admin_mfa_api.py
RENAMED
|
File without changes
|
{supabase_auth-2.31.0 → supabase_auth-2.32.0}/src/supabase_auth/_sync/gotrue_admin_oauth_api.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|