auth

package
v0.0.0-...-46354e0 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: Apache-2.0 Imports: 9 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthorizeRequest

func AuthorizeRequest(next http.Handler) http.Handler

AuthorizeRequest Middleware validates JWT tokens from incoming HTTP requests.

func GenerateJWT

func GenerateJWT(name, role string) (string, error)

GenerateJWT generates a new JWT token for authenticated user.

func InitRSAKeys

func InitRSAKeys()

InitRSAKeys reads the key files to be used for JWT

Types

type AppClaims

type AppClaims struct {
	UserName string `json:"username"`
	Role     string `json:"role"`
	jwt.StandardClaims
}

AppClaims provides custom claim for JWT

Jump to

Keyboard shortcuts

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