-
-
Notifications
You must be signed in to change notification settings - Fork 986
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: enforce secret requirement for session creation #1025
base: v2
Are you sure you want to change the base?
Conversation
index.js
Outdated
@@ -207,7 +207,7 @@ function session(options) { | |||
|
|||
// backwards compatibility for signed cookies | |||
// req.secret is passed from the cookie parser middleware | |||
var secrets = secret || [req.secret]; | |||
var secrets = secret; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to review this part because if I remove it, the tests still pass. It's likely that several tests need to be created if this is necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is from the early days of Connect (senchalabs/connect#580). Initially, they used cookie-parser to secure cookies. Now, the package itself has the option to handle it on its own, so it is safe to remove it since this package is being decoupled from cookie-parser.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find the logic to bee correct. Some minor notions in comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it. Just needs a decisions about const
and lint.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's perfect now!
Now it is mandatory to have a secret to create the session, a deprecated feature has been removed.
Context:
That is from the early days of Connect (senchalabs/connect#580). Initially, they used cookie-parser to secure cookies. Now, the package itself has the option to handle it on its own, so it is safe to remove it since this package is being decoupled from cookie-parser