feat: now auth could be disabled with pipeline param
All checks were successful
Build and Deploy Go App / build (push) Successful in 6m20s
Build and Deploy Go App / deploy (push) Successful in 40s

This commit is contained in:
Iron_Felix 2025-12-04 20:12:54 +03:00
parent 5d1d138aca
commit 604ac0ebbc
4 changed files with 7 additions and 2 deletions

View file

@ -46,8 +46,10 @@ func main() {
r := gin.Default()
r.Use(middleware.CSRFMiddleware())
r.Use(middleware.JWTAuthMiddleware(AppConfig.JwtPrivateKey))
if len(AppConfig.AuthEnabled) > 0 && AppConfig.AuthEnabled != "false" {
r.Use(middleware.CSRFMiddleware())
r.Use(middleware.JWTAuthMiddleware(AppConfig.JwtPrivateKey))
}
queries := sqlc.New(pool)

View file

@ -7,4 +7,5 @@ type Config struct {
JwtPrivateKey string `toml:"JwtPrivateKey" env:"JWT_PRIVATE_KEY"`
LogLevel string `toml:"LogLevel" env:"LOG_LEVEL"`
RmqURL string `toml:"RabbitMQUrl" env:"RABBITMQ_URL"`
AuthEnabled string `toml:"AuthEnabled" env:"AUTH_ENABLED"`
}