mirror of
https://github.com/tailscale/tailscale.git
synced 2026-02-09 17:52:57 +01:00
This file was never truly necessary and has never actually been used in the history of Tailscale's open source releases. A Brief History of AUTHORS files --- The AUTHORS file was a pattern developed at Google, originally for Chromium, then adopted by Go and a bunch of other projects. The problem was that Chromium originally had a copyright line only recognizing Google as the copyright holder. Because Google (and most open source projects) do not require copyright assignemnt for contributions, each contributor maintains their copyright. Some large corporate contributors then tried to add their own name to the copyright line in the LICENSE file or in file headers. This quickly becomes unwieldy, and puts a tremendous burden on anyone building on top of Chromium, since the license requires that they keep all copyright lines intact. The compromise was to create an AUTHORS file that would list all of the copyright holders. The LICENSE file and source file headers would then include that list by reference, listing the copyright holder as "The Chromium Authors". This also become cumbersome to simply keep the file up to date with a high rate of new contributors. Plus it's not always obvious who the copyright holder is. Sometimes it is the individual making the contribution, but many times it may be their employer. There is no way for the proejct maintainer to know. Eventually, Google changed their policy to no longer recommend trying to keep the AUTHORS file up to date proactively, and instead to only add to it when requested: https://opensource.google/docs/releasing/authors. They are also clear that: > Adding contributors to the AUTHORS file is entirely within the > project's discretion and has no implications for copyright ownership. It was primarily added to appease a small number of large contributors that insisted that they be recognized as copyright holders (which was entirely their right to do). But it's not truly necessary, and not even the most accurate way of identifying contributors and/or copyright holders. In practice, we've never added anyone to our AUTHORS file. It only lists Tailscale, so it's not really serving any purpose. It also causes confusion because Tailscalars put the "Tailscale Inc & AUTHORS" header in other open source repos which don't actually have an AUTHORS file, so it's ambiguous what that means. Instead, we just acknowledge that the contributors to Tailscale (whoever they are) are copyright holders for their individual contributions. We also have the benefit of using the DCO (developercertificate.org) which provides some additional certification of their right to make the contribution. The source file changes were purely mechanical with: git ls-files | xargs sed -i -e 's/\(Tailscale Inc &\) AUTHORS/\1 contributors/g' Updates #cleanup Change-Id: Ia101a4a3005adb9118051b3416f5a64a4a45987d Signed-off-by: Will Norris <will@tailscale.com>
294 lines
7.2 KiB
Go
294 lines
7.2 KiB
Go
// Copyright (c) Tailscale Inc & contributors
|
|
// SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
package main
|
|
|
|
import (
|
|
"maps"
|
|
"slices"
|
|
"strings"
|
|
"testing"
|
|
|
|
"tailscale.com/feature/featuretags"
|
|
"tailscale.com/tstest/deptest"
|
|
)
|
|
|
|
func TestOmitSSH(t *testing.T) {
|
|
const msg = "unexpected with ts_omit_ssh"
|
|
deptest.DepChecker{
|
|
GOOS: "linux",
|
|
GOARCH: "amd64",
|
|
Tags: "ts_omit_ssh,ts_include_cli",
|
|
BadDeps: map[string]string{
|
|
"golang.org/x/crypto/ssh": msg,
|
|
"tailscale.com/ssh/tailssh": msg,
|
|
"tailscale.com/sessionrecording": msg,
|
|
"github.com/anmitsu/go-shlex": msg,
|
|
"github.com/creack/pty": msg,
|
|
"github.com/kr/fs": msg,
|
|
"github.com/pkg/sftp": msg,
|
|
"github.com/u-root/u-root/pkg/termios": msg,
|
|
"tempfork/gliderlabs/ssh": msg,
|
|
},
|
|
}.Check(t)
|
|
}
|
|
|
|
func TestOmitSyspolicy(t *testing.T) {
|
|
const msg = "unexpected syspolicy usage with ts_omit_syspolicy"
|
|
deptest.DepChecker{
|
|
GOOS: "linux",
|
|
GOARCH: "amd64",
|
|
Tags: "ts_omit_syspolicy,ts_include_cli",
|
|
BadDeps: map[string]string{
|
|
"tailscale.com/util/syspolicy": msg,
|
|
"tailscale.com/util/syspolicy/setting": msg,
|
|
"tailscale.com/util/syspolicy/rsop": msg,
|
|
},
|
|
}.Check(t)
|
|
}
|
|
|
|
func TestOmitLocalClient(t *testing.T) {
|
|
deptest.DepChecker{
|
|
GOOS: "linux",
|
|
GOARCH: "amd64",
|
|
Tags: "ts_omit_webclient,ts_omit_relayserver,ts_omit_oauthkey,ts_omit_acme",
|
|
BadDeps: map[string]string{
|
|
"tailscale.com/client/local": "unexpected",
|
|
},
|
|
}.Check(t)
|
|
}
|
|
|
|
// Test that we can build a binary without reflect.MethodByName.
|
|
// See https://github.com/tailscale/tailscale/issues/17063
|
|
func TestOmitReflectThings(t *testing.T) {
|
|
deptest.DepChecker{
|
|
GOOS: "linux",
|
|
GOARCH: "amd64",
|
|
Tags: "ts_include_cli,ts_omit_systray,ts_omit_debugeventbus,ts_omit_webclient",
|
|
BadDeps: map[string]string{
|
|
"text/template": "unexpected text/template usage",
|
|
"html/template": "unexpected text/template usage",
|
|
},
|
|
OnDep: func(dep string) {
|
|
if strings.Contains(dep, "systray") {
|
|
t.Errorf("unexpected systray dep %q", dep)
|
|
}
|
|
},
|
|
}.Check(t)
|
|
}
|
|
|
|
func TestOmitDrive(t *testing.T) {
|
|
deptest.DepChecker{
|
|
GOOS: "linux",
|
|
GOARCH: "amd64",
|
|
Tags: "ts_omit_drive,ts_include_cli",
|
|
OnDep: func(dep string) {
|
|
if strings.Contains(dep, "driveimpl") {
|
|
t.Errorf("unexpected dep with ts_omit_drive: %q", dep)
|
|
}
|
|
if strings.Contains(dep, "webdav") {
|
|
t.Errorf("unexpected dep with ts_omit_drive: %q", dep)
|
|
}
|
|
},
|
|
}.Check(t)
|
|
}
|
|
|
|
func TestOmitPortmapper(t *testing.T) {
|
|
deptest.DepChecker{
|
|
GOOS: "linux",
|
|
GOARCH: "amd64",
|
|
Tags: "ts_omit_portmapper,ts_include_cli,ts_omit_debugportmapper",
|
|
OnDep: func(dep string) {
|
|
if dep == "tailscale.com/net/portmapper" {
|
|
t.Errorf("unexpected dep with ts_omit_portmapper: %q", dep)
|
|
return
|
|
}
|
|
if strings.Contains(dep, "goupnp") || strings.Contains(dep, "/soap") ||
|
|
strings.Contains(dep, "internetgateway2") {
|
|
t.Errorf("unexpected dep with ts_omit_portmapper: %q", dep)
|
|
}
|
|
},
|
|
}.Check(t)
|
|
}
|
|
|
|
func TestOmitACME(t *testing.T) {
|
|
deptest.DepChecker{
|
|
GOOS: "linux",
|
|
GOARCH: "amd64",
|
|
Tags: "ts_omit_acme,ts_include_cli",
|
|
OnDep: func(dep string) {
|
|
if strings.Contains(dep, "/acme") {
|
|
t.Errorf("unexpected dep with ts_omit_acme: %q", dep)
|
|
}
|
|
},
|
|
}.Check(t)
|
|
}
|
|
|
|
func TestOmitCaptivePortal(t *testing.T) {
|
|
deptest.DepChecker{
|
|
GOOS: "linux",
|
|
GOARCH: "amd64",
|
|
Tags: "ts_omit_captiveportal,ts_include_cli",
|
|
OnDep: func(dep string) {
|
|
if strings.Contains(dep, "captive") {
|
|
t.Errorf("unexpected dep with ts_omit_captiveportal: %q", dep)
|
|
}
|
|
},
|
|
}.Check(t)
|
|
}
|
|
|
|
func TestOmitAuth(t *testing.T) {
|
|
deptest.DepChecker{
|
|
GOOS: "linux",
|
|
GOARCH: "amd64",
|
|
Tags: "ts_omit_oauthkey,ts_omit_identityfederation,ts_include_cli",
|
|
OnDep: func(dep string) {
|
|
if strings.HasPrefix(dep, "golang.org/x/oauth2") {
|
|
t.Errorf("unexpected oauth2 dep: %q", dep)
|
|
}
|
|
},
|
|
}.Check(t)
|
|
}
|
|
|
|
func TestOmitOutboundProxy(t *testing.T) {
|
|
deptest.DepChecker{
|
|
GOOS: "linux",
|
|
GOARCH: "amd64",
|
|
Tags: "ts_omit_outboundproxy,ts_include_cli",
|
|
OnDep: func(dep string) {
|
|
if strings.Contains(dep, "socks5") || strings.Contains(dep, "proxymux") {
|
|
t.Errorf("unexpected dep with ts_omit_outboundproxy: %q", dep)
|
|
}
|
|
},
|
|
}.Check(t)
|
|
}
|
|
|
|
func TestOmitDBus(t *testing.T) {
|
|
deptest.DepChecker{
|
|
GOOS: "linux",
|
|
GOARCH: "amd64",
|
|
Tags: "ts_omit_networkmanager,ts_omit_dbus,ts_omit_resolved,ts_omit_systray,ts_omit_ssh,ts_include_cli",
|
|
OnDep: func(dep string) {
|
|
if strings.Contains(dep, "dbus") {
|
|
t.Errorf("unexpected DBus dep: %q", dep)
|
|
}
|
|
},
|
|
}.Check(t)
|
|
}
|
|
|
|
func TestNetstack(t *testing.T) {
|
|
deptest.DepChecker{
|
|
GOOS: "linux",
|
|
GOARCH: "amd64",
|
|
Tags: "ts_omit_gro,ts_omit_netstack,ts_omit_outboundproxy,ts_omit_serve,ts_omit_ssh,ts_omit_webclient,ts_omit_tap",
|
|
OnDep: func(dep string) {
|
|
if strings.Contains(dep, "gvisor") {
|
|
t.Errorf("unexpected gvisor dep: %q", dep)
|
|
}
|
|
},
|
|
}.Check(t)
|
|
}
|
|
|
|
func TestOmitPortlist(t *testing.T) {
|
|
deptest.DepChecker{
|
|
GOOS: "linux",
|
|
GOARCH: "amd64",
|
|
Tags: "ts_omit_portlist,ts_include_cli",
|
|
OnDep: func(dep string) {
|
|
if strings.Contains(dep, "portlist") {
|
|
t.Errorf("unexpected dep: %q", dep)
|
|
}
|
|
},
|
|
}.Check(t)
|
|
}
|
|
|
|
func TestOmitGRO(t *testing.T) {
|
|
deptest.DepChecker{
|
|
GOOS: "linux",
|
|
GOARCH: "amd64",
|
|
Tags: "ts_omit_gro,ts_include_cli",
|
|
BadDeps: map[string]string{
|
|
"gvisor.dev/gvisor/pkg/tcpip/stack/gro": "unexpected dep with ts_omit_gro",
|
|
},
|
|
}.Check(t)
|
|
}
|
|
|
|
func TestOmitUseProxy(t *testing.T) {
|
|
deptest.DepChecker{
|
|
GOOS: "linux",
|
|
GOARCH: "amd64",
|
|
Tags: "ts_omit_useproxy,ts_include_cli",
|
|
OnDep: func(dep string) {
|
|
if strings.Contains(dep, "tshttproxy") {
|
|
t.Errorf("unexpected dep: %q", dep)
|
|
}
|
|
},
|
|
}.Check(t)
|
|
}
|
|
|
|
func minTags() string {
|
|
var tags []string
|
|
for _, f := range slices.Sorted(maps.Keys(featuretags.Features)) {
|
|
if f.IsOmittable() {
|
|
tags = append(tags, f.OmitTag())
|
|
}
|
|
}
|
|
return strings.Join(tags, ",")
|
|
}
|
|
|
|
func TestMinTailscaledNoCLI(t *testing.T) {
|
|
badSubstrs := []string{
|
|
"cbor",
|
|
"regexp",
|
|
"golang.org/x/net/proxy",
|
|
"internal/socks",
|
|
"github.com/tailscale/peercred",
|
|
"tailscale.com/types/netlogtype",
|
|
"deephash",
|
|
"util/hashx",
|
|
}
|
|
deptest.DepChecker{
|
|
GOOS: "linux",
|
|
GOARCH: "amd64",
|
|
Tags: minTags(),
|
|
OnDep: func(dep string) {
|
|
for _, bad := range badSubstrs {
|
|
if strings.Contains(dep, bad) {
|
|
t.Errorf("unexpected dep: %q", dep)
|
|
}
|
|
}
|
|
},
|
|
}.Check(t)
|
|
}
|
|
|
|
func TestMinTailscaledWithCLI(t *testing.T) {
|
|
badSubstrs := []string{
|
|
"cbor",
|
|
"hujson",
|
|
"pprof",
|
|
"multierr", // https://github.com/tailscale/tailscale/pull/17379
|
|
"tailscale.com/metrics",
|
|
"tailscale.com/tsweb/varz",
|
|
"dirwalk",
|
|
"deephash",
|
|
"util/hashx",
|
|
}
|
|
deptest.DepChecker{
|
|
GOOS: "linux",
|
|
GOARCH: "amd64",
|
|
Tags: minTags() + ",ts_include_cli",
|
|
OnDep: func(dep string) {
|
|
for _, bad := range badSubstrs {
|
|
if strings.Contains(dep, bad) {
|
|
t.Errorf("unexpected dep: %q", dep)
|
|
}
|
|
}
|
|
},
|
|
BadDeps: map[string]string{
|
|
"golang.org/x/net/http2": "unexpected x/net/http2 dep; tailscale/tailscale#17305",
|
|
"expvar": "unexpected expvar dep",
|
|
"github.com/mdlayher/genetlink": "unexpected genetlink dep",
|
|
},
|
|
}.Check(t)
|
|
}
|