feat: add CrowdSecWhitelist model and integrate into API route registration
This commit is contained in:
@@ -122,6 +122,7 @@ func RegisterWithDeps(ctx context.Context, router *gin.Engine, db *gorm.DB, cfg
|
||||
&models.DNSProviderCredential{}, // Multi-credential support (Phase 3)
|
||||
&models.Plugin{}, // Phase 5: DNS provider plugins
|
||||
&models.ManualChallenge{}, // Phase 1: Manual DNS challenges
|
||||
&models.CrowdSecWhitelist{}, // Issue #939: CrowdSec IP whitelist management
|
||||
); err != nil {
|
||||
return fmt.Errorf("auto migrate: %w", err)
|
||||
}
|
||||
|
||||
13
backend/internal/models/crowdsec_whitelist.go
Normal file
13
backend/internal/models/crowdsec_whitelist.go
Normal file
@@ -0,0 +1,13 @@
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
// CrowdSecWhitelist represents a single IP or CIDR block that CrowdSec should never ban.
|
||||
type CrowdSecWhitelist struct {
|
||||
ID uint `json:"-" gorm:"primaryKey"`
|
||||
UUID string `json:"uuid" gorm:"uniqueIndex;not null"`
|
||||
IPOrCIDR string `json:"ip_or_cidr" gorm:"not null;uniqueIndex"`
|
||||
Reason string `json:"reason" gorm:"not null;default:''"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
}
|
||||
Reference in New Issue
Block a user