oauth

package
v0.7.71 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2026 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ClientID is the OAuth client identifier registered with CircleCI.
	ClientID = "chunk-cli"
	// CallbackTimeout is how long to wait for the browser callback before giving up.
	CallbackTimeout = 5 * time.Minute
)

Variables

This section is empty.

Functions

func GenerateState

func GenerateState() (string, error)

func GenerateVerifier

func GenerateVerifier() (string, error)

func ListenForCallback

func ListenForCallback(ctx context.Context) (port int, result <-chan CallbackResult, cleanup func(), err error)

func LoadOrCreateDeviceID

func LoadOrCreateDeviceID() (string, error)

func Login

func Login(ctx context.Context, cfg LoginConfig, status io.Writer) (string, error)

func OpenBrowser

func OpenBrowser(url string) error

func S256Challenge

func S256Challenge(verifier string) string

Types

type CallbackResult

type CallbackResult struct {
	Code  string
	State string
	Error string
}

type LoginConfig

type LoginConfig struct {
	BaseURL   string
	NoBrowser bool
	Signup    bool
}

type TokenResponse

type TokenResponse struct {
	AccessToken string `json:"access_token"`
	TokenType   string `json:"token_type"`
	ExpiresIn   int    `json:"expires_in"`
}

Jump to

Keyboard shortcuts

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