mirror of
https://github.com/netbirdio/netbird.git
synced 2026-09-21 06:09:07 +02:00
Carry the VNC session key through the network map DB path
This commit is contained in:
@@ -12,7 +12,7 @@ const (
|
||||
GetPoliciesQuery = `
|
||||
select p.id, p.public_id, p.enabled, p.source_posture_checks, pr.enabled as rule_enabled, pr.action, pr.protocol, pr.bidirectional,
|
||||
pr.sources, pr.destinations, pr.source_resource, pr.destination_resource, pr.ports, pr.port_ranges,
|
||||
pr.authorized_groups, pr.authorized_user
|
||||
pr.authorized_groups, pr.authorized_user, pr.session_pub_key, pr.session_display_name
|
||||
from policies as p
|
||||
left join policy_rules as pr on p.id = pr.policy_id
|
||||
where account_id=$1
|
||||
|
||||
@@ -151,6 +151,8 @@ type Policy struct {
|
||||
PortRanges []byte `nmap:"skip,json"`
|
||||
AuthorizedGroups []byte `nmap:"skip,json"`
|
||||
AuthorizedUser sql.NullString `nmap:"skip"`
|
||||
SessionPubKey sql.NullString `nmap:"skip"`
|
||||
SessionDisplayName sql.NullString `nmap:"skip"`
|
||||
}
|
||||
|
||||
// Depending on db interface LastLogin contains time in different formats:
|
||||
@@ -458,6 +460,12 @@ func ConvertToNmdataPolicy(policies []Policy) ([]nmdata.Policy, map[string]map[s
|
||||
if p.AuthorizedUser.Valid {
|
||||
pr().AuthorizedUser = p.AuthorizedUser.String
|
||||
}
|
||||
if p.SessionPubKey.Valid {
|
||||
pr().SessionPubKey = p.SessionPubKey.String
|
||||
}
|
||||
if p.SessionDisplayName.Valid {
|
||||
pr().SessionDisplayName = p.SessionDisplayName.String
|
||||
}
|
||||
|
||||
if policyRule != nil {
|
||||
policyRule.ID = p.ID
|
||||
|
||||
@@ -11,7 +11,7 @@ const (
|
||||
GetPoliciesQuery = `
|
||||
select p.id, p.public_id, p.enabled, p.source_posture_checks, pr.enabled as rule_enabled, pr.action, pr.protocol, pr.bidirectional,
|
||||
pr.sources, pr.destinations, pr.source_resource, pr.destination_resource, pr.ports, pr.port_ranges,
|
||||
pr.authorized_groups, pr.authorized_user
|
||||
pr.authorized_groups, pr.authorized_user, pr.session_pub_key, pr.session_display_name
|
||||
from policies as p
|
||||
left join policy_rules as pr on p.id = pr.policy_id
|
||||
where account_id=?
|
||||
|
||||
Reference in New Issue
Block a user