nickredmark / ooth

User identity/authentication/accounts management microservice for node.js
https://nmaro.github.io/ooth/
MIT License
605 stars 65 forks source link

Postgres integration #47

Open pdiniz13 opened 6 years ago

pdiniz13 commented 6 years ago

I'm about to start working on a new project for which I'm going to have to setup an auth system. Given the complete lack of a full auth library setup for node, I was looking for some boilerplate code so that I didn't have to setup the whole thing from scratch and would just fix whatever security vulnerabilities it had. While I was looking for one of those I came across your project and it looks like you've been putting in a lot of work into maintaining it. I think this project might be exactly what i'm looking for. If you have time in the next few days to walk me through the project, I could create a postgres integration with the same api as your current mongo one, https://github.com/nmaro/ooth/tree/master/packages/ooth-mongo and you could add it as a package.

nickredmark commented 6 years ago

Hey thank you for your interest! I'd love to assist you and to add an ooth-postgres package to this library. It's going to be hard in the coming days since I'm doing a training this week. At any rate your best bet is to join the slack channel and @ me whenever you need me. If you take on the task here are a few thoughts:

the user object is structured this way:

{
  _id: "XXX"
  [strategyname]: {
    [key]: [value]
  }
}

where there could be many strategy names. Now the advantage of mongodb is that you can just store any kind of object, so no schema is needed. I'm not sure how you would solve this problem with postgres. So this might be a difficulty.

pdiniz13 commented 6 years ago

@nmaro sorry for the delay. Another project took priority and I got swamped. This would be fine for postgres since we could just use its jsonb storage to store that info. But when I have some time again Ill look at an alternative solution so that it can be used accross other sql databases as well, regardless of json support.

chase-moskal commented 6 years ago

i found this reddit thread where people are discussing mongodb vs postgres with regards to user accounting

i found it noteworthy that the conversation is overwhelmingly in favor of postgres

mnlbox commented 5 years ago

@nmaro Any plan or roadmap for add Postgres support? If Postgres support work then we can use it with other tools. For example we can use it for http://hasura.io/

see this links please: https://docs.hasura.io/1.0/graphql/manual/auth/index.html https://github.com/elitan/hasura-backend-plus