authentication

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: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthService

type AuthService interface {
	OAuthHandler
	CurrentUser(req *http.Request) (*User, error)
	LoadUserData(token *oauth2.Token, req *http.Request, res http.ResponseWriter) (*User, error)
}

An AuthService wraps OAuth and a access to the current user.

type OAuthHandler

type OAuthHandler interface {
	Start(res http.ResponseWriter, req *http.Request) error
	Callback(res http.ResponseWriter, req *http.Request, beforeWriteCallback func(*User) error) error
	Destroy(res http.ResponseWriter, req *http.Request) error
}

An OAuthHandler is responsible of providing the callbacks to interact with an OAuth provider.

type User

type User struct {
	AvatarURL string
	Login     string
	Email     string
}

A User is a convenient structure to hold user data coming from Github.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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