mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-11 17:38:50 -04:00
Integrate with the API for adding and getting webauthn creds
This links up the `get_webauthn_credentials_for_user` and
`create_webauthn_credential_for_user` methods of the user api client to
notifications-api.
To send data to the API we need strings to be unicode, so we call
decode('utf-8') on base64 objects.
Co-authored-by: Leo Hemsted <leo.hemsted@digital.cabinet-office.gov.uk>
This commit is contained in:
@@ -32,15 +32,15 @@ class WebAuthnCredential(JSONModel):
|
||||
'name': 'Unnamed key',
|
||||
'credential_data': base64.b64encode(
|
||||
cbor.encode(auth_data.credential_data),
|
||||
),
|
||||
).decode('utf-8'),
|
||||
'registration_response': base64.b64encode(
|
||||
cbor.encode(response),
|
||||
)
|
||||
).decode('utf-8')
|
||||
})
|
||||
|
||||
def to_credential_data(self):
|
||||
return AttestedCredentialData(
|
||||
cbor.decode(base64.b64decode(self.credential_data))
|
||||
cbor.decode(base64.b64decode(self.credential_data.encode()))
|
||||
)
|
||||
|
||||
def serialize(self):
|
||||
|
||||
Reference in New Issue
Block a user