auth

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureOAuthLogin

func EnsureOAuthLogin(ctx context.Context, instanceURL, tokenPath, clientPath string, callbackPort int) error

EnsureOAuthLogin guarantees a valid OAuth token exists at tokenPath. It validates an existing token and falls back to browser OAuth login if needed.

Types

type FileTokenProvider

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

FileTokenProvider reads a bearer token from a file on disk.

func NewFileTokenProvider

func NewFileTokenProvider(path string) *FileTokenProvider

NewFileTokenProvider creates a TokenProvider that reads from the given file path.

func (*FileTokenProvider) AccessToken

func (f *FileTokenProvider) AccessToken() (string, error)

AccessToken reads and returns the token, trimming whitespace.

type TokenProvider

type TokenProvider interface {
	AccessToken() (string, error)
}

TokenProvider supplies an access token for API authentication.

Jump to

Keyboard shortcuts

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