Documentation ¶
Index ¶
- func CheckPasswordHash(password, hash string) bool
- func GenerateJWTToken(email string, groupId uint8, tenantSchema string) (string, string)
- func GetJSONFromMessagePackRequest(r *http.Request) (string, error)
- func GetJWTClaimsFromContext(ctx context.Context) (string, string, uint8)
- func GetJWTTokenAuthority() *jwtauth.JWTAuth
- func HashPassword(password string) (string, error)
- func Message(status bool, message string) map[string]interface{}
- func NewContextWithJWTToken(token string) context.Context
- func Respond(w http.ResponseWriter, data map[string]interface{})
- func VerifyToken(tokenStr string) (*jwt.Token, bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckPasswordHash ¶
func GenerateJWTToken ¶
Function will generate a unique JWT token with the claims data of holding the `userID` paramter.
func GetJWTClaimsFromContext ¶
Function used to extract the `email` from the JWT token that was passed in by the JWT middleware when a successful authentication happened.
func GetJWTTokenAuthority ¶
Function will either lazily create and return the JWT token authority object, or return the JWT token authority if it was previously created.
func HashPassword ¶
func NewContextWithJWTToken ¶
Function used to create a new context with the JWT authenticated `claims` already attached to the context. This function should be used in unit tests.
func Respond ¶
func Respond(w http.ResponseWriter, data map[string]interface{})
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.