chore: update
ci-api / test (push) Successful in 22m11s
ci-web / test (push) Successful in 13m32s

This commit is contained in:
Xor290
2026-08-02 16:54:09 +02:00
parent 09928c0d76
commit 6992e505ae
26 changed files with 681 additions and 695 deletions
+1 -6
View File
@@ -10,7 +10,6 @@ import (
"github.com/omnex/control-plane/api/internal/config"
"github.com/omnex/control-plane/api/internal/demos"
"github.com/omnex/control-plane/api/internal/httpx"
"github.com/omnex/control-plane/api/internal/leads"
"github.com/omnex/control-plane/api/internal/profile"
"github.com/omnex/control-plane/api/internal/session"
"github.com/omnex/control-plane/api/internal/sub"
@@ -22,7 +21,6 @@ type Deps struct {
Issuer *auth.Issuer
Sessions session.Manager
AuthH *auth.Handler
LeadsH *leads.Handler
DemosH *demos.Handler
SubH *sub.Handler
ProfileH *profile.Handler
@@ -42,10 +40,9 @@ func New(d Deps) *gin.Engine {
api := r.Group("/api/v1")
// Public : login, inscription + formulaire de contact, rate-limités.
// Public : login, inscription, rate-limités.
api.POST("/auth/login", httpx.RateLimit(1, 5), d.AuthH.Login)
api.POST("/auth/register", httpx.RateLimit(0.2, 3), d.AuthH.Register)
api.POST("/leads", httpx.RateLimit(1, 3), d.LeadsH.Create)
// Toute route authentifiée (session valide, n'importe quel rôle).
authed := api.Group("")
authed.Use(auth.RequireAuth(d.Issuer, d.Sessions))
@@ -60,8 +57,6 @@ func New(d Deps) *gin.Engine {
client := authed.Group("")
client.Use(auth.RequireRole(auth.RoleClient))
{
client.GET("/leads", d.LeadsH.List)
client.PATCH("/leads/:id/status", d.LeadsH.SetStatus)
client.POST("/subscription", d.SubH.AddCode)
if d.DemosH != nil {
client.GET("/demos/mine", d.DemosH.ListMine)