1
0

feature/rate-limit (#91)

This commit is contained in:
konrad
2019-07-21 21:27:30 +00:00
committed by Gitea
parent 2e599e792e
commit 4327a559e5
33 changed files with 1520 additions and 86 deletions

View File

@ -218,10 +218,13 @@ func registerAPIRoutes(a *echo.Group) {
// Info endpoint
a.GET("/info", apiv1.Info)
// ===== Routes with Authetification =====
// ===== Routes with Authetication =====
// Authetification
a.Use(middleware.JWT([]byte(config.ServiceJWTSecret.GetString())))
// Rate limit
setupRateLimit(a)
// Middleware to collect metrics
if config.ServiceJWTSecret.GetBool() {
a.Use(func(next echo.HandlerFunc) echo.HandlerFunc {