Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/iconnect/rails-session
Decrypt Ruby on Rails sessions in Haskell
https://github.com/iconnect/rails-session
haskell rails ruby web
Last synced: about 1 month ago
JSON representation
Decrypt Ruby on Rails sessions in Haskell
- Host: GitHub
- URL: https://github.com/iconnect/rails-session
- Owner: iconnect
- License: bsd-3-clause
- Created: 2017-04-09T15:22:09.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-08-22T12:53:58.000Z (3 months ago)
- Last Synced: 2024-09-21T16:38:36.070Z (about 2 months ago)
- Topics: haskell, rails, ruby, web
- Language: Haskell
- Size: 66.4 KB
- Stars: 9
- Watchers: 9
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# rails-session
[![Build Status](https://travis-ci.org/iconnect/rails-session.svg?branch=issue-3)](https://travis-ci.org/iconnect/rails-session)
Haskell library to decrypt Ruby on Rails sessions in order to allow you to share
them between Ruby on Rails and Haskell web applications.## Usage
``` haskell
-- | Read session id from encrypted Rails cookie on the filesystem.
example :: FilePath -> IO (Maybe ByteString)
example path = do
rawCookie <- BS.readFile path
let appSecret = mkSecretKeyBase "development_secret_token"
let cookie = mkCookie rawCookie
case decodeEither Nothing appSecret cookie of
Left _ ->
pure Nothing
Right rubyObject ->
pure $ sessionId rubyObject
```See more in [Spec.hs](https://github.com/iconnect/rails-session/blob/master/test/Spec.hs).
## Contributing
1. Fork it.
2. Create your feature branch (`git checkout -b my-new-feature`).
3. Commit your changes (`git commit -am 'Add some feature'`).
4. Push to the branch (`git push origin my-new-feature`).
5. Create new Pull Request.### Contributors
- [@filib](https://github.com/filib)
- [@adinapoli](https://github.com/adinapoli)
- [@saurabhnanda](https://github.com/saurabhnanda)## Similar Libraries
- [adjust/gorails](https://github.com/adjust/gorails)
- [cconstantin/plug_rails_cookie_session_store](https://github.com/cconstantin/plug_rails_cookie_session_store)
- [instore/rails-cookie-parser](https://github.com/instore/rails-cookie-parser)