github

package
v0.33.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package github implements an auth provider and backend that identifies a user via github account.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Keyring    keyring.Keyring
	NonceStore *nonce.Store
}

Config is used to configure the GitHub OAuth2 provider. If none of Organization, Teams, or Users are specified as criteria, any valid user will be accepted.

type Provider

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

Provider will respond to /auth and /callback endpoints for the purposes of GitHub OAuth2 authentication.

func NewProvider

func NewProvider(ctx context.Context, c *Config) (*Provider, error)

NewProvider will validate Config and create a new Provider. If Enabled is false, validation will be skipped.

func (*Provider) ExtractIdentity

func (p *Provider) ExtractIdentity(route *auth.RouteInfo, w http.ResponseWriter, req *http.Request) (*auth.Identity, error)

ExtractIdentity implements the auth.IdentityProvider interface handling both auth and callback endpoints.

func (Provider) Info

Info implements the auth.Provider interface.

Jump to

Keyboard shortcuts

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