Merge pull request #3 from abdollar/master

GetSigningMethod only returns method - fixes failing tests with go 1.1.2
This commit is contained in:
Dave Grijalva 2013-12-02 13:37:07 -08:00
commit f4c00c0ac2
2 changed files with 4 additions and 4 deletions

View File

@ -38,7 +38,7 @@ func TestRS256Verify(t *testing.T) {
for _, data := range rsaTestData { for _, data := range rsaTestData {
parts := strings.Split(data.tokenString, ".") parts := strings.Split(data.tokenString, ".")
method, _ := GetSigningMethod("RS256") method := GetSigningMethod("RS256")
err := method.Verify(strings.Join(parts[0:2], "."), parts[2], key) err := method.Verify(strings.Join(parts[0:2], "."), parts[2], key)
if data.valid && err != nil { if data.valid && err != nil {
t.Errorf("[%v] Error while verifying key: %v", data.name, err) t.Errorf("[%v] Error while verifying key: %v", data.name, err)
@ -59,7 +59,7 @@ func TestRS256Sign(t *testing.T) {
for _, data := range rsaTestData { for _, data := range rsaTestData {
if data.valid { if data.valid {
parts := strings.Split(data.tokenString, ".") parts := strings.Split(data.tokenString, ".")
method, _ := GetSigningMethod("RS256") method := GetSigningMethod("RS256")
sig, err := method.Sign(strings.Join(parts[0:2], "."), key) sig, err := method.Sign(strings.Join(parts[0:2], "."), key)
if err != nil { if err != nil {
t.Errorf("[%v] Error signing token: %v", data.name, err) t.Errorf("[%v] Error signing token: %v", data.name, err)

View File

@ -37,7 +37,7 @@ func TestHS256Verify(t *testing.T) {
for _, data := range sha256TestData { for _, data := range sha256TestData {
parts := strings.Split(data.tokenString, ".") parts := strings.Split(data.tokenString, ".")
method, _ := GetSigningMethod("HS256") method := GetSigningMethod("HS256")
err := method.Verify(strings.Join(parts[0:2], "."), parts[2], sha256TestKey) err := method.Verify(strings.Join(parts[0:2], "."), parts[2], sha256TestKey)
if data.valid && err != nil { if data.valid && err != nil {
t.Errorf("[%v] Error while verifying key: %v", data.name, err) t.Errorf("[%v] Error while verifying key: %v", data.name, err)
@ -52,7 +52,7 @@ func TestHS256Sign(t *testing.T) {
for _, data := range sha256TestData { for _, data := range sha256TestData {
if data.valid { if data.valid {
parts := strings.Split(data.tokenString, ".") parts := strings.Split(data.tokenString, ".")
method, _ := GetSigningMethod("HS256") method := GetSigningMethod("HS256")
sig, err := method.Sign(strings.Join(parts[0:2], "."), sha256TestKey) sig, err := method.Sign(strings.Join(parts[0:2], "."), sha256TestKey)
if err != nil { if err != nil {
t.Errorf("[%v] Error signing token: %v", data.name, err) t.Errorf("[%v] Error signing token: %v", data.name, err)