Add policy rule source and destination resource

Signed-off-by: bcmmbaga <bethuelmbaga12@gmail.com>
This commit is contained in:
bcmmbaga
2024-12-11 14:22:09 +01:00
parent 60ee31df3e
commit ac06f178fe
3 changed files with 47 additions and 11 deletions

View File

@@ -1,5 +1,9 @@
package types
import (
"github.com/netbirdio/netbird/management/server/networks/resources/types"
)
// PolicyUpdateOperationType operation type
type PolicyUpdateOperationType int
@@ -41,9 +45,15 @@ type PolicyRule struct {
// Destinations policy destination groups
Destinations []string `gorm:"serializer:json"`
// DestinationResource policy destination resource that the rule is applied to
DestinationResource types.Resource `gorm:"serializer:json"`
// Sources policy source groups
Sources []string `gorm:"serializer:json"`
// SourceResource policy source resource that the rule is applied to
SourceResource types.Resource `gorm:"serializer:json"`
// Bidirectional define if the rule is applicable in both directions, sources, and destinations
Bidirectional bool