Documentation ¶
Index ¶
- Constants
- Variables
- func GetUID(c *server.Context) int32
- func InitHMACKey(key string)
- func JwtErrHandler(w http.ResponseWriter, r *http.Request, err string)
- func NewToken(uid int32) (string, string, error)
- func Skipper(path string) bool
- func WriteStatusAndDataJSON(ctx *server.Context, status int, data interface{}) error
- func WriteStatusAndIDJSON(ctx *server.Context, status int, id interface{}) error
Constants ¶
View Source
const ( InvalidUID = int32(-1) ClaimsKey = "user" )
Variables ¶
View Source
var ( // TokenHMACKey used to validate token. // Note: This variable must be initialized before attach JWT middleware // to HTTP Entrypoint. TokenHMACKey string // Defines a URL map to skip JWT validation on the specified route. URLMap map[string]struct{} )
Functions ¶
func JwtErrHandler ¶
func JwtErrHandler(w http.ResponseWriter, r *http.Request, err string)
JwtErrHandler -
func WriteStatusAndDataJSON ¶
WriteStatusAndDataJSON send JSON encoding status (and data) response. The data is optional.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.