Auth microservice for managing authentication sessions.
The microservice has the following applications:
- Auth - the main application of the microservice that start up a gRPC server.
- Clear - application for clearing expired refresh sessions from the database. It can usually be used in cron jobs.
- Migrate - application that apply all up database migrations.
$ make install-depsCompiled application binaries saved to the local /out/bin folder.
Before build, it is necessary to do vendoring:
$ make vendor$ make build-auth$ make build-clear$ make build-migrateReplace {DATABASE_URL} to PostgreSQL database url, should look like: postgres://username:password@localhost:5432/dbname.
$ DATABASE_URL="{DATABASE_URL}" make migrate-up$ DATABASE_URL="{DATABASE_URL}" make migrate-downThis service uses the SQLBoiler package to generate models based on a database schema.
To generate, you must create a SQLBoiler configuration file sqlboiler.toml at the root of the project.
You can see an example of this configuration in the sqlboiler.toml.example file at the root of the project.
To start generating models, run the command
$ make boil-generateThese are basically gRPC server settings.
You can see an example of this configuration in the /configs/app/config.env.sample file.
These are authorization parameters settings.
You can see an example of this configuration in the /configs/auth/config.env.sample file.
These are the settings for connecting to the PostgreSQL database, which stores refresh session records.
You can see an example of this configuration in the /configs/db/config.env.sample file.
These are the settings for connecting to the Redis database, where access session data stored.
You can see an example of this configuration in the /configs/redis/config.env.sample file.