Address follow-up CodeRabbit VNC findings

This commit is contained in:
Viktor Liu
2026-05-22 11:35:16 +02:00
parent d06ed64e59
commit 5be2607708
3 changed files with 8 additions and 4 deletions
@@ -81,7 +81,7 @@ func (cb ruleAuthCallbacks) handleVNCRule(rule *PolicyRule, peerInSources, peerI
return
}
cb.collectVNCUsers(rule, state.vncAuthorizedUsers)
if rule.SessionPubKey != "" && rule.AuthorizedUser != "" {
if peerInDestinations && rule.SessionPubKey != "" && rule.AuthorizedUser != "" {
state.vncSessionPubKeys = append(state.vncSessionPubKeys, VNCSessionPubKey{
PubKey: rule.SessionPubKey,
UserID: rule.AuthorizedUser,