rename getKey to genKey
for consistency with external backend protocol
This commit is contained in:
parent
d1300eca2e
commit
c4cc2cdf4c
8 changed files with 13 additions and 13 deletions
|
@ -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
|
||||
|
|
|
@ -21,7 +21,7 @@ backends = [backend]
|
|||
backend :: Backend
|
||||
backend = Backend
|
||||
{ backendVariety = URLKey
|
||||
, getKey = Nothing
|
||||
, genKey = Nothing
|
||||
, verifyKeyContent = Nothing
|
||||
, canUpgradeKey = Nothing
|
||||
, fastMigrate = Nothing
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue