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: 0

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