rename getKey to genKey

for consistency with external backend protocol
This commit is contained in:
Joey Hess 2020-07-20 14:06:05 -04:00
parent d1300eca2e
commit c4cc2cdf4c
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
8 changed files with 13 additions and 13 deletions

View file

@ -74,7 +74,7 @@ backends = concatMap (\h -> [genBackendE h, genBackend h]) hashes
genBackend :: Hash -> Backend
genBackend hash = Backend
{ backendVariety = hashKeyVariety hash (HasExt False)
, getKey = Just (keyValue hash)
, genKey = Just (keyValue hash)
, verifyKeyContent = Just $ checkKeyChecksum hash
, canUpgradeKey = Just needsUpgrade
, fastMigrate = Just trivialMigrate
@ -85,7 +85,7 @@ genBackend hash = Backend
genBackendE :: Hash -> Backend
genBackendE hash = (genBackend hash)
{ backendVariety = hashKeyVariety hash (HasExt True)
, getKey = Just (keyValueE hash)
, genKey = Just (keyValueE hash)
}
hashKeyVariety :: Hash -> HasExt -> KeyVariety
@ -308,10 +308,10 @@ md5Hasher = show . md5
testKeyBackend :: Backend
testKeyBackend =
let b = genBackendE (SHA2Hash (HashSize 256))
gk = case getKey b of
gk = case genKey b of
Nothing -> Nothing
Just f -> Just (\ks p -> addE <$> f ks p)
in b { getKey = gk }
in b { genKey = gk }
where
addE k = alterKey k $ \d -> d
{ keyName = keyName d <> longext

View file

@ -21,7 +21,7 @@ backends = [backend]
backend :: Backend
backend = Backend
{ backendVariety = URLKey
, getKey = Nothing
, genKey = Nothing
, verifyKeyContent = Nothing
, canUpgradeKey = Nothing
, fastMigrate = Nothing

View file

@ -24,7 +24,7 @@ backends = [backend]
backend :: Backend
backend = Backend
{ backendVariety = WORMKey
, getKey = Just keyValue
, genKey = Just keyValue
, verifyKeyContent = Nothing
, canUpgradeKey = Just needsUpgrade
, fastMigrate = Just removeProblemChars