Skip to content

Commit 6a07921

Browse files
Enable go module support for the project (#3)
* initial go module file Signed-off-by: sadmansakib <[email protected]> * fix linting issues Signed-off-by: sadmansakib <[email protected]> * rename module to golang-jwt/jwt Signed-off-by: sadmansakib <[email protected]> * Renamed imports to match with go module name. Signed-off-by: sadmansakib <[email protected]> * update travis for latest go versions Signed-off-by: sadmansakib <[email protected]> * Set go version to 1.14 lowered the go version to make it consistent with matrix build * revert accidental changes while renaming Signed-off-by: sadmansakib <[email protected]> * remove travis CI no longer needed since github actions workflow was created for the project Signed-off-by: sadmansakib <[email protected]> * Revert "remove travis CI" This reverts commit b3ae57f. * update travis for older go versions
1 parent fb1de35 commit 6a07921

17 files changed

+40
-31
lines changed

.travis.yml

-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,3 @@ go:
99
- 1.8
1010
- 1.9
1111
- 1.10
12-
- tip

README.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# jwt-go
22

33
[![Build Status](https://travis-ci.org/dgrijalva/jwt-go.svg?branch=master)](https://travis-ci.org/dgrijalva/jwt-go)
4-
[![GoDoc](https://godoc.org/github.com/dgrijalva/jwt-go?status.svg)](https://godoc.org/github.com/dgrijalva/jwt-go)
4+
[![GoDoc](https://godoc.org/github.com/golang-jwt/jwt?status.svg)](https://godoc.org/github.com/golang-jwt/jwt)
55

66
A [go](http://www.golang.org) (or 'golang' for search engine friendliness) implementation of [JSON Web Tokens](http://self-issued.info/docs/draft-ietf-oauth-json-web-token.html)
77

@@ -27,11 +27,11 @@ This library supports the parsing and verification as well as the generation and
2727

2828
## Examples
2929

30-
See [the project documentation](https://godoc.org/github.com/dgrijalva/jwt-go) for examples of usage:
30+
See [the project documentation](https://godoc.org/github.com/golang-jwt/jwt) for examples of usage:
3131

32-
* [Simple example of parsing and validating a token](https://godoc.org/github.com/dgrijalva/jwt-go#example-Parse--Hmac)
33-
* [Simple example of building and signing a token](https://godoc.org/github.com/dgrijalva/jwt-go#example-New--Hmac)
34-
* [Directory of Examples](https://godoc.org/github.com/dgrijalva/jwt-go#pkg-examples)
32+
* [Simple example of parsing and validating a token](https://godoc.org/github.com/golang-jwt/jwt#example-Parse--Hmac)
33+
* [Simple example of building and signing a token](https://godoc.org/github.com/golang-jwt/jwt#example-New--Hmac)
34+
* [Directory of Examples](https://godoc.org/github.com/golang-jwt/jwt#pkg-examples)
3535

3636
## Extensions
3737

@@ -49,7 +49,7 @@ This library was last reviewed to comply with [RTF 7519](http://www.rfc-editor.o
4949

5050
This library is considered production ready. Feedback and feature requests are appreciated. The API should be considered stable. There should be very few backwards-incompatible changes outside of major version updates (and only with good reason).
5151

52-
This project uses [Semantic Versioning 2.0.0](http://semver.org). Accepted pull requests will land on `master`. Periodically, versions will be tagged from `master`. You can find all the releases on [the project releases page](https://github.com/dgrijalva/jwt-go/releases).
52+
This project uses [Semantic Versioning 2.0.0](http://semver.org). Accepted pull requests will land on `master`. Periodically, versions will be tagged from `master`. You can find all the releases on [the project releases page](https://github.com/golang-jwt/jwt/releases).
5353

5454
While we try to make it obvious when we make breaking changes, there isn't a great mechanism for pushing announcements out to users. You may want to use this alternative package include: `gopkg.in/dgrijalva/jwt-go.v3`. It will do the right thing WRT semantic versioning.
5555

@@ -79,9 +79,9 @@ Asymmetric signing methods, such as RSA, use different keys for signing and veri
7979

8080
Each signing method expects a different object type for its signing keys. See the package documentation for details. Here are the most common ones:
8181

82-
* The [HMAC signing method](https://godoc.org/github.com/dgrijalva/jwt-go#SigningMethodHMAC) (`HS256`,`HS384`,`HS512`) expect `[]byte` values for signing and validation
83-
* The [RSA signing method](https://godoc.org/github.com/dgrijalva/jwt-go#SigningMethodRSA) (`RS256`,`RS384`,`RS512`) expect `*rsa.PrivateKey` for signing and `*rsa.PublicKey` for validation
84-
* The [ECDSA signing method](https://godoc.org/github.com/dgrijalva/jwt-go#SigningMethodECDSA) (`ES256`,`ES384`,`ES512`) expect `*ecdsa.PrivateKey` for signing and `*ecdsa.PublicKey` for validation
82+
* The [HMAC signing method](https://godoc.org/github.com/golang-jwt/jwt#SigningMethodHMAC) (`HS256`,`HS384`,`HS512`) expect `[]byte` values for signing and validation
83+
* The [RSA signing method](https://godoc.org/github.com/golang-jwt/jwt#SigningMethodRSA) (`RS256`,`RS384`,`RS512`) expect `*rsa.PrivateKey` for signing and `*rsa.PublicKey` for validation
84+
* The [ECDSA signing method](https://godoc.org/github.com/golang-jwt/jwt#SigningMethodECDSA) (`ES256`,`ES384`,`ES512`) expect `*ecdsa.PrivateKey` for signing and `*ecdsa.PublicKey` for validation
8585

8686
### JWT and OAuth
8787

@@ -99,6 +99,6 @@ This library uses descriptive error messages whenever possible. If you are not g
9999

100100
## More
101101

102-
Documentation can be found [on godoc.org](http://godoc.org/github.com/dgrijalva/jwt-go).
102+
Documentation can be found [on godoc.org](http://godoc.org/github.com/golang-jwt/jwt).
103103

104104
The command line utility included in this project (cmd/jwt) provides a straightforward example of token creation and parsing as well as a useful tool for debugging your own integration. You'll also find several implementation examples in the documentation.

cmd/jwt/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ To simply display a token, use:
1616

1717
You can install this tool with the following command:
1818

19-
go install github.com/dgrijalva/jwt-go/cmd/jwt
19+
go install github.com/golang-jwt/jwt/cmd/jwt
2020

cmd/jwt/app.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616
"regexp"
1717
"strings"
1818

19-
jwt "github.com/dgrijalva/jwt-go"
19+
"github.com/golang-jwt/jwt"
2020
)
2121

2222
var (

ecdsa_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"strings"
77
"testing"
88

9-
"github.com/dgrijalva/jwt-go"
9+
"github.com/golang-jwt/jwt"
1010
)
1111

1212
var ecdsaTestData = []struct {

example_test.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ package jwt_test
22

33
import (
44
"fmt"
5-
"github.com/dgrijalva/jwt-go"
65
"time"
6+
7+
"github.com/golang-jwt/jwt"
78
)
89

910
// Example (atypical) using the StandardClaims type by itself to parse a token.

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module github.com/dgrijalva/jwt-go
1+
module github.com/golang-jwt/jwt
22

33
go 1.14
44

hmac_example_test.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ package jwt_test
22

33
import (
44
"fmt"
5-
"github.com/dgrijalva/jwt-go"
65
"io/ioutil"
76
"time"
7+
8+
"github.com/golang-jwt/jwt"
89
)
910

1011
// For HMAC signing method, the key can be any []byte. It is recommended to generate
@@ -51,7 +52,7 @@ func ExampleParse_hmac() {
5152
if _, ok := token.Method.(*jwt.SigningMethodHMAC); !ok {
5253
return nil, fmt.Errorf("Unexpected signing method: %v", token.Header["alg"])
5354
}
54-
55+
5556
// hmacSampleSecret is a []byte containing your secret, e.g. []byte("my_secret_key")
5657
return hmacSampleSecret, nil
5758
})

hmac_test.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
package jwt_test
22

33
import (
4-
"github.com/dgrijalva/jwt-go"
54
"io/ioutil"
65
"strings"
76
"testing"
7+
8+
"github.com/golang-jwt/jwt"
89
)
910

1011
var hmacTestData = []struct {

http_example_test.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ import (
77
"bytes"
88
"crypto/rsa"
99
"fmt"
10-
"github.com/dgrijalva/jwt-go"
11-
"github.com/dgrijalva/jwt-go/request"
1210
"io"
1311
"io/ioutil"
1412
"log"
@@ -17,6 +15,9 @@ import (
1715
"net/url"
1816
"strings"
1917
"time"
18+
19+
"github.com/golang-jwt/jwt"
20+
"github.com/golang-jwt/jwt/request"
2021
)
2122

2223
// location of the files used for signing and verification
@@ -55,6 +56,7 @@ func init() {
5556

5657
// Setup listener
5758
listener, err := net.ListenTCP("tcp", &net.TCPAddr{})
59+
fatal(err)
5860
serverPort = listener.Addr().(*net.TCPAddr).Port
5961

6062
log.Println("Listening...")

none_test.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
package jwt_test
22

33
import (
4-
"github.com/dgrijalva/jwt-go"
54
"strings"
65
"testing"
6+
7+
"github.com/golang-jwt/jwt"
78
)
89

910
var noneTestData = []struct {

parser_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import (
88
"testing"
99
"time"
1010

11-
"github.com/dgrijalva/jwt-go"
12-
"github.com/dgrijalva/jwt-go/test"
11+
"github.com/golang-jwt/jwt"
12+
"github.com/golang-jwt/jwt/test"
1313
)
1414

1515
var keyFuncError error = fmt.Errorf("error loading key")

request/request.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
package request
22

33
import (
4-
"github.com/dgrijalva/jwt-go"
54
"net/http"
5+
6+
"github.com/golang-jwt/jwt"
67
)
78

89
// Extract and parse a JWT token from an HTTP request.

request/request_test.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@ package request
22

33
import (
44
"fmt"
5-
"github.com/dgrijalva/jwt-go"
6-
"github.com/dgrijalva/jwt-go/test"
75
"net/http"
86
"net/url"
97
"reflect"
108
"strings"
119
"testing"
10+
11+
"github.com/golang-jwt/jwt"
12+
"github.com/golang-jwt/jwt/test"
1213
)
1314

1415
var requestTestData = []struct {

rsa_pss_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import (
99
"testing"
1010
"time"
1111

12-
"github.com/dgrijalva/jwt-go"
13-
"github.com/dgrijalva/jwt-go/test"
12+
"github.com/golang-jwt/jwt"
13+
"github.com/golang-jwt/jwt/test"
1414
)
1515

1616
var rsaPSSTestData = []struct {

rsa_test.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
package jwt_test
22

33
import (
4-
"github.com/dgrijalva/jwt-go"
54
"io/ioutil"
65
"strings"
76
"testing"
7+
8+
"github.com/golang-jwt/jwt"
89
)
910

1011
var rsaTestData = []struct {

test/helpers.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ package test
22

33
import (
44
"crypto/rsa"
5-
"github.com/dgrijalva/jwt-go"
65
"io/ioutil"
6+
7+
"github.com/golang-jwt/jwt"
78
)
89

910
func LoadRSAPrivateKeyFromDisk(location string) *rsa.PrivateKey {

0 commit comments

Comments
 (0)