Code Monkey home page Code Monkey logo

base-golang-rest-jwt's Introduction

TODO

  • After every change to th prisma data model, we need to run prisma deploy.
  • Need to add managementApiSecret to the docker-compose.yml.

Usage

Development Mode

To run the project in development mode, we need to run the docker-compose.dev.yml file, like so:

sudo docker-compose -f docker-compose.dev.yml up -d

And then, run the server's executable:

go run server/cmd/main.go

If redis is installed on the local machine, you may need to disable it:

sudo systemctl stop redis

You can start it back up again, when you're done, with the command:

sudo systemctl start redis

Release Mode

To run the project in Release Mode, we only need to run the docker-compose.yml file, like so:

sudo docker-compose up -d --build

(You may also have to disable redis, if you have it installed.)

Tests

To run all the unit tests included, use the command:

go test ./...

base-golang-rest-jwt's People

Contributors

diogox avatar

Stargazers

 avatar  avatar

Watchers

 avatar

base-golang-rest-jwt's Issues

Token blacklist

Should probably have a 'Token Blacklist' so that I can invalidate tokens while they don't expire.
Some places where this would be useful:

  • Invalidate password reset token after the token is reset.
  • Invalidate an auth token so that I can implement a Logout-like functionality.
  • Invalidate an auth token after the password has been reset, to force the user to login again.

Create endpoints for user management

Create endpoints to deal with a user's info. A user should be able add/modify their:

  • Email
  • Avatar (Use multipart to upload the image. Maybe restrict the image size)
  • Etc.

Add user roles

Add user roles, for example:

  • Free User
  • Premium (paid) user

Remove unverified accounts after a defined interval

Right now, when we sign in, we receive an email prompting use to verify our email before we can use the account.
If the account doesn't get verified then it just stays unverified indefinitely. This behaviour is not optimal, the account should probably get deleted after a defined interval.

Limit failed login attempts

Should limit the amount of failed login attempts.
This could be done on the server side by blocking the IP temporarily, blocking the account temporarily or, on the client side, by adding a captcha after a few failed attempts.
The one on the client side may be the least secure since one could possibly alter the javascript to be able to brute-force the account (maybe?). On the other hand, blocking the account may be an inconvenience to the affected user.

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.