authentication

package
v0.0.0-...-3befcbb Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2023 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const MAX_BLOCK_AGE = 60 * 5

seconds

Variables

This section is empty.

Functions

func AuthenticatedHandler

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

func LoginHandler

func LoginHandler(client *ethclient.Client) func(w http.ResponseWriter, r *http.Request)

Validates signed payload with latest block number Block has to maximum MAX_BLOCK_AGE old

func LogoutHandler

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

Types

type LoginBody

type LoginBody struct {
	Message   string `json:"message"`
	Signature string `json:"signature"`
}

Jump to

Keyboard shortcuts

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