login

package
v1.1.7 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2026 License: ISC Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrRateLimited = errors.New("rate limited")

ErrRateLimited marks a login failure caused by the auth API rate limiting the caller. It is wrapped into the returned error so callers can react to it with errors.Is without depending on a concrete error type or HTTP status code.

View Source
var ErrUnknownPollID = errors.New("unknown ID")

ErrUnknownPollID marks a poll for a sign-in the auth api does not know, or no longer knows: it expired or its token was already released.

Functions

func DeriveToken

func DeriveToken(ctx *appcontext.AppContext) (string, error)

func NewLoginFlow

func NewLoginFlow(appCtx *appcontext.AppContext, noSpawn bool) (*loginFlow, error)

Types

type PollStatus added in v1.1.7

type PollStatus int

PollStatus is where a sign-in stands after one poll of the auth api.

const (
	// PollPending: the user has not completed the sign-in yet.
	PollPending PollStatus = iota
	// PollCodeRequired: the sign-in is complete but the token is only
	// released against the completion code, and none or a wrong one was sent.
	PollCodeRequired
	// PollDone: the token was released.
	PollDone
)

type TokenResponse

type TokenResponse struct {
	Token string `json:"token"`
}

type UILogin added in v1.1.7

type UILogin struct {
	URL    string `json:"URL"`
	PollID string `json:"poll_id"`
}

UILogin is a sign-in started on behalf of the local ui. The ui opens URL (github only; the email provider sends a link instead) and then drives PollOnce with PollID, passing the completion code the user reads off the sign-in page.

Jump to

Keyboard shortcuts

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