kawaiiauth

package
v0.0.0-...-031f79c Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseAdminToken

func ParseAdminToken(cfg config.IJwtConfig, tokenString string) (*kawaiiMapClaims, error)

func ParseApiKey

func ParseApiKey(cfg config.IJwtConfig, tokenString string) (*kawaiiMapClaims, error)

func ParseToken

func ParseToken(cfg config.IJwtConfig, tokenString string) (*kawaiiMapClaims, error)

func RepeatToken

func RepeatToken(cfg config.IJwtConfig, claims *users.UserClaims, exp int64) string

Types

type IKawaiiAdmin

type IKawaiiAdmin interface {
	SignToken() string
}

type IKawaiiApiKey

type IKawaiiApiKey interface {
	SignToken() string
}

type IKawaiiAuth

type IKawaiiAuth interface {
	SignToken() string
}

func NewKawaiiAuth

func NewKawaiiAuth(tokenType TokenType, cfg config.IJwtConfig, claims *users.UserClaims) (IKawaiiAuth, error)

type TokenType

type TokenType string
const (
	Access  TokenType = "access"
	Refresh TokenType = "refresh"
	Admin   TokenType = "admin"
	ApiKey  TokenType = "apikey"
)

Jump to

Keyboard shortcuts

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