https://github.com/gitkodev/golang_auth
Golang authentification service providing authentication and refresh tokens
https://github.com/gitkodev/golang_auth
Last synced: 2 months ago
JSON representation
Golang authentification service providing authentication and refresh tokens
- Host: GitHub
- URL: https://github.com/gitkodev/golang_auth
- Owner: gitkoDev
- Created: 2024-08-20T02:18:30.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-08-26T04:39:23.000Z (9 months ago)
- Last Synced: 2025-01-20T21:56:55.953Z (4 months ago)
- Language: Go
- Homepage:
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Medods Authentication Service
JWT Golang Authentication service built with `Clean Architecure` and `Dependency Injection` principles
## Endpoints
- 0.0.0.0:8080/v1/health `=>` **GET** `=>` Check API connection
- 0.0.0.0:8080/v1/auth?id=*{user id}* `=>` **GET** `=>` Get token pair`Response example:`
```json
{
"access_token": "access_token",
"refresh_token": "refresh_token",
"user_ip": "172.24.0.1"
}
```
- 0.0.0.0:8080/v1/auth/refresh `=>` **POST** `=>` Refresh token pair
`Response example:`
```json
{
"access_token": "access_token",
"refresh_token": "refresh_token",
}
```## Running the app
```bash
# start the app
make run
```## Tools used
- `Logging` **=>** [Logrus](https://github.com/sirupsen/logrus)
- `Routing` **=>** [Gin](https://github.com/gin-gonic/gin)
- `Database` **=>** Postgres + [pgx](github.com/jackc/pgx/v5)
- `Database migrations` **=>** [Goose](https://github.com/pressly/goose#sql-migrations)
- `Containerization` **=>** [Docker](http://docker.com/) + Docker Compose
- `Authentification and middleware` **=>** [JWT Go](https://github.com/golang-jwt/jwt)