move cryptographicallySecure into Backend type
This is groundwork for external backends, but also makes sense to keep this information with the rest of a Backend's implementation. Also, removed isVerifiable. I noticed that the same information is encoded by whether a Backend implements verifyKeyContent or not.
This commit is contained in:
parent
4be5567372
commit
172743728e
10 changed files with 38 additions and 41 deletions
12
Backend.hs
12
Backend.hs
|
@ -1,6 +1,6 @@
|
|||
{- git-annex key/value backends
|
||||
-
|
||||
- Copyright 2010-2017 Joey Hess <id@joeyh.name>
|
||||
- Copyright 2010-2020 Joey Hess <id@joeyh.name>
|
||||
-
|
||||
- Licensed under the GNU AGPL version 3 or higher.
|
||||
-}
|
||||
|
@ -14,6 +14,8 @@ module Backend (
|
|||
lookupBackendVariety,
|
||||
maybeLookupBackendVariety,
|
||||
isStableKey,
|
||||
isCryptographicallySecure,
|
||||
isVerifiable,
|
||||
) where
|
||||
|
||||
import Annex.Common
|
||||
|
@ -101,3 +103,11 @@ varietyMap = M.fromList $ zip (map B.backendVariety list) list
|
|||
isStableKey :: Key -> Bool
|
||||
isStableKey k = maybe False (`B.isStableKey` k)
|
||||
(maybeLookupBackendVariety (fromKey keyVariety k))
|
||||
|
||||
isCryptographicallySecure :: Key -> Bool
|
||||
isCryptographicallySecure k = maybe False (`B.isCryptographicallySecure` k)
|
||||
(maybeLookupBackendVariety (fromKey keyVariety k))
|
||||
|
||||
isVerifiable :: Key -> Bool
|
||||
isVerifiable k = maybe False (isJust . B.verifyKeyContent)
|
||||
(maybeLookupBackendVariety (fromKey keyVariety k))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue