verifyKeyContent for VURL
VURL is now fully working, though needs more testing. Still need to implement verifyKeyContentIncrementally but it works without it. Sponsored-by: Luke T. Shumaker on Patreon
This commit is contained in:
parent
cc17ac423b
commit
c72df19784
2 changed files with 44 additions and 2 deletions
|
@ -23,7 +23,20 @@ backendVURL :: Backend
|
|||
backendVURL = Backend
|
||||
{ backendVariety = VURLKey
|
||||
, genKey = Nothing
|
||||
, verifyKeyContent = Nothing -- TODO
|
||||
, verifyKeyContent = Just $ \k f -> do
|
||||
equivkeys k >>= \case
|
||||
-- Normally there will always be an key
|
||||
-- recorded when a VURL's content is available,
|
||||
-- because downloading the content from the web in
|
||||
-- the first place records one.
|
||||
[] -> return False
|
||||
l -> do
|
||||
let check ek = getbackend ek >>= \case
|
||||
Nothing -> pure False
|
||||
Just b -> case verifyKeyContent b of
|
||||
Just verify -> verify ek f
|
||||
Nothing -> pure False
|
||||
anyM check l
|
||||
, verifyKeyContentIncrementally = Nothing -- TODO
|
||||
, canUpgradeKey = Nothing
|
||||
, fastMigrate = Nothing
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue