implement isCryptographicallySecureKey for VURL

Considerable difficulty to work around an import cycle. Had to move the
list of backends (except for VURL) to Backend.Variety to VURL could use
it.

Sponsored-by: Kevin Mueller on Patreon
This commit is contained in:
Joey Hess 2024-02-29 17:21:29 -04:00
parent e7b7ea78af
commit cc17ac423b
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
16 changed files with 143 additions and 64 deletions

View file

@ -1,5 +1,4 @@
{- git-annex "URL" and "VURL" backends -- keys whose content is
- available from urls.
{- git-annex URL backend -- keys whose content is available from urls.
-
- Copyright 2011-2024 Joey Hess <id@joeyh.name>
-
@ -15,10 +14,9 @@ import Annex.Common
import Types.Key
import Types.Backend
import Backend.Utilities
import Logs.EquivilantKeys
backends :: [Backend]
backends = [backendURL, backendVURL]
backends = [backendURL]
backendURL :: Backend
backendURL = Backend
@ -31,25 +29,8 @@ backendURL = Backend
-- The content of an url can change at any time, so URL keys are
-- not stable.
, isStableKey = const False
, isCryptographicallySecure = pure False
}
backendVURL :: Backend
backendVURL = Backend
{ backendVariety = VURLKey
, genKey = Nothing
, verifyKeyContent = Nothing -- TODO
, verifyKeyContentIncrementally = Nothing -- TODO
, canUpgradeKey = Nothing
, fastMigrate = Nothing
-- Even if a hash is recorded on initial download from the web and
-- is used to verify every subsequent transfer including other
-- downloads from the web, in a split-brain situation there
-- can be more than one hash and different versions of the content.
-- So the content is not stable.
, isStableKey = const False
, isCryptographicallySecure = pure False
-- TODO it is when all recorded hashes are
, isCryptographicallySecure = False
, isCryptographicallySecureKey = const (pure False)
}
{- Every unique url has a corresponding key. -}