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:
parent
e7b7ea78af
commit
cc17ac423b
16 changed files with 143 additions and 64 deletions
35
Backend/Variety.hs
Normal file
35
Backend/Variety.hs
Normal file
|
@ -0,0 +1,35 @@
|
|||
{- git-annex backend varieties
|
||||
-
|
||||
- Copyright 2012-2024 Joey Hess <id@joeyh.name>
|
||||
-
|
||||
- Licensed under the GNU AGPL version 3 or higher.
|
||||
-}
|
||||
|
||||
module Backend.Variety where
|
||||
|
||||
import qualified Data.Map as M
|
||||
|
||||
import Annex.Common
|
||||
import Types.Key
|
||||
import Types.Backend
|
||||
import qualified Backend.External
|
||||
|
||||
-- When adding a new backend, import it here and add it to the builtinList.
|
||||
import qualified Backend.Hash
|
||||
import qualified Backend.WORM
|
||||
import qualified Backend.URL
|
||||
|
||||
{- Regular backends. Does not include externals or VURL. -}
|
||||
regularBackendList :: [Backend]
|
||||
regularBackendList = Backend.Hash.backends
|
||||
++ Backend.WORM.backends
|
||||
++ Backend.URL.backends
|
||||
|
||||
makeVarietyMap :: [Backend] -> M.Map KeyVariety Backend
|
||||
makeVarietyMap l = M.fromList $ zip (map backendVariety l) l
|
||||
|
||||
maybeLookupBackendVarietyMap :: KeyVariety -> M.Map KeyVariety Backend -> Annex (Maybe Backend)
|
||||
maybeLookupBackendVarietyMap (ExternalKey s hasext) _varitymap =
|
||||
Just <$> Backend.External.makeBackend s hasext
|
||||
maybeLookupBackendVarietyMap v varietymap =
|
||||
pure $ M.lookup v varietymap
|
Loading…
Add table
Add a link
Reference in a new issue