auth

package
v0.49.3 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2022 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const OauthSuccessPage = `` /* 1941-byte string literal not displayed */
View Source
const ResetLine = "\r\033[K"

ResetLine returns the cursor to start of line and clean it

Variables

This section is empty.

Functions

func Flow added in v0.31.0

func Flow(hostname string, provider AuthProvider) (accessToken string, username string, err error)

Flow - authentication workflow returns access tooken

func NewCmdLogin

func NewCmdLogin() *cobra.Command

NewCmdLogin creates the `auth login` command

func NewCmdLogout

func NewCmdLogout() *cobra.Command

NewCmdLogout creates the `auth logout` command

func NewCmdStatus

func NewCmdStatus() *cobra.Command

NewCmdStatus creates the `auth status` command

Types

type AuthProvider

type AuthProvider int
const (
	AuthWithGithub AuthProvider = iota
	AuthWithGitlab

	// used for requesting more permissions from
	// github when working with Github repo based
	// objectives
	AuthWithGithubWorkflow
)

func (AuthProvider) AuthPath added in v0.31.0

func (p AuthProvider) AuthPath() (s string)

func (AuthProvider) AuthorizeURL

func (p AuthProvider) AuthorizeURL() string

AuthorizeURL returns the URL of the OAuth authorization endpoint

func (AuthProvider) ClientID

func (p AuthProvider) ClientID() string

func (AuthProvider) Scopes

func (p AuthProvider) Scopes() string

func (AuthProvider) String

func (p AuthProvider) String() string

type LoginOptions

type LoginOptions struct {
	IO *iostreams.IOStreams

	Interactive bool

	Hostname string
	Provider string
	Token    string
}

func (*LoginOptions) GetToken added in v0.31.0

func (l *LoginOptions) GetToken() string

implement utils.TokenReader interface

func (*LoginOptions) Reader added in v0.31.0

func (l *LoginOptions) Reader() io.ReadCloser

func (*LoginOptions) SetToken added in v0.31.0

func (l *LoginOptions) SetToken(t string)

type LogoutOptions

type LogoutOptions struct {
	IO *iostreams.IOStreams

	Interactive bool

	Hostname  string
	NoConfirm bool
}

type StatusOptions

type StatusOptions struct {
	IO *iostreams.IOStreams

	Hostname  string
	ShowToken bool
}

Jump to

Keyboard shortcuts

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