tailcfg/peercap, types/appctype: prepare for conn25 grants

This change contains the protocol changes needed to support
describing authorization for conn25 apps. As a temporary transition
measure during development, app configurations can disable authorization
enforcement.

Updates tailscale/corp#40076

Change-Id: I3183c10374aacb0048f6632c384f71f758c20f2f
Signed-off-by: Adrian Dewhurst <[email protected]>
This commit is contained in:
Adrian Dewhurst authored and Adrian Dewhurst committed 2026-08-14 13:48:46 -04:00
1 parent 0953fd9a97
commit 5a1066f494
2 files changed
+28

No files matched your search

+23
View File
@@ -12,6 +12,18 @@ package peercap
// or "tailscale.com/cap/webui".
type Cap string
// Prefix is a prefix for [tailscale.com/tailcfg.PeerCapMap] keys that share a
// common namespace, where each entry represents a distinct named instance (e.g.
// one per App definition). The full key is formed by concatenating the prefix
// with the instance name.
type Prefix string
// ToAttribute returns the full [Cap] key for the given value under this prefix,
// of the form prefix+value.
func (p Prefix) ToAttribute(value string) Cap {
return Cap(string(p) + value)
}
const (
// FileSharingTarget grants the current node the ability to send
// files to the peer which has this capability.
@@ -54,3 +66,14 @@ const (
// claim
TsIDP Cap = "tailscale.com/cap/tsidp"
)
const (
// Conn25Prefix is the prefix for per-app [Cap] names that grant a peer
// access to an app provided by a conn25 app connector.
// Actual capabilities look like "tailscale.com/cap/conn25/example" for
// an app named "example".
// Each value under such a key is a [tailscale.com/tailcfg.ProtoPortRange].
// If multiple values are present, the union of all protocol/port
// combinations described shall be permitted.
Conn25Prefix Prefix = "tailscale.com/cap/conn25/"
)
+5
View File
@@ -107,6 +107,11 @@ type Conn25Attr struct {
// These can either be "*" to match any advertising connector, or a
// tag of the form tag:<tag-name>.
Connectors []string `json:"connectors,omitempty"`
// TemporaryUnsafeBypassFilter indicates that the connector should not look
// for peer capabilities when determining authorization to use an app. This
// is a temporary measure during development and will be removed without
// warning.
TemporaryUnsafeBypassFilter bool `json:"temporaryUnsafeBypassFilter,omitzero"`
}
type Conn25PoolsAttr struct {