Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Web.Rails7.Session
Contents
Synopsis
- decode :: Maybe Salt -> SecretKeyBase -> Cookie -> Maybe Value
- decodeEither :: Maybe Salt -> SecretKeyBase -> Cookie -> Either DecodingError Value
- data DecodingError
- decrypt :: Maybe Salt -> SecretKeyBase -> Cookie -> Either DecodingError DecryptedData
Decoding
decode :: Maybe Salt -> SecretKeyBase -> Cookie -> Maybe Value Source #
Decode a cookie encrypted by Rails.
decodeEither :: Maybe Salt -> SecretKeyBase -> Cookie -> Either DecodingError Value Source #
Decode a cookie encrypted by Rails and retain some error information on failure.
data DecodingError Source #
Constructors
InvalidCookieFormat | |
InvalidAuthTagSize Int | |
InvalidIVSize Int | |
InvalidJSON String | |
InvalidBase64 String | |
InvalidCryptoStep String | |
MakeIVFailed String | |
DecryptionIsEmpty |
Instances
Show DecodingError Source # | |
Defined in Web.Rails7.Session Methods showsPrec :: Int -> DecodingError -> ShowS # show :: DecodingError -> String # showList :: [DecodingError] -> ShowS # | |
Eq DecodingError Source # | |
Defined in Web.Rails7.Session Methods (==) :: DecodingError -> DecodingError -> Bool # (/=) :: DecodingError -> DecodingError -> Bool # |
Decrypting
decrypt :: Maybe Salt -> SecretKeyBase -> Cookie -> Either DecodingError DecryptedData Source #
Decrypts a cookie encrypted by Rails. It returns the encrypted
data as a ByteString
blob, which is your responsibility to deserialise.