Skip to content

Commit 080ad61

Browse files
committed
fix: backend-sdk mock parsing
- update setup version
1 parent f66f5fb commit 080ad61

File tree

2 files changed

+36
-5
lines changed

2 files changed

+36
-5
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282

8383
setup(
8484
name="supertokens_python",
85-
version="0.29.2",
85+
version="0.30.0",
8686
author="SuperTokens",
8787
license="Apache 2.0",
8888
author_email="[email protected]",

tests/test-server/webauthn.py

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
)
3030
from supertokens_python.recipe.webauthn.interfaces.recipe import (
3131
AuthenticationPayload,
32+
AuthenticatorAssertionResponseJSON,
33+
AuthenticatorAttestationResponseJSON,
3234
RegistrationPayload,
3335
)
3436
from supertokens_python.types.response import StatusResponseBaseModel
@@ -65,12 +67,20 @@ def webauthn_signup(): # type: ignore
6567
session = None
6668
if "session" in request.json:
6769
session = convert_session_to_container(request.json)
70+
6871
response = sign_up.sync(
6972
**{
7073
**{to_snake(k): v for k, v in request.json.items()},
7174
# Create model without validation so that we can test edge cases
7275
"credential": RegistrationPayload.model_construct(
73-
request.json["credential"]
76+
**{
77+
k: v
78+
for k, v in request.json["credential"].items()
79+
if k != "response"
80+
},
81+
response=AuthenticatorAttestationResponseJSON.model_construct(
82+
**request.json["credential"]["response"],
83+
),
7484
),
7585
"session": session,
7686
} # type: ignore
@@ -89,7 +99,14 @@ def webauthn_signin(): # type: ignore
8999
**{to_snake(k): v for k, v in request.json.items()},
90100
# Create model without validation so that we can test edge cases
91101
"credential": AuthenticationPayload.model_construct(
92-
request.json["credential"]
102+
**{
103+
k: v
104+
for k, v in request.json["credential"].items()
105+
if k != "response"
106+
},
107+
response=AuthenticatorAssertionResponseJSON.model_construct(
108+
**request.json["credential"]["response"],
109+
),
93110
),
94111
"session": session,
95112
} # type: ignore
@@ -106,7 +123,14 @@ def webauthn_verify_credentials(): # type: ignore
106123
**{to_snake(k): v for k, v in request.json.items()},
107124
# Create model without validation so that we can test edge cases
108125
"credential": AuthenticationPayload.model_construct(
109-
request.json["credential"]
126+
**{
127+
k: v
128+
for k, v in request.json["credential"].items()
129+
if k != "response"
130+
},
131+
response=AuthenticatorAssertionResponseJSON.model_construct(
132+
**request.json["credential"]["response"],
133+
),
110134
),
111135
} # type: ignore
112136
),
@@ -145,7 +169,14 @@ def webauthn_register_credential(): # type: ignore
145169
**{to_snake(k): v for k, v in request.json.items()},
146170
# Create model without validation so that we can test edge cases
147171
"credential": RegistrationPayload.model_construct(
148-
request.json["credential"]
172+
**{
173+
k: v
174+
for k, v in request.json["credential"].items()
175+
if k != "response"
176+
},
177+
response=AuthenticatorAttestationResponseJSON.model_construct(
178+
**request.json["credential"]["response"],
179+
),
149180
),
150181
} # type: ignore
151182
)

0 commit comments

Comments
 (0)