From 9794be375d661b3f95a3eb9ef54a71ffa937844f Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Tue, 1 Jun 2021 20:04:37 -0700 Subject: [PATCH] tailcfg: add SetDNSRequest type Updates #1235 Signed-off-by: Brad Fitzpatrick --- tailcfg/tailcfg.go | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/tailcfg/tailcfg.go b/tailcfg/tailcfg.go index 87836d10c..5a6ad8cc5 100644 --- a/tailcfg/tailcfg.go +++ b/tailcfg/tailcfg.go @@ -1174,3 +1174,31 @@ const ( CapabilityFileSharing = "https://tailscale.com/cap/file-sharing" CapabilityAdmin = "https://tailscale.com/cap/is-admin" ) + +// SetDNSRequest is a request to add a DNS record. +// +// This is used for ACME DNS-01 challenges (so people can use +// LetsEncrypt, etc). +// +// The request is encoded to JSON, encrypted with golang.org/x/crypto/nacl/box, +// using the local machine key, and sent to: +// https://login.tailscale.com/machine//set-dns +type SetDNSRequest struct { + // Version indicates what level of SetDNSRequest functionality + // the client understands. Currently this type only has + // one version; this field should always be 1 for now. + Version int + + // NodeKey is the client's current node key. + NodeKey NodeKey + + // Name is the domain name for which to create a record. + Name string + + // Type is the DNS record type. For ACME DNS-01 challenges, it + // should be "TXT". + Type string + + // Value is the value to add. + Value string +}