auth_service

package
v0.0.0-...-a773fcb Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2022 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractToken

func ExtractToken(r *http.Request) string

get the token from the request body

func NewAuth

func NewAuth(client *redis.Client) auth_service.AuthInterface

func TokenValid

func TokenValid(r *http.Request) error

func VerifyToken

func VerifyToken(r *http.Request) (*jwt.Token, error)

Types

type ClientData

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

func (*ClientData) CreateAuth

func (tk *ClientData) CreateAuth(userid string, td *token_detail.TokenDetail) error

Save token metadata to Redis

func (*ClientData) DeleteRefresh

func (tk *ClientData) DeleteRefresh(refreshUuid string) error

func (*ClientData) DeleteTokens

func (tk *ClientData) DeleteTokens(authD *access_detail.AccessDetail) error

Once a user row in the token table

func (*ClientData) FetchAuth

func (tk *ClientData) FetchAuth(tokenUuid string) (uint64, error)

Check the metadata saved

type RedisService

type RedisService struct {
	Auth   auth_service.AuthInterface
	Client *redis.Client
}

func NewRedisService

func NewRedisService(client *redis.Client) *RedisService

type Token

type Token struct{}

func NewTokenService

func NewTokenService() *Token

func (*Token) CreateToken

func (t *Token) CreateToken(userid string) (*token_detail.TokenDetail, error)

func (*Token) ExtractTokenMetadata

func (t *Token) ExtractTokenMetadata(r *http.Request) (*access_detail.AccessDetail, error)

Jump to

Keyboard shortcuts

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