Erster Schritt des golangci-lint-Rollouts (non-blocking): 44 misspell + 4 staticcheck automatisch behoben (32 Dateien, nur Tippfehler/mechanisch). build+test grün. Kein Runtime-Change → kein Deploy. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
44 lines
2.0 KiB
Go
44 lines
2.0 KiB
Go
package models
|
|
|
|
import "time"
|
|
|
|
// RADIUSSettings ist die node-lokale Singleton-Configuration 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" }
|