Versions in this module Expand all Collapse all v0 v0.4.0 Aug 11, 2020 Changes in this version + const ETHAuthPrefix + const ETHAuthVersion + const IsValidSignatureBytes32MagicValue + func Base64UrlDecode(s string) ([]byte, error) + func Base64UrlEncode(s []byte) string + func ValidateContractAccountProof(ctx context.Context, provider *ethrpc.Provider, chainID *big.Int, proof *Proof) (bool, string, error) + func ValidateEOAProof(ctx context.Context, provider *ethrpc.Provider, chainID *big.Int, proof *Proof) (bool, string, error) + func ValidateEOASignature(address string, message []byte, signatureHex string) (bool, error) + type Claims struct + App string + ETHAuthVersion string + ExpiresAt int64 + IssuedAt int64 + Nonce uint64 + Origin string + Type string + func (c *Claims) SetExpiryIn(tm time.Duration) + func (c *Claims) SetIssuedAtNow() + func (c Claims) Map() map[string]interface{} + func (c Claims) MessageDigest() ([]byte, error) + func (c Claims) TypedData() (*ethcoder.TypedData, error) + func (c Claims) Valid() error + type ETHAuth struct + func New(validators ...ValidatorFunc) (*ETHAuth, error) + func (w *ETHAuth) ConfigJsonRpcProvider(ethereumJsonRpcURL string, optChainId ...int64) error + func (w *ETHAuth) ConfigValidators(validators ...ValidatorFunc) error + func (w *ETHAuth) DecodeProof(proofString string) (bool, *Proof, error) + func (w *ETHAuth) EncodeProof(proof *Proof) (string, error) + func (w *ETHAuth) ValidateProof(proof *Proof) (bool, error) + func (w *ETHAuth) ValidateProofClaims(proof *Proof) (bool, error) + func (w *ETHAuth) ValidateProofSignature(proof *Proof) bool + func (w *ETHAuth) Validators() []ValidatorFunc + type Proof struct + Address string + Claims Claims + Extra string + Prefix string + Signature string + func NewProof() *Proof + func (t *Proof) MessageDigest() ([]byte, error) + func (t *Proof) MessageTypedData() (*ethcoder.TypedData, error) + type ValidatorFunc func(ctx context.Context, provider *ethrpc.Provider, chainID *big.Int, proof *Proof) (bool, string, error)