auth

package
v0.0.0-...-b5dad65 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth struct {
	AuthKey               rsa.PrivateKey
	JWTExpirationDuration time.Duration
}

func NewAuth

func NewAuth(config AuthConfig) (*Auth, error)

func (Auth) GenerateToken

func (auth Auth) GenerateToken(username string) (string, error)

func (Auth) VerifyToken

func (auth Auth) VerifyToken(tokenString string) (string, error)

type AuthConfig

type AuthConfig struct {
	AuthKeyLocation       string        `json:"authKeyLocation"`
	JWTExpirationDuration time.Duration `json:"jwtExpirationDuration"`
}

Jump to

Keyboard shortcuts

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