Merge pull request #3892 from alphagov/update-remove-webauthn-cred

Let admin user update and delete their security key
This commit is contained in:
Pea Tyczynska
2021-05-25 14:33:00 +01:00
committed by GitHub
8 changed files with 401 additions and 17 deletions

View File

@@ -201,5 +201,15 @@ class UserApiClient(NotifyAdminAPIClient):
return self.post(endpoint, data=credential.serialize())
def update_webauthn_credential_name_for_user(self, *, user_id, credential_id, new_name_for_credential):
endpoint = f'/user/{user_id}/webauthn/{credential_id}'
return self.post(endpoint, data={"name": new_name_for_credential})
def delete_webauthn_credential_for_user(self, *, user_id, credential_id):
endpoint = f'/user/{user_id}/webauthn/{credential_id}'
return self.delete(endpoint)
user_api_client = UserApiClient()