Authentication & authorization in Fiber (an up-to-date version of https://github.com/peterdee/go-fiber-auth)
Key features:
- PostgreSQL
- Redis
- JWT
- Additional JWT protection mechanics (fingerprinting, token pairing)
- Gloabal error handler with custom errors
git clone https://github.com/peterdee/go-fiber-auth-2024
cd ./go-fiber-auth-2024
gvm use go1.22
go mod download
ENV_SOURCE
environment variable determines the origin of environment variables: file
or env
If ENV_SOURCE
variable is set to file
, then .env
file is required and the app will not launch without it
Required environment variables are located in .env.example file
Without Docker
ENV_SOURCE=file go run ./
# With AIR
ENV_SOURCE=file air
With Docker
docker run -p 2024:2024 --env-file .env -it $(docker build -q .)
With Docker Compose
docker compose up -d