An authentication microservice built in Rust. This is one of my first Rust projects so there will be things to improve, and I will go back and do when I get some spare time!
Implements the ability to register new users, and authenticate existing users. No authoristion (e.g. RBAC) has been implemented, this would be done in a separate microservice.
This has been imported from another side-project, it is intended to be a demo of how Rust could be used to build a gRPC microservice. It is not ready for production use in its current state, particularly security-wise.
Rough list of things that could be improved (time permitted)!
- Implement Certificate Authority with JWK support
- Remove
JWT_SECRET
from.env
. Sign and validate with a key issued from ^ - More unit tests
- More system tests (
authentication_test
crate) - Logging
-
Refactoring to reduce the size of files such asdatabase.rs
andrepository.rs
. Look to separate these out into modules for different types of data to reduce coupling.
- Refer to the Skaffold Quickstart to details on how to set up your environment.
- Start a local Docker registry instance.
docker run -d -p 5000:5000 --restart=always --name registry registry:2
- Run skaffold
skaffold dev
- Wait for it to build, the first one will be quite slow.
Run the following command to port forward the Postgres instance to your host.
kubectl port-forward $(kubectl get pods|awk '/^authentication-postgres.*Running/{print$1}'|head) 5432:5432