Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: enforce secret requirement for session creation #1025

Open
wants to merge 3 commits into
base: v2
Choose a base branch
from

Conversation

bjohansebas
Copy link
Member

@bjohansebas bjohansebas commented Feb 13, 2025

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

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;
Copy link
Member Author

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.

Copy link
Member Author

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.

@bjohansebas bjohansebas changed the base branch from master to v2 February 13, 2025 03:20
@bjohansebas bjohansebas marked this pull request as ready for review February 13, 2025 04:39
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants