command
module
Version:
v0.0.0-...-514e0f0
Opens a new window with list of versions in this module.
Published: Nov 14, 2023
License: MIT
Opens a new window with license information.
Imports: 5
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
User Service
User Service is a microservice written in Golang which handles management of user information, and the registration/login workflow.
Package Overview
- auth: utilities relating to authentication (JWT validation, registration, login)
- config: extracts configuration information from the environment, and initializes database connections
- grpc: implements the GRPC API for User Service
- model: abstractions over database operations for users
Overview of Workflow
Login
- The user sends their username and password to User Service.
- The user's plaintext password is hashed via bcrypt, and the hash is compared to the stored password hash.
- If the password matches, we return a signed JWT with their user ID as the sole claim.
Registration
- User sends username, password and email
- The password is hashed with bcrypt, and stored in the users table along with their username and email.
JWT Validation
- Frontend sends the JWT to User Service via the ValidateJWT API
- User Service returns whether the JWT is valid, and the user's ID if so.
TODOs
- Add expiration date to JWT claims, and add expiration date validation to the token validation process.
Documentation
¶
There is no documentation for this package.
Source Files
¶
Directories
¶
|
|
internal
|
|
|
|
|
|
|
|
|
|
|
|
mocks
Package mocks is a generated GoMock package.
|
Package mocks is a generated GoMock package. |
Click to show internal directories.
Click to hide internal directories.