Skip to content

Commit f131ac9

Browse files
committed
adding dev-v0.15.0 tag to this commit to ensure building
1 parent 007591e commit f131ac9

File tree

190 files changed

+20913
-7164
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

190 files changed

+20913
-7164
lines changed

html/supertokens_python/asyncio/index.html

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -56,29 +56,35 @@ <h1 class="title">Module <code>supertokens_python.asyncio</code></h1>
5656

5757

5858
async def get_users_oldest_first(
59+
tenant_id: str,
5960
limit: Union[int, None] = None,
6061
pagination_token: Union[str, None] = None,
6162
include_recipe_ids: Union[None, List[str]] = None,
6263
query: Union[None, Dict[str, str]] = None,
6364
) -&gt; UsersResponse:
6465
return await Supertokens.get_instance().get_users(
65-
&#34;ASC&#34;, limit, pagination_token, include_recipe_ids, query
66+
tenant_id, &#34;ASC&#34;, limit, pagination_token, include_recipe_ids, query
6667
)
6768

6869

6970
async def get_users_newest_first(
71+
tenant_id: str,
7072
limit: Union[int, None] = None,
7173
pagination_token: Union[str, None] = None,
7274
include_recipe_ids: Union[None, List[str]] = None,
7375
query: Union[None, Dict[str, str]] = None,
7476
) -&gt; UsersResponse:
7577
return await Supertokens.get_instance().get_users(
76-
&#34;DESC&#34;, limit, pagination_token, include_recipe_ids, query
78+
tenant_id, &#34;DESC&#34;, limit, pagination_token, include_recipe_ids, query
7779
)
7880

7981

80-
async def get_user_count(include_recipe_ids: Union[None, List[str]] = None) -&gt; int:
81-
return await Supertokens.get_instance().get_user_count(include_recipe_ids)
82+
async def get_user_count(
83+
include_recipe_ids: Union[None, List[str]] = None, tenant_id: Optional[str] = None
84+
) -&gt; int:
85+
return await Supertokens.get_instance().get_user_count(
86+
include_recipe_ids, tenant_id
87+
)
8288

8389

8490
async def delete_user(user_id: str) -&gt; None:
@@ -191,16 +197,20 @@ <h2 class="section-title" id="header-functions">Functions</h2>
191197
</details>
192198
</dd>
193199
<dt id="supertokens_python.asyncio.get_user_count"><code class="name flex">
194-
<span>async def <span class="ident">get_user_count</span></span>(<span>include_recipe_ids: Optional[None] = None) ‑> int</span>
200+
<span>async def <span class="ident">get_user_count</span></span>(<span>include_recipe_ids: Optional[None] = None, tenant_id: Optional[str] = None) ‑> int</span>
195201
</code></dt>
196202
<dd>
197203
<div class="desc"></div>
198204
<details class="source">
199205
<summary>
200206
<span>Expand source code</span>
201207
</summary>
202-
<pre><code class="python">async def get_user_count(include_recipe_ids: Union[None, List[str]] = None) -&gt; int:
203-
return await Supertokens.get_instance().get_user_count(include_recipe_ids)</code></pre>
208+
<pre><code class="python">async def get_user_count(
209+
include_recipe_ids: Union[None, List[str]] = None, tenant_id: Optional[str] = None
210+
) -&gt; int:
211+
return await Supertokens.get_instance().get_user_count(
212+
include_recipe_ids, tenant_id
213+
)</code></pre>
204214
</details>
205215
</dd>
206216
<dt id="supertokens_python.asyncio.get_user_id_mapping"><code class="name flex">
@@ -220,7 +230,7 @@ <h2 class="section-title" id="header-functions">Functions</h2>
220230
</details>
221231
</dd>
222232
<dt id="supertokens_python.asyncio.get_users_newest_first"><code class="name flex">
223-
<span>async def <span class="ident">get_users_newest_first</span></span>(<span>limit: Optional[int] = None, pagination_token: Optional[str] = None, include_recipe_ids: Optional[None] = None, query: Optional[None] = None) ‑> <a title="supertokens_python.types.UsersResponse" href="../types.html#supertokens_python.types.UsersResponse">UsersResponse</a></span>
233+
<span>async def <span class="ident">get_users_newest_first</span></span>(<span>tenant_id: str, limit: Optional[int] = None, pagination_token: Optional[str] = None, include_recipe_ids: Optional[None] = None, query: Optional[None] = None) ‑> <a title="supertokens_python.types.UsersResponse" href="../types.html#supertokens_python.types.UsersResponse">UsersResponse</a></span>
224234
</code></dt>
225235
<dd>
226236
<div class="desc"></div>
@@ -229,18 +239,19 @@ <h2 class="section-title" id="header-functions">Functions</h2>
229239
<span>Expand source code</span>
230240
</summary>
231241
<pre><code class="python">async def get_users_newest_first(
242+
tenant_id: str,
232243
limit: Union[int, None] = None,
233244
pagination_token: Union[str, None] = None,
234245
include_recipe_ids: Union[None, List[str]] = None,
235246
query: Union[None, Dict[str, str]] = None,
236247
) -&gt; UsersResponse:
237248
return await Supertokens.get_instance().get_users(
238-
&#34;DESC&#34;, limit, pagination_token, include_recipe_ids, query
249+
tenant_id, &#34;DESC&#34;, limit, pagination_token, include_recipe_ids, query
239250
)</code></pre>
240251
</details>
241252
</dd>
242253
<dt id="supertokens_python.asyncio.get_users_oldest_first"><code class="name flex">
243-
<span>async def <span class="ident">get_users_oldest_first</span></span>(<span>limit: Optional[int] = None, pagination_token: Optional[str] = None, include_recipe_ids: Optional[None] = None, query: Optional[None] = None) ‑> <a title="supertokens_python.types.UsersResponse" href="../types.html#supertokens_python.types.UsersResponse">UsersResponse</a></span>
254+
<span>async def <span class="ident">get_users_oldest_first</span></span>(<span>tenant_id: str, limit: Optional[int] = None, pagination_token: Optional[str] = None, include_recipe_ids: Optional[None] = None, query: Optional[None] = None) ‑> <a title="supertokens_python.types.UsersResponse" href="../types.html#supertokens_python.types.UsersResponse">UsersResponse</a></span>
244255
</code></dt>
245256
<dd>
246257
<div class="desc"></div>
@@ -249,13 +260,14 @@ <h2 class="section-title" id="header-functions">Functions</h2>
249260
<span>Expand source code</span>
250261
</summary>
251262
<pre><code class="python">async def get_users_oldest_first(
263+
tenant_id: str,
252264
limit: Union[int, None] = None,
253265
pagination_token: Union[str, None] = None,
254266
include_recipe_ids: Union[None, List[str]] = None,
255267
query: Union[None, Dict[str, str]] = None,
256268
) -&gt; UsersResponse:
257269
return await Supertokens.get_instance().get_users(
258-
&#34;ASC&#34;, limit, pagination_token, include_recipe_ids, query
270+
tenant_id, &#34;ASC&#34;, limit, pagination_token, include_recipe_ids, query
259271
)</code></pre>
260272
</details>
261273
</dd>

html/supertokens_python/constants.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ <h1 class="title">Module <code>supertokens_python.constants</code></h1>
4141
# under the License.
4242
from __future__ import annotations
4343

44-
SUPPORTED_CDI_VERSIONS = [&#34;2.21&#34;]
45-
VERSION = &#34;0.14.8&#34;
44+
SUPPORTED_CDI_VERSIONS = [&#34;3.0&#34;]
45+
VERSION = &#34;0.15.0&#34;
4646
TELEMETRY = &#34;/telemetry&#34;
4747
USER_COUNT = &#34;/users/count&#34;
4848
USER_DELETE = &#34;/user/remove&#34;
@@ -55,7 +55,7 @@ <h1 class="title">Module <code>supertokens_python.constants</code></h1>
5555
FDI_KEY_HEADER = &#34;fdi-version&#34;
5656
API_VERSION = &#34;/apiversion&#34;
5757
API_VERSION_HEADER = &#34;cdi-version&#34;
58-
DASHBOARD_VERSION = &#34;0.6&#34;
58+
DASHBOARD_VERSION = &#34;0.7&#34;
5959
HUNDRED_YEARS_IN_MS = 3153600000000</code></pre>
6060
</details>
6161
</section>

html/supertokens_python/exceptions.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ <h1 class="title">Module <code>supertokens_python.exceptions</code></h1>
4646

4747
def raise_general_exception(
4848
msg: Union[str, Exception], previous: Union[None, Exception] = None
49-
):
49+
) -&gt; NoReturn:
5050
if isinstance(msg, SuperTokensError):
5151
raise msg
5252
if isinstance(msg, Exception):
@@ -91,7 +91,7 @@ <h2 class="section-title" id="header-functions">Functions</h2>
9191
</details>
9292
</dd>
9393
<dt id="supertokens_python.exceptions.raise_general_exception"><code class="name flex">
94-
<span>def <span class="ident">raise_general_exception</span></span>(<span>msg: Union[str, Exception], previous: Union[None, Exception] = None)</span>
94+
<span>def <span class="ident">raise_general_exception</span></span>(<span>msg: Union[str, Exception], previous: Union[None, Exception] = None)> NoReturn</span>
9595
</code></dt>
9696
<dd>
9797
<div class="desc"></div>
@@ -101,7 +101,7 @@ <h2 class="section-title" id="header-functions">Functions</h2>
101101
</summary>
102102
<pre><code class="python">def raise_general_exception(
103103
msg: Union[str, Exception], previous: Union[None, Exception] = None
104-
):
104+
) -&gt; NoReturn:
105105
if isinstance(msg, SuperTokensError):
106106
raise msg
107107
if isinstance(msg, Exception):
@@ -180,9 +180,11 @@ <h3>Subclasses</h3>
180180
<li><a title="supertokens_python.recipe.emailpassword.exceptions.SuperTokensEmailPasswordError" href="recipe/emailpassword/exceptions.html#supertokens_python.recipe.emailpassword.exceptions.SuperTokensEmailPasswordError">SuperTokensEmailPasswordError</a></li>
181181
<li><a title="supertokens_python.recipe.emailverification.exceptions.SuperTokensEmailVerificationError" href="recipe/emailverification/exceptions.html#supertokens_python.recipe.emailverification.exceptions.SuperTokensEmailVerificationError">SuperTokensEmailVerificationError</a></li>
182182
<li><a title="supertokens_python.recipe.jwt.exceptions.SuperTokensJWTError" href="recipe/jwt/exceptions.html#supertokens_python.recipe.jwt.exceptions.SuperTokensJWTError">SuperTokensJWTError</a></li>
183+
<li><a title="supertokens_python.recipe.multitenancy.exceptions.MultitenancyError" href="recipe/multitenancy/exceptions.html#supertokens_python.recipe.multitenancy.exceptions.MultitenancyError">MultitenancyError</a></li>
183184
<li><a title="supertokens_python.recipe.openid.exceptions.SuperTokensOpenIdError" href="recipe/openid/exceptions.html#supertokens_python.recipe.openid.exceptions.SuperTokensOpenIdError">SuperTokensOpenIdError</a></li>
184185
<li><a title="supertokens_python.recipe.passwordless.exceptions.SuperTokensPasswordlessError" href="recipe/passwordless/exceptions.html#supertokens_python.recipe.passwordless.exceptions.SuperTokensPasswordlessError">SuperTokensPasswordlessError</a></li>
185186
<li><a title="supertokens_python.recipe.session.exceptions.SuperTokensSessionError" href="recipe/session/exceptions.html#supertokens_python.recipe.session.exceptions.SuperTokensSessionError">SuperTokensSessionError</a></li>
187+
<li><a title="supertokens_python.recipe.thirdparty.exceptions.ClientTypeNotFoundError" href="recipe/thirdparty/exceptions.html#supertokens_python.recipe.thirdparty.exceptions.ClientTypeNotFoundError">ClientTypeNotFoundError</a></li>
186188
<li><a title="supertokens_python.recipe.thirdparty.exceptions.SuperTokensThirdPartyError" href="recipe/thirdparty/exceptions.html#supertokens_python.recipe.thirdparty.exceptions.SuperTokensThirdPartyError">SuperTokensThirdPartyError</a></li>
187189
<li><a title="supertokens_python.recipe.thirdpartyemailpassword.exceptions.SupertokensThirdPartyEmailPasswordError" href="recipe/thirdpartyemailpassword/exceptions.html#supertokens_python.recipe.thirdpartyemailpassword.exceptions.SupertokensThirdPartyEmailPasswordError">SupertokensThirdPartyEmailPasswordError</a></li>
188190
<li><a title="supertokens_python.recipe.thirdpartypasswordless.exceptions.SupertokensThirdPartyPasswordlessError" href="recipe/thirdpartypasswordless/exceptions.html#supertokens_python.recipe.thirdpartypasswordless.exceptions.SupertokensThirdPartyPasswordlessError">SupertokensThirdPartyPasswordlessError</a></li>

html/supertokens_python/framework/django/django_middleware.html

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ <h1 class="title">Module <code>supertokens_python.framework.django.django_middle
5656
from supertokens_python.supertokens import manage_session_post_response
5757

5858
from django.http import HttpRequest
59+
from supertokens_python.utils import default_user_context
5960

6061
if asyncio.iscoroutinefunction(get_response):
6162

@@ -65,8 +66,10 @@ <h1 class="title">Module <code>supertokens_python.framework.django.django_middle
6566
from django.http import HttpResponse
6667

6768
response = DjangoResponse(HttpResponse())
69+
user_context = default_user_context(custom_request)
70+
6871
try:
69-
result = await st.middleware(custom_request, response)
72+
result = await st.middleware(custom_request, response, user_context)
7073
if result is None:
7174
result = await get_response(request)
7275
result = DjangoResponse(result)
@@ -149,6 +152,7 @@ <h2 class="section-title" id="header-functions">Functions</h2>
149152
from supertokens_python.supertokens import manage_session_post_response
150153

151154
from django.http import HttpRequest
155+
from supertokens_python.utils import default_user_context
152156

153157
if asyncio.iscoroutinefunction(get_response):
154158

@@ -158,8 +162,10 @@ <h2 class="section-title" id="header-functions">Functions</h2>
158162
from django.http import HttpResponse
159163

160164
response = DjangoResponse(HttpResponse())
165+
user_context = default_user_context(custom_request)
166+
161167
try:
162-
result = await st.middleware(custom_request, response)
168+
result = await st.middleware(custom_request, response, user_context)
163169
if result is None:
164170
result = await get_response(request)
165171
result = DjangoResponse(result)

html/supertokens_python/framework/fastapi/fastapi_middleware.html

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ <h1 class="title">Module <code>supertokens_python.framework.fastapi.fastapi_midd
5151

5252
def get_middleware():
5353
from starlette.middleware.base import BaseHTTPMiddleware, RequestResponseEndpoint
54+
from supertokens_python.utils import default_user_context
5455

5556
class Middleware(BaseHTTPMiddleware):
5657
def __init__(self, app: FastAPI):
@@ -74,8 +75,9 @@ <h1 class="title">Module <code>supertokens_python.framework.fastapi.fastapi_midd
7475
try:
7576
custom_request = FastApiRequest(request)
7677
response = FastApiResponse(Response())
78+
user_context = default_user_context(custom_request)
7779
result: Union[BaseResponse, None] = await st.middleware(
78-
custom_request, response
80+
custom_request, response, user_context
7981
)
8082
if result is None:
8183
response = await call_next(request)
@@ -118,6 +120,7 @@ <h2 class="section-title" id="header-functions">Functions</h2>
118120
</summary>
119121
<pre><code class="python">def get_middleware():
120122
from starlette.middleware.base import BaseHTTPMiddleware, RequestResponseEndpoint
123+
from supertokens_python.utils import default_user_context
121124

122125
class Middleware(BaseHTTPMiddleware):
123126
def __init__(self, app: FastAPI):
@@ -141,8 +144,9 @@ <h2 class="section-title" id="header-functions">Functions</h2>
141144
try:
142145
custom_request = FastApiRequest(request)
143146
response = FastApiResponse(Response())
147+
user_context = default_user_context(custom_request)
144148
result: Union[BaseResponse, None] = await st.middleware(
145-
custom_request, response
149+
custom_request, response, user_context
146150
)
147151
if result is None:
148152
response = await call_next(request)

html/supertokens_python/framework/flask/flask_middleware.html

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ <h1 class="title">Module <code>supertokens_python.framework.flask.flask_middlewa
6262
from supertokens_python.framework.flask.flask_request import FlaskRequest
6363
from supertokens_python.framework.flask.flask_response import FlaskResponse
6464
from supertokens_python.supertokens import manage_session_post_response
65+
from supertokens_python.utils import default_user_context
6566

6667
from flask.wrappers import Response
6768

@@ -78,8 +79,11 @@ <h1 class="title">Module <code>supertokens_python.framework.flask.flask_middlewa
7879

7980
request_ = FlaskRequest(request)
8081
response_ = FlaskResponse(Response())
82+
user_context = default_user_context(request_)
8183

82-
result: Union[BaseResponse, None] = sync(st.middleware(request_, response_))
84+
result: Union[BaseResponse, None] = sync(
85+
st.middleware(request_, response_, user_context)
86+
)
8387

8488
if result is not None:
8589
if isinstance(result, FlaskResponse):
@@ -154,6 +158,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
154158
from supertokens_python.framework.flask.flask_request import FlaskRequest
155159
from supertokens_python.framework.flask.flask_response import FlaskResponse
156160
from supertokens_python.supertokens import manage_session_post_response
161+
from supertokens_python.utils import default_user_context
157162

158163
from flask.wrappers import Response
159164

@@ -170,8 +175,11 @@ <h2 class="section-title" id="header-classes">Classes</h2>
170175

171176
request_ = FlaskRequest(request)
172177
response_ = FlaskResponse(Response())
178+
user_context = default_user_context(request_)
173179

174-
result: Union[BaseResponse, None] = sync(st.middleware(request_, response_))
180+
result: Union[BaseResponse, None] = sync(
181+
st.middleware(request_, response_, user_context)
182+
)
175183

176184
if result is not None:
177185
if isinstance(result, FlaskResponse):
@@ -231,6 +239,7 @@ <h3>Methods</h3>
231239
from supertokens_python.framework.flask.flask_request import FlaskRequest
232240
from supertokens_python.framework.flask.flask_response import FlaskResponse
233241
from supertokens_python.supertokens import manage_session_post_response
242+
from supertokens_python.utils import default_user_context
234243

235244
from flask.wrappers import Response
236245

@@ -247,8 +256,11 @@ <h3>Methods</h3>
247256

248257
request_ = FlaskRequest(request)
249258
response_ = FlaskResponse(Response())
259+
user_context = default_user_context(request_)
250260

251-
result: Union[BaseResponse, None] = sync(st.middleware(request_, response_))
261+
result: Union[BaseResponse, None] = sync(
262+
st.middleware(request_, response_, user_context)
263+
)
252264

253265
if result is not None:
254266
if isinstance(result, FlaskResponse):

html/supertokens_python/normalised_url_path.html

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ <h1 class="title">Module <code>supertokens_python.normalised_url_path</code></h1
6767
return self.__value == other.get_as_string_dangerous()
6868

6969
def is_a_recipe_path(self) -&gt; bool:
70-
return self.__value == &#34;/recipe&#34; or self.__value.startswith(&#34;/recipe/&#34;)
70+
parts = self.__value.split(&#34;/&#34;)
71+
return parts[1] == &#34;recipe&#34; or parts[2] == &#34;recipe&#34;
7172

7273

7374
def normalise_url_path_or_throw_error(input_str: str) -&gt; str:
@@ -245,7 +246,8 @@ <h2 class="section-title" id="header-classes">Classes</h2>
245246
return self.__value == other.get_as_string_dangerous()
246247

247248
def is_a_recipe_path(self) -&gt; bool:
248-
return self.__value == &#34;/recipe&#34; or self.__value.startswith(&#34;/recipe/&#34;)</code></pre>
249+
parts = self.__value.split(&#34;/&#34;)
250+
return parts[1] == &#34;recipe&#34; or parts[2] == &#34;recipe&#34;</code></pre>
249251
</details>
250252
<h3>Methods</h3>
251253
<dl>
@@ -298,7 +300,8 @@ <h3>Methods</h3>
298300
<span>Expand source code</span>
299301
</summary>
300302
<pre><code class="python">def is_a_recipe_path(self) -&gt; bool:
301-
return self.__value == &#34;/recipe&#34; or self.__value.startswith(&#34;/recipe/&#34;)</code></pre>
303+
parts = self.__value.split(&#34;/&#34;)
304+
return parts[1] == &#34;recipe&#34; or parts[2] == &#34;recipe&#34;</code></pre>
302305
</details>
303306
</dd>
304307
<dt id="supertokens_python.normalised_url_path.NormalisedURLPath.startswith"><code class="name flex">

0 commit comments

Comments
 (0)