github

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2026 License: MIT Imports: 10 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package github implements theauth.Provider against GitHub's OAuth 2.0 endpoints. Import this package only when you want GitHub sign-in; the root theauth package has no hard dependency on it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(cfg Config) theauth.Provider

New returns a GitHub theauth.Provider with the supplied Config. Required fields: ClientID, ClientSecret.

Types

type Config

type Config struct {
	ClientID     string
	ClientSecret string
	Scopes       []string

	// Endpoint overrides for tests / GitHub Enterprise. Leave empty in
	// production to hit github.com directly.
	AuthorizeURL string
	TokenURL     string
	UserURL      string
	EmailsURL    string

	// HTTPClient lets callers inject a custom client (timeouts, transport
	// instrumentation, proxy). Defaults to a fresh client with httpTimeout.
	HTTPClient *http.Client
}

Config is the provider's wiring. ClientID + ClientSecret are required; everything else has a sensible default. Scopes default to read:user + user:email when nil.

Jump to

Keyboard shortcuts

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