service-auth is the service responsible for user management and authentication/authorization in the ssup2ket Project. service-auth follows this considerations.
service-auth uses simple authentication based on ID/Password. A user can get the Access Token and Refresh Token based on JWT required for authentication/authorization by entering ID/Password. Passwords are encrypted and stored using the PBKDF2 algorithm.
In JWT Token, User's ID(UUID), Login ID, Password and Role are stored. Other services of the ssup2ket Project need to implement authentication and RBAC-based authorization through JWT Token. Each User can have only one Role. There are two role types, admin and user.
service-auth uses following external packages and tools.
- HTTP Server, Middleware - chi, HTTP, oapi-codegen
- GRPC Server, Intercepter - grpc, protoc-gen-go
- MySQL - GORM
- Kafka - kafka-go, Debezium Outbox
- Authorziation - Casbin
- Logging, Tracking - zerolog, Istio, OpenTracing, Jaeger
- Continuous Integration - Testify, sqlmock, Mockery, Github Actions
- Continuous Deployment - K8s, ArgoCD, ArgoCD Image Updater, Kustomize
- Golang Version : 1.16
- For HTTP Server, Swagger
$ go install github.com/deepmap/oapi-codegen/cmd/oapi-codegen@v1.6.0
$ go get github.com/mikefarah/yq/v4
$ go install github.com/mikefarah/yq/v4
- For GRPC Server
// Ubuntu
$ apt install -y protobuf-compiler
$ go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.26
$ go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.1
// MacOS
$ brew install protobuf
$ go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.26
$ go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.1
- For Test, CI
// Ubuntu
$ apt install jq
$ go install github.com/fullstorydev/grpcurl/cmd/grpcurl@v1.8.7
$ go install github.com/vektra/mockery/v2@v2.15.0
$ go install github.com/nektos/act@latest
// MacOS
$ brew install jq
$ go install github.com/fullstorydev/grpcurl/cmd/grpcurl@v1.8.7
$ go install github.com/vektra/mockery/v2@v2.15.0
$ go install github.com/nektos/act@latest
- UUID for DB
- Istio GRPC
- Casbin RBAC
- OpenTracing tracer
- OpenTracing middleware
- OpenTracing intercepter