Skip to content

Commit 8567ab5

Browse files
committed
adding dev-v0.14.1 tag to this commit to ensure building
1 parent f3e6bb2 commit 8567ab5

File tree

5 files changed

+96
-15
lines changed

5 files changed

+96
-15
lines changed

html/supertokens_python/asyncio/index.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,18 @@ <h1 class="title">Module <code>supertokens_python.asyncio</code></h1>
3939
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
4040
# License for the specific language governing permissions and limitations
4141
# under the License.
42-
from typing import List, Union, Optional, Dict
42+
from typing import Dict, List, Optional, Union
4343

4444
from supertokens_python import Supertokens
4545
from supertokens_python.interfaces import (
4646
CreateUserIdMappingOkResult,
47+
DeleteUserIdMappingOkResult,
48+
GetUserIdMappingOkResult,
49+
UnknownMappingError,
4750
UnknownSupertokensUserIDError,
51+
UpdateOrDeleteUserIdMappingInfoOkResult,
4852
UserIdMappingAlreadyExistsError,
4953
UserIDTypes,
50-
UnknownMappingError,
51-
GetUserIdMappingOkResult,
52-
DeleteUserIdMappingOkResult,
53-
UpdateOrDeleteUserIdMappingInfoOkResult,
5454
)
5555
from supertokens_python.types import UsersResponse
5656

html/supertokens_python/constants.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ <h1 class="title">Module <code>supertokens_python.constants</code></h1>
4242
from __future__ import annotations
4343

4444
SUPPORTED_CDI_VERSIONS = [&#34;2.21&#34;]
45-
VERSION = &#34;0.14.0&#34;
45+
VERSION = &#34;0.14.1&#34;
4646
TELEMETRY = &#34;/telemetry&#34;
4747
USER_COUNT = &#34;/users/count&#34;
4848
USER_DELETE = &#34;/user/remove&#34;

html/supertokens_python/index.html

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,11 @@ <h1 class="title">Package <code>supertokens_python</code></h1>
4040
# License for the specific language governing permissions and limitations
4141
# under the License.
4242

43+
from typing import Any, Callable, Dict, List, Optional, Union
44+
4345
from typing_extensions import Literal
44-
from typing import Callable, List, Union
46+
47+
from supertokens_python.framework.request import BaseRequest
4548

4649
from . import supertokens
4750
from .recipe_module import RecipeModule
@@ -66,7 +69,13 @@ <h1 class="title">Package <code>supertokens_python</code></h1>
6669

6770

6871
def get_all_cors_headers() -&gt; List[str]:
69-
return supertokens.Supertokens.get_instance().get_all_cors_headers()</code></pre>
72+
return supertokens.Supertokens.get_instance().get_all_cors_headers()
73+
74+
75+
def get_request_from_user_context(
76+
user_context: Optional[Dict[str, Any]],
77+
) -&gt; Optional[BaseRequest]:
78+
return Supertokens.get_instance().get_request_from_user_context(user_context)</code></pre>
7079
</details>
7180
</section>
7281
<section>
@@ -168,6 +177,21 @@ <h2 class="section-title" id="header-functions">Functions</h2>
168177
return supertokens.Supertokens.get_instance().get_all_cors_headers()</code></pre>
169178
</details>
170179
</dd>
180+
<dt id="supertokens_python.get_request_from_user_context"><code class="name flex">
181+
<span>def <span class="ident">get_request_from_user_context</span></span>(<span>user_context: Optional[Dict[str, Any]]) ‑> Optional[<a title="supertokens_python.framework.request.BaseRequest" href="framework/request.html#supertokens_python.framework.request.BaseRequest">BaseRequest</a>]</span>
182+
</code></dt>
183+
<dd>
184+
<div class="desc"></div>
185+
<details class="source">
186+
<summary>
187+
<span>Expand source code</span>
188+
</summary>
189+
<pre><code class="python">def get_request_from_user_context(
190+
user_context: Optional[Dict[str, Any]],
191+
) -&gt; Optional[BaseRequest]:
192+
return Supertokens.get_instance().get_request_from_user_context(user_context)</code></pre>
193+
</details>
194+
</dd>
171195
<dt id="supertokens_python.init"><code class="name flex">
172196
<span>def <span class="ident">init</span></span>(<span>app_info: <a title="supertokens_python.supertokens.InputAppInfo" href="supertokens.html#supertokens_python.supertokens.InputAppInfo">InputAppInfo</a>, framework: Literal['fastapi', 'flask', 'django'], supertokens_config: <a title="supertokens_python.supertokens.SupertokensConfig" href="supertokens.html#supertokens_python.supertokens.SupertokensConfig">SupertokensConfig</a>, recipe_list: List[Callable[[<a title="supertokens_python.supertokens.AppInfo" href="supertokens.html#supertokens_python.supertokens.AppInfo">AppInfo</a>], <a title="supertokens_python.recipe_module.RecipeModule" href="recipe_module.html#supertokens_python.recipe_module.RecipeModule">RecipeModule</a>]], mode: Optional[Literal['asgi', 'wsgi']] = None, telemetry: Optional[bool] = None)</span>
173197
</code></dt>
@@ -227,6 +251,7 @@ <h2>Index</h2>
227251
<li><h3><a href="#header-functions">Functions</a></h3>
228252
<ul class="">
229253
<li><code><a title="supertokens_python.get_all_cors_headers" href="#supertokens_python.get_all_cors_headers">get_all_cors_headers</a></code></li>
254+
<li><code><a title="supertokens_python.get_request_from_user_context" href="#supertokens_python.get_request_from_user_context">get_request_from_user_context</a></code></li>
230255
<li><code><a title="supertokens_python.init" href="#supertokens_python.init">init</a></code></li>
231256
</ul>
232257
</li>

html/supertokens_python/supertokens.html

Lines changed: 58 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,22 @@ <h1 class="title">Module <code>supertokens_python.supertokens</code></h1>
579579
&#34;errorHandler: Matched with recipeID: %s&#34;, recipe.get_recipe_id()
580580
)
581581
return await recipe.handle_error(request, err, response)
582-
raise err</code></pre>
582+
raise err
583+
584+
def get_request_from_user_context( # pylint: disable=no-self-use
585+
self,
586+
user_context: Optional[Dict[str, Any]] = None,
587+
) -&gt; Optional[BaseRequest]:
588+
if user_context is None:
589+
return None
590+
591+
if &#34;_default&#34; not in user_context:
592+
return None
593+
594+
if not isinstance(user_context[&#34;_default&#34;], dict):
595+
return None
596+
597+
return user_context.get(&#34;_default&#34;, {}).get(&#34;request&#34;)</code></pre>
583598
</details>
584599
</section>
585600
<section>
@@ -1150,7 +1165,22 @@ <h3>Methods</h3>
11501165
&#34;errorHandler: Matched with recipeID: %s&#34;, recipe.get_recipe_id()
11511166
)
11521167
return await recipe.handle_error(request, err, response)
1153-
raise err</code></pre>
1168+
raise err
1169+
1170+
def get_request_from_user_context( # pylint: disable=no-self-use
1171+
self,
1172+
user_context: Optional[Dict[str, Any]] = None,
1173+
) -&gt; Optional[BaseRequest]:
1174+
if user_context is None:
1175+
return None
1176+
1177+
if &#34;_default&#34; not in user_context:
1178+
return None
1179+
1180+
if not isinstance(user_context[&#34;_default&#34;], dict):
1181+
return None
1182+
1183+
return user_context.get(&#34;_default&#34;, {}).get(&#34;request&#34;)</code></pre>
11541184
</details>
11551185
<h3>Static methods</h3>
11561186
<dl>
@@ -1353,6 +1383,31 @@ <h3>Methods</h3>
13531383
return list(headers_set)</code></pre>
13541384
</details>
13551385
</dd>
1386+
<dt id="supertokens_python.supertokens.Supertokens.get_request_from_user_context"><code class="name flex">
1387+
<span>def <span class="ident">get_request_from_user_context</span></span>(<span>self, user_context: Optional[Dict[str, Any]] = None) ‑> Optional[BaseRequest]</span>
1388+
</code></dt>
1389+
<dd>
1390+
<div class="desc"></div>
1391+
<details class="source">
1392+
<summary>
1393+
<span>Expand source code</span>
1394+
</summary>
1395+
<pre><code class="python">def get_request_from_user_context( # pylint: disable=no-self-use
1396+
self,
1397+
user_context: Optional[Dict[str, Any]] = None,
1398+
) -&gt; Optional[BaseRequest]:
1399+
if user_context is None:
1400+
return None
1401+
1402+
if &#34;_default&#34; not in user_context:
1403+
return None
1404+
1405+
if not isinstance(user_context[&#34;_default&#34;], dict):
1406+
return None
1407+
1408+
return user_context.get(&#34;_default&#34;, {}).get(&#34;request&#34;)</code></pre>
1409+
</details>
1410+
</dd>
13561411
<dt id="supertokens_python.supertokens.Supertokens.get_user_count"><code class="name flex">
13571412
<span>async def <span class="ident">get_user_count</span></span>(<span>self, include_recipe_ids: Union[None, List[str]]) ‑> int</span>
13581413
</code></dt>
@@ -1705,6 +1760,7 @@ <h4><code><a title="supertokens_python.supertokens.Supertokens" href="#supertoke
17051760
<li><code><a title="supertokens_python.supertokens.Supertokens.delete_user_id_mapping" href="#supertokens_python.supertokens.Supertokens.delete_user_id_mapping">delete_user_id_mapping</a></code></li>
17061761
<li><code><a title="supertokens_python.supertokens.Supertokens.get_all_cors_headers" href="#supertokens_python.supertokens.Supertokens.get_all_cors_headers">get_all_cors_headers</a></code></li>
17071762
<li><code><a title="supertokens_python.supertokens.Supertokens.get_instance" href="#supertokens_python.supertokens.Supertokens.get_instance">get_instance</a></code></li>
1763+
<li><code><a title="supertokens_python.supertokens.Supertokens.get_request_from_user_context" href="#supertokens_python.supertokens.Supertokens.get_request_from_user_context">get_request_from_user_context</a></code></li>
17081764
<li><code><a title="supertokens_python.supertokens.Supertokens.get_user_count" href="#supertokens_python.supertokens.Supertokens.get_user_count">get_user_count</a></code></li>
17091765
<li><code><a title="supertokens_python.supertokens.Supertokens.get_user_id_mapping" href="#supertokens_python.supertokens.Supertokens.get_user_id_mapping">get_user_id_mapping</a></code></li>
17101766
<li><code><a title="supertokens_python.supertokens.Supertokens.get_users" href="#supertokens_python.supertokens.Supertokens.get_users">get_users</a></code></li>

html/supertokens_python/syncio/index.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,19 +39,19 @@ <h1 class="title">Module <code>supertokens_python.syncio</code></h1>
3939
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
4040
# License for the specific language governing permissions and limitations
4141
# under the License.
42-
from typing import List, Union, Optional, Dict
42+
from typing import Dict, List, Optional, Union
4343

4444
from supertokens_python import Supertokens
4545
from supertokens_python.async_to_sync_wrapper import sync
4646
from supertokens_python.interfaces import (
4747
CreateUserIdMappingOkResult,
48+
DeleteUserIdMappingOkResult,
49+
GetUserIdMappingOkResult,
50+
UnknownMappingError,
4851
UnknownSupertokensUserIDError,
52+
UpdateOrDeleteUserIdMappingInfoOkResult,
4953
UserIdMappingAlreadyExistsError,
5054
UserIDTypes,
51-
UnknownMappingError,
52-
GetUserIdMappingOkResult,
53-
DeleteUserIdMappingOkResult,
54-
UpdateOrDeleteUserIdMappingInfoOkResult,
5555
)
5656
from supertokens_python.types import UsersResponse
5757

0 commit comments

Comments
 (0)