Skip to content

Commit dccdc00

Browse files
doc: update docs for v0.30.2 tag
1 parent 04699cb commit dccdc00

File tree

9 files changed

+214
-738
lines changed

9 files changed

+214
-738
lines changed

html/supertokens_python/constants.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ <h1 class="title">Module <code>supertokens_python.constants</code></h1>
4343
from __future__ import annotations
4444

4545
SUPPORTED_CDI_VERSIONS = [&#34;5.3&#34;]
46-
VERSION = &#34;0.30.1&#34;
46+
VERSION = &#34;0.30.2&#34;
4747
TELEMETRY = &#34;/telemetry&#34;
4848
USER_COUNT = &#34;/users/count&#34;
4949
USER_DELETE = &#34;/user/remove&#34;
@@ -56,7 +56,7 @@ <h1 class="title">Module <code>supertokens_python.constants</code></h1>
5656
FDI_KEY_HEADER = &#34;fdi-version&#34;
5757
API_VERSION = &#34;/apiversion&#34;
5858
API_VERSION_HEADER = &#34;cdi-version&#34;
59-
DASHBOARD_VERSION = &#34;0.13&#34;
59+
DASHBOARD_VERSION = &#34;0.15&#34;
6060
ONE_YEAR_IN_MS = 31536000000
6161
RATE_LIMIT_STATUS_CODE = 429</code></pre>
6262
</details>

html/supertokens_python/recipe/dashboard/api/multitenancy/utils.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ <h1 class="title">Module <code>supertokens_python.recipe.dashboard.api.multitena
106106
&#34;link-email&#34;: &#34;Passwordless&#34;,
107107
&#34;link-phone&#34;: &#34;Passwordless&#34;,
108108
&#34;totp&#34;: &#34;Totp&#34;,
109+
&#34;webauthn&#34;: &#34;WebAuthn&#34;,
109110
}
110111

111112
return factor_id_to_recipe_map.get(factor_id, &#34;&#34;)

html/supertokens_python/recipe/dashboard/api/userdetails/user_put.html

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ <h1 class="title">Module <code>supertokens_python.recipe.dashboard.api.userdetai
6565
)
6666
from supertokens_python.recipe.usermetadata import UserMetadataRecipe
6767
from supertokens_python.recipe.usermetadata.asyncio import update_user_metadata
68+
from supertokens_python.recipe.webauthn.functions import update_user_email
69+
from supertokens_python.recipe.webauthn.interfaces.recipe import (
70+
UnknownUserIdErrorResponse,
71+
)
72+
from supertokens_python.recipe.webauthn.recipe import WebauthnRecipe
6873
from supertokens_python.types import RecipeUserId
6974

7075
from .....types.response import APIResponse
@@ -229,6 +234,31 @@ <h1 class="title">Module <code>supertokens_python.recipe.dashboard.api.userdetai
229234

230235
return OkResponse()
231236

237+
if recipe_id == &#34;webauthn&#34;:
238+
validation_error = (
239+
await WebauthnRecipe.get_instance().config.validate_email_address(
240+
email=email,
241+
tenant_id=tenant_id,
242+
user_context=user_context,
243+
)
244+
)
245+
246+
if validation_error is not None:
247+
return InvalidEmailErrorResponse(validation_error)
248+
249+
email_update_response = await update_user_email(
250+
email=email,
251+
recipe_user_id=recipe_user_id.get_as_string(),
252+
tenant_id=tenant_id,
253+
user_context=user_context,
254+
)
255+
256+
if isinstance(email_update_response, EmailAlreadyExistsError):
257+
return EmailAlreadyExistsErrorResponse()
258+
259+
if isinstance(email_update_response, UnknownUserIdErrorResponse):
260+
raise Exception(&#34;Should never come here&#34;)
261+
232262
# If it comes here then the user is a third party user in which case the UI should not have allowed this
233263
raise Exception(&#34;Should never come here&#34;)
234264

html/supertokens_python/recipe/dashboard/utils.html

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ <h1 class="title">Module <code>supertokens_python.recipe.dashboard.utils</code><
4646
from typing_extensions import Literal
4747

4848
from supertokens_python.recipe.accountlinking.recipe import AccountLinkingRecipe
49+
from supertokens_python.recipe.webauthn.recipe import WebauthnRecipe
4950

5051
if TYPE_CHECKING:
5152
from supertokens_python.framework.request import BaseRequest
@@ -245,7 +246,9 @@ <h1 class="title">Module <code>supertokens_python.recipe.dashboard.utils</code><
245246
async def _get_user_for_recipe_id(
246247
recipe_user_id: RecipeUserId, recipe_id: str, user_context: Dict[str, Any]
247248
) -&gt; GetUserForRecipeIdHelperResult:
248-
recipe: Optional[Literal[&#34;emailpassword&#34;, &#34;thirdparty&#34;, &#34;passwordless&#34;]] = None
249+
recipe: Optional[
250+
Literal[&#34;emailpassword&#34;, &#34;thirdparty&#34;, &#34;passwordless&#34;, &#34;webauthn&#34;]
251+
] = None
249252

250253
user = await AccountLinkingRecipe.get_instance().recipe_implementation.get_user(
251254
recipe_user_id.get_as_string(), user_context
@@ -285,6 +288,12 @@ <h1 class="title">Module <code>supertokens_python.recipe.dashboard.utils</code><
285288
recipe = &#34;passwordless&#34;
286289
except Exception:
287290
pass
291+
elif recipe_id == WebauthnRecipe.recipe_id:
292+
try:
293+
WebauthnRecipe.get_instance()
294+
recipe = &#34;webauthn&#34;
295+
except Exception:
296+
pass
288297

289298
return GetUserForRecipeIdHelperResult(user=user, recipe=recipe)
290299

html/supertokens_python/recipe/multitenancy/api/implementation.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ <h1 class="title">Module <code>supertokens_python.recipe.multitenancy.api.implem
5353
from supertokens_python.types.response import GeneralErrorResponse
5454

5555
from ..constants import DEFAULT_TENANT_ID
56-
from ..interfaces import APIInterface, ThirdPartyProvider
56+
from ..interfaces import APIInterface, LoginMethodWebauthn, ThirdPartyProvider
5757

5858

5959
class APIImplementation(APIInterface):
@@ -143,6 +143,7 @@ <h1 class="title">Module <code>supertokens_python.recipe.multitenancy.api.implem
143143
enabled=&#34;thirdparty&#34; in valid_first_factors,
144144
providers=final_provider_list,
145145
),
146+
webauthn=LoginMethodWebauthn(enabled=&#34;webauthn&#34; in valid_first_factors),
146147
first_factors=valid_first_factors,
147148
)</code></pre>
148149
</details>
@@ -253,6 +254,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
253254
enabled=&#34;thirdparty&#34; in valid_first_factors,
254255
providers=final_provider_list,
255256
),
257+
webauthn=LoginMethodWebauthn(enabled=&#34;webauthn&#34; in valid_first_factors),
256258
first_factors=valid_first_factors,
257259
)</code></pre>
258260
</details>

html/supertokens_python/recipe/multitenancy/interfaces.html

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,16 @@ <h1 class="title">Module <code>supertokens_python.recipe.multitenancy.interfaces
358358
}
359359

360360

361+
class LoginMethodWebauthn:
362+
def __init__(self, enabled: bool):
363+
self.enabled = enabled
364+
365+
def to_json(self) -&gt; Dict[str, Any]:
366+
return {
367+
&#34;enabled&#34;: self.enabled,
368+
}
369+
370+
361371
class LoginMethodThirdParty:
362372
def __init__(self, enabled: bool, providers: List[ThirdPartyProvider]):
363373
self.enabled = enabled
@@ -376,12 +386,14 @@ <h1 class="title">Module <code>supertokens_python.recipe.multitenancy.interfaces
376386
email_password: LoginMethodEmailPassword,
377387
passwordless: LoginMethodPasswordless,
378388
third_party: LoginMethodThirdParty,
389+
webauthn: LoginMethodWebauthn,
379390
first_factors: List[str],
380391
):
381392
self.status = &#34;OK&#34;
382393
self.email_password = email_password
383394
self.passwordless = passwordless
384395
self.third_party = third_party
396+
self.webauthn = webauthn
385397
self.first_factors = first_factors
386398

387399
def to_json(self) -&gt; Dict[str, Any]:
@@ -390,6 +402,7 @@ <h1 class="title">Module <code>supertokens_python.recipe.multitenancy.interfaces
390402
&#34;emailPassword&#34;: self.email_password.to_json(),
391403
&#34;passwordless&#34;: self.passwordless.to_json(),
392404
&#34;thirdParty&#34;: self.third_party.to_json(),
405+
&#34;webauthn&#34;: self.webauthn.to_json(),
393406
&#34;firstFactors&#34;: self.first_factors,
394407
}
395408

@@ -859,9 +872,38 @@ <h3>Methods</h3>
859872
</dd>
860873
</dl>
861874
</dd>
875+
<dt id="supertokens_python.recipe.multitenancy.interfaces.LoginMethodWebauthn"><code class="flex name class">
876+
<span>class <span class="ident">LoginMethodWebauthn</span></span>
877+
<span>(</span><span>enabled: bool)</span>
878+
</code></dt>
879+
<dd>
880+
<div class="desc"></div>
881+
<details class="source">
882+
<summary>
883+
<span>Expand source code</span>
884+
</summary>
885+
<pre><code class="python">class LoginMethodWebauthn:
886+
def __init__(self, enabled: bool):
887+
self.enabled = enabled
888+
889+
def to_json(self) -&gt; Dict[str, Any]:
890+
return {
891+
&#34;enabled&#34;: self.enabled,
892+
}</code></pre>
893+
</details>
894+
<h3>Methods</h3>
895+
<dl>
896+
<dt id="supertokens_python.recipe.multitenancy.interfaces.LoginMethodWebauthn.to_json"><code class="name flex">
897+
<span>def <span class="ident">to_json</span></span>(<span>self) ‑> Dict[str, Any]</span>
898+
</code></dt>
899+
<dd>
900+
<div class="desc"></div>
901+
</dd>
902+
</dl>
903+
</dd>
862904
<dt id="supertokens_python.recipe.multitenancy.interfaces.LoginMethodsGetOkResult"><code class="flex name class">
863905
<span>class <span class="ident">LoginMethodsGetOkResult</span></span>
864-
<span>(</span><span>email_password: <a title="supertokens_python.recipe.multitenancy.interfaces.LoginMethodEmailPassword" href="#supertokens_python.recipe.multitenancy.interfaces.LoginMethodEmailPassword">LoginMethodEmailPassword</a>, passwordless: <a title="supertokens_python.recipe.multitenancy.interfaces.LoginMethodPasswordless" href="#supertokens_python.recipe.multitenancy.interfaces.LoginMethodPasswordless">LoginMethodPasswordless</a>, third_party: <a title="supertokens_python.recipe.multitenancy.interfaces.LoginMethodThirdParty" href="#supertokens_python.recipe.multitenancy.interfaces.LoginMethodThirdParty">LoginMethodThirdParty</a>, first_factors: List[str])</span>
906+
<span>(</span><span>email_password: <a title="supertokens_python.recipe.multitenancy.interfaces.LoginMethodEmailPassword" href="#supertokens_python.recipe.multitenancy.interfaces.LoginMethodEmailPassword">LoginMethodEmailPassword</a>, passwordless: <a title="supertokens_python.recipe.multitenancy.interfaces.LoginMethodPasswordless" href="#supertokens_python.recipe.multitenancy.interfaces.LoginMethodPasswordless">LoginMethodPasswordless</a>, third_party: <a title="supertokens_python.recipe.multitenancy.interfaces.LoginMethodThirdParty" href="#supertokens_python.recipe.multitenancy.interfaces.LoginMethodThirdParty">LoginMethodThirdParty</a>, webauthn: <a title="supertokens_python.recipe.multitenancy.interfaces.LoginMethodWebauthn" href="#supertokens_python.recipe.multitenancy.interfaces.LoginMethodWebauthn">LoginMethodWebauthn</a>, first_factors: List[str])</span>
865907
</code></dt>
866908
<dd>
867909
<div class="desc"><p>Helper class that provides a standard way to create an ABC using
@@ -876,12 +918,14 @@ <h3>Methods</h3>
876918
email_password: LoginMethodEmailPassword,
877919
passwordless: LoginMethodPasswordless,
878920
third_party: LoginMethodThirdParty,
921+
webauthn: LoginMethodWebauthn,
879922
first_factors: List[str],
880923
):
881924
self.status = &#34;OK&#34;
882925
self.email_password = email_password
883926
self.passwordless = passwordless
884927
self.third_party = third_party
928+
self.webauthn = webauthn
885929
self.first_factors = first_factors
886930

887931
def to_json(self) -&gt; Dict[str, Any]:
@@ -890,6 +934,7 @@ <h3>Methods</h3>
890934
&#34;emailPassword&#34;: self.email_password.to_json(),
891935
&#34;passwordless&#34;: self.passwordless.to_json(),
892936
&#34;thirdParty&#34;: self.third_party.to_json(),
937+
&#34;webauthn&#34;: self.webauthn.to_json(),
893938
&#34;firstFactors&#34;: self.first_factors,
894939
}</code></pre>
895940
</details>
@@ -1378,6 +1423,12 @@ <h4><code><a title="supertokens_python.recipe.multitenancy.interfaces.LoginMetho
13781423
</ul>
13791424
</li>
13801425
<li>
1426+
<h4><code><a title="supertokens_python.recipe.multitenancy.interfaces.LoginMethodWebauthn" href="#supertokens_python.recipe.multitenancy.interfaces.LoginMethodWebauthn">LoginMethodWebauthn</a></code></h4>
1427+
<ul class="">
1428+
<li><code><a title="supertokens_python.recipe.multitenancy.interfaces.LoginMethodWebauthn.to_json" href="#supertokens_python.recipe.multitenancy.interfaces.LoginMethodWebauthn.to_json">to_json</a></code></li>
1429+
</ul>
1430+
</li>
1431+
<li>
13811432
<h4><code><a title="supertokens_python.recipe.multitenancy.interfaces.LoginMethodsGetOkResult" href="#supertokens_python.recipe.multitenancy.interfaces.LoginMethodsGetOkResult">LoginMethodsGetOkResult</a></code></h4>
13821433
<ul class="">
13831434
<li><code><a title="supertokens_python.recipe.multitenancy.interfaces.LoginMethodsGetOkResult.to_json" href="#supertokens_python.recipe.multitenancy.interfaces.LoginMethodsGetOkResult.to_json">to_json</a></code></li>

0 commit comments

Comments
 (0)