auth

package
v0.0.0-...-65de388 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2023 License: MIT Imports: 9 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAuth

func NewAuth(client *redis.Client) *service

func NewToken

func NewToken() *tokenservice

func TokenValid

func TokenValid(r *http.Request) error

Types

type AccessDetails

type AccessDetails struct {
	TokenUuid string
	UserId    string
}

type AuthInterface

type AuthInterface interface {
	CreateAuth(string, *TokenDetails) error
	FetchAuth(string) (string, error)
	DeleteRefresh(string) error
	DeleteTokens(*AccessDetails) error
}

type TokenDetails

type TokenDetails struct {
	AccessToken  string
	RefreshToken string
	TokenUuid    string
	RefreshUuid  string
	AtExpires    int64
	RtExpires    int64
}

type TokenInterface

type TokenInterface interface {
	CreateToken(userId string) (*TokenDetails, error)
	ExtractTokenMetadata(*http.Request) (*AccessDetails, error)
}

Jump to

Keyboard shortcuts

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