tailcfg: add RawMessage

This adds a new RawMessage type backed by string instead of the
json.RawMessage which is backed by []byte. The byte slice makes
the generated views be a lot more defensive than the need to be
which we can get around by using a string instead.

Updates #cleanup

Signed-off-by: Maisem Ali <maisem@tailscale.com>
This commit is contained in:
Maisem Ali
2023-09-18 09:40:14 -07:00
committed by Maisem Ali
parent 258f16f84b
commit d06b48dd0a
5 changed files with 118 additions and 21 deletions
+1 -2
View File
@@ -4,7 +4,6 @@
package filter
import (
"encoding/json"
"fmt"
"net/netip"
"strings"
@@ -60,7 +59,7 @@ type CapMatch struct {
// Values are the raw JSON values of the capability.
// See tailcfg.PeerCapability and tailcfg.PeerCapMap for details.
Values []json.RawMessage
Values []tailcfg.RawMessage
}
// Match matches packets from any IP address in Srcs to any ip:port in