An open API service indexing awesome lists of open source software.

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

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)