Documentation ¶
Index ¶
- Constants
- Variables
- func IsTimeOutErr(err error) bool
- func Parse(token string) (interface{}, error)
- func ParseRequest(req *http.Request) (interface{}, error)
- func ParseResponse(resp *http.Response) (interface{}, error)
- func SetHTTPHeaderKey(key string)
- func Sign(kid string, arg interface{}, minutes int) (string, error)
- func SignRequest(req *http.Request, kid string, arg interface{}, minutes int) error
- func SignResponse(rw http.ResponseWriter, kid string, arg interface{}, minutes int) error
- type Config
Constants ¶
View Source
const ( DEFAULT_KID_HMAC string = "hmac_default" DEFAULT_KID_RSA = "rsa_default" )
View Source
const ( KID = "kid" ARG = "arg" EXP = "exp" )
View Source
const ( TagHmac string = StringHmac TagRSA = StringRSA )
Variables ¶
View Source
var ( ErrInit error = errors.New("jwt: Fail to initialize jwt") ErrNil = errors.New("jwt: This is nil") )
View Source
var ( ErrToken error = errors.New("jwt: That's not even a token") ErrTokenExpired = errors.New("jwt: Token is expired") ErrTokenNotActive = errors.New("jwt: Token is not active yet") ErrRequest = errors.New("jwt: Request error") ErrResponse = errors.New("jwt: Response error") )
Functions ¶
func IsTimeOutErr ¶
func ParseRequest ¶
Parse http request, validate, and return a token.
func ParseResponse ¶
Parse http response, validate, and return a token.
func SetHTTPHeaderKey ¶
func SetHTTPHeaderKey(key string)
set key and prefix value in http.Request header entries
func SignRequest ¶
Generate the signing string, and set into http request
func SignResponse ¶
func SignResponse(rw http.ResponseWriter, kid string, arg interface{}, minutes int) error
Generate the signing string, and set into http response writer
Types ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.