Documentation
¶
Index ¶
- func Authorize(w http.ResponseWriter, r *http.Request, jwtSigningKey, expectedAPIKey string, ...)
- func JWT(username string, userID int64, accounts map[int64]string, jwtKey string) (token string, err error)
- func Log(next http.Handler) http.Handler
- func Param(r *http.Request, name string) string
- func UserID(r *http.Request) int64
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Authorize ¶
func Authorize(w http.ResponseWriter, r *http.Request, jwtSigningKey, expectedAPIKey string, next http.Handler)
Authorize validates the JWT, or API key if caller is a Kenza service, and makes claims available for downstream handlers.
func JWT ¶
func JWT(username string, userID int64, accounts map[int64]string, jwtKey string) (token string, err error)
JWT signs a new JWT with the parameters as claims (plus some standard claims).
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.