auth

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2024 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAuthHeader        error = errors.New("invalid auth header")
	ErrMissingAuthHeader error = errors.New("missing auth header")
)

Functions

func AddAuthorizationHeader

func AddAuthorizationHeader(request *http.Request, sessionToken string)

Adds an authorization header to an HTTP request

func GetSessionTokenFromRequest

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

Gets the session token from a request

func GetSignatureForLogin

func GetSignatureForLogin(nonce string, nodeAddress common.Address, privateKey *ecdsa.PrivateKey) ([]byte, error)

Creates a signature for node registration

func GetSignatureForRegistration

func GetSignatureForRegistration(email string, nodeAddress common.Address, privateKey *ecdsa.PrivateKey, nodeRegistrationMessageFormat string) ([]byte, error)

Creates a signature for node registration

func VerifyLoginSignature

func VerifyLoginSignature(nonce string, nodeAddress common.Address, signature []byte) error

Verifies a signature for logging in

func VerifyRegistrationSignature

func VerifyRegistrationSignature(email string, nodeAddress common.Address, signature []byte, nodeRegistrationMessageFormat string) error

Verifies a signature for node registration

Types

This section is empty.

Jump to

Keyboard shortcuts

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