mirror of
https://github.com/speatzle/nfsense.git
synced 2025-09-13 15:19:08 +00:00
Remove old, broken Validation
This commit is contained in:
parent
e12a1fe16f
commit
f67ec52fae
13 changed files with 39 additions and 64 deletions
|
@ -1,7 +1,7 @@
|
|||
package firewall
|
||||
|
||||
type Firewall struct {
|
||||
ForwardRules []ForwardRule `json:"forward_rules" validate:"required,dive"`
|
||||
DestinationNATRules []DestinationNATRule `json:"destination_nat_rules" validate:"required,dive"`
|
||||
SourceNATRules []SourceNATRule `json:"source_nat_rules" validate:"required,dive"`
|
||||
ForwardRules []ForwardRule `json:"forward_rules"`
|
||||
DestinationNATRules []DestinationNATRule `json:"destination_nat_rules"`
|
||||
SourceNATRules []SourceNATRule `json:"source_nat_rules"`
|
||||
}
|
||||
|
|
|
@ -3,15 +3,15 @@ package firewall
|
|||
import "encoding/json"
|
||||
|
||||
type Rule struct {
|
||||
Name string `json:"name" validate:"required"`
|
||||
Match Match `json:"match" validate:"required,dive"`
|
||||
Name string `json:"name"`
|
||||
Match Match `json:"match"`
|
||||
Comment string `json:"comment,omitempty"`
|
||||
Counter bool `json:"counter,omitempty"`
|
||||
}
|
||||
|
||||
type ForwardRule struct {
|
||||
Rule
|
||||
Verdict Verdict `json:"verdict" validate:"min=0,max=2"`
|
||||
Verdict Verdict `json:"verdict"`
|
||||
}
|
||||
|
||||
type Verdict int
|
||||
|
|
|
@ -4,7 +4,7 @@ import "encoding/json"
|
|||
|
||||
type SourceNATRule struct {
|
||||
Rule
|
||||
Type SnatType `json:"type" validate:"min=0,max=1"`
|
||||
Type SnatType `json:"type"`
|
||||
Address *string `json:"address,omitempty"`
|
||||
Service *string `json:"service,omitempty"`
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue