Commit graph

14 commits

Author SHA1 Message Date
Vojtech Vitek
7ae401cf04 Update to github.com/go-chi/chi/v4 2019-01-08 18:40:54 -05:00
Jonathan ES Lin
ea7d7e213f Remove unnecessary code and clean up errors (#30)
* Initial refactor

* Fix some of the tests

* Handle more specific errors from jwt library

* Fix comments

* Rename package

* Verify signing algo after nil check
2018-09-26 10:43:54 -07:00
Peter Kieltyka
ace6ea2799 Lint fix, rename JwtAuth to JWTAuth 2017-11-26 10:34:54 -05:00
Emil Nikolov
050a030f1c Changed the expected key type from []byte to interface{} to match the method signatures of jwt-go and added a test (#22) 2017-10-10 06:26:11 -04:00
Peter Kieltyka
6444fb9aef Move Verifier method to pkg-level func to accept *jwtauth.JwtAuth 2017-07-06 18:09:09 -04:00
Peter Kieltyka
1e267ab0c7 Rename TokenContext method to FromContext 2017-07-06 15:23:11 -04:00
Peter Kieltyka
4c654d77d5 Refactor jwtauth pkg, move to go-chi org, and support dgrijalva/jwt-go v3 2017-07-05 17:05:27 -04:00
Vojtech Vitek (V-Teq)
c97496f7ab JWT Auth for go1.7 2016-07-11 17:51:29 -04:00
Hafiz Ismail
293f48cc84 Fixed an issue with panic error when token supplied was signed with a different
`alg` method than expected

```
	...
	token, err := ja.Decode(tokenStr)
	if err != nil || !token.Valid || token.Method != ja.signer {
		switch err.Error() { ... } // panic when `err == nil` but `token.Method != ja.signer`
		...
	}

```

Added test to cover this case.
2016-02-03 19:53:31 +08:00
Peter Kieltyka
b2ccd8612d Test status code in tests 2016-01-21 14:19:49 -05:00
Peter Kieltyka
2d088c1f3a Chi can chain middleware in one line, #fancy 2016-01-21 14:12:19 -05:00
Peter Kieltyka
4c4d95448b Use test secret 2016-01-21 14:09:44 -05:00
Peter Kieltyka
5230a789a2 Remove debug statements 2016-01-21 14:08:52 -05:00
Peter Kieltyka
a872c75843 Handler improvements, Claims type, expiry and tests 2016-01-21 14:00:36 -05:00