Skip to content
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

Upgrading passport.js to greater than 0.5.x in registry-server #1071

Closed
3 tasks
wgwz opened this issue Jul 21, 2022 · 3 comments · Fixed by regen-network/regen-server#335
Closed
3 tasks
Assignees
Labels
bug Something isn't working dev Engineering tasks

Comments

@wgwz
Copy link

wgwz commented Jul 21, 2022

Describe the bug
When passport.js 0.6.x is installed in the registry-server we get this error:

TypeError: req.session.regenerate is not a function                                                        
    at SessionManager.logIn (/Users/kyle/regen/registry-server/node_modules/passport/lib/sessionmanager.js:28:15)                                                                                                     
    at IncomingMessage.req.login.req.logIn (/Users/kyle/regen/registry-server/node_modules/passport/lib/http/request.js:39:26)
    at Strategy.strategy.success (/Users/kyle/regen/registry-server/node_modules/passport/lib/middleware/authenticate.js:256:13)
    at verified (/Users/kyle/regen/registry-server/node_modules/passport-custom/lib/strategy.js:56:8)      
    at Strategy._verify (/Users/kyle/regen/registry-server/server/middleware/passport.ts:79:20)            
    at Strategy.authenticate (/Users/kyle/regen/registry-server/node_modules/passport-custom/lib/strategy.js:60:8)
    at attempt (/Users/kyle/regen/registry-server/node_modules/passport/lib/middleware/authenticate.js:369:16)                                                                                                        
    at authenticate (/Users/kyle/regen/registry-server/node_modules/passport/lib/middleware/authenticate.js:370:7)                                                                                                    
    at Layer.handle [as handle_request] (/Users/kyle/regen/registry-server/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/Users/kyle/regen/registry-server/node_modules/express/lib/router/index.js:323:13)

Related upstream issues: jaredhanson/passport#907, jaredhanson/passport#904

In order to upgrade passport to > 0.5.x, we will need to have a fix for the issue above.

Found during work in PR: regen-network/regen-server#227


For Admin Use

  • Not duplicate issue
  • Appropriate labels and zenhub epics applied
  • Appropriate contributors tagged
@wgwz wgwz added bug Something isn't working dev Engineering tasks labels Jul 21, 2022
@wgwz
Copy link
Author

wgwz commented May 10, 2023

Newer versions of passport.js require this req.session.regenerate API.
express/cookie-session does not make use of this API and they do not plan to fix it (ref).
A workaround was shared here:
jaredhanson/passport#904 (comment)
We can try this workaround to perform the upgrade.
Alternative ideas:

@wgwz
Copy link
Author

wgwz commented May 10, 2023

@blushi i think we should pull this into the next sprint if possible.
i don't want to fall to far behind with passport.js since it's an important dependency.
this will involve some hacking for finding the best support path, and thorough testing.

@blushi
Copy link
Member

blushi commented May 13, 2023

Please add your planning poker estimate with Zenhub @wgwz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dev Engineering tasks
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants