From fbcdf70c52c155ae9aa58e72ee0532fa2f1cad2e Mon Sep 17 00:00:00 2001 From: Vishal Rana Date: Thu, 16 Jun 2016 14:40:43 -0700 Subject: [PATCH] Update JWT lib to v3 Signed-off-by: Vishal Rana --- glide.lock | 12 ++++++------ middleware/jwt_test.go | 3 ++- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/glide.lock b/glide.lock index 1de37383..f81f8a52 100644 --- a/glide.lock +++ b/glide.lock @@ -1,12 +1,12 @@ hash: 21820434709470e49c64df0f854d3352088ca664d193e29bc6cd434518c27a7c -updated: 2016-06-11T08:07:31.375646661-07:00 +updated: 2016-06-16T14:30:17.695241955-07:00 imports: - name: github.com/davecgh/go-spew version: 5215b55f46b2b919f50a1df0eaa5886afe4e3b3d subpackages: - spew - name: github.com/dgrijalva/jwt-go - version: c04502f106d7c5b3fae17c5da49a1bbdd3006b3c + version: d2709f9f1f31ebcda9651b03077758c1f3a0018c - name: github.com/klauspost/compress version: 14eb9c4951195779ecfbec34431a976de7335b0a subpackages: @@ -32,22 +32,22 @@ imports: subpackages: - difflib - name: github.com/stretchr/testify - version: 8d64eb7173c7753d6419fd4a9caf057398611364 + version: d77da356e56a7428ad25149ca77381849a6a5232 subpackages: - assert - name: github.com/valyala/fasthttp - version: 8db7d05839b5f4d21d5da1fcb3897d294ff6fd9f + version: 83a24c301bb683e450cd0304a3eb69556c48678c subpackages: - fasthttputil - name: github.com/valyala/fasttemplate version: 3b874956e03f1636d171bda64b130f9135f42cff - name: golang.org/x/net - version: 3f122ce3dbbe488b7e6a8bdb26f41edec852a40b + version: d7bf3545bb0dacf009c535b3d3fbf53ac0a339ab subpackages: - context - websocket - name: golang.org/x/sys - version: 7f918dd405547ecb864d14a8ecbbfe205b5f930f + version: 62bee037599929a6e9146f29d10dd5208c43507d subpackages: - unix devImports: [] diff --git a/middleware/jwt_test.go b/middleware/jwt_test.go index 5debc969..e35e6d3e 100644 --- a/middleware/jwt_test.go +++ b/middleware/jwt_test.go @@ -45,7 +45,8 @@ func TestJWT(t *testing.T) { h = JWT([]byte("secret"))(handler) if assert.NoError(t, h(c)) { user := c.Get("user").(*jwt.Token) - assert.Equal(t, user.Claims["name"], "John Doe") + claims := user.Claims.(jwt.MapClaims) + assert.Equal(t, claims["name"], "John Doe") } // Invalid Authorization header