-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update to latest webauthn (1.11) (#851)
* Update py_webauthn (1.11) Use new 1.11 helpers - parse_registration_credential_json and parse_authentication_credential_json Note in release notes that for now - must use pydantic 1.x with webauthn until user_handle issue solved.
- Loading branch information
Showing
7 changed files
with
32 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,7 @@ qrcode | |
requests | ||
sqlalchemy | ||
sqlalchemy-utils | ||
webauthn==1.9.0 | ||
webauthn | ||
pydantic<2.0 | ||
werkzeug | ||
zxcvbn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1177,20 +1177,20 @@ def test_reset(app, client): | |
|
||
|
||
@pytest.mark.settings(webauthn_util_cls=HackWebauthnUtil) | ||
def test_user_handle(app, client, get_message): | ||
def test_user_handle(app, clients, get_message): | ||
"""Test that we fail signin if user_handle doesn't match. | ||
Since we generated the SIGNIN_DATA_OH from view_scaffold - the user_handle | ||
has no way of matching. | ||
""" | ||
authenticate(client) | ||
register_options, response_url = _register_start_json(client, usage="first") | ||
response = client.post(response_url, json=dict(credential=json.dumps(REG_DATA_UH))) | ||
authenticate(clients) | ||
register_options, response_url = _register_start_json(clients, usage="first") | ||
response = clients.post(response_url, json=dict(credential=json.dumps(REG_DATA_UH))) | ||
assert response.status_code == 200 | ||
|
||
# verify can't sign in | ||
logout(client) | ||
signin_options, response_url, _ = _signin_start_json(client, "[email protected]") | ||
response = client.post( | ||
logout(clients) | ||
signin_options, response_url, _ = _signin_start_json(clients, "[email protected]") | ||
response = clients.post( | ||
response_url, json=dict(credential=json.dumps(SIGNIN_DATA_UH)) | ||
) | ||
assert response.json["response"]["field_errors"]["credential"][0].encode( | ||
|
@@ -1210,12 +1210,12 @@ def test_user_handle(app, client, get_message): | |
) | ||
upd_signin_data = copy.deepcopy(SIGNIN_DATA_UH) | ||
upd_signin_data["response"]["userHandle"] = b64_user_handle | ||
signin_options, response_url, _ = _signin_start_json(client, "[email protected]") | ||
response = client.post( | ||
signin_options, response_url, _ = _signin_start_json(clients, "[email protected]") | ||
response = clients.post( | ||
response_url, json=dict(credential=json.dumps(upd_signin_data)) | ||
) | ||
# verify actually logged in | ||
response = client.get("/profile", headers={"accept": "application/json"}) | ||
response = clients.get("/profile", headers={"accept": "application/json"}) | ||
assert response.status_code == 200 | ||
|
||
|
||
|