setup

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Logout added in v0.9.4

func Logout() error

Logout removes stored OAuth tokens so the next setup run authenticates from scratch (used by --switch and --logout). The OAuth client secret is left in place — switching Webex user under the same integration only needs the tokens cleared. A missing token entry is not an error.

func Run

func Run(binaryPath string) error

Run starts the setup UI on a random localhost port and opens the browser.

Types

type ExistingAuth added in v0.9.4

type ExistingAuth struct {
	DisplayName    string // from people/me; empty if the access token couldn't be validated live
	Email          string
	AccessExpires  time.Time
	RefreshExpires time.Time
}

ExistingAuth describes a currently-stored OAuth session.

func CurrentAuth added in v0.9.4

func CurrentAuth() *ExistingAuth

CurrentAuth loads stored OAuth tokens and reports the existing session, if any. It returns (nil, nil) when there is nothing usable — no tokens, or the refresh token has expired — so the caller falls through to the interactive setup flow. A non-nil result means the user is already signed in and setup can be skipped (unless they explicitly want to switch or force re-auth).

It never errors out the caller: any inability to determine state is treated as "no existing session" so --setup still works.

func (*ExistingAuth) Authenticated added in v0.9.4

func (e *ExistingAuth) Authenticated() bool

Authenticated reports whether the identity was confirmed against the Webex API (people/me) on this call, versus inferred from a still-valid refresh token without a live check.

Jump to

Keyboard shortcuts

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