Fix tests
This commit is contained in:
parent
03fa874e05
commit
77d03348e8
@ -678,10 +678,10 @@ instance Yesod UniWorX where
|
|||||||
encrypted plaintextJson plaintext = do
|
encrypted plaintextJson plaintext = do
|
||||||
canDecrypt <- (== Authorized) <$> evalAccess AdminErrMsgR True
|
canDecrypt <- (== Authorized) <$> evalAccess AdminErrMsgR True
|
||||||
shouldEncrypt <- getsYesod $ appEncryptErrors . appSettings
|
shouldEncrypt <- getsYesod $ appEncryptErrors . appSettings
|
||||||
errKey <- getsYesod appErrorMsgKey
|
|
||||||
if
|
if
|
||||||
| shouldEncrypt
|
| shouldEncrypt
|
||||||
, not canDecrypt -> do
|
, not canDecrypt -> do
|
||||||
|
errKey <- getsYesod appErrorMsgKey
|
||||||
nonce <- liftIO SecretBox.newNonce
|
nonce <- liftIO SecretBox.newNonce
|
||||||
let ciphertext = SecretBox.secretbox errKey nonce . Lazy.ByteString.toStrict $ encode plaintextJson
|
let ciphertext = SecretBox.secretbox errKey nonce . Lazy.ByteString.toStrict $ encode plaintextJson
|
||||||
encoded = decodeUtf8 . Base64.encode $ Saltine.encode nonce <> ciphertext
|
encoded = decodeUtf8 . Base64.encode $ Saltine.encode nonce <> ciphertext
|
||||||
|
|||||||
@ -21,7 +21,7 @@ sampleCron :: Natural -> Cron -> [UTCTime]
|
|||||||
sampleCron n = go n baseTime Nothing
|
sampleCron n = go n baseTime Nothing
|
||||||
where
|
where
|
||||||
go 0 _ _ _ = []
|
go 0 _ _ _ = []
|
||||||
go (pred -> n') t mPrev cron = case nextCronMatch utcTZ mPrev t cron of
|
go (pred -> n') t mPrev cron = case nextCronMatch utcTZ mPrev 0 t cron of
|
||||||
MatchAsap -> t : go n' t (Just t) cron
|
MatchAsap -> t : go n' t (Just t) cron
|
||||||
MatchAt t' -> t' : go n' t' (Just t') cron
|
MatchAt t' -> t' : go n' t' (Just t') cron
|
||||||
MatchNone -> []
|
MatchNone -> []
|
||||||
|
|||||||
Reference in New Issue
Block a user