Documentation
¶
Overview ¶
Package cli is the iap command: it gives a local CLI or an AI coding agent short-lived, host-bound credentials for hosts behind an iap-authz identity-aware proxy (default issuer https://access.iap.r167.dev). Main runs it; cmd/iap and the module root are thin package main shims.
login register agent:user:<you>:<machine>:<program> through the browser
(loopback + PKCE); the refresh credential goes to the OS keyring.
One registration per program (claude under Claude Code, else cli)
curl run curl with a freshly minted access token, passed on a pipe;
https://api.tailscale.com via a federated token and Tailscale's
token exchange
expose publish 127.0.0.1:<port> at https://<name>.<domain> through the
tunnel service behind the IAP (./expose)
status show every program's registration (no secrets)
logout delete one program's stored credential
No subcommand prints a token or the refresh credential. The library under it is github.com/R167/iap/iapclient; the tunnel client is github.com/R167/iap/expose.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Version = "dev"
Version is the release version, stamped at build time with -ldflags "-X github.com/R167/iap/internal/cli.Version=v1.2.3". Unstamped, it is the module version from the build info (go install ...@v1.2.3), else "dev".
Functions ¶
func Main ¶
func Main() int
Main runs the iap command with os.Args and returns the process exit status: 0 on success, the status of curl or of an expose -- command when it fails, else 1. Callers pass it to os.Exit. The headless login's code prompt may itself exit with 130 or 143 on SIGINT or SIGTERM, after restoring the terminal.
Types ¶
This section is empty.