/service-auth

service auth

Primary LanguageGoApache License 2.0Apache-2.0

service-auth

service-auth is the service responsible for user management and authentication/authorization in the ssup2ket Project. service-auth follows this considerations.

Authentication/Authorization

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.

Used main external packages and tools

service-auth uses following external packages and tools.

Development Environment

  • Golang Version : 1.16

Required CLI

  • 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

Reference