Skip to content

Commit 5846d0d

Browse files
committed
adding dev-v0.13.0 tag to this commit to ensure building
1 parent 7ef1339 commit 5846d0d

File tree

11 files changed

+141
-161
lines changed

11 files changed

+141
-161
lines changed

html/supertokens_python/framework/django/django_request.html

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,10 @@ <h1 class="title">Module <code>supertokens_python.framework.django.django_reques
4949

5050
if TYPE_CHECKING:
5151
from supertokens_python.recipe.session.interfaces import SessionContainer
52+
from django.http import HttpRequest
5253

5354

5455
class DjangoRequest(BaseRequest):
55-
from django.http import HttpRequest
56-
5756
def __init__(self, request: HttpRequest):
5857
super().__init__()
5958
self.request = request
@@ -123,8 +122,6 @@ <h2 class="section-title" id="header-classes">Classes</h2>
123122
<span>Expand source code</span>
124123
</summary>
125124
<pre><code class="python">class DjangoRequest(BaseRequest):
126-
from django.http import HttpRequest
127-
128125
def __init__(self, request: HttpRequest):
129126
super().__init__()
130127
self.request = request
@@ -177,13 +174,6 @@ <h3>Ancestors</h3>
177174
<li><a title="supertokens_python.framework.request.BaseRequest" href="../request.html#supertokens_python.framework.request.BaseRequest">BaseRequest</a></li>
178175
<li>abc.ABC</li>
179176
</ul>
180-
<h3>Class variables</h3>
181-
<dl>
182-
<dt id="supertokens_python.framework.django.django_request.DjangoRequest.HttpRequest"><code class="name">var <span class="ident">HttpRequest</span></code></dt>
183-
<dd>
184-
<div class="desc"><p>A basic HTTP request.</p></div>
185-
</dd>
186-
</dl>
187177
<h3>Methods</h3>
188178
<dl>
189179
<dt id="supertokens_python.framework.django.django_request.DjangoRequest.form_data"><code class="name flex">
@@ -355,7 +345,6 @@ <h2>Index</h2>
355345
<li>
356346
<h4><code><a title="supertokens_python.framework.django.django_request.DjangoRequest" href="#supertokens_python.framework.django.django_request.DjangoRequest">DjangoRequest</a></code></h4>
357347
<ul class="two-column">
358-
<li><code><a title="supertokens_python.framework.django.django_request.DjangoRequest.HttpRequest" href="#supertokens_python.framework.django.django_request.DjangoRequest.HttpRequest">HttpRequest</a></code></li>
359348
<li><code><a title="supertokens_python.framework.django.django_request.DjangoRequest.form_data" href="#supertokens_python.framework.django.django_request.DjangoRequest.form_data">form_data</a></code></li>
360349
<li><code><a title="supertokens_python.framework.django.django_request.DjangoRequest.get_cookie" href="#supertokens_python.framework.django.django_request.DjangoRequest.get_cookie">get_cookie</a></code></li>
361350
<li><code><a title="supertokens_python.framework.django.django_request.DjangoRequest.get_header" href="#supertokens_python.framework.django.django_request.DjangoRequest.get_header">get_header</a></code></li>

html/supertokens_python/framework/fastapi/fastapi_request.html

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,10 @@ <h1 class="title">Module <code>supertokens_python.framework.fastapi.fastapi_requ
4848

4949
if TYPE_CHECKING:
5050
from supertokens_python.recipe.session.interfaces import SessionContainer
51+
from fastapi import Request
5152

5253

5354
class FastApiRequest(BaseRequest):
54-
55-
from fastapi import Request
56-
5755
def __init__(self, request: Request):
5856
super().__init__()
5957
self.request = request
@@ -124,9 +122,6 @@ <h2 class="section-title" id="header-classes">Classes</h2>
124122
<span>Expand source code</span>
125123
</summary>
126124
<pre><code class="python">class FastApiRequest(BaseRequest):
127-
128-
from fastapi import Request
129-
130125
def __init__(self, request: Request):
131126
super().__init__()
132127
self.request = request
@@ -180,14 +175,6 @@ <h3>Ancestors</h3>
180175
<li><a title="supertokens_python.framework.request.BaseRequest" href="../request.html#supertokens_python.framework.request.BaseRequest">BaseRequest</a></li>
181176
<li>abc.ABC</li>
182177
</ul>
183-
<h3>Class variables</h3>
184-
<dl>
185-
<dt id="supertokens_python.framework.fastapi.fastapi_request.FastApiRequest.Request"><code class="name">var <span class="ident">Request</span></code></dt>
186-
<dd>
187-
<div class="desc"><p>A base class for incoming HTTP connections, that is used to provide
188-
any functionality that is common to both <code>Request</code> and <code>WebSocket</code>.</p></div>
189-
</dd>
190-
</dl>
191178
<h3>Methods</h3>
192179
<dl>
193180
<dt id="supertokens_python.framework.fastapi.fastapi_request.FastApiRequest.form_data"><code class="name flex">
@@ -360,7 +347,6 @@ <h2>Index</h2>
360347
<li>
361348
<h4><code><a title="supertokens_python.framework.fastapi.fastapi_request.FastApiRequest" href="#supertokens_python.framework.fastapi.fastapi_request.FastApiRequest">FastApiRequest</a></code></h4>
362349
<ul class="two-column">
363-
<li><code><a title="supertokens_python.framework.fastapi.fastapi_request.FastApiRequest.Request" href="#supertokens_python.framework.fastapi.fastapi_request.FastApiRequest.Request">Request</a></code></li>
364350
<li><code><a title="supertokens_python.framework.fastapi.fastapi_request.FastApiRequest.form_data" href="#supertokens_python.framework.fastapi.fastapi_request.FastApiRequest.form_data">form_data</a></code></li>
365351
<li><code><a title="supertokens_python.framework.fastapi.fastapi_request.FastApiRequest.get_cookie" href="#supertokens_python.framework.fastapi.fastapi_request.FastApiRequest.get_cookie">get_cookie</a></code></li>
366352
<li><code><a title="supertokens_python.framework.fastapi.fastapi_request.FastApiRequest.get_header" href="#supertokens_python.framework.fastapi.fastapi_request.FastApiRequest.get_header">get_header</a></code></li>

html/supertokens_python/framework/flask/flask_request.html

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,10 @@ <h1 class="title">Module <code>supertokens_python.framework.flask.flask_request<
4747

4848
if TYPE_CHECKING:
4949
from supertokens_python.recipe.session.interfaces import SessionContainer
50+
from flask.wrappers import Request
5051

5152

5253
class FlaskRequest(BaseRequest):
53-
from flask.wrappers import Request
54-
5554
def __init__(self, req: Request):
5655
super().__init__()
5756
self.request = req
@@ -130,8 +129,6 @@ <h2 class="section-title" id="header-classes">Classes</h2>
130129
<span>Expand source code</span>
131130
</summary>
132131
<pre><code class="python">class FlaskRequest(BaseRequest):
133-
from flask.wrappers import Request
134-
135132
def __init__(self, req: Request):
136133
super().__init__()
137134
self.request = req
@@ -193,22 +190,6 @@ <h3>Ancestors</h3>
193190
<li><a title="supertokens_python.framework.request.BaseRequest" href="../request.html#supertokens_python.framework.request.BaseRequest">BaseRequest</a></li>
194191
<li>abc.ABC</li>
195192
</ul>
196-
<h3>Class variables</h3>
197-
<dl>
198-
<dt id="supertokens_python.framework.flask.flask_request.FlaskRequest.Request"><code class="name">var <span class="ident">Request</span></code></dt>
199-
<dd>
200-
<div class="desc"><p>The request object used by default in Flask.
201-
Remembers the
202-
matched endpoint and view arguments.</p>
203-
<p>It is what ends up as :class:<code>~flask.request</code>.
204-
If you want to replace
205-
the request object used you can subclass this and set
206-
:attr:<code>~flask.Flask.request_class</code> to your subclass.</p>
207-
<p>The request object is a :class:<code>~werkzeug.wrappers.Request</code> subclass and
208-
provides all of the attributes Werkzeug defines plus a few Flask
209-
specific ones.</p></div>
210-
</dd>
211-
</dl>
212193
<h3>Methods</h3>
213194
<dl>
214195
<dt id="supertokens_python.framework.flask.flask_request.FlaskRequest.form_data"><code class="name flex">
@@ -387,7 +368,6 @@ <h2>Index</h2>
387368
<li>
388369
<h4><code><a title="supertokens_python.framework.flask.flask_request.FlaskRequest" href="#supertokens_python.framework.flask.flask_request.FlaskRequest">FlaskRequest</a></code></h4>
389370
<ul class="two-column">
390-
<li><code><a title="supertokens_python.framework.flask.flask_request.FlaskRequest.Request" href="#supertokens_python.framework.flask.flask_request.FlaskRequest.Request">Request</a></code></li>
391371
<li><code><a title="supertokens_python.framework.flask.flask_request.FlaskRequest.form_data" href="#supertokens_python.framework.flask.flask_request.FlaskRequest.form_data">form_data</a></code></li>
392372
<li><code><a title="supertokens_python.framework.flask.flask_request.FlaskRequest.get_cookie" href="#supertokens_python.framework.flask.flask_request.FlaskRequest.get_cookie">get_cookie</a></code></li>
393373
<li><code><a title="supertokens_python.framework.flask.flask_request.FlaskRequest.get_header" href="#supertokens_python.framework.flask.flask_request.FlaskRequest.get_header">get_header</a></code></li>

html/supertokens_python/recipe/session/asyncio/index.html

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,13 @@ <h1 class="title">Module <code>supertokens_python.recipe.session.asyncio</code><
121121
claims_added_by_other_recipes = (
122122
SessionRecipe.get_instance().get_claims_added_by_other_recipes()
123123
)
124-
final_access_token_payload = access_token_payload
124+
app_info = SessionRecipe.get_instance().app_info
125+
issuer = (
126+
app_info.api_domain.get_as_string_dangerous()
127+
+ app_info.api_base_path.get_as_string_dangerous()
128+
)
129+
130+
final_access_token_payload = {**access_token_payload, &#34;iss&#34;: issuer}
125131

126132
for claim in claims_added_by_other_recipes:
127133
update = await claim.build(user_id, user_context)
@@ -650,7 +656,13 @@ <h2 class="section-title" id="header-functions">Functions</h2>
650656
claims_added_by_other_recipes = (
651657
SessionRecipe.get_instance().get_claims_added_by_other_recipes()
652658
)
653-
final_access_token_payload = access_token_payload
659+
app_info = SessionRecipe.get_instance().app_info
660+
issuer = (
661+
app_info.api_domain.get_as_string_dangerous()
662+
+ app_info.api_base_path.get_as_string_dangerous()
663+
)
664+
665+
final_access_token_payload = {**access_token_payload, &#34;iss&#34;: issuer}
654666

655667
for claim in claims_added_by_other_recipes:
656668
update = await claim.build(user_id, user_context)

html/supertokens_python/recipe/session/exceptions.html

Lines changed: 18 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ <h1 class="title">Module <code>supertokens_python.recipe.session.exceptions</cod
5656
def raise_try_refresh_token_exception(ex: Union[str, Exception]) -&gt; NoReturn:
5757
if isinstance(ex, SuperTokensError):
5858
raise ex
59+
5960
raise TryRefreshTokenError(ex) from None
6061

6162

@@ -64,16 +65,18 @@ <h1 class="title">Module <code>supertokens_python.recipe.session.exceptions</cod
6465
clear_tokens: bool = True,
6566
response_mutators: Optional[List[ResponseMutator]] = None,
6667
) -&gt; NoReturn:
67-
if response_mutators is None:
68-
response_mutators = []
69-
7068
err = UnauthorisedError(msg, clear_tokens)
71-
err.response_mutators.extend(UnauthorisedError.response_mutators)
69+
70+
if response_mutators is not None:
71+
err.response_mutators.extend(response_mutators)
72+
7273
raise err
7374

7475

7576
class SuperTokensSessionError(SuperTokensError):
76-
response_mutators: List[ResponseMutator] = []
77+
def __init__(self, *args: Any, **kwargs: Any) -&gt; None:
78+
super().__init__(*args, **kwargs)
79+
self.response_mutators: List[ResponseMutator] = []
7780

7881

7982
class TokenTheftError(SuperTokensSessionError):
@@ -161,6 +164,7 @@ <h2 class="section-title" id="header-functions">Functions</h2>
161164
<pre><code class="python">def raise_try_refresh_token_exception(ex: Union[str, Exception]) -&gt; NoReturn:
162165
if isinstance(ex, SuperTokensError):
163166
raise ex
167+
164168
raise TryRefreshTokenError(ex) from None</code></pre>
165169
</details>
166170
</dd>
@@ -178,11 +182,11 @@ <h2 class="section-title" id="header-functions">Functions</h2>
178182
clear_tokens: bool = True,
179183
response_mutators: Optional[List[ResponseMutator]] = None,
180184
) -&gt; NoReturn:
181-
if response_mutators is None:
182-
response_mutators = []
183-
184185
err = UnauthorisedError(msg, clear_tokens)
185-
err.response_mutators.extend(UnauthorisedError.response_mutators)
186+
187+
if response_mutators is not None:
188+
err.response_mutators.extend(response_mutators)
189+
186190
raise err</code></pre>
187191
</details>
188192
</dd>
@@ -256,17 +260,10 @@ <h3>Ancestors</h3>
256260
<li>builtins.Exception</li>
257261
<li>builtins.BaseException</li>
258262
</ul>
259-
<h3>Class variables</h3>
260-
<dl>
261-
<dt id="supertokens_python.recipe.session.exceptions.InvalidClaimsError.response_mutators"><code class="name">var <span class="ident">response_mutators</span> : List[ResponseMutator]</code></dt>
262-
<dd>
263-
<div class="desc"></div>
264-
</dd>
265-
</dl>
266263
</dd>
267264
<dt id="supertokens_python.recipe.session.exceptions.SuperTokensSessionError"><code class="flex name class">
268265
<span>class <span class="ident">SuperTokensSessionError</span></span>
269-
<span>(</span><span>*args, **kwargs)</span>
266+
<span>(</span><span>*args: Any, **kwargs: Any)</span>
270267
</code></dt>
271268
<dd>
272269
<div class="desc"><p>Common base class for all non-exit exceptions.</p></div>
@@ -275,7 +272,9 @@ <h3>Class variables</h3>
275272
<span>Expand source code</span>
276273
</summary>
277274
<pre><code class="python">class SuperTokensSessionError(SuperTokensError):
278-
response_mutators: List[ResponseMutator] = []</code></pre>
275+
def __init__(self, *args: Any, **kwargs: Any) -&gt; None:
276+
super().__init__(*args, **kwargs)
277+
self.response_mutators: List[ResponseMutator] = []</code></pre>
279278
</details>
280279
<h3>Ancestors</h3>
281280
<ul class="hlist">
@@ -290,13 +289,6 @@ <h3>Subclasses</h3>
290289
<li><a title="supertokens_python.recipe.session.exceptions.TryRefreshTokenError" href="#supertokens_python.recipe.session.exceptions.TryRefreshTokenError">TryRefreshTokenError</a></li>
291290
<li><a title="supertokens_python.recipe.session.exceptions.UnauthorisedError" href="#supertokens_python.recipe.session.exceptions.UnauthorisedError">UnauthorisedError</a></li>
292291
</ul>
293-
<h3>Class variables</h3>
294-
<dl>
295-
<dt id="supertokens_python.recipe.session.exceptions.SuperTokensSessionError.response_mutators"><code class="name">var <span class="ident">response_mutators</span> : List[ResponseMutator]</code></dt>
296-
<dd>
297-
<div class="desc"></div>
298-
</dd>
299-
</dl>
300292
</dd>
301293
<dt id="supertokens_python.recipe.session.exceptions.TokenTheftError"><code class="flex name class">
302294
<span>class <span class="ident">TokenTheftError</span></span>
@@ -321,17 +313,10 @@ <h3>Ancestors</h3>
321313
<li>builtins.Exception</li>
322314
<li>builtins.BaseException</li>
323315
</ul>
324-
<h3>Class variables</h3>
325-
<dl>
326-
<dt id="supertokens_python.recipe.session.exceptions.TokenTheftError.response_mutators"><code class="name">var <span class="ident">response_mutators</span> : List[ResponseMutator]</code></dt>
327-
<dd>
328-
<div class="desc"></div>
329-
</dd>
330-
</dl>
331316
</dd>
332317
<dt id="supertokens_python.recipe.session.exceptions.TryRefreshTokenError"><code class="flex name class">
333318
<span>class <span class="ident">TryRefreshTokenError</span></span>
334-
<span>(</span><span>*args, **kwargs)</span>
319+
<span>(</span><span>*args: Any, **kwargs: Any)</span>
335320
</code></dt>
336321
<dd>
337322
<div class="desc"><p>Common base class for all non-exit exceptions.</p></div>
@@ -349,13 +334,6 @@ <h3>Ancestors</h3>
349334
<li>builtins.Exception</li>
350335
<li>builtins.BaseException</li>
351336
</ul>
352-
<h3>Class variables</h3>
353-
<dl>
354-
<dt id="supertokens_python.recipe.session.exceptions.TryRefreshTokenError.response_mutators"><code class="name">var <span class="ident">response_mutators</span> : List[ResponseMutator]</code></dt>
355-
<dd>
356-
<div class="desc"></div>
357-
</dd>
358-
</dl>
359337
</dd>
360338
<dt id="supertokens_python.recipe.session.exceptions.UnauthorisedError"><code class="flex name class">
361339
<span>class <span class="ident">UnauthorisedError</span></span>
@@ -379,13 +357,6 @@ <h3>Ancestors</h3>
379357
<li>builtins.Exception</li>
380358
<li>builtins.BaseException</li>
381359
</ul>
382-
<h3>Class variables</h3>
383-
<dl>
384-
<dt id="supertokens_python.recipe.session.exceptions.UnauthorisedError.response_mutators"><code class="name">var <span class="ident">response_mutators</span> : List[ResponseMutator]</code></dt>
385-
<dd>
386-
<div class="desc"></div>
387-
</dd>
388-
</dl>
389360
</dd>
390361
</dl>
391362
</section>
@@ -419,33 +390,18 @@ <h4><code><a title="supertokens_python.recipe.session.exceptions.ClaimValidation
419390
</li>
420391
<li>
421392
<h4><code><a title="supertokens_python.recipe.session.exceptions.InvalidClaimsError" href="#supertokens_python.recipe.session.exceptions.InvalidClaimsError">InvalidClaimsError</a></code></h4>
422-
<ul class="">
423-
<li><code><a title="supertokens_python.recipe.session.exceptions.InvalidClaimsError.response_mutators" href="#supertokens_python.recipe.session.exceptions.InvalidClaimsError.response_mutators">response_mutators</a></code></li>
424-
</ul>
425393
</li>
426394
<li>
427395
<h4><code><a title="supertokens_python.recipe.session.exceptions.SuperTokensSessionError" href="#supertokens_python.recipe.session.exceptions.SuperTokensSessionError">SuperTokensSessionError</a></code></h4>
428-
<ul class="">
429-
<li><code><a title="supertokens_python.recipe.session.exceptions.SuperTokensSessionError.response_mutators" href="#supertokens_python.recipe.session.exceptions.SuperTokensSessionError.response_mutators">response_mutators</a></code></li>
430-
</ul>
431396
</li>
432397
<li>
433398
<h4><code><a title="supertokens_python.recipe.session.exceptions.TokenTheftError" href="#supertokens_python.recipe.session.exceptions.TokenTheftError">TokenTheftError</a></code></h4>
434-
<ul class="">
435-
<li><code><a title="supertokens_python.recipe.session.exceptions.TokenTheftError.response_mutators" href="#supertokens_python.recipe.session.exceptions.TokenTheftError.response_mutators">response_mutators</a></code></li>
436-
</ul>
437399
</li>
438400
<li>
439401
<h4><code><a title="supertokens_python.recipe.session.exceptions.TryRefreshTokenError" href="#supertokens_python.recipe.session.exceptions.TryRefreshTokenError">TryRefreshTokenError</a></code></h4>
440-
<ul class="">
441-
<li><code><a title="supertokens_python.recipe.session.exceptions.TryRefreshTokenError.response_mutators" href="#supertokens_python.recipe.session.exceptions.TryRefreshTokenError.response_mutators">response_mutators</a></code></li>
442-
</ul>
443402
</li>
444403
<li>
445404
<h4><code><a title="supertokens_python.recipe.session.exceptions.UnauthorisedError" href="#supertokens_python.recipe.session.exceptions.UnauthorisedError">UnauthorisedError</a></code></h4>
446-
<ul class="">
447-
<li><code><a title="supertokens_python.recipe.session.exceptions.UnauthorisedError.response_mutators" href="#supertokens_python.recipe.session.exceptions.UnauthorisedError.response_mutators">response_mutators</a></code></li>
448-
</ul>
449405
</li>
450406
</ul>
451407
</li>

0 commit comments

Comments
 (0)