Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ To continue using the older version, please import as follows: `import "gopkg.in

### Features

gcp-jwt-go has basic implementations of using [Google Cloud KMS](https://cloud.google.com/kms/docs/create-validate-signatures), Google IAM API (both [signJwt](https://cloud.google.com/iam/reference/rest/v1/projects.serviceAccounts/signJwt) and [signBlob](https://cloud.google.com/iam/reference/rest/v1/projects.serviceAccounts/signBlob)), and the [App Identity API](https://cloud.google.com/appengine/docs/go/appidentity/) from AppEngine Standard on Google Cloud Platform to sign JWT tokens using the [dgrijalva/jwt-go](https://github.com/dgrijalva/jwt-go) package. Should work across virtually all environments, on or off of Google's Cloud Platform.
gcp-jwt-go has basic implementations of using [Google Cloud KMS](https://cloud.google.com/kms/docs/create-validate-signatures), Google IAM API (both [signJwt](https://cloud.google.com/iam/reference/rest/v1/projects.serviceAccounts/signJwt) and [signBlob](https://cloud.google.com/iam/reference/rest/v1/projects.serviceAccounts/signBlob)), and the [App Identity API](https://cloud.google.com/appengine/docs/go/appidentity/) from AppEngine Standard on Google Cloud Platform to sign JWT tokens using the [golang-jwt/jwt](https://github.com/golang-jwt/jwt) package. Should work across virtually all environments, on or off of Google's Cloud Platform.

## Getting Started

Expand Down
2 changes: 1 addition & 1 deletion certs.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"net/http"
"time"

"github.com/dgrijalva/jwt-go"
"github.com/golang-jwt/jwt/v4"
"github.com/pquerna/cachecontrol"
)

Expand Down
6 changes: 3 additions & 3 deletions doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Example:
"context"
"net/http"

"github.com/dgrijalva/jwt-go"
"github.com/golang-jwt/jwt/v4"
"github.com/someone1/gcp-jwt-go"
"google.golang.org/appengine" // only on AppEngine Standard when using the SigningMethodAppEngine signing method
)
Expand Down Expand Up @@ -118,7 +118,7 @@ Example:
"time"
"strings"

"github.com/dgrijalva/jwt-go"
"github.com/golang-jwt/jwt/v4"
"github.com/someone1/gcp-jwt-go"
)

Expand Down Expand Up @@ -156,7 +156,7 @@ Example:
// The following is an extreme and advanced use-case - it is NOT recommended but here for those who need it.
//
// If we need to manually override the detected jwt.SigningMethod based on the 'alg' header
// This is basically copying the https://github.com/dgrijalva/jwt-go/blob/master/parser.go#L23 ParseWithClaims function here but forcing our own method vs getting one based on the Alg field
// This is basically copying the https://github.com/golang-jwt/jwt/v4/blob/main/parser.go#L23 ParseWithClaims function here but forcing our own method vs getting one based on the Alg field
// Or Try and parse, Ignore the result and try with the proper method:
token, _ := jwt.Parse(tokenString, func(token *jwt.Token) (interface{}, error) {
return nil, nil
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/someone1/gcp-jwt-go/v2
require (
cloud.google.com/go v0.76.0
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dgrijalva/jwt-go v3.2.0+incompatible
github.com/golang-jwt/jwt/v4 v4.2.0
github.com/patrickmn/go-cache v2.1.0+incompatible
github.com/pquerna/cachecontrol v0.0.0-20180517163645-1555304b9b35
golang.org/x/oauth2 v0.0.0-20210113205817-d3ed898aa8a3
Expand Down
43 changes: 2 additions & 41 deletions go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion iam.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"crypto/rsa"
"fmt"

"github.com/dgrijalva/jwt-go"
"github.com/golang-jwt/jwt/v4"
"google.golang.org/api/iamcredentials/v1"
)

Expand Down
2 changes: 1 addition & 1 deletion iam_appengine.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"sync"
"time"

"github.com/dgrijalva/jwt-go"
"github.com/golang-jwt/jwt/v4"
"google.golang.org/appengine"
)

Expand Down
2 changes: 1 addition & 1 deletion iam_appengine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"testing"
"time"

"github.com/dgrijalva/jwt-go"
"github.com/golang-jwt/jwt/v4"
)

// Public/Private key is hardcoded in dev server and found in
Expand Down
2 changes: 1 addition & 1 deletion iam_blob.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"encoding/base64"
"fmt"

"github.com/dgrijalva/jwt-go"
"github.com/golang-jwt/jwt/v4"
"google.golang.org/api/iamcredentials/v1"
)

Expand Down
2 changes: 1 addition & 1 deletion iam_jwt.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"strings"

"github.com/dgrijalva/jwt-go"
"github.com/golang-jwt/jwt/v4"
"google.golang.org/api/iamcredentials/v1"
)

Expand Down
2 changes: 1 addition & 1 deletion iam_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"strings"
"testing"

"github.com/dgrijalva/jwt-go"
"github.com/golang-jwt/jwt/v4"
"golang.org/x/oauth2/google"
gjwt "golang.org/x/oauth2/jwt"
"google.golang.org/appengine"
Expand Down
4 changes: 2 additions & 2 deletions jwtmiddleware/middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"fmt"
"net/http"

"github.com/dgrijalva/jwt-go"
"github.com/dgrijalva/jwt-go/request"
"github.com/golang-jwt/jwt/v4"
"github.com/golang-jwt/jwt/v4/request"

gcpjwt "github.com/someone1/gcp-jwt-go/v2"
)
Expand Down
2 changes: 1 addition & 1 deletion kms.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"math/big"

kms "cloud.google.com/go/kms/apiv1"
"github.com/dgrijalva/jwt-go"
"github.com/golang-jwt/jwt/v4"
kmspb "google.golang.org/genproto/googleapis/cloud/kms/v1"
)

Expand Down
2 changes: 1 addition & 1 deletion kms_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"strings"
"testing"

"github.com/dgrijalva/jwt-go"
"github.com/golang-jwt/jwt/v4"
)

type testKey struct {
Expand Down
2 changes: 1 addition & 1 deletion oauth2/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"strings"
"time"

"github.com/dgrijalva/jwt-go"
"github.com/golang-jwt/jwt/v4"
"golang.org/x/oauth2"

gcpjwt "github.com/someone1/gcp-jwt-go/v2"
Expand Down