authorization

package
v0.0.0-...-1ce29ab Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2022 License: Unlicense Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authenticator

type Authenticator interface {
	Authenticate(ctx context.Context, phone, code string) error
	VerifyPhone(ctx context.Context, phone string) error
}

type Authorizer

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

func New

func New(log *logrus.Logger, auth Authenticator, key string) *Authorizer

func (*Authorizer) GetToken

func (a *Authorizer) GetToken(uuid string) (string, error)

func (*Authorizer) ParseToken

func (a *Authorizer) ParseToken(accessToken string) (string, error)

func (*Authorizer) SignIn

func (a *Authorizer) SignIn(ctx context.Context, user *models.User, code string) (string, error)

func (*Authorizer) StartAuthentication

func (a *Authorizer) StartAuthentication(ctx context.Context, user *models.User) error

type Claims

type Claims struct {
	jwt.StandardClaims
	UUID string `json:"uuid"`
}

Jump to

Keyboard shortcuts

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