auth

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2020 License: Apache-2.0 Imports: 14 Imported by: 58

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckAuthFile

func CheckAuthFile(authfile string) error

CheckAuthFile validates filepath given by --authfile used by command has --authfile flag

func GetDefaultAuthFile

func GetDefaultAuthFile() string

GetDefaultAuthFile returns env value REGISTRY_AUTH_FILE as default --authfile path used in multiple --authfile flag definitions

func GetLoginFlags

func GetLoginFlags(flags *LoginOptions) *pflag.FlagSet

GetLoginFlags defines and returns login flags for containers tools

func GetLogoutFlags

func GetLogoutFlags(flags *LogoutOptions) *pflag.FlagSet

GetLogoutFlags defines and returns logout flags for containers tools

func Login

func Login(ctx context.Context, systemContext *types.SystemContext, opts *LoginOptions, args []string) error

Login implements a “log in” command with the provided opts and args reading the password from opts.Stdin or the options in opts.

func Logout

func Logout(systemContext *types.SystemContext, opts *LogoutOptions, args []string) error

Logout implements a “log out” command with the provided opts and args

Types

type LoginOptions

type LoginOptions struct {
	// CLI flags managed by the FlagSet returned by GetLoginFlags
	AuthFile      string
	CertDir       string
	Password      string
	Username      string
	StdinPassword bool
	// Options caller can set
	GetLoginSet               bool      // set to true if --get-login is explicitly set
	Stdin                     io.Reader // set to os.Stdin
	Stdout                    io.Writer // set to os.Stdout
	AcceptUnspecifiedRegistry bool      // set to true if allows login with unspecified registry
}

LoginOptions represents common flags in login caller should define bool or optionalBool fields for flags --get-login and --tls-verify

type LogoutOptions

type LogoutOptions struct {
	// CLI flags managed by the FlagSet returned by GetLogoutFlags
	AuthFile string
	All      bool
	// Options caller can set
	Stdin                     io.Reader // set to os.Stdin
	Stdout                    io.Writer // set to os.Stdout
	AcceptUnspecifiedRegistry bool      // set to true if allows logout with unspecified registry
}

LogoutOptions represents the results for flags in logout

Jump to

Keyboard shortcuts

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