util

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExpireWebauthnSession

func ExpireWebauthnSession(session *sessions.Session, r *http.Request, w http.ResponseWriter)

ExpireWebauthnSession invalidate session by expiring cookie

func FetchWebauthnSession

func FetchWebauthnSession(session *sessions.Session, key string, r *http.Request) (webauthn.SessionData, error)

Fetch webauthn session data from session store

func GenChallenge

func GenChallenge() string

Generate crytographically secure challenge

func GetUserIP

func GetUserIP(r *http.Request) string

GetUserIP return user IP address

func GetUsername

func GetUsername(r *http.Request, regex string) (string, error)

Get "username" query param and validate against supplied regex

func JSONResponse

func JSONResponse(w http.ResponseWriter, d interface{}, c int)

Marshal object to JSON and write response

func PrettyPrint

func PrettyPrint(data interface{})

func SaveWebauthnSession

func SaveWebauthnSession(session *sessions.Session, key string, sessionData *webauthn.SessionData, r *http.Request, w http.ResponseWriter) error

Save webauthn session data to session store

func SetupLogging

func SetupLogging(name, loggingLevel string) *logrus.Entry

SetupLogging setup logger

Types

This section is empty.

Jump to

Keyboard shortcuts

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