Documentation ¶
Overview ¶
package jwt provides an easy way to perform jwt based authentication for http handle func
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶ added in v0.0.4
type Manager interface { // Validate validates the token embedded in http.Request body and returns the registered // function to forward http request to. Validate(r *http.Request) error // NewHTTPHandler wraps input http handler into a closure such that jwt authentication // is enabled prior to execution of input handler. NewHTTPHandler(f func( w http.ResponseWriter, r *http.Request), ) func( w http.ResponseWriter, r *http.Request) // NewHTTPRequest provides a new http Request with token embedded in its header. // Authorization: Bearer <token> NewHTTPRequest(method, url string, claims map[string]interface{}, b []byte) (*http.Request, error) // GetToken gets a token string GetToken(claims map[string]interface{}) (string, error) // SetToken sets token for input http request SetToken(token string, req *http.Request) }
Manager defines the interface for jwt related methods
func NewManager ¶ added in v0.0.4
NewManager provides a new instance of jwt manager
type Option ¶ added in v0.0.7
type Option interface {
GetValue() interface{}
}
func EnforceExpiration ¶ added in v0.0.7
func EnforceExpiration() Option
func SetLifeSpan ¶ added in v0.0.7
Click to show internal directories.
Click to hide internal directories.