auth

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DoBrowserLogin

func DoBrowserLogin(ctx context.Context, am *config.AccountManager, opts BrowserLoginOptions) error

DoBrowserLogin performs OAuth2 browser-based authentication flow

Types

type BrowserLoginOptions

type BrowserLoginOptions struct {
	APIUrl        string
	CallbackPort  string
	NoBrowser     bool
	IsInteractive bool // Set to false in CI environments
}

BrowserLoginOptions contains options for browser-based login

type Provider

type Provider interface {
	Login() error
	Refresh() error
	GetToken() (string, error)
}

Provider handles authentication flows.

type TokenManager

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

TokenManager handles OAuth token refresh and validation

func NewTokenManager

func NewTokenManager(am *config.AccountManager) *TokenManager

NewTokenManager creates a new token manager

func (*TokenManager) RefreshOrganizationsIfNeeded

func (tm *TokenManager) RefreshOrganizationsIfNeeded(ctx context.Context, account *config.Account) (bool, error)

RefreshOrganizationsIfNeeded checks if organizations need refresh and refreshes them if necessary

func (*TokenManager) RefreshToken

func (tm *TokenManager) RefreshToken(ctx context.Context, account *config.Account) error

RefreshToken refreshes the OAuth token for the given account

func (*TokenManager) RefreshTokenIfNeeded

func (tm *TokenManager) RefreshTokenIfNeeded(ctx context.Context, account *config.Account) error

RefreshTokenIfNeeded checks if the token needs refresh and refreshes it if necessary

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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