auth

package
v0.0.0-...-64a0d4e Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2017 License: BSD-3-Clause Imports: 15 Imported by: 2

Documentation

Index

Constants

View Source
const (
	SessionKeyFmt    = "_auth_%s"
	ReturnQueryParam = "return"
)

Variables

View Source
var (
	UserSessionKey     = fmt.Sprintf(SessionKeyFmt, "user")
	ProviderSessionKey = fmt.Sprintf(SessionKeyFmt, "provider")
	ReturnSessionKey   = fmt.Sprintf(SessionKeyFmt, "return")
)

Functions

func Register

func Register(reg *objects.Registry)

Types

type Component

type Component struct {
	Log     log.DebugLogger  `com:"singleton"`
	Session sessions.Session `com:"singleton"`

	Config
}

func (*Component) CurrentUser

func (c *Component) CurrentUser(r *http.Request) *User

func (*Component) InitializeConfig

func (c *Component) InitializeConfig(cfg config.Settings) (err error)

func (*Component) LoginURL

func (c *Component) LoginURL(r *http.Request, providerName string, dest string) string

func (*Component) LogoutURL

func (c *Component) LogoutURL(r *http.Request, dest string) string

func (*Component) MatchHTTP

func (c *Component) MatchHTTP(r *http.Request) bool

func (*Component) ServeHTTP

func (c *Component) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Config

type Config struct {
	// base path to use for web endpoints
	BasePath string

	// TEMP
	ClientKey    string
	ClientSecret string
}

type Requestor

type Requestor interface {
	CurrentUser(r *http.Request) *User
	LoginURL(r *http.Request, destPath string, providerName string) string
	LogoutURL(r *http.Request, destPath string) string
}

type User

type User = goth.User

Directories

Path Synopsis
Package init is used to register the auth component with the default registry via side effect import.
Package init is used to register the auth component with the default registry via side effect import.

Jump to

Keyboard shortcuts

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