Coder Social home page Coder Social logo

joist's People

Contributors

secular12 avatar

Watchers

 avatar

joist's Issues

Add RolesModule

Create the roles schema, with name field and the resolver for roles.

Add forgotPassword and verifyForgotPassword

forgotPassword
accepts uid
This should create a new token
with the same expiration time as other verification expiration

verifyForgotPassword
accepts token, password, and confirmPassword
Updates the password and deletes the token

login
deletes any forgot password token

Add Signup

Requires #2

A way to sign-up/create a user

This would also create a token in the tokens db
requires use of bcrypt for encrypting passwords
schema & resolver set up
validations set up

Create Modules Table

A table to represent the various types of modules for role/permission purposes.

Columns:

  • id [an application-wide unique module identifier, provided by the module]
  • name [string, human readable]

Add update password

Requires being logged in

updatePassword
input of password and confirmPassword
delete/revoke refreshToken?
returns message that it was complete

Roles Seeder

Start with the following roles:

  • Admin
  • Customer

Scopes Seeder

Create a scopes seeder starting with the following:

  • any
  • own

Implement Refresh token

Requires #2 and #7 to be completed first

add refreshTokenExpiration to Auth config
Upon login create a refresh token and save to tokens table in db

Add and update queries and mutations to AuthModule to utilize the refreshToken, test expiration against the refresh tokens expiration date.

Add Auth Config

Add auth to the app config folder.
pass the config into the context, as a provider
First add jwtTokenExpiration and implement it into the login resolver

Add Permissions Table

Requires #19 & #23

For role/permissions

columns:

  • module_id [reference to the modules table, is the namespace for the token]

  • scope_id [reference to the scopes table, is the namespace for the token]

  • action [string / int, action identifier provided by the module, unique in the scope of the module]

  • name [string, human readable name]

  • Primary Key: [module_id, action]

Any easy way to add new permissions to the DB

Perhaps it is GUI capable for, but usually with a disclaimer that adding a new permissions is intended for Dev access only as it should only appear as an option if it is actually in affect.
Could also be a separate GUI build.
Possibility is a permissions file that is scanned and added, modified, etc. to the database.
Could also have Scopes/Modules/Permissions "tables" as part of a flat file rather than DB tables.

Permissions Seeder

Add permissions seeder as part of the set up seeding

Start with the following permissions

action: read, module: users, scope: all
action: create, module: permissions, scope: all
action: delete, module: permissions, scope: all
action: update, module: permissions, scope: all
action: read, module: permissions, scope: own
action: read, module: permissions, scope: all
action: create, module: roles, scope: all
action: delete, module: roles, scope: all
action: update, module: roles, scope: all
action: read, module: roles, scope: own
action: read, module: roles, scope: all

...scopes and modules are included as part of permissions since they go hand in hand

Add tokens table

Add a tokens table migration. First, figure out what columns are required.

Add Unit Testing

Use a unit testing library to test the api. Set up the initial unit tests to test the various endpoints and compositions.

Create Roles table

Make a roles migration. With the following initial name column

Add role_id to the users table as a foreign key

Remove IP address tracking

IP address is not a useful way of telling if something is suspicious, especially due to mobile devices, remove IP addresses to basically rely on the user-agent rather than the IP address.

Create Roles_Users table

For role/permissions

  • remove role_id from users table

Columns:

  • user_id [FK:user_id, unsigned]
  • role_id [FK:roles_id, unsigned]

Modules Seeder

Add seeder for modules
Start with the following modules:

  • users
  • roles
  • permissions

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.