oauth

package
v0.29.2 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2026 License: CC0-1.0 Imports: 8 Imported by: 0

Documentation

Overview

Package oauth speaks the minimal GitHub OAuth web flow needed by the panel: build the consent URL, exchange the code, fetch the primary verified email. No third-party SDK — the surface is tiny enough that stdlib + a couple of struct types is simpler than golang.org/x/oauth2.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GitHubAuthURL

func GitHubAuthURL(clientID, redirectURI, state string) string

GitHubAuthURL builds the GitHub OAuth consent URL.

func GitHubExchange

func GitHubExchange(ctx context.Context, a ExchangeArgs) (string, error)

GitHubExchange swaps the OAuth `code` for an access token.

func GitHubPrimaryEmail

func GitHubPrimaryEmail(ctx context.Context, accessToken string) (string, error)

GitHubPrimaryEmail returns the verified primary email of the authenticated user.

Types

type ExchangeArgs

type ExchangeArgs struct {
	ClientID     string
	ClientSecret string
	RedirectURI  string
	Code         string
}

Jump to

Keyboard shortcuts

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