first try

This commit is contained in:
Sotirios Pupakis
2025-09-05 17:44:49 +02:00
parent f0aadeb2c7
commit 72731aeb10
10 changed files with 360 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
package controllers
import (
"net/http"
"gitea.tbdevent.eu/TBD/reforger_crawler_main/initializers"
"github.com/gin-gonic/gin"
)
func CheckAllowed(c *gin.Context) {
secret := c.GetHeader("X-SECRET-KEY")
if secret != initializers.SECRET {
c.JSON(http.StatusForbidden, gin.H{"error": "Forbidden"})
c.Abort()
return
}
}