Documentation ¶
Index ¶
- Constants
- func AbortRequest(c *gin.Context, code int, reason string, err error, log *zap.SugaredLogger)
- func CreateJWTToken(userID umid.UMID) (string, error)
- func GenerateChallenge(wallet string) (string, error)
- func GenerateGuestName(c *gin.Context, db database.DB) (string, error)
- func GetJWTSecret() ([]byte, error)
- func GetTokenFromContext(c *gin.Context) (jwt.Token, error)
- func GetTokenFromRequest(c *gin.Context) string
- func GetUserIDFromContext(c *gin.Context) (umid.UMID, error)
- func GetUserIDFromToken(token jwt.Token) (umid.UMID, error)
- func ValidateJWTWithSecret(signedString string, secret []byte) (*jwt.Token, error)
- func VerifyEthereumSignature(address string, challenge string, signature string) (bool, error)
- func VerifyPolkadotSignature(wallet, challenge, signature string) (bool, error)
- type HTTPError
- type HTTPErrorPayload
Constants ¶
View Source
const (
TokenContextKey = "token"
)
Variables ¶
This section is empty.
Functions ¶
func AbortRequest ¶
func CreateJWTToken ¶
CreateJWTToken saves a jwt token with the given userID as subject and signed with the given secret
func GenerateChallenge ¶
func GetJWTSecret ¶
func GetTokenFromRequest ¶
func ValidateJWTWithSecret ¶
func VerifyEthereumSignature ¶
func VerifyPolkadotSignature ¶
Types ¶
type HTTPError ¶
type HTTPError struct {
Error HTTPErrorPayload `json:"error"`
}
type HTTPErrorPayload ¶
Click to show internal directories.
Click to hide internal directories.