summaryrefslogtreecommitdiffhomepage
path: root/ipn/localapi
diff options
context:
space:
mode:
authorBrad Fitzpatrick <bradfitz@tailscale.com>2026-02-11 04:45:45 +0000
committerBrad Fitzpatrick <bradfitz@tailscale.com>2026-02-11 09:08:30 -0800
commit8527cb1ffd79026a0db82cb04adc8290d5033344 (patch)
treebedb90c2ec3852f3325c33f168785d13601447f1 /ipn/localapi
parent6cbfc2f3babe5e6e55ddc589dee413801f663797 (diff)
downloadtailscale-bradfitz/feature_appconnectors.tar.xz
tailscale-bradfitz/feature_appconnectors.zip
ipn/ipnlocal, feature/appconnectors: move app connector code out of LocalBackedbradfitz/feature_appconnectors
This is Claude Code's attempt at moving App Connector code out of LocalBackend, with plenty of tips and guidance. This is probably too big of a single commit (and untested, and not sufficiently reviewed) but shared for discussion purposes, so we can start thinking about what hooks we might actually want, and how we can break something like this up into smaller chunks that are reviewable. Updates #12614 Change-Id: I4c79abbef687bfb7bc81f94c393c08b7636fd3c6 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
Diffstat (limited to 'ipn/localapi')
-rw-r--r--ipn/localapi/localapi.go29
1 files changed, 2 insertions, 27 deletions
diff --git a/ipn/localapi/localapi.go b/ipn/localapi/localapi.go
index dc558b36e..afc112644 100644
--- a/ipn/localapi/localapi.go
+++ b/ipn/localapi/localapi.go
@@ -40,7 +40,6 @@ import (
"tailscale.com/net/netutil"
"tailscale.com/tailcfg"
"tailscale.com/tstime"
- "tailscale.com/types/appctype"
"tailscale.com/types/key"
"tailscale.com/types/logger"
"tailscale.com/types/logid"
@@ -92,9 +91,6 @@ var handler = map[string]LocalAPIHandler{
}
func init() {
- if buildfeatures.HasAppConnectors {
- Register("appc-route-info", (*Handler).serveGetAppcRouteInfo)
- }
if buildfeatures.HasAdvertiseRoutes {
Register("check-ip-forwarding", (*Handler).serveCheckIPForwarding)
Register("check-udp-gro-forwarding", (*Handler).serveCheckUDPGROForwarding)
@@ -1003,8 +999,8 @@ func (h *Handler) servePrefs(w http.ResponseWriter, r *http.Request) {
http.Error(w, err.Error(), http.StatusBadRequest)
return
}
- if buildfeatures.HasAppConnectors {
- if err := h.b.MaybeClearAppConnector(mp); err != nil {
+ if mp.AdvertiseRoutesSet {
+ if err := h.b.MaybeClearAutoRoutes(); err != nil {
w.Header().Set("Content-Type", "application/json")
w.WriteHeader(http.StatusInternalServerError)
json.NewEncoder(w).Encode(resJSON{Error: err.Error()})
@@ -1738,24 +1734,3 @@ func (h *Handler) serveShutdown(w http.ResponseWriter, r *http.Request) {
eventbus.Publish[Shutdown](ec).Publish(Shutdown{})
}
-func (h *Handler) serveGetAppcRouteInfo(w http.ResponseWriter, r *http.Request) {
- if !buildfeatures.HasAppConnectors {
- http.Error(w, feature.ErrUnavailable.Error(), http.StatusNotImplemented)
- return
- }
- if r.Method != httpm.GET {
- http.Error(w, "only GET allowed", http.StatusMethodNotAllowed)
- return
- }
- res, err := h.b.ReadRouteInfo()
- if err != nil {
- if errors.Is(err, ipn.ErrStateNotExist) {
- res = &appctype.RouteInfo{}
- } else {
- WriteErrorJSON(w, err)
- return
- }
- }
- w.Header().Set("Content-Type", "application/json")
- json.NewEncoder(w).Encode(res)
-}