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.
Click to show internal directories.
Click to hide internal directories.