package models import "time" // RADIUSSettings ist die node-lokale Singleton-Konfiguration des // FreeRADIUS-Servers (ob diese Node RADIUS betreibt + Listen-Adressen). type RADIUSSettings struct { ID int `gorm:"column:id;primaryKey" json:"id"` Enabled bool `gorm:"column:enabled" json:"enabled"` ListenAddresses string `gorm:"column:listen_addresses" json:"listen_addresses"` CreatedAt time.Time `gorm:"column:created_at" json:"created_at"` UpdatedAt time.Time `gorm:"column:updated_at" json:"updated_at"` } func (RADIUSSettings) TableName() string { return "radius_settings" } // RADIUSClient ist ein NAS-Client (IP/CIDR + Shared Secret). SecretEnc // wird via secrets.Box verschlüsselt und nie serialisiert. type RADIUSClient struct { ID int64 `gorm:"column:id;primaryKey" json:"id"` Name string `gorm:"column:name" json:"name"` IPAddr string `gorm:"column:ipaddr" json:"ipaddr"` SecretEnc []byte `gorm:"column:secret_enc" json:"-"` Active bool `gorm:"column:active" json:"active"` Description string `gorm:"column:description" json:"description"` CreatedAt time.Time `gorm:"column:created_at" json:"created_at"` UpdatedAt time.Time `gorm:"column:updated_at" json:"updated_at"` } func (RADIUSClient) TableName() string { return "radius_clients" } // RADIUSUser ist ein PAP/CHAP-Benutzer. PasswordEnc wird via secrets.Box // verschlüsselt und nie serialisiert. type RADIUSUser struct { ID int64 `gorm:"column:id;primaryKey" json:"id"` Username string `gorm:"column:username" json:"username"` PasswordEnc []byte `gorm:"column:password_enc" json:"-"` Active bool `gorm:"column:active" json:"active"` CreatedAt time.Time `gorm:"column:created_at" json:"created_at"` UpdatedAt time.Time `gorm:"column:updated_at" json:"updated_at"` } func (RADIUSUser) TableName() string { return "radius_users" }