Giter Site home page Giter Site logo

Encrypt and sign session cookies about rocket HOT 11 CLOSED

rwf2 avatar rwf2 commented on June 7, 2024 6
Encrypt and sign session cookies

from rocket.

Comments (11)

SergioBenitez avatar SergioBenitez commented on June 7, 2024 8

I've submitted a PR (rwf2/cookie-rs#76) to make this possible. After the PR is in, session support in Rocket should be straightforward.

from rocket.

SergioBenitez avatar SergioBenitez commented on June 7, 2024 4

Sessions landed in master ~18 days ago in 16cb729. Aside from the session example, however, sessions are undocumented. This is because the API is likely to change before support lands in 0.3. I'm hoping for a more robust, future-proof solution. That route, however, requires a few more general features to implement.

from rocket.

majkcramer avatar majkcramer commented on June 7, 2024 2

After the PR is in, session support in Rocket should be straightforward.

PR is in.

from rocket.

SergioBenitez avatar SergioBenitez commented on June 7, 2024

This is currently blocked on an open PR for Hyper updating its OpenSSL to 0.9 and the Cookies lib to 0.4. Pushing to 0.2.

from rocket.

flosse avatar flosse commented on June 7, 2024

I really hope hyperium/hyper#975 will be merged soon :)

from rocket.

mgattozzi avatar mgattozzi commented on June 7, 2024

Should be noted it might not be based off the response from the maintainer here:
hyperium/hyper#985

Seems like it'll remove openssl-sys so as to not cause conflicts/not be breaking change.

from rocket.

SergioBenitez avatar SergioBenitez commented on June 7, 2024

rwf2/cookie-rs#68 will make this possible.

from rocket.

SergioBenitez avatar SergioBenitez commented on June 7, 2024

Unfortunately this must be pushed to 0.3.

from rocket.

flosse avatar flosse commented on June 7, 2024

Seems like it'll remove openssl-sys so as to not cause conflicts/not be breaking change.

It's done in v0.10.0 :)

from rocket.

pointlessone avatar pointlessone commented on June 7, 2024

Session can not be restored after process restart. It appears, some key gets changed on every run and it prevents session from properly decrypting cookies.

I'm not sure if this is a bug or me using it wrong. Also if it needs its own issue here.

from rocket.

SergioBenitez avatar SergioBenitez commented on June 7, 2024

@pointlessone You need to set the secret_key config parameter. Otherwise, Rocket will generate a secret key for you.

from rocket.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.