Documentation ¶
Index ¶
- Constants
- Variables
- func DB() *cache.Cache
- func GetUserFromJWT(token interface{}) string
- func NewChallenge(address string) (string, error)
- func NewJWT(user string, expTime int64, hexKey string) (string, error)
- func ParseHexKey(hexKey string) (*ecdsa.PrivateKey, error)
- func VerifyChallenge(address string, signature string) (string, error)
- type Challenge
Constants ¶
View Source
const ( // ErrChallengeNotFound error message ErrChallengeNotFound = "Could not find a matching challenge for this address." // ErrChallengeBadRequest error message ErrChallengeBadRequest = "No address or signature provided when attempting to prove the challenge." )
Variables ¶
View Source
var ( // JWTExpiration describes how long the token should be valid, in hours JWTExpiration = time.Duration(time.Hour * 48) )
Functions ¶
func GetUserFromJWT ¶
func GetUserFromJWT(token interface{}) string
GetUserFromJWT checks if the auth token is valid
func NewChallenge ¶
NewChallenge prepares a new challenge message to be signed by the user client-side, using Web3.
func ParseHexKey ¶
func ParseHexKey(hexKey string) (*ecdsa.PrivateKey, error)
ParseHexKey parses a key in hexa (string) into an ECDSA private key
Types ¶
Click to show internal directories.
Click to hide internal directories.