tailscale

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2026 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package tailscale mints short-lived, tagged auth keys from an OAuth client and watches for the new node to join the tailnet. No long-lived secret touches the box.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MintAccess

func MintAccess(ctx context.Context, oauthID, oauthSecret string) (string, error)

MintAccess exchanges an OAuth client for a short-lived API access token, used to revoke a node during teardown.

func MintKey

func MintKey(ctx context.Context, oauthID, oauthSecret, tag string) (key, accessToken string, err error)

MintKey exchanges an OAuth client for an access token, then creates a single-use, pre-authorized, tagged, non-ephemeral auth key (30 min TTL). It returns the key (for cloud-init) and the access token (reused to poll/revoke the node).

func RevokeByHostname

func RevokeByHostname(ctx context.Context, accessToken, hostname string) error

RevokeByHostname deletes every tailnet node with the given hostname. Tagged nodes never expire, so an old box must be revoked explicitly on rebuild/teardown.

func Validate

func Validate(ctx context.Context, oauthID, oauthSecret string) error

Validate confirms the OAuth client credentials work.

func WaitForNode

func WaitForNode(ctx context.Context, accessToken, hostname string, attempts int, every time.Duration) (string, error)

WaitForNode polls until a node with the given hostname appears, returning its 100.x address. It picks the most recently created match to avoid stale nodes.

Types

This section is empty.

Jump to

Keyboard shortcuts

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