Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
from webauthn.webauthn import (
AuthenticationRejectedException as _AuthenticationRejectedException,
RegistrationRejectedException as _RegistrationRejectedException,
)
class AuthenticationRejectedException(Exception):
pass
class RegistrationRejectedException(Exception):
pass
WebAuthnCredential = pywebauthn.WebAuthnCredential
def _get_webauthn_users(user, *, rp_id):
"""
Returns a webauthn.WebAuthnUser instance corresponding
to the given user model, with properties suitable for
usage within the webauthn API.
"""
return [
pywebauthn.WebAuthnUser(
str(user.id),
user.username,
user.name,
None,
credential.credential_id,
credential.public_key,