xss mitigation & test

This commit is contained in:
$(pass /github/name)
2024-09-20 07:57:54 +02:00
parent b34a85e9d6
commit 46afa417b7
7 changed files with 81 additions and 33 deletions

View File

@@ -5,10 +5,10 @@ import "time"
type Consent struct {
CreatedAt time.Time
UpdatedAt time.Time
FirstName string `gorm:"not null" json:"first_name"`
LastName string `gorm:"not null" json:"last_name"`
Email string `json:"email"`
ConsentType string `gorm:"not null" json:"consent_type"`
FirstName string `gorm:"not null" json:"first_name" validate:"safe_content"`
LastName string `gorm:"not null" json:"last_name" validate:"safe_content"`
Email string `json:"email" validate:"email,safe_content"`
ConsentType string `gorm:"not null" json:"consent_type" validate:"safe_content"`
ID int64 `gorm:"primaryKey"`
UserID int64 `gorm:"not null" json:"user_id"`
}