rails-session-0.1.0.0: Decrypt Ruby on Rails sessions in Haskell

Safe HaskellNone
LanguageHaskell2010

Web.Rails.Session

Contents

Synopsis

Decoding

decode :: Maybe Salt -> SecretKeyBase -> Cookie -> Maybe RubyObject Source

Decode a cookie encrypted by Rails.

decodeEither :: Maybe Salt -> SecretKeyBase -> Cookie -> Either String RubyObject Source

Decode a cookie encrypted by Rails and retain some error information on failure.

Decrypting

decrypt :: Maybe Salt -> SecretKeyBase -> Cookie -> Either String DecryptedData Source

Decrypts a cookie encrypted by Rails. Use this if you are using a serialisation format other than Ruby's Marshal format.

Utilities

lookupString :: ByteString -> RubyStringEncoding -> RubyObject -> Maybe ByteString Source

Lookup string for a given key and throw away encoding information.

lookupFixnum :: ByteString -> RubyStringEncoding -> RubyObject -> Maybe Int Source

Lookup integer for a given key.

Lifting weaker types into stronger types

mkCookie :: ByteString -> Cookie Source

data Salt Source

Instances

mkSalt :: ByteString -> Salt Source