auth

package
v0.0.0-...-53bba90 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// CredentialPath is the path on disk to where credential is recorded
	CredentialPath string
	// TTY is the terminal for reading credentials from users
	TTY *os.File
)

Functions

func GetCredential

func GetCredential(endpoint string) (u, p string, err error)

GetCredential returns Basic Auth credentials for authenticating to the Section API

func IsCredentialRecorded

func IsCredentialRecorded() bool

IsCredentialRecorded returns if API credentials have been recorded

func Printf

func Printf(out *os.File, str string, a ...interface{})

Printf formats according to a format specifier and writes to an output. Output can be overridden for testing purposes by setting: auth.TTY

func PromptForCredential

func PromptForCredential(m string) (u, p string, err error)

PromptForCredential interactively prompts the user for a credential to authenticate to the Section API

func Setup

func Setup(endpoint string) (err error)

Setup ensures authentication is set up

func WriteCredential

func WriteCredential(endpoint, username, password string) (err error)

WriteCredential saves Section API credentials to disk

Types

This section is empty.

Jump to

Keyboard shortcuts

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