Documentation ¶
Overview ¶
Package auth contains the api authentication mechanism.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EIP191Auth ¶
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.
Click to show internal directories.
Click to hide internal directories.