An accounts microservice for easy addition of a login requirement to your system.
Current Scope of Component (For Version 1.0)
- User account creation with email/password
- Updating of user's account information
- Deletion of an existing user
- Retrieval of a user's account information
- Retrieval of a list of users
- Session creation
- Authentication with email/username and password
- Session status retrieval (still logged in?)
- Session deletion
See the roadmap section for future developements.
|POST||/user||Register a new user||0.0.1||#1|
|GET||/user/:uuid||Returns the user identified by the :uuid||0.0.1||#2|
|PATCH||/user/:uuid||Updates a field of the user identified by :uuid||0.0.3||#4|
|DELETE||/user/:uuid||Deletes the user identified by the :uuid||0.0.1||#3|
|PATCH||/security/:user_uuid||Updates the password for the user identified by the :user_uuid||0.0.4||#7|
|POST||/auth/credentials||Verifies a user's email/username and password matches||0.0.7||#24|
|POST||/session||Creates the user session||0.0.6||#12|
|DELETE||/session||Destroys the user session||TODO||#13|
|GET||/metrics||Returns Prometheus metrics||TODO||N/A|
|GET||/healthz||Returns 200 OK if healthy||TODO||#8|
|GET||/readyz||Returns 200 OK if ready to accept connections||TODO||#9|
Refer to the User documentation for details on the user endpoints.
Refer to the Security documentation for detials on the security endpoints.
Refer to the Session documentation for details on the session endpoints.
Refer to the Auth documentation for details on the authentication endpoints.
Refer to the Configuration documentation for details on configuring the application.
You'll need Docker and Docker Compose installed on your machine for the development environment to be provisioned.
make start to get started in development.
make test to run automated tests.
Refer to the Makefile for details.
- MySQL database
Refer to the Docker Compose file for more information on support services required.
app to start the application.
app --migrate to run the migrations.
Refer to main.go for the various usable flags.
- Registration of new users using an email address and password
- Removal of an existing user from the system
- Retrieval of a list of users
- Updating of existing users' account information
- Updating of existing users' password
- Logging in of existing users via password
- Logging out of existing users
- Session maintenance of existing users
- Creation of profiles associated with accounts
- Registration of new users using Facebook Login
- Logging in of existing users via Facebook Login
- Registration of new users using Google login
- Logging in of existing users via Google Login
- Logging in of existing users via an email message
- Audit trail of session creation/destruction
- Audit trail of user's actions
If you'd like to contribute, clone this repository and read on!
- Docker Compose
We use the Makefile to run development tasks. The Makefile contains comments which describes what each recipe does. Below is a list of those you'd more commonly use.
Start the Project
make start to start the application on a development machine. If you haven't migrated the database before, run the migration (next point)
Migrate the Database
make migrate in another terminal to run the migration.
Run Tests in Auto-Reload
make test to start the tests.
Viewing the Documentation on the Knowledge Repository
make docs.view to start the Knowledge Repository server.
Adding Documentation to the Knowledge Repository
make docs.add DOC="/path/to/doc".
Updating Documentation on the Knowledge Repository
make docs.update DOC="/path/to/doc".
Build the Binary
make build to build the binary.
- Create a new issue (if one isn't already available)
- Create a new branch with a descriptive title like
feature-<ISSUE_NUMBER>/describe-it-brieflyand create a pull request (PR). Prefix the PR with
WIPwhile it's still in progress
- Make changes to the codebase on your branch
- Finalise your PR, remove the
WIPand prefix your PR title with a
?is the issue number
- Squash and merge when ready and close the issue
- After merging, if a milestone is achieved, tag it using
make version.bump BUMP=$BUMP_WHATwhere
- Fork this repository
- Create a new issue on this repository
- Make changes to the
masterbranch of your fork
- Push your changes to your fork
- Raise a pull request to this repository and prefix the title with a
?is the issue number
- Ping a contributor if you're getting impatient
- Added endpoint for verification of credentials at
POST /auth/credentials. See the Auth documentation for more information.
- Added session creation at
POST /session. See the Session documentation for more information.
- Enable configuring of the logging format via
- Added endpoint for updating of existing users' password. See the Security documentation for more information.
- Updating of existing users' account information. See the User documentation for more information.
- Retrieval of a list of users. See the User documentation for more information.
- Registration of new users using an email address and password.
- Removal of an existing user from the system.
This project is licensed under the MIT license. Feel free to fork it and create your own!