@ -45,15 +45,15 @@ func TestImpersonationHeaders(t *testing.T) {
emailish : "foo@example.com" ,
capMap : tailcfg . PeerCapMap {
capabilityName : {
[ ] byt e( ` { "impersonate": { "groups":["group1","group2"]}} ` ) ,
[ ] byt e( ` { "impersonate": { "groups":["group1","group3"]}} ` ) , // One group is duplicated.
[ ] byt e( ` { "impersonate": { "groups":["group4"]}} ` ) ,
[ ] byt e( ` { "impersonate": { "groups":["group2"]}} ` ) , // duplicate
tailcfg . RawMessag e( ` { "impersonate": { "groups":["group1","group2"]}} ` ) ,
tailcfg . RawMessag e( ` { "impersonate": { "groups":["group1","group3"]}} ` ) , // One group is duplicated.
tailcfg . RawMessag e( ` { "impersonate": { "groups":["group4"]}} ` ) ,
tailcfg . RawMessag e( ` { "impersonate": { "groups":["group2"]}} ` ) , // duplicate
// These should be ignored, but should parse correctly.
[ ] byt e( ` { } ` ) ,
[ ] byt e( ` { "impersonate": { }} ` ) ,
[ ] byt e( ` { "impersonate": { "groups":[]}} ` ) ,
tailcfg . RawMessag e( ` { } ` ) ,
tailcfg . RawMessag e( ` { "impersonate": { }} ` ) ,
tailcfg . RawMessag e( ` { "impersonate": { "groups":[]}} ` ) ,
} ,
} ,
wantHeaders : http . Header {
@ -67,7 +67,7 @@ func TestImpersonationHeaders(t *testing.T) {
tags : [ ] string { "tag:foo" , "tag:bar" } ,
capMap : tailcfg . PeerCapMap {
capabilityName : {
[ ] byt e( ` { "impersonate": { "groups":["group1"]}} ` ) ,
tailcfg . RawMessag e( ` { "impersonate": { "groups":["group1"]}} ` ) ,
} ,
} ,
wantHeaders : http . Header {
@ -81,7 +81,7 @@ func TestImpersonationHeaders(t *testing.T) {
tags : [ ] string { "tag:foo" , "tag:bar" } ,
capMap : tailcfg . PeerCapMap {
capabilityName : {
[ ] byt e( ` [] ` ) ,
tailcfg . RawMessag e( ` [] ` ) ,
} ,
} ,
wantHeaders : http . Header { } ,