provider

package
v0.0.0-...-9fd81f0 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2021 License: AGPL-3.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SessionStoreKey  = "session"
	ProviderStoreKey = "provider"
	IDStoreKey       = "id"
	ValueStoreKey    = "value"

	CategoryKey               = "category"
	AutoRegistrationCookieKey = "autoregistration"
)

Variables

View Source
var (
	ErrNoAutoRegistrationKey = errors.New("no autoregistration key was provided")
)

Functions

func Callback

func Callback(env *env.Env, w http.ResponseWriter, r *http.Request)

func NewSAMLProvider

func NewSAMLProvider(env *env.Env) (*samlsp.Middleware, error)

Types

type AutoRegistrationCookieStruct

type AutoRegistrationCookieStruct struct {
	Provider Provider
	User     *model.User
	Val      interface{}
}

type GitHub

type GitHub struct{}

GitHub implements the service provider for github.com

func (GitHub) Callback

func (g GitHub) Callback(env *env.Env, w http.ResponseWriter, r *http.Request)

func (GitHub) Get

func (g GitHub) Get(env *env.Env, u *model.User, val interface{}) error

TOOD: Groups / Organizations and stuff

func (GitHub) Login

func (g GitHub) Login(env *env.Env, w http.ResponseWriter, r *http.Request)

func (GitHub) NewSession

func (g GitHub) NewSession(env *env.Env, w http.ResponseWriter, r *http.Request, u *model.User, val interface{})

func (GitHub) String

func (GitHub) String() string

type Google

type Google struct{}

func (Google) Callback

func (Google) Callback(env *env.Env, w http.ResponseWriter, r *http.Request)

func (Google) Get

func (g Google) Get(env *env.Env, u *model.User, val interface{}) error

func (Google) Login

func (g Google) Login(env *env.Env, w http.ResponseWriter, r *http.Request)

func (Google) NewSession

func (g Google) NewSession(env *env.Env, w http.ResponseWriter, r *http.Request, u *model.User, val interface{})

func (Google) String

func (Google) String() string

type Local

type Local struct{}

func (Local) Callback

func (l Local) Callback(env *env.Env, w http.ResponseWriter, r *http.Request)

func (Local) Get

func (l Local) Get(env *env.Env, u *model.User, val interface{}) error

func (Local) Login

func (l Local) Login(env *env.Env, w http.ResponseWriter, r *http.Request)

func (Local) NewSession

func (l Local) NewSession(env *env.Env, w http.ResponseWriter, r *http.Request, u *model.User, val interface{})

func (Local) String

func (Local) String() string

type Provider

type Provider interface {
	// TODO: Context
	Get(env *env.Env, u *model.User, val interface{}) error
	Login(env *env.Env, w http.ResponseWriter, r *http.Request)
	Callback(env *env.Env, w http.ResponseWriter, r *http.Request)
	NewSession(env *env.Env, w http.ResponseWriter, r *http.Request, u *model.User, val interface{})
	String() string
}

func FromString

func FromString(p string) Provider

type SAML

type SAML struct{}

func (SAML) Callback

func (s SAML) Callback(env *env.Env, w http.ResponseWriter, r *http.Request)

func (SAML) Get

func (s SAML) Get(env *env.Env, u *model.User, val interface{}) error

func (SAML) Login

func (s SAML) Login(env *env.Env, w http.ResponseWriter, r *http.Request)

func (SAML) NewSession

func (s SAML) NewSession(env *env.Env, w http.ResponseWriter, r *http.Request, u *model.User, val interface{})

func (SAML) String

func (SAML) String() string

type Unknown

type Unknown struct{}

func (Unknown) Callback

func (Unknown) Callback(env *env.Env, w http.ResponseWriter, r *http.Request)

func (Unknown) Get

func (Unknown) Get(env *env.Env, u *model.User, val interface{}) error

func (Unknown) Login

func (Unknown) Login(env *env.Env, w http.ResponseWriter, r *http.Request)

func (Unknown) NewSession

func (Unknown) NewSession(env *env.Env, w http.ResponseWriter, r *http.Request, u *model.User, val interface{})

func (Unknown) String

func (Unknown) String() string

Jump to

Keyboard shortcuts

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