https://github.com/robconery/pg-auth
A complete authentication system built in Postgres using schemas and functions
https://github.com/robconery/pg-auth
Last synced: about 2 months ago
JSON representation
A complete authentication system built in Postgres using schemas and functions
- Host: GitHub
- URL: https://github.com/robconery/pg-auth
- Owner: robconery
- License: other
- Created: 2015-03-14T18:29:11.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2016-06-30T22:00:50.000Z (almost 9 years ago)
- Last Synced: 2025-01-08T04:51:44.836Z (3 months ago)
- Language: PLpgSQL
- Size: 33.2 KB
- Stars: 121
- Watchers: 7
- Forks: 19
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - robconery/pg-auth - A complete authentication system built in Postgres using schemas and functions (PLpgSQL)
README
## A Bit of Crazy
I'm fairly certain that the existence of this repo will cause anxiety. It's just a thought exercise - people have asked, so here it is.
This is the **Postgres Authentication stuff** - meaning it's a full authentication system in a box, in your DB. I flipped out one weekend and decided to see if I could do it... I could, so here it is.
Still a bit raw, but tests are passing nicely. Still need to work on a few things.
## Installation
I tried to make everything as self-contained as I could. So, to install this just crack open `index.js` and set `DB` to whatever local database you want to use.
And then...
```
npm install
node index.js
```This will execute a bulk SQL transaction against your database and will:
- Create a schema called "membership"
- Install `pgcrypto` for hashing passwords
- Drop in the schema, tables, functions etc needed for this crazy## Development
If you want to play around, the test db is called `pg_auth` and I build it on the fly. You can see all the scripts in the `build/src` directory - these get built and dropped into `build/dist`. If all you want is to check stuff out just install as above and have a good time.
## This is Supposed To Be Fun
I like seeing what Postgres can do, and I'm not the world's best programmer so if you see some things that are interesting, have some fun.