Skip to content

Commit

Permalink
cleanup and documentation updates
Browse files Browse the repository at this point in the history
  • Loading branch information
dgrijalva committed Aug 26, 2014
1 parent 23cb3af commit c9b532b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions VERSION_HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
* **Compatibility Breaking Changes**
* `SigningMethodHS256` is now `*SigningMethodHMAC` instead of `type struct`
* `SigningMethodRS256` is now `*SigningMethodRSA` instead of `type struct`
* `KeyFunc` now returns `interface{}` instead of `[]byte`
* `SigningMethod.Sign` now takes `interface{}` instead of `[]byte` for the key
* `SigningMethod.Verify` now takes `interface{}` instead of `[]byte` for the key
* Renamed type `SigningMethodHS256` to `SigningMethodHMAC`. Specific sizes are now just instances of this type.
* Added public package global `SigningMethodHS256`
* Added public package global `SigningMethodHS384`
Expand Down
5 changes: 5 additions & 0 deletions jwt.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ var TimeFunc = time.Now
// Header of the token (such as `kid`) to identify which key to use.
type Keyfunc func(*Token) (interface{}, error)

// Error constants
var (
ErrInvalidKey = errors.New("Key is invalid or of invalid type.")
)

// A JWT Token. Different fields will be used depending on whether you're
// creating or parsing/verifying a token.
type Token struct {
Expand Down
1 change: 0 additions & 1 deletion rsa.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ var (
SigningMethodRS256 *SigningMethodRSA
SigningMethodRS384 *SigningMethodRSA
SigningMethodRS512 *SigningMethodRSA
ErrInvalidKey = errors.New("An invalid key was passed. Expected a []byte")
)

func init() {
Expand Down

0 comments on commit c9b532b

Please sign in to comment.