File tree Expand file tree Collapse file tree 11 files changed +12
-12
lines changed Expand file tree Collapse file tree 11 files changed +12
-12
lines changed Original file line number Diff line number Diff line change 5
5
require (
6
6
github.com/golang-jwt/jwt v3.2.1+incompatible
7
7
github.com/google/go-cmp v0.5.6
8
+ github.com/pkg/errors v0.9.1
8
9
github.com/stretchr/testify v1.7.0 // indirect
9
10
golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a // indirect
10
11
gopkg.in/square/go-jose.v2 v2.5.1
Original file line number Diff line number Diff line change @@ -2,10 +2,10 @@ github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8
2
2
github.com/davecgh/go-spew v1.1.0 /go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38 =
3
3
github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c =
4
4
github.com/golang-jwt/jwt v3.2.1+incompatible /go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I =
5
- github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU =
6
- github.com/google/go-cmp v0.5.5 /go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE =
7
5
github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ =
8
6
github.com/google/go-cmp v0.5.6 /go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE =
7
+ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4 =
8
+ github.com/pkg/errors v0.9.1 /go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0 =
9
9
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM =
10
10
github.com/pmezard/go-difflib v1.0.0 /go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4 =
11
11
github.com/stretchr/objx v0.1.0 /go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME =
Original file line number Diff line number Diff line change @@ -2,10 +2,11 @@ package jwtmiddleware
2
2
3
3
import (
4
4
"context"
5
- "errors"
6
5
"fmt"
7
6
"net/http"
8
7
"strings"
8
+
9
+ "github.com/pkg/errors"
9
10
)
10
11
11
12
var (
Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ package jwtmiddleware
2
2
3
3
import (
4
4
"context"
5
- "errors"
6
5
"fmt"
7
6
"io/ioutil"
8
7
"net/http"
@@ -12,6 +11,7 @@ import (
12
11
13
12
"github.com/auth0/go-jwt-middleware/validate/josev2"
14
13
"github.com/google/go-cmp/cmp"
14
+ "github.com/pkg/errors"
15
15
"gopkg.in/square/go-jose.v2"
16
16
"gopkg.in/square/go-jose.v2/jwt"
17
17
)
Original file line number Diff line number Diff line change @@ -4,7 +4,6 @@ the Square go-jose package version 2.
4
4
5
5
The implementation handles some nuances around JWTs and supports:
6
6
- a key func to pull the key(s) used to verify the token signature
7
- // TODO(joncarl): maybe we should provide a high level helper func for the above
8
7
- verifying the signature algorithm is what it should be
9
8
- validation of "regular" claims
10
9
- validation of custom claims
Original file line number Diff line number Diff line change @@ -3,13 +3,13 @@ package main
3
3
import (
4
4
"context"
5
5
"encoding/json"
6
- "errors"
7
6
"fmt"
8
7
"net/http"
9
8
"time"
10
9
11
10
jwtmiddleware "github.com/auth0/go-jwt-middleware"
12
11
"github.com/auth0/go-jwt-middleware/validate/josev2"
12
+ "github.com/pkg/errors"
13
13
"gopkg.in/square/go-jose.v2"
14
14
"gopkg.in/square/go-jose.v2/jwt"
15
15
)
Original file line number Diff line number Diff line change @@ -3,14 +3,14 @@ package josev2
3
3
import (
4
4
"context"
5
5
"encoding/json"
6
- "errors"
7
6
"fmt"
8
7
"net/http"
9
8
"net/url"
10
9
"sync"
11
10
"time"
12
11
13
12
"github.com/auth0/go-jwt-middleware/internal/oidc"
13
+ "github.com/pkg/errors"
14
14
"gopkg.in/square/go-jose.v2"
15
15
"gopkg.in/square/go-jose.v2/jwt"
16
16
)
@@ -98,7 +98,6 @@ type Validator struct {
98
98
// With josev2 `jose.JSONWebKeySet` is supported as a return type of
99
99
// this function which hands off the heavy lifting of determining which
100
100
// key to used based on the header `kid` to the josev2 library.
101
- // TODO(joncarl): provide an example of using a kid
102
101
keyFunc func (context.Context ) (interface {}, error )
103
102
signatureAlgorithm jose.SignatureAlgorithm
104
103
Original file line number Diff line number Diff line change 6
6
"crypto/rsa"
7
7
"crypto/x509"
8
8
"encoding/json"
9
- "errors"
10
9
"math/big"
11
10
"net/http"
12
11
"net/http/httptest"
@@ -17,6 +16,7 @@ import (
17
16
18
17
"github.com/auth0/go-jwt-middleware/internal/oidc"
19
18
"github.com/google/go-cmp/cmp"
19
+ "github.com/pkg/errors"
20
20
"gopkg.in/square/go-jose.v2"
21
21
"gopkg.in/square/go-jose.v2/jwt"
22
22
)
Original file line number Diff line number Diff line change @@ -3,13 +3,13 @@ package main
3
3
import (
4
4
"context"
5
5
"encoding/json"
6
- "errors"
7
6
"fmt"
8
7
"net/http"
9
8
10
9
jwtmiddleware "github.com/auth0/go-jwt-middleware"
11
10
jwtgo "github.com/auth0/go-jwt-middleware/validate/jwt-go"
12
11
"github.com/golang-jwt/jwt"
12
+ "github.com/pkg/errors"
13
13
)
14
14
15
15
// CustomClaimsExample contains custom data we want from the token.
Original file line number Diff line number Diff line change @@ -2,10 +2,10 @@ package jwtgo
2
2
3
3
import (
4
4
"context"
5
- "errors"
6
5
"fmt"
7
6
8
7
"github.com/golang-jwt/jwt"
8
+ "github.com/pkg/errors"
9
9
)
10
10
11
11
// CustomClaims defines any custom data / claims wanted. The validator will
You can’t perform that action at this time.
0 commit comments