Crates.io | user-service |
lib.rs | user-service |
version | 0.4.1 |
source | src |
created_at | 2023-04-11 05:29:21.393891 |
updated_at | 2023-04-11 05:32:18.87617 |
description | A user management microservice. |
homepage | |
repository | https://github.com/uniteme-pty-ltd/user-service |
max_upload_size | |
id | 835774 |
size | 124,549 |
Install Docker by following it's installation instructions.
Install Watch by running cargo install cargo-watch
.
Install PostgreSQL by following it's installation instructions.
Install Diesel by running cargo install diesel_cli --no-default-features --features postgres
.
When developing, ensure cargo watch --clear -x fmt
is running in a terminal, where:
watch
will detect any changes in the repo and refresh commands.--clear
will clear the console output each time changes are detected.fmt
will format your Rust code to comply with standards and ensure unformatted code is not committed.To launch the application run docker compose up --build
, this will:
http://localhos:<port>
localhos:<port>
The individual ports uniquely chosen by Docker can be found through the Docker interface.
New updates can be defined by running the generate
command and editing it's corrosponding folder contents in the migrations
directory:
diesel migration generate my_update_name --database-url=postgres://admin:123@db:5432/user_service
Pending updates can be applied:
diesel migration run --database-url=postgres://admin:123@db:5432/user_service
They can be reverted with:
diesel migration revert --database-url=postgres://admin:123@db:5432/user_service
It's important to run the redo
command after using run
to ensure your revert script works correctly:
diesel migration redo --database-url=postgres://admin:123@db:5432/user_service
This service contains a public and private set of routes/endpoints to enable Single Sign-On (SSO).
The internal interface is for other internal services to query and run privileged commands, whereas the public interface allows a centralised API to be called from clients for SSO.
These interfaces run on two separate ports, where one port should only be accessible from LAN (Internal Network) and the other should only be accessible from WAN (Internet).
SSO is not yet implemented meaning this dual solution is not currently available, but will be in the future.