tokencmd

package
v0.0.0-...-ea77a8b Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2016 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const CSRFTokenHeader = "X-CSRF-Token"

CSRFTokenHeader is a marker header that indicates we are not a browser that got tricked into requesting basic auth Corresponds to the header expected by basic-auth challenging authenticators

Variables

This section is empty.

Functions

func RequestToken

func RequestToken(clientCfg *kclient.Config, reader io.Reader, defaultUsername string, defaultPassword string) (string, error)

RequestToken uses the cmd arguments to locate an openshift oauth server and attempts to authenticate it returns the access token if it gets one. An error if it does not

Types

type BasicChallengeHandler

type BasicChallengeHandler struct {
	// Host is the server being authenticated to. Used only for displaying messages when prompting for username/password
	Host string

	// Reader is used to prompt for username/password. If nil, no prompting is done
	Reader io.Reader
	// Writer is used to output prompts. If nil, stdout is used
	Writer io.Writer

	// Username is the username to use when challenged. If empty, a prompt is issued to a non-nil Reader
	Username string
	// Password is the password to use when challenged. If empty, a prompt is issued to a non-nil Reader
	Password string
	// contains filtered or unexported fields
}

func (*BasicChallengeHandler) CanHandle

func (c *BasicChallengeHandler) CanHandle(headers http.Header) bool

func (*BasicChallengeHandler) HandleChallenge

func (c *BasicChallengeHandler) HandleChallenge(headers http.Header) (http.Header, bool, error)

Jump to

Keyboard shortcuts

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