auth

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2026 License: MPL-2.0 Imports: 19 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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
	Hostname     string
	Output       *format.Outputter
	NewAPIClient func(token string) (*client.Client, error)
	Profile      *profile.Profile

	// 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
	TokenFromStdin 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