feat(storage-key): add StorageKeyR to routes; minor Handler refactor
This commit is contained in:
parent
059efe5085
commit
2d1d58f78f
3
routes
3
routes
@ -73,6 +73,7 @@
|
||||
/user/set-display-email SetDisplayEmailR GET POST !free
|
||||
/user/csv-options CsvOptionsR GET POST !free
|
||||
/user/lang LangR POST !free
|
||||
/user/storage-key StorageKeyR POST !free
|
||||
|
||||
/exam-office ExamOfficeR !exam-office:
|
||||
/ EOExamsR GET
|
||||
@ -221,4 +222,4 @@
|
||||
!/#UUID CryptoUUIDDispatchR GET !free -- just redirect
|
||||
-- !/*{CI FilePath} CryptoFileNameDispatchR GET !free -- Disabled until preliminary check for valid cID exists
|
||||
|
||||
!/*WellKnownFileName WellKnownR GET !free
|
||||
!/*WellKnownFileName WellKnownR GET !free
|
||||
|
||||
@ -70,7 +70,7 @@ postStorageKeyR = do
|
||||
ikm = (toStrict . Aeson.encode) (skReqType, uid, sbKey)
|
||||
key = HKDF.expand (HKDF.extract salt ikm :: HKDF.PRK SHA3_256) (toStrict $ Binary.encode (timestamp,skReqLength)) skReqLength
|
||||
|
||||
sendResponseStatus ok200 $ toJSON StorageKeyResponse
|
||||
return $ toJSON StorageKeyResponse
|
||||
{ skResKey = (decodeUtf8 . Base64.encode) key
|
||||
, skResTimestamp = timestamp
|
||||
, skResSalt = (decodeUtf8 . Base64.encode) salt
|
||||
|
||||
Loading…
Reference in New Issue
Block a user