auth

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2024 License: AGPL-3.0 Imports: 9 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, session *db.Session)

Adds an authorization header to an HTTP request

func GetSessionTokenFromRequest added in v0.2.0

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

Gets the session token from a request

func GetSignatureForLogin added in v0.2.0

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

Creates a signature for node registration

func GetSignatureForRegistration added in v0.2.0

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

Creates a signature for node registration

func VerifyLoginSignature added in v0.2.0

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

Verifies a signature for logging in

func VerifyRegistrationSignature added in v0.2.0

func VerifyRegistrationSignature(email string, nodeAddress common.Address, signature []byte) 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