core

package
v0.0.0-...-ee3fdc8 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModeProd = "prod"
	ModeDev  = "dev"
)
View Source
const Version = "v0.3.0"

Variables

This section is empty.

Functions

func ErrorHandler

func ErrorHandler(next clevergo.Handle) clevergo.Handle

func IsDevelopMode

func IsDevelopMode() bool

Types

type Authenticator

type Authenticator struct {
	Provider *oidc.Provider
	Config   oauth2.Config
	Ctx      context.Context
}

func NewAuthenticator

func NewAuthenticator(ctx context.Context) (*Authenticator, error)

type Handler

type Handler interface {
	Register(clevergo.Router)
}

type SessionAuthenticator

type SessionAuthenticator struct {
	// contains filtered or unexported fields
}

func NewSessionAuthenticator

func NewSessionAuthenticator(sessionManager *scs.SessionManager) *SessionAuthenticator

func (*SessionAuthenticator) Authenticate

Authenticates the current user.

func (*SessionAuthenticator) Challenge

Challenge generates challenges upon authentication failure.

type User

type User struct {
	jwt.StandardClaims
	Email         string `json:"email"`
	EmailVerified bool   `json:"email_verified"`
	Name          string `json:"name"`
	Nickname      string `json:"nickname"`
	Picture       string `json:"picture"`
	AccessToken   string `json:"-"`
	IDToken       string `json:"-"`
}

func (User) Expired

func (u User) Expired() bool

func (User) GetID

func (u User) GetID() string

Jump to

Keyboard shortcuts

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