httpauth

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: May 11, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComparePassword added in v0.10.0

func ComparePassword(password string, hashedPass []byte) error

func ConvertToBase64

func ConvertToBase64()

func GenerateKey added in v0.11.0

func GenerateKey(key []byte) []byte

generating a 64 bytes key. why? see the function signMessage

func HashPassword added in v0.10.0

func HashPassword(password string) (hashedPass []byte, err error)

func Refresh added in v0.13.0

func Refresh(w http.ResponseWriter, r *http.Request)

func SignIn added in v0.13.0

func SignIn(w http.ResponseWriter, r *http.Request)

func Welcome added in v0.13.0

func Welcome(w http.ResponseWriter, r *http.Request)

Types

type Claims added in v0.13.0

type Claims struct {
	Username string `json:"username"`
	Password string `json:"password"`
	jwt.StandardClaims
}

type Credentials added in v0.13.0

type Credentials struct {
	Password string `json:"password"`
	Username string `json:"username"`
}

type UserClaims added in v0.12.0

type UserClaims struct {
	jwt.StandardClaims
	SessionID int64 `json:"session_id"`
}

func (*UserClaims) Valid added in v0.12.0

func (u *UserClaims) Valid() error

Jump to

Keyboard shortcuts

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