Help us shape the future of Go! Take the 2026 Go Developer Survey

openapi

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 24, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package openapi pins the operations of Tailscale's OpenAPI document (spec §20). operations.txt lists every operation in it, with a header naming the document's sha256. The document itself is not committed: TestOperationsMatchTheDocument compares the list with a copy named by TAILKEEPER_OPENAPI_LIVE, and the weekly drift check does the same against the live document. fingerprint.txt pins what the tools depend on: the required operations; the fields of their 2xx JSON responses (and of the validate call's 4xx responses: see ReadsErrorBody); their parameters ("param <name> <in>") and the content types they accept ("req <type>"), compared by TestLiveDocumentMatchesThePin. The binary never parses YAML.

Index

Constants

This section is empty.

Variables

View Source
var Skipped = map[string]string{
	"GET /tailnet/{tailnet}/dns/nameservers":                                   "dns_get reads /dns/configuration, which carries the nameservers",
	"GET /tailnet/{tailnet}/dns/preferences":                                   "dns_get reads /dns/configuration, which carries MagicDNS and the override setting",
	"GET /tailnet/{tailnet}/dns/searchpaths":                                   "dns_get reads /dns/configuration, which carries the search paths",
	"GET /tailnet/{tailnet}/dns/split-dns":                                     "dns_get reads /dns/configuration, which carries split DNS",
	"GET /tailnet/{tailnet}/services/{serviceName}/devices":                    "a privileged read: the API demands the write-level services scope with devices:core, so service_hosts waits for the approval gate (M2)",
	"GET /tailnet/{tailnet}/services/{serviceName}/device/{deviceId}/approved": "a privileged read: the API demands the write-level services scope with devices:core, so service_hosts waits for the approval gate (M2)",
	"GET /organizations/{organization}/tailnets":                               "organization endpoints are a non-goal in v1 (spec §2)",
}

Skipped lists the required operations no tool calls, and why.

Functions

func Operations

func Operations() []string

Operations returns every operation of the pinned document as "METHOD /path", sorted.

func ReadsErrorBody added in v0.6.0

func ReadsErrorBody(op string) bool

ReadsErrorBody reports whether fingerprint.txt pins the fields of op's 4xx JSON responses. The client reads message from every error body, and every 4xx response of the required operations refers to one shared error schema, so the validate call's lines pin that shape for all of them; the validate call is also the one whose 400 the client reads beyond message (a rejected policy's test results).

func Required

func Required(op string) bool

Required reports whether tailkeeper must answer for op: each GET, and the policy validation acl_test sends. Writes arrive with the gate (M2).

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL