auth

package
v0.0.0-...-ed3c475 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2020 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppleAuthorizeURL

func AppleAuthorizeURL(redirectURI string, clientID string) string

func GenerateAppleClientSecret

func GenerateAppleClientSecret(ctx context.Context, conf *config.Config) (*string, error)

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