jwtk

package
v0.0.0-...-7bd48cf Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Verify

func Verify(accessSecret string, redis *redis.Client, r *http.Request) (*http.Request, error)

Types

type Config

type Config struct {
	AccessSecret  string        `json:",optional"`
	AccessExpire  time.Duration `json:",optional,default=1h"`
	RefreshExpire time.Duration `json:",optional,default=720h"`
	ExcludePaths  []string      `json:",optional"`
}

type Token

type Token struct {
	AccessToken  string
	RefreshToken string
}

func New

func New(accessSecret string, accessExpire, refreshExpire time.Duration, redis *redis.Client, fields map[string]any) (*Token, error)

func Refresh

func Refresh(accessSecret, accessToken, refreshToken string, accessExpire, refreshExpire time.Duration, redis *redis.Client) (*Token, error)

Jump to

Keyboard shortcuts

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