login

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2019 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InteractiveLogin

func InteractiveLogin(profile profile.Profile) error

InteractiveLogin lets the user set configuration on the command line

func Login

func Login(baseURL string, profile profile.Profile, input io.Reader) error

Login function is used to obtain credentials via stripe dashboard.

func SuccessMessage added in v0.2.2

func SuccessMessage(account *Account, baseURL string, apiKey string) (string, error)

SuccessMessage returns the display message for a successfully authenticated user

Types

type Account added in v0.2.2

type Account struct {
	ID       string   `json:"id"`
	Settings Settings `json:"settings"`
}

Account is the most outer layer of the json response from Stripe

func PollForKey

func PollForKey(pollURL string, interval time.Duration, maxAttempts int) (string, *Account, error)

PollForKey polls Stripe at the specified interval until either the API key is available or we've reached the max attempts.

type Dashboard added in v0.2.2

type Dashboard struct {
	DisplayName string `json:"display_name"`
}

Dashboard is within the Settings json response from Stripe

type Links struct {
	BrowserURL       string `json:"browser_url"`
	PollURL          string `json:"poll_url"`
	VerificationCode string `json:"verification_code"`
}

Links provides the URLs for the CLI to continue the login flow

type Settings added in v0.2.2

type Settings struct {
	Dashboard Dashboard `json:"dashboard"`
}

Settings is within the Account json response from Stripe

Jump to

Keyboard shortcuts

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