login

package
v1.40.5 Latest Latest
Warning

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

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

Documentation

Overview

Package login implements Stripe authentication flows.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitiateLogin added in v1.39.0

func InitiateLogin(ctx context.Context, baseURL string, cfg *config.Config) error

InitiateLogin calls GetLinks, prints JSON with browser_url, verification_code, and a next_step command to complete login, then exits. Intended for non-interactive (agent/script) use.

func InteractiveLogin

func InteractiveLogin(ctx context.Context, config *config.Config) error

InteractiveLogin lets the user set configuration on the command line

func Login

func Login(ctx context.Context, baseURL string, config *config.Config) error

Login is the main entrypoint for logging in to the CLI.

func PollForLogin added in v1.39.0

func PollForLogin(ctx context.Context, pollURL string, cfg *config.Config) error

PollForLogin polls the given poll URL until browser auth completes, then saves credentials. Intended as the second step of a non-interactive login flow.

func SuccessMessage added in v0.2.2

func SuccessMessage(ctx context.Context, account *acct.Account, baseURL string, apiKey string) (string, error)

SuccessMessage returns the display message for a successfully authenticated user

Types

type AsyncInputReader added in v1.12.4

type AsyncInputReader interface {
	// contains filtered or unexported methods
}

AsyncInputReader is an interface that has an async version of scanln

type AsyncStdinReader added in v1.12.4

type AsyncStdinReader struct {
}

AsyncStdinReader implements scanln(ch chan int), an async version of scanln

type Authenticator added in v1.13.12

type Authenticator struct {
	// contains filtered or unexported fields
}

Authenticator handles the login flow

func NewAuthenticator added in v1.13.12

func NewAuthenticator(keytransfer keys.KeyTransfer) *Authenticator

NewAuthenticator creates a new authenticator object

func (*Authenticator) Login added in v1.13.12

func (a *Authenticator) Login(ctx context.Context, links *Links) error

Login function is used to obtain credentials via stripe dashboard.

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

func GetLinks(ctx context.Context, baseURL string, deviceName string) (*Links, error)

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

Directories

Path Synopsis
Package acct provides Stripe account retrieval during login.
Package acct provides Stripe account retrieval during login.
Package keys handles API key retrieval and configuration during login.
Package keys handles API key retrieval and configuration during login.

Jump to

Keyboard shortcuts

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