oauth

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 24, 2026 License: MIT Imports: 3 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 oauth defines provider interfaces and shared OAuth profile types used by Canopy.

Provider implementations are responsible for constructing OAuth2 configuration, exchanging authorization codes, refreshing provider access tokens, and normalizing verified provider profile data into Canopy's account model.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Profile

type Profile struct {
	ProviderID            string
	AccountID             string
	Email                 string
	EmailVerified         bool
	Name                  string
	Image                 string
	IDToken               string
	AccessToken           string
	RefreshToken          string
	Scope                 string
	AccessTokenExpiresAt  *time.Time
	RefreshTokenExpiresAt *time.Time
}

type Provider

type Provider interface {
	ID() string
	Config(ctx context.Context) (*oauth2.Config, error)
	AuthCodeOptions(StartOptions) []oauth2.AuthCodeOption
	Exchange(ctx context.Context, code string, verifier string) (*oauth2.Token, error)
	Refresh(ctx context.Context, refreshToken string) (*oauth2.Token, error)
	Profile(ctx context.Context, token *oauth2.Token, nonce string) (*Profile, error)
}

type StartOptions

type StartOptions struct {
	State        string
	Nonce        string
	PKCEVerifier string
	CallbackURL  string
	Scopes       []string
}

Jump to

Keyboard shortcuts

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