supabase_auth 2.4.4__tar.gz → 2.5.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.
Files changed (27) hide show
  1. {supabase_auth-2.4.4 → supabase_auth-2.5.0}/PKG-INFO +1 -1
  2. {supabase_auth-2.4.4 → supabase_auth-2.5.0}/pyproject.toml +2 -2
  3. {supabase_auth-2.4.4 → supabase_auth-2.5.0}/supabase_auth/__init__.py +1 -1
  4. {supabase_auth-2.4.4 → supabase_auth-2.5.0}/supabase_auth/_async/gotrue_client.py +30 -0
  5. {supabase_auth-2.4.4 → supabase_auth-2.5.0}/supabase_auth/_sync/gotrue_client.py +30 -0
  6. {supabase_auth-2.4.4 → supabase_auth-2.5.0}/supabase_auth/types.py +9 -0
  7. {supabase_auth-2.4.4 → supabase_auth-2.5.0}/LICENSE +0 -0
  8. {supabase_auth-2.4.4 → supabase_auth-2.5.0}/README.md +0 -0
  9. {supabase_auth-2.4.4 → supabase_auth-2.5.0}/supabase_auth/_async/__init__.py +0 -0
  10. {supabase_auth-2.4.4 → supabase_auth-2.5.0}/supabase_auth/_async/gotrue_admin_api.py +0 -0
  11. {supabase_auth-2.4.4 → supabase_auth-2.5.0}/supabase_auth/_async/gotrue_admin_mfa_api.py +0 -0
  12. {supabase_auth-2.4.4 → supabase_auth-2.5.0}/supabase_auth/_async/gotrue_base_api.py +0 -0
  13. {supabase_auth-2.4.4 → supabase_auth-2.5.0}/supabase_auth/_async/gotrue_mfa_api.py +0 -0
  14. {supabase_auth-2.4.4 → supabase_auth-2.5.0}/supabase_auth/_async/storage.py +0 -0
  15. {supabase_auth-2.4.4 → supabase_auth-2.5.0}/supabase_auth/_sync/__init__.py +0 -0
  16. {supabase_auth-2.4.4 → supabase_auth-2.5.0}/supabase_auth/_sync/api.py +0 -0
  17. {supabase_auth-2.4.4 → supabase_auth-2.5.0}/supabase_auth/_sync/client.py +0 -0
  18. {supabase_auth-2.4.4 → supabase_auth-2.5.0}/supabase_auth/_sync/gotrue_admin_api.py +0 -0
  19. {supabase_auth-2.4.4 → supabase_auth-2.5.0}/supabase_auth/_sync/gotrue_admin_mfa_api.py +0 -0
  20. {supabase_auth-2.4.4 → supabase_auth-2.5.0}/supabase_auth/_sync/gotrue_base_api.py +0 -0
  21. {supabase_auth-2.4.4 → supabase_auth-2.5.0}/supabase_auth/_sync/gotrue_mfa_api.py +0 -0
  22. {supabase_auth-2.4.4 → supabase_auth-2.5.0}/supabase_auth/_sync/storage.py +0 -0
  23. {supabase_auth-2.4.4 → supabase_auth-2.5.0}/supabase_auth/constants.py +0 -0
  24. {supabase_auth-2.4.4 → supabase_auth-2.5.0}/supabase_auth/errors.py +0 -0
  25. {supabase_auth-2.4.4 → supabase_auth-2.5.0}/supabase_auth/helpers.py +0 -0
  26. {supabase_auth-2.4.4 → supabase_auth-2.5.0}/supabase_auth/http_clients.py +0 -0
  27. {supabase_auth-2.4.4 → supabase_auth-2.5.0}/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.0
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.0"
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"
@@ -30,7 +30,7 @@ pytest-depends = "^1.0.1"
30
30
  pytest-asyncio = "^0.23.7"
31
31
  Faker = "^25.4.0"
32
32
  unasync-cli = "^0.0.9"
33
- python-semantic-release = "^9.8.0"
33
+ python-semantic-release = "^9.8.1"
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.0"
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,
@@ -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,
@@ -348,6 +348,15 @@ class SignInWithSSOOptions(TypedDict):
348
348
  skip_http_redirect: NotRequired[bool]
349
349
 
350
350
 
351
+ class SignInAnonymouslyCredentials(TypedDict):
352
+ options: NotRequired[SignInAnonymouslyCredentialsOptions]
353
+
354
+
355
+ class SignInAnonymouslyCredentialsOptions(TypedDict):
356
+ data: NotRequired[Any]
357
+ captcha_token: NotRequired[str]
358
+
359
+
351
360
  class VerifyOtpParamsOptions(TypedDict):
352
361
  redirect_to: NotRequired[str]
353
362
  captcha_token: NotRequired[str]
File without changes
File without changes