githubauth

package
v0.7.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrRateLimited = errors.New("github: rate limit exceeded")

Functions

func Authorize

func Authorize(ctx context.Context, request *http.Request, origin string, resolver *Resolver) error

func HTTPClient

func HTTPClient(base *http.Client, origin string) *http.Client

func IsAPIOrigin

func IsAPIOrigin(destination *url.URL, origin string) bool

func IsAPIOriginURL

func IsAPIOriginURL(destination, origin string) bool

func RedactError

func RedactError(request *http.Request, err error) error

func RedactResponse

func RedactResponse(response *http.Response, message string) string

func ValidateCredentialTransport

func ValidateCredentialTransport(destination *url.URL) error

ValidateCredentialTransport preserves local HTTP registries without exposing credentials remotely.

Types

type RateLimitError

type RateLimitError struct {
	RetryAt       time.Time
	Authenticated bool
}

func RateLimit

func RateLimit(response *http.Response, now time.Time) *RateLimitError

func (*RateLimitError) Error

func (e *RateLimitError) Error() string

func (*RateLimitError) Unwrap

func (e *RateLimitError) Unwrap() error

type RateLimitGate

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

RateLimitGate retains upstream deadlines across transient clients owned by one service. Each configured API origin has an independent quota boundary.

func (*RateLimitGate) Check

func (g *RateLimitGate) Check(origin string, now time.Time) *RateLimitError

func (*RateLimitGate) Record

func (g *RateLimitGate) Record(origin string, limited *RateLimitError)

type Resolver

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

Resolver keeps GitHub CLI credentials in memory within its owner's lifetime and environment.

func NewResolver

func NewResolver(getenv func(string) string) *Resolver

func (*Resolver) Resolve

func (r *Resolver) Resolve(ctx context.Context, origin string) (string, error)

Jump to

Keyboard shortcuts

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