auth_ui

package
v2.5.8 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotURLSafe = errors.New("not a valid url safe string")
	ErrRequired   = errors.New("can not be empty")
)

Functions

func Sanitize added in v2.5.0

func Sanitize(workspace string) (string, error)

Sanitize takes a workspace name or URL and returns the workspace name.

Types

type CLI

type CLI struct{}

CLI is the archaic fallback UI for auth.

func (*CLI) ConfirmationCode added in v2.5.2

func (*CLI) ConfirmationCode(email string) (code int, err error)

func (*CLI) RequestEmail added in v2.5.0

func (cl *CLI) RequestEmail(w io.Writer) (string, error)

func (*CLI) RequestLoginType added in v2.5.0

func (cl *CLI) RequestLoginType(w io.Writer) (LoginType, error)

func (*CLI) RequestPassword added in v2.5.0

func (cl *CLI) RequestPassword(w io.Writer, account string) (string, error)

func (*CLI) RequestWorkspace

func (cl *CLI) RequestWorkspace(w io.Writer) (string, error)

func (*CLI) Stop

func (*CLI) Stop()

type Huh added in v2.5.0

type Huh struct {
	// contains filtered or unexported fields
}

Huh is the Auth UI that uses the huh library to provide a terminal UI.

func (*Huh) ConfirmationCode added in v2.5.2

func (*Huh) ConfirmationCode(email string) (int, error)

ConfirmationCode asks the user to input the confirmation code, does some validation on it and returns it as an int.

func (*Huh) RequestCreds added in v2.5.1

func (*Huh) RequestCreds(w io.Writer, workspace string) (email string, passwd string, err error)

func (*Huh) RequestLoginType added in v2.5.0

func (*Huh) RequestLoginType(w io.Writer) (LoginType, error)

func (*Huh) RequestWorkspace added in v2.5.0

func (*Huh) RequestWorkspace(w io.Writer) (string, error)

func (*Huh) Stop added in v2.5.0

func (*Huh) Stop()

type LoginType added in v2.5.3

type LoginType int8

LoginType is the login type, that is used to choose the authentication flow, for example login headlessly or interactively.

const (
	// LInteractive is the SSO login type (Google, Apple, etc).
	LInteractive LoginType = iota
	// LHeadless is the email/password login type.
	LHeadless
	// LCancel should be returned if the user cancels the login intent.
	LCancel
)

Jump to

Keyboard shortcuts

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