auth

package
v0.0.0-...-880b486 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2020 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithAuthedUser

func WithAuthedUser(ctx context.Context, user *DelphisAuthedUser) context.Context

Types

type DelphisAccessToken

type DelphisAccessToken struct {
	Claims      *JWTClaims
	TokenString string
}

type DelphisAuth

type DelphisAuth interface {
	NewAccessToken(userID string) (*DelphisAccessToken, error)
	NewRefreshToken(userID string) (*DelphisRefreshToken, error)
	ValidateAccessToken(ctx context.Context, token string) (*DelphisAuthedUser, error)
	ValidateRefreshToken(ctx context.Context, token string) (*DelphisRefreshTokenUser, error)
}

func NewDelphisAuth

func NewDelphisAuth(config *config.AuthConfig) DelphisAuth

type DelphisAuthedUser

type DelphisAuthedUser struct {
	UserID string
	User   *model.User
}

func GetAuthedUser

func GetAuthedUser(ctx context.Context) *DelphisAuthedUser

type DelphisRefreshToken

type DelphisRefreshToken struct {
	Claims      *JWTClaims
	TokenString string
}

type DelphisRefreshTokenUser

type DelphisRefreshTokenUser struct {
	UserID string
	User   *model.User
}

type JWTClaims

type JWTClaims struct {
	UserID      string
	ReAuthAfter int64
	jwt.StandardClaims
}

Jump to

Keyboard shortcuts

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