security

package
v0.0.0-...-cef7651 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(encoded string) ([]byte, error)

func Encode

func Encode(data []byte) string

func GenerateJWT

func GenerateJWT(data JWTData) (string, error)

func HashRefreshToken

func HashRefreshToken(token string, hashCost int) (string, error)

func ValidateRefreshToken

func ValidateRefreshToken(token, hashedToken string) bool

Types

type JWTData

type JWTData struct {
	IP        string
	GUID      string
	Value     string
	SecretKey string
	Algorithm string
	TTL       time.Duration
}

func ParseJWT

func ParseJWT(tokenString, secretKey string) (*JWTData, error)

Jump to

Keyboard shortcuts

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