auth

package
v0.0.0-...-e218867 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrPermissionDenied = status.Errorf(codes.PermissionDenied, "Permission Denied")

Functions

This section is empty.

Types

type Auth

type Auth interface {
	GenerateToken(email string, exp time.Duration) (string, error)
	ValidateToken(token string) (string, error)
}

func New

func New(privateKey *rsa.PrivateKey, publicKey *rsa.PublicKey) Auth

func NewFake

func NewFake() Auth

type Fake

type Fake struct{}

func (*Fake) GenerateToken

func (*Fake) GenerateToken(email string, exp time.Duration) (string, error)

func (*Fake) ValidateToken

func (*Fake) ValidateToken(token string) (string, error)

type JWTAuth

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

func (*JWTAuth) GenerateToken

func (a *JWTAuth) GenerateToken(email string, exp time.Duration) (string, error)

func (*JWTAuth) ValidateToken

func (a *JWTAuth) ValidateToken(token string) (string, error)

Jump to

Keyboard shortcuts

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