Skip to content

Commit

Permalink
database: Remove unused function
Browse files Browse the repository at this point in the history
  • Loading branch information
duijf authored and arianvp committed Jun 24, 2020
1 parent dfb5054 commit b289d5d
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions server/Database.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ module Database
getUserByCredentialId,
getCredentialIdsByUserId,
getCredentialsByUserId,
getPublicKeyByCredentialId,
initialize,
)
where
Expand Down Expand Up @@ -157,22 +156,3 @@ getCredentialIdsByUserId (Transaction conn) (UserId (URLEncodedBase64 userId)) =
"select id from attested_credential_data where user_id = ?;"
[userId]
pure $ fmap (CredentialId . URLEncodedBase64 . Sqlite.fromOnly) $ credentialIds

getPublicKeyByCredentialId ::
Transaction ->
Fido2.CredentialId ->
IO (Maybe Fido2.PublicKey)
getPublicKeyByCredentialId
(Transaction conn)
(CredentialId (URLEncodedBase64 credentialId)) = do
result <-
Sqlite.query
conn
" select (public_key_x, public_key_y) \
\ from attested_credential_data \
\ where id = ?; "
[credentialId]
case result of
[] -> pure Nothing
[(x, y)] -> pure $ Fido2.mkEcdsaPublicKey x y
_ -> fail "Unreachable: attested_credential_data.id has a unique index."

0 comments on commit b289d5d

Please sign in to comment.