mirror of
https://github.com/netbirdio/netbird.git
synced 2026-09-20 05:39:07 +02:00
Resolve VNC authorized users on the components path and fix uinput, X11 and macOS input gaps
This commit is contained in:
@@ -968,6 +968,39 @@ func TestGetPeerNetworkMapComponents_SSHRequirements(t *testing.T) {
|
||||
},
|
||||
targetInSrc: true,
|
||||
},
|
||||
|
||||
// VNC resolves authorized users exactly the way SSH does, so it needs
|
||||
// the same inputs carried into the components. Leaving it out strips
|
||||
// them and the rule reaches the resolver with nobody authorized.
|
||||
{
|
||||
name: "netbird-vnc with authorized groups",
|
||||
mutateRule: func(r *nmdata.PolicyRule) {
|
||||
r.Protocol = string(nbtypes.PolicyRuleProtocolNetbirdVNC)
|
||||
r.AuthorizedGroups = map[string][]string{"g-auth": nil}
|
||||
},
|
||||
wantGroupsMap: map[string][]string{"g-auth": {"user-a"}},
|
||||
},
|
||||
{
|
||||
name: "netbird-vnc default needs allowed users",
|
||||
mutateRule: func(r *nmdata.PolicyRule) {
|
||||
r.Protocol = string(nbtypes.PolicyRuleProtocolNetbirdVNC)
|
||||
},
|
||||
wantAllowed: true,
|
||||
},
|
||||
{
|
||||
name: "netbird-vnc with authorized user carries its own",
|
||||
mutateRule: func(r *nmdata.PolicyRule) {
|
||||
r.Protocol = string(nbtypes.PolicyRuleProtocolNetbirdVNC)
|
||||
r.AuthorizedUser = "user-1"
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "netbird-vnc only counts on the destination side",
|
||||
mutateRule: func(r *nmdata.PolicyRule) {
|
||||
r.Protocol = string(nbtypes.PolicyRuleProtocolNetbirdVNC)
|
||||
},
|
||||
targetInSrc: true,
|
||||
},
|
||||
}
|
||||
|
||||
for _, tc := range cases {
|
||||
|
||||
Reference in New Issue
Block a user