Documentation ¶
Index ¶
- Variables
- func FromContext(ctx context.Context) (int64, map[string]*http.Client)
- func GenerateSecret(n int) []byte
- type Auth
- func (a *Auth) AddProvider(id, clientID, clientSecret, redirectURL string, scopes []string)
- func (a *Auth) Auth(w http.ResponseWriter, r *http.Request)
- func (a *Auth) Clients(userID int64) (map[string]*http.Client, error)
- func (a *Auth) Middleware(next http.Handler) http.Handler
- func (a *Auth) SetCORS(cors string)
- func (a *Auth) Token(w http.ResponseWriter, r *http.Request)
- func (a *Auth) Validate(w http.ResponseWriter, r *http.Request) (int64, error)
- type Provider
- type ProviderFunc
- type ProviderItem
- type ProviderList
- type User
- type UserClaims
- type UserFunc
- type UserStore
Constants ¶
This section is empty.
Variables ¶
View Source
var Providers = map[string]ProviderFunc{ "google": Google, "facebook": Facebook, "github": GitHub, }
Functions ¶
func GenerateSecret ¶
GenerateSecret returns a byte slice of length n of cryptographically secure random data
Types ¶
type Auth ¶
type Auth struct {
// contains filtered or unexported fields
}
func (*Auth) AddProvider ¶
func (*Auth) Middleware ¶
Middleware provides authentication middleware for a http.HandlerFunc
type ProviderItem ¶
ProviderItem is the response for the List request
type ProviderList ¶
type ProviderList []ProviderItem
func (ProviderList) Len ¶
func (s ProviderList) Len() int
func (ProviderList) Less ¶
func (s ProviderList) Less(i, j int) bool
func (ProviderList) Swap ¶
func (s ProviderList) Swap(i, j int)
type UserClaims ¶
type UserClaims struct { User jwt.StandardClaims }
Click to show internal directories.
Click to hide internal directories.