auth

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package auth contains the api authentication mechanism.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EIP191Auth

func EIP191Auth(c *gin.Context, account string, deadline int64) (err error)

EIP191Auth implements ethereum signed message authentication middleware for gin rest api For auth, relayer should pass in eth signed message following eip-191 with the message as the current unix timestamp in seconds i.e. signature (hex encoded) = keccak(bytes.concat("\x19Ethereum Signed Message:\n", len(strconv.Itoa(time.Now().Unix()), strconv.Itoa(time.Now().Unix()))) so that full auth header string: auth = strconv.Itoa(time.Now().Unix()) + ":" + signature see: https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sign

Types

This section is empty.

Jump to

Keyboard shortcuts

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