Carry netbird-vnc policies over the component network map

This commit is contained in:
Viktor Liu
2026-07-30 10:43:26 +02:00
parent abe8bc1b53
commit 05a75d80eb
5 changed files with 260 additions and 203 deletions

View File

@@ -307,6 +307,8 @@ func decodePolicyCompact(pc *proto.PolicyCompact, policyID string, peerIDByIndex
Destinations: pc.DestinationGroupIds,
AuthorizedUser: pc.AuthorizedUser,
AuthorizedGroups: authorizedGroupsFromProto(pc.AuthorizedGroups),
SessionPubKey: pc.SessionPubKey,
SessionDisplayName: pc.SessionDisplayName,
SourceResource: resourceFromProto(pc.SourceResource, peerIDByIndex),
DestinationResource: resourceFromProto(pc.DestinationResource, peerIDByIndex),
}
@@ -496,6 +498,8 @@ func protocolFromProto(p proto.RuleProtocol) types.PolicyRuleProtocolType {
return types.PolicyRuleProtocolALL
case proto.RuleProtocol_NETBIRD_SSH:
return types.PolicyRuleProtocolNetbirdSSH
case proto.RuleProtocol_NETBIRD_VNC:
return types.PolicyRuleProtocolNetbirdVNC
default:
return types.PolicyRuleProtocolALL
}

View File

@@ -144,6 +144,8 @@ func GetProtoProtocol(protocol string) proto.RuleProtocol {
return proto.RuleProtocol_ICMP
case types.PolicyRuleProtocolNetbirdSSH:
return proto.RuleProtocol_NETBIRD_SSH
case types.PolicyRuleProtocolNetbirdVNC:
return proto.RuleProtocol_NETBIRD_VNC
default:
return proto.RuleProtocol_UNKNOWN
}