Files
Charon/backend/internal/models/access_list.go
GitHub Actions af8384046c chore: implement instruction compliance remediation
- Replace Go interface{} with any (Go 1.18+ standard)
- Add database indexes to frequently queried model fields
- Add JSDoc documentation to frontend API client methods
- Remove deprecated docker-compose version keys
- Add concurrency groups to all 25 GitHub Actions workflows
- Add YAML front matter and fix H1→H2 headings in docs

Coverage: Backend 85.5%, Frontend 87.73%
Security: No vulnerabilities detected

Refs: docs/plans/instruction_compliance_spec.md
2025-12-21 04:08:42 +00:00

28 lines
1.2 KiB
Go

package models
import (
"time"
)
// AccessList defines IP-based or auth-based access control rules
// that can be applied to proxy hosts.
type AccessList struct {
ID uint `json:"id" gorm:"primaryKey"`
UUID string `json:"uuid" gorm:"uniqueIndex"`
Name string `json:"name" gorm:"index"`
Description string `json:"description"`
Type string `json:"type" gorm:"index"` // "whitelist", "blacklist", "geo_whitelist", "geo_blacklist"
IPRules string `json:"ip_rules" gorm:"type:text"` // JSON array of IP/CIDR rules
CountryCodes string `json:"country_codes"` // Comma-separated ISO country codes (for geo types)
LocalNetworkOnly bool `json:"local_network_only"` // RFC1918 private networks only
Enabled bool `json:"enabled" gorm:"index"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
// AccessListRule represents a single IP or CIDR rule
type AccessListRule struct {
CIDR string `json:"cidr"` // IP address or CIDR notation
Description string `json:"description"` // Optional description
}