security

package
v0.0.0-...-05e6c51 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractTokenFromHeader

func ExtractTokenFromHeader(r *http.Request) (string, error)

func HashPassword

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

func NewAccessToken

func NewAccessToken(claims model.Player) (string, error)

func ParseAccessToken

func ParseAccessToken(accessToken string) *model.Player

Types

type RoleGuard

type RoleGuard struct {
	AllowedRoles []string
	Handler      http.Handler
}

func (*RoleGuard) ServeHTTP

func (rg *RoleGuard) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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