Documentation ¶
Index ¶
Constants ¶
View Source
const ChallengeExpirationDelta = 5 * time.Minute
Variables ¶
View Source
var ( ErrChallengeWasNotRequested = errors.New("challenge was not requested") ErrChallengeExpired = errors.New("challenge expired") ErrDecodeHex = errors.New("failed to decode hex string") ErrBadLength = errors.New("bad signature length") ErrBadRecoverByte = errors.New("bad recovery byte") ErrMissMatched = errors.New("recovered address didn't match any of the given ones") )
View Source
var AddressRegexp = regexp.MustCompile("^0x[0-9a-fA-F]{40}$")
View Source
var SHA256HexRegexp = regexp.MustCompile("^0x[0-9a-fA-F]{64}$")
View Source
var SignatureRegexp = regexp.MustCompile("^0x[0-9a-fA-F]{130}$")
Functions ¶
func ChallengeToHash ¶
func DecodeSignature ¶
Types ¶
type AuthVerifier ¶
type AuthVerifier struct { Disabled bool // contains filtered or unexported fields }
func (*AuthVerifier) VerifySignature ¶
func (v *AuthVerifier) VerifySignature(signature string, address string) error
type AuthVerifierer ¶
type AuthVerifierer interface {
AuthVerifier() *AuthVerifier
}
func NewAuthVerifierer ¶
func NewAuthVerifierer(getter kv.Getter) AuthVerifierer
Click to show internal directories.
Click to hide internal directories.