github_auth

package
v0.0.0-...-6972059 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2021 License: GPL-3.0 Imports: 12 Imported by: 1 module, 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

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

TODO wrap in a config struct?

func New

func New(serverSecret string, clientID string, clientSecret string, logger zerolog.Logger) *Handler

func (*Handler) Callback

func (h *Handler) Callback(res http.ResponseWriter, req *http.Request, beforeWriteCallback func(*authentication.User) error) error

func (*Handler) CurrentUser

func (h *Handler) CurrentUser(req *http.Request) (*authentication.User, error)

func (*Handler) Destroy

func (h *Handler) Destroy(res http.ResponseWriter, req *http.Request) error

func (*Handler) LoadUserData

func (h *Handler) LoadUserData(accessToken *oauth2.Token, req *http.Request, res http.ResponseWriter) (*authentication.User, error)

TODO comment that properly side effect: load into session returns what was stored in the session

func (*Handler) Start

func (h *Handler) Start(res http.ResponseWriter, req *http.Request) error

Jump to

Keyboard shortcuts

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