This commit is contained in:
Dave Grijalva 2012-04-18 12:59:37 -07:00
parent c416da491f
commit 0008f0b730
5 changed files with 54 additions and 55 deletions

7
jwt.go
View File

@ -1,12 +1,12 @@
package jwt package jwt
import ( import (
"strings"
"errors"
"encoding/base64" "encoding/base64"
"encoding/json" "encoding/json"
"time" "errors"
"net/http" "net/http"
"strings"
"time"
) )
// A JWT Token // A JWT Token
@ -77,7 +77,6 @@ func Parse(tokenString string, keyFunc func(*Token)([]byte, error)) (token *Toke
return return
} }
func ParseFromRequest(req *http.Request, keyFunc func(*Token) ([]byte, error)) (token *Token, err error) { func ParseFromRequest(req *http.Request, keyFunc func(*Token) ([]byte, error)) (token *Token, err error) {
// Look for an Authorization header // Look for an Authorization header

View File

@ -1,13 +1,13 @@
package jwt package jwt
import ( import (
"os"
"io"
"bytes" "bytes"
"testing"
"reflect"
"fmt" "fmt"
"io"
"net/http" "net/http"
"os"
"reflect"
"testing"
) )
var jwtTestData = []struct { var jwtTestData = []struct {

View File

@ -1,12 +1,12 @@
package jwt package jwt
import ( import (
"errors"
"encoding/pem"
"crypto" "crypto"
"crypto/x509"
"crypto/rsa" "crypto/rsa"
"crypto/sha256" "crypto/sha256"
"crypto/x509"
"encoding/pem"
"errors"
) )
type SigningMethodRS256 struct{} type SigningMethodRS256 struct{}

View File

@ -1,11 +1,11 @@
package jwt package jwt
import ( import (
"os"
"io"
"bytes" "bytes"
"testing" "io"
"os"
"strings" "strings"
"testing"
) )
var rsaTestData = []struct { var rsaTestData = []struct {

View File

@ -1,8 +1,8 @@
package jwt package jwt
import ( import (
"fmt"
"errors" "errors"
"fmt"
) )
var signingMethods = map[string]func() SigningMethod{} var signingMethods = map[string]func() SigningMethod{}