auth

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2026 License: MPL-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package auth implements the `auth` command group for managing authentication.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCmdAuth

func NewCmdAuth(inv *cmd.Invocation) *cmd.Command

NewCmdAuth returns the `auth` command for managing authentication.

func NewCmdLogin

func NewCmdLogin(inv *cmd.Invocation) *cmd.Command

NewCmdLogin returns the `auth login` command for authenticating.

func NewCmdStatus

func NewCmdStatus(inv *cmd.Invocation) *cmd.Command

NewCmdStatus returns the `auth status` command for displaying auth info.

Types

type LoginOpts

type LoginOpts struct {
	IO      iostreams.IOStreams
	Profile *profile.Profile
	Output  *format.Outputter

	// OpenBrowser opens a URL in the user's default browser. When nil, the
	// package default openBrowser is used. Tests inject a no-op opener to avoid
	// launching a real browser and to keep parallel tests free of shared state.
	OpenBrowser func(url string) error

	Name   string
	Token  bool
	DryRun bool
}

LoginOpts defines the options for the `auth login` command.

type StatusOpts

type StatusOpts struct {
	IO        iostreams.IOStreams
	Profile   *profile.Profile
	Output    *format.Outputter
	APIClient *client.Client
}

StatusOpts defines the options for the `auth status` command.

type StatusResult

type StatusResult struct {
	Hostname  string     `json:"hostname"`
	Username  string     `json:"username,omitempty"`
	TokenType string     `json:"token_type,omitempty"`
	ExpiresAt *time.Time `json:"expires_at,omitempty"`
	Active    bool       `json:"active"`
}

StatusResult is the structured output for auth status.

Jump to

Keyboard shortcuts

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