@ -35,7 +35,7 @@ import (
"gopkg.in/square/go-jose.v2"
"gopkg.in/square/go-jose.v2"
"gopkg.in/square/go-jose.v2/jwt"
"gopkg.in/square/go-jose.v2/jwt"
"tailscale.com/client/ tailscale "
"tailscale.com/client/ local "
"tailscale.com/client/tailscale/apitype"
"tailscale.com/client/tailscale/apitype"
"tailscale.com/envknob"
"tailscale.com/envknob"
"tailscale.com/ipn"
"tailscale.com/ipn"
@ -75,7 +75,7 @@ func main() {
}
}
var (
var (
lc * tailscale. Local Client
lc * local. Client
st * ipnstate . Status
st * ipnstate . Status
err error
err error
watcherChan chan error
watcherChan chan error
@ -84,7 +84,7 @@ func main() {
lns [ ] net . Listener
lns [ ] net . Listener
)
)
if * flagUseLocalTailscaled {
if * flagUseLocalTailscaled {
lc = & tailscale. Local Client{ }
lc = & local. Client{ }
st , err = lc . StatusWithoutPeers ( ctx )
st , err = lc . StatusWithoutPeers ( ctx )
if err != nil {
if err != nil {
log . Fatalf ( "getting status: %v" , err )
log . Fatalf ( "getting status: %v" , err )
@ -212,7 +212,7 @@ func main() {
// serveOnLocalTailscaled starts a serve session using an already-running
// serveOnLocalTailscaled starts a serve session using an already-running
// tailscaled instead of starting a fresh tsnet server, making something
// tailscaled instead of starting a fresh tsnet server, making something
// listening on clientDNSName:dstPort accessible over serve/funnel.
// listening on clientDNSName:dstPort accessible over serve/funnel.
func serveOnLocalTailscaled ( ctx context . Context , lc * tailscale. Local Client, st * ipnstate . Status , dstPort uint16 , shouldFunnel bool ) ( cleanup func ( ) , watcherChan chan error , err error ) {
func serveOnLocalTailscaled ( ctx context . Context , lc * local. Client, st * ipnstate . Status , dstPort uint16 , shouldFunnel bool ) ( cleanup func ( ) , watcherChan chan error , err error ) {
// In order to support funneling out in local tailscaled mode, we need
// In order to support funneling out in local tailscaled mode, we need
// to add a serve config to forward the listeners we bound above and
// to add a serve config to forward the listeners we bound above and
// allow those forwarders to be funneled out.
// allow those forwarders to be funneled out.
@ -275,7 +275,7 @@ func serveOnLocalTailscaled(ctx context.Context, lc *tailscale.LocalClient, st *
}
}
type idpServer struct {
type idpServer struct {
lc * tailscale. Local Client
lc * local. Client
loopbackURL string
loopbackURL string
serverURL string // "https://foo.bar.ts.net"
serverURL string // "https://foo.bar.ts.net"
funnel bool
funnel bool
@ -328,7 +328,7 @@ type authRequest struct {
// allowRelyingParty validates that a relying party identified either by a
// allowRelyingParty validates that a relying party identified either by a
// known remoteAddr or a valid client ID/secret pair is allowed to proceed
// known remoteAddr or a valid client ID/secret pair is allowed to proceed
// with the authorization flow associated with this authRequest.
// with the authorization flow associated with this authRequest.
func ( ar * authRequest ) allowRelyingParty ( r * http . Request , lc * tailscale. Local Client) error {
func ( ar * authRequest ) allowRelyingParty ( r * http . Request , lc * local. Client) error {
if ar . localRP {
if ar . localRP {
ra , err := netip . ParseAddrPort ( r . RemoteAddr )
ra , err := netip . ParseAddrPort ( r . RemoteAddr )
if err != nil {
if err != nil {