auth

package
v0.9.5 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2020 License: Apache-2.0 Imports: 13 Imported by: 59

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, registry string) error

Login login to the server with creds from Stdin or CLI

func Logout

func Logout(systemContext *types.SystemContext, opts *LogoutOptions, server string) error

Logout removes the authentication of server from authfile removes all authtication if specifies all in the options

Types

type LoginOptions

type LoginOptions struct {
	AuthFile      string
	CertDir       string
	GetLoginSet   bool
	Password      string
	Username      string
	StdinPassword bool
	Stdin         io.Reader
	Stdout        io.Writer
}

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 {
	AuthFile string
	All      bool
	Stdin    io.Reader
	Stdout   io.Writer
}

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