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

User authentication middleware/controller #57

Closed
5 of 6 tasks
bunsenmcdubbs opened this issue Feb 22, 2018 · 0 comments · Fixed by #64
Closed
5 of 6 tasks

User authentication middleware/controller #57

bunsenmcdubbs opened this issue Feb 22, 2018 · 0 comments · Fixed by #64
Assignees

Comments

@bunsenmcdubbs
Copy link
Contributor

bunsenmcdubbs commented Feb 22, 2018

  • Account creation
  • Password encryption with bcrypt and checking if they match
  • Login (JWT creation, parsing and validating)
  • Authentication middleware to protect routes (includes redirects)
  • Unit tests
  • (extra credit) Password reset

Relevant routes from #58 (to be finalized):

Route Method Description Request Response
/user PUT Create a new user {email: <string>, password: <string>, org_id: <id>} {token: <JWT>}
/user/login POST Login and authenticate {email: <string>, password: <string>} {token: <JWT>}

blue-jay/blueprint is a good template for MVC golang servers. I've used as a reference to structure a much of this project. In particular, something like https://github.com/blue-jay/blueprint/blob/master/middleware/acl/acl.go would probably be the way to go.

This middleware would be selectively applied to routes by wrapping around the route's http.Handler similar to how it works for the logging and recovery middleware https://github.com/HackGT/SponsorshipPortal/blob/master/server/routes.go#L26-L27

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants