github

package
v0.0.0-...-ed0f25c Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2017 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package github provides OKs and tokens for GitHub authentication.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Context

func Context(ctx context.Context, r *http.Request) context.Context

Context returns a context that is updated with a GitHub authentication token from the given HTTP request, if it exists.

func Show

func Show(ctx context.Context) (string, bool)

Show reports the value of the verified credentials, if any.

func VerifyLogin

func VerifyLogin(ok okay.OK, logins ...string) okay.OK

VerifyLogin returns an OK that will verify users by their GitHub login.

Types

type Config

type Config struct {
	ClientID     string
	ClientSecret string
	RedirectURI  string
	LogoutPath   string
}

func (*Config) RegisterHandlers

func (c *Config) RegisterHandlers(path string) error

RegisterHandlers registers GitHub authentication handlers. The given path is the landing URL to begin the sign-in flow, and the return handler is registered at the URL listed in the config.

Jump to

Keyboard shortcuts

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