acl.go 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. package models
  2. import (
  3. "time"
  4. "github.com/google/uuid"
  5. )
  6. // AllowedTrafficDirection - allowed direction of traffic
  7. type AllowedTrafficDirection int
  8. const (
  9. // TrafficDirectionUni implies traffic is only allowed in one direction (src --> dst)
  10. TrafficDirectionUni AllowedTrafficDirection = iota
  11. // TrafficDirectionBi implies traffic is allowed both direction (src <--> dst )
  12. TrafficDirectionBi
  13. )
  14. type AclPolicyType string
  15. const (
  16. UserPolicy AclPolicyType = "user-policy"
  17. DevicePolicy AclPolicyType = "device-policy"
  18. )
  19. type Acl struct {
  20. ID uuid.UUID `json:"id"`
  21. Name string `json:"name"`
  22. NetworkID NetworkID `json:"network_id"`
  23. RuleType AclPolicyType `json:"policy_type"`
  24. Src []string `json:"src_type"`
  25. Dst []string `json:"dst_type"`
  26. AllowedDirection AllowedTrafficDirection `json:"allowed_traffic_direction"`
  27. Enabled bool `json:"enabled"`
  28. CreatedBy string `json:"created_by"`
  29. CreatedAt time.Time `json:"created_at"`
  30. }