An accounts microservice for easy addition of a login requirement to your system.
- 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.
Method | Endpoint | Description | Version | Reference |
---|---|---|---|---|
GET | /user | Retrieves users | 0.0.2 | #6 |
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.
Run make start
to get started in development.
Run 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.
Run app
to start the application.
Run 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
- Docker Compose
- Make
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.
Use make start
to start the application on a development machine. If you haven't migrated the database before, run the migration (next point)
Use make migrate
in another terminal to run the migration.
Use make test
to start the tests.
Use make docs.view
to start the Knowledge Repository server.
Use make docs.add DOC="/path/to/doc"
.
Use make docs.update DOC="/path/to/doc"
.
Use 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-briefly
and create a pull request (PR). Prefix the PR withWIP
while it's still in progress - Make changes to the codebase on your branch
- Finalise your PR, remove the
WIP
and prefix your PR title with a[#?]
where?
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_WHAT
where$BUMP_WHAT
is either"patch"
,"minor"
, or"major"
.
- Fork this repository
- Create a new issue on this repository
- Make changes to the
master
branch of your fork - Push your changes to your fork
- Raise a pull request to this repository and prefix the title with a
[#?]
where?
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
LOG_FORMAT
,LOG_LEVEL
,LOG_SOURCE_MAP
andLOG_PRETTY_PRINT
environment variables.
- 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!