Help us shape the future of Go! Take the 2026 Go Developer Survey

githubauth

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package githubauth provides an HTTP transport that mints repository-scoped GitHub App installation tokens from the in-cluster token broker.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// BrokerURL is the base URL of the token broker. Empty disables the broker
	// and makes the transport use FallbackToken.
	BrokerURL string
	// TokenFile contains the caller ServiceAccount token. Defaults to the
	// in-cluster projected token path.
	TokenFile string
	// FallbackToken is used when the broker is disabled, the request is not
	// repository-scoped, or the broker denies the request. It may be empty.
	FallbackToken string
	// Base is the transport used for GitHub API requests. Broker requests use
	// the default transport.
	Base http.RoundTripper
}

Config controls the broker-backed transport.

type Transport

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

Transport adds a repository-scoped GitHub token to outgoing API requests.

func NewTransport

func NewTransport(cfg Config) *Transport

NewTransport returns a transport configured from cfg.

func (*Transport) RoundTrip

func (t *Transport) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip implements http.RoundTripper.

Jump to

Keyboard shortcuts

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