supabase_auth 2.4.4__tar.gz → 2.5.1__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.
Files changed (27) hide show
  1. {supabase_auth-2.4.4 → supabase_auth-2.5.1}/PKG-INFO +1 -1
  2. {supabase_auth-2.4.4 → supabase_auth-2.5.1}/pyproject.toml +4 -4
  3. {supabase_auth-2.4.4 → supabase_auth-2.5.1}/supabase_auth/__init__.py +1 -1
  4. {supabase_auth-2.4.4 → supabase_auth-2.5.1}/supabase_auth/_async/gotrue_client.py +35 -1
  5. {supabase_auth-2.4.4 → supabase_auth-2.5.1}/supabase_auth/_sync/gotrue_client.py +35 -1
  6. {supabase_auth-2.4.4 → supabase_auth-2.5.1}/supabase_auth/types.py +11 -0
  7. {supabase_auth-2.4.4 → supabase_auth-2.5.1}/LICENSE +0 -0
  8. {supabase_auth-2.4.4 → supabase_auth-2.5.1}/README.md +0 -0
  9. {supabase_auth-2.4.4 → supabase_auth-2.5.1}/supabase_auth/_async/__init__.py +0 -0
  10. {supabase_auth-2.4.4 → supabase_auth-2.5.1}/supabase_auth/_async/gotrue_admin_api.py +0 -0
  11. {supabase_auth-2.4.4 → supabase_auth-2.5.1}/supabase_auth/_async/gotrue_admin_mfa_api.py +0 -0
  12. {supabase_auth-2.4.4 → supabase_auth-2.5.1}/supabase_auth/_async/gotrue_base_api.py +0 -0
  13. {supabase_auth-2.4.4 → supabase_auth-2.5.1}/supabase_auth/_async/gotrue_mfa_api.py +0 -0
  14. {supabase_auth-2.4.4 → supabase_auth-2.5.1}/supabase_auth/_async/storage.py +0 -0
  15. {supabase_auth-2.4.4 → supabase_auth-2.5.1}/supabase_auth/_sync/__init__.py +0 -0
  16. {supabase_auth-2.4.4 → supabase_auth-2.5.1}/supabase_auth/_sync/api.py +0 -0
  17. {supabase_auth-2.4.4 → supabase_auth-2.5.1}/supabase_auth/_sync/client.py +0 -0
  18. {supabase_auth-2.4.4 → supabase_auth-2.5.1}/supabase_auth/_sync/gotrue_admin_api.py +0 -0
  19. {supabase_auth-2.4.4 → supabase_auth-2.5.1}/supabase_auth/_sync/gotrue_admin_mfa_api.py +0 -0
  20. {supabase_auth-2.4.4 → supabase_auth-2.5.1}/supabase_auth/_sync/gotrue_base_api.py +0 -0
  21. {supabase_auth-2.4.4 → supabase_auth-2.5.1}/supabase_auth/_sync/gotrue_mfa_api.py +0 -0
  22. {supabase_auth-2.4.4 → supabase_auth-2.5.1}/supabase_auth/_sync/storage.py +0 -0
  23. {supabase_auth-2.4.4 → supabase_auth-2.5.1}/supabase_auth/constants.py +0 -0
  24. {supabase_auth-2.4.4 → supabase_auth-2.5.1}/supabase_auth/errors.py +0 -0
  25. {supabase_auth-2.4.4 → supabase_auth-2.5.1}/supabase_auth/helpers.py +0 -0
  26. {supabase_auth-2.4.4 → supabase_auth-2.5.1}/supabase_auth/http_clients.py +0 -0
  27. {supabase_auth-2.4.4 → supabase_auth-2.5.1}/supabase_auth/timer.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: supabase_auth
3
- Version: 2.4.4
3
+ Version: 2.5.1
4
4
  Summary: Python Client Library for Supabase Auth
5
5
  Home-page: https://github.com/supabase-community/auth-py
6
6
  License: MIT
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "supabase_auth"
3
- version = "2.4.4"
3
+ version = "2.5.1"
4
4
  description = "Python Client Library for Supabase Auth"
5
5
  authors = ["Joel Lee <joel@joellee.org>"]
6
6
  homepage = "https://github.com/supabase-community/auth-py"
@@ -20,7 +20,7 @@ httpx = ">=0.23,<0.28"
20
20
  pydantic = ">=1.10,<3"
21
21
 
22
22
  [tool.poetry.dev-dependencies]
23
- pytest = "^8.2.1"
23
+ pytest = "^8.2.2"
24
24
  flake8 = "^5.0.4"
25
25
  black = "^24.4.2"
26
26
  isort = "^5.12.0"
@@ -28,9 +28,9 @@ pre-commit = "^3.4.0"
28
28
  pytest-cov = "^5.0.0"
29
29
  pytest-depends = "^1.0.1"
30
30
  pytest-asyncio = "^0.23.7"
31
- Faker = "^25.4.0"
31
+ Faker = "^25.8.0"
32
32
  unasync-cli = "^0.0.9"
33
- python-semantic-release = "^9.8.0"
33
+ python-semantic-release = "^9.8.3"
34
34
 
35
35
  [tool.poetry.group.dev.dependencies]
36
36
  pygithub = ">=1.57,<3.0"
@@ -1,6 +1,6 @@
1
1
  from __future__ import annotations
2
2
 
3
- __version__ = "2.4.4"
3
+ __version__ = "2.5.1"
4
4
 
5
5
  from ._async.gotrue_admin_api import AsyncGoTrueAdminAPI # type: ignore # noqa: F401
6
6
  from ._async.gotrue_client import AsyncGoTrueClient # type: ignore # noqa: F401
@@ -61,9 +61,11 @@ from ..types import (
61
61
  Options,
62
62
  Provider,
63
63
  Session,
64
+ SignInAnonymouslyCredentials,
64
65
  SignInWithOAuthCredentials,
65
66
  SignInWithPasswordCredentials,
66
67
  SignInWithPasswordlessCredentials,
68
+ SignInWithSSOCredentials,
67
69
  SignOutOptions,
68
70
  SignUpWithPasswordCredentials,
69
71
  Subscription,
@@ -149,6 +151,34 @@ class AsyncGoTrueClient(AsyncGoTrueBaseAPI):
149
151
 
150
152
  # Public methods
151
153
 
154
+ async def sign_in_anonymously(
155
+ self, credentials: Union[SignInAnonymouslyCredentials, None] = None
156
+ ) -> AuthResponse:
157
+ """
158
+ Creates a new anonymous user.
159
+ """
160
+ self._remove_session()
161
+ if credentials is None:
162
+ credentials = {"options": {}}
163
+ options = credentials.get("options", {})
164
+ data = options.get("data") or {}
165
+ captcha_token = options.get("captcha_token")
166
+ response = self._request(
167
+ "POST",
168
+ "signup",
169
+ body={
170
+ "data": data,
171
+ "gotrue_meta_security": {
172
+ "captcha_token": captcha_token,
173
+ },
174
+ },
175
+ xform=parse_auth_response,
176
+ )
177
+ if response.session:
178
+ self._save_session(response.session)
179
+ self._notify_all_subscribers("SIGNED_IN", response.session)
180
+ return response
181
+
152
182
  async def sign_up(
153
183
  self,
154
184
  credentials: SignUpWithPasswordCredentials,
@@ -161,8 +191,9 @@ class AsyncGoTrueClient(AsyncGoTrueBaseAPI):
161
191
  phone = credentials.get("phone")
162
192
  password = credentials.get("password")
163
193
  options = credentials.get("options", {})
164
- redirect_to = options.get("redirect_to")
194
+ redirect_to = options.get("redirect_to") or options.get("email_redirect_to")
165
195
  data = options.get("data") or {}
196
+ channel = options.get("channel", "sms")
166
197
  captcha_token = options.get("captcha_token")
167
198
  if email:
168
199
  response = await self._request(
@@ -187,6 +218,7 @@ class AsyncGoTrueClient(AsyncGoTrueBaseAPI):
187
218
  "phone": phone,
188
219
  "password": password,
189
220
  "data": data,
221
+ "channel": channel,
190
222
  "gotrue_meta_security": {
191
223
  "captcha_token": captcha_token,
192
224
  },
@@ -389,6 +421,7 @@ class AsyncGoTrueClient(AsyncGoTrueBaseAPI):
389
421
  email_redirect_to = options.get("email_redirect_to")
390
422
  should_create_user = options.get("create_user", True)
391
423
  data = options.get("data")
424
+ channel = options.get("channel", "sms")
392
425
  captcha_token = options.get("captcha_token")
393
426
  if email:
394
427
  return await self._request(
@@ -413,6 +446,7 @@ class AsyncGoTrueClient(AsyncGoTrueBaseAPI):
413
446
  "phone": phone,
414
447
  "data": data,
415
448
  "create_user": should_create_user,
449
+ "channel": channel,
416
450
  "gotrue_meta_security": {
417
451
  "captcha_token": captcha_token,
418
452
  },
@@ -61,9 +61,11 @@ from ..types import (
61
61
  Options,
62
62
  Provider,
63
63
  Session,
64
+ SignInAnonymouslyCredentials,
64
65
  SignInWithOAuthCredentials,
65
66
  SignInWithPasswordCredentials,
66
67
  SignInWithPasswordlessCredentials,
68
+ SignInWithSSOCredentials,
67
69
  SignOutOptions,
68
70
  SignUpWithPasswordCredentials,
69
71
  Subscription,
@@ -149,6 +151,34 @@ class SyncGoTrueClient(SyncGoTrueBaseAPI):
149
151
 
150
152
  # Public methods
151
153
 
154
+ def sign_in_anonymously(
155
+ self, credentials: Union[SignInAnonymouslyCredentials, None] = None
156
+ ) -> AuthResponse:
157
+ """
158
+ Creates a new anonymous user.
159
+ """
160
+ self._remove_session()
161
+ if credentials is None:
162
+ credentials = {"options": {}}
163
+ options = credentials.get("options", {})
164
+ data = options.get("data") or {}
165
+ captcha_token = options.get("captcha_token")
166
+ response = self._request(
167
+ "POST",
168
+ "signup",
169
+ body={
170
+ "data": data,
171
+ "gotrue_meta_security": {
172
+ "captcha_token": captcha_token,
173
+ },
174
+ },
175
+ xform=parse_auth_response,
176
+ )
177
+ if response.session:
178
+ self._save_session(response.session)
179
+ self._notify_all_subscribers("SIGNED_IN", response.session)
180
+ return response
181
+
152
182
  def sign_up(
153
183
  self,
154
184
  credentials: SignUpWithPasswordCredentials,
@@ -161,8 +191,9 @@ class SyncGoTrueClient(SyncGoTrueBaseAPI):
161
191
  phone = credentials.get("phone")
162
192
  password = credentials.get("password")
163
193
  options = credentials.get("options", {})
164
- redirect_to = options.get("redirect_to")
194
+ redirect_to = options.get("redirect_to") or options.get("email_redirect_to")
165
195
  data = options.get("data") or {}
196
+ channel = options.get("channel", "sms")
166
197
  captcha_token = options.get("captcha_token")
167
198
  if email:
168
199
  response = self._request(
@@ -187,6 +218,7 @@ class SyncGoTrueClient(SyncGoTrueBaseAPI):
187
218
  "phone": phone,
188
219
  "password": password,
189
220
  "data": data,
221
+ "channel": channel,
190
222
  "gotrue_meta_security": {
191
223
  "captcha_token": captcha_token,
192
224
  },
@@ -389,6 +421,7 @@ class SyncGoTrueClient(SyncGoTrueBaseAPI):
389
421
  email_redirect_to = options.get("email_redirect_to")
390
422
  should_create_user = options.get("create_user", True)
391
423
  data = options.get("data")
424
+ channel = options.get("channel", "sms")
392
425
  captcha_token = options.get("captcha_token")
393
426
  if email:
394
427
  return self._request(
@@ -413,6 +446,7 @@ class SyncGoTrueClient(SyncGoTrueBaseAPI):
413
446
  "phone": phone,
414
447
  "data": data,
415
448
  "create_user": should_create_user,
449
+ "channel": channel,
416
450
  "gotrue_meta_security": {
417
451
  "captcha_token": captcha_token,
418
452
  },
@@ -260,6 +260,7 @@ class SignUpWithEmailAndPasswordCredentials(TypedDict):
260
260
  class SignUpWithPhoneAndPasswordCredentialsOptions(TypedDict):
261
261
  data: NotRequired[Any]
262
262
  captcha_token: NotRequired[str]
263
+ channel: NotRequired[Literal["sms", "whatsapp"]]
263
264
 
264
265
 
265
266
  class SignUpWithPhoneAndPasswordCredentials(TypedDict):
@@ -313,6 +314,7 @@ class SignInWithPhoneAndPasswordlessCredentialsOptions(TypedDict):
313
314
  should_create_user: NotRequired[bool]
314
315
  data: NotRequired[Any]
315
316
  captcha_token: NotRequired[str]
317
+ channel: NotRequired[Literal["sms", "whatsapp"]]
316
318
 
317
319
 
318
320
  class SignInWithPhoneAndPasswordlessCredentials(TypedDict):
@@ -348,6 +350,15 @@ class SignInWithSSOOptions(TypedDict):
348
350
  skip_http_redirect: NotRequired[bool]
349
351
 
350
352
 
353
+ class SignInAnonymouslyCredentials(TypedDict):
354
+ options: NotRequired[SignInAnonymouslyCredentialsOptions]
355
+
356
+
357
+ class SignInAnonymouslyCredentialsOptions(TypedDict):
358
+ data: NotRequired[Any]
359
+ captcha_token: NotRequired[str]
360
+
361
+
351
362
  class VerifyOtpParamsOptions(TypedDict):
352
363
  redirect_to: NotRequired[str]
353
364
  captcha_token: NotRequired[str]
File without changes
File without changes