Skip to content

Commit

Permalink
Migrate dgrijalva/jwt-go to golang-jwt/jwt-go
Browse files Browse the repository at this point in the history
  • Loading branch information
longsleep committed Oct 15, 2021
1 parent 75d97a3 commit 80b68ed
Show file tree
Hide file tree
Showing 35 changed files with 37 additions and 35 deletions.
4 changes: 2 additions & 2 deletions bootstrap/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (
"strings"
"time"

"github.com/dgrijalva/jwt-go"
"github.com/golang-jwt/jwt/v4"
"github.com/sirupsen/logrus"
"stash.kopano.io/kgol/rndm"

Expand Down Expand Up @@ -96,7 +96,7 @@ func (bs *bootstrap) Managers() *managers.Managers {
func Boot(ctx context.Context, settings *Settings, cfg *config.Config) (Bootstrap, error) {
// NOTE(longsleep): Ensure to use same salt length as the hash size.
// See https://www.ietf.org/mail-archive/web/jose/current/msg02901.html for
// reference and https://github.com/dgrijalva/jwt-go/issues/285 for
// reference and https://github.com/golang-jwt/jwt/v4/issues/285 for
// the issue in upstream jwt-go.
for _, alg := range []string{jwt.SigningMethodPS256.Name, jwt.SigningMethodPS384.Name, jwt.SigningMethodPS512.Name} {
sm := jwt.GetSigningMethod(alg)
Expand Down
2 changes: 1 addition & 1 deletion bootstrap/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"crypto/tls"
"net/url"

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

"github.com/libregraph/lico/config"
)
Expand Down
2 changes: 1 addition & 1 deletion bootstrap/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"path/filepath"
"strings"

"github.com/dgrijalva/jwt-go"
"github.com/golang-jwt/jwt/v4"
"github.com/sirupsen/logrus"
"gopkg.in/square/go-jose.v2"

Expand Down
2 changes: 1 addition & 1 deletion claims.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ package lico
import (
"errors"

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

"github.com/libregraph/lico/oidc/payload"
)
Expand Down
2 changes: 1 addition & 1 deletion context.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ package lico
import (
"context"

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

// key is an unexported type for keys defined in this package.
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ require (
github.com/crewjam/httperr v0.2.0
github.com/crewjam/saml v0.4.5
github.com/deckarep/golang-set v1.7.1
github.com/dgrijalva/jwt-go v3.2.0+incompatible
github.com/gabriel-vasile/mimetype v1.4.0
github.com/ghodss/yaml v1.0.0
github.com/go-ldap/ldap/v3 v3.4.1
github.com/golang-jwt/jwt/v4 v4.1.0
github.com/google/go-querystring v1.1.0
github.com/gorilla/mux v1.8.0
github.com/gorilla/schema v1.2.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/me
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/golang-jwt/jwt/v4 v4.1.0 h1:XUgk2Ex5veyVFVeLm0xhusUTQybEbexJXrvPNOKkSY0=
github.com/golang-jwt/jwt/v4 v4.1.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
Expand Down
2 changes: 1 addition & 1 deletion identifier/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"strings"
"time"

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

"github.com/libregraph/lico/identifier/meta"
"github.com/libregraph/lico/identity/clients"
Expand Down
2 changes: 1 addition & 1 deletion identifier/oauth2.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"strings"
"time"

"github.com/dgrijalva/jwt-go"
"github.com/golang-jwt/jwt/v4"
"stash.kopano.io/kgol/oidc-go"
"stash.kopano.io/kgol/rndm"

Expand Down
2 changes: 1 addition & 1 deletion identifier/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"errors"
"time"

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

konnect "github.com/libregraph/lico"
"github.com/libregraph/lico/identifier/backends"
Expand Down
2 changes: 1 addition & 1 deletion identity/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ package identity
import (
"time"

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

"github.com/libregraph/lico/oidc/payload"
)
Expand Down
2 changes: 1 addition & 1 deletion identity/authorities/authorities.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"net/http"
"net/url"

"github.com/dgrijalva/jwt-go"
"github.com/golang-jwt/jwt/v4"
"stash.kopano.io/kgol/oidc-go"
)

Expand Down
2 changes: 1 addition & 1 deletion identity/authorities/oidc.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"net/url"
"sync"

"github.com/dgrijalva/jwt-go"
"github.com/golang-jwt/jwt/v4"
"github.com/sirupsen/logrus"
"gopkg.in/square/go-jose.v2"
"stash.kopano.io/kgol/oidc-go"
Expand Down
2 changes: 1 addition & 1 deletion identity/authrecord.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ package identity
import (
"time"

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

"github.com/libregraph/lico/oidc/payload"
)
Expand Down
2 changes: 1 addition & 1 deletion identity/clients/claims.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
package clients

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

// RegistrationClaims are claims used to with dynamic clients.
Expand Down
2 changes: 1 addition & 1 deletion identity/clients/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"fmt"
"time"

"github.com/dgrijalva/jwt-go"
"github.com/golang-jwt/jwt/v4"
"github.com/mendsley/gojwk"
"golang.org/x/crypto/blake2b"
_ "gopkg.in/yaml.v2" // Make sure we have yaml.
Expand Down
2 changes: 1 addition & 1 deletion identity/clients/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
"sync"
"time"

"github.com/dgrijalva/jwt-go"
"github.com/golang-jwt/jwt/v4"
"github.com/sirupsen/logrus"
"gopkg.in/yaml.v2"
"stash.kopano.io/kgol/oidc-go"
Expand Down
2 changes: 1 addition & 1 deletion identity/managers/cookie.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
"strings"
"time"

"github.com/dgrijalva/jwt-go"
"github.com/golang-jwt/jwt/v4"
"github.com/gorilla/mux"
"github.com/sirupsen/logrus"
"stash.kopano.io/kgol/oidc-go"
Expand Down
2 changes: 1 addition & 1 deletion identity/managers/dummy.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"net/http"
"strings"

"github.com/dgrijalva/jwt-go"
"github.com/golang-jwt/jwt/v4"
"github.com/gorilla/mux"
"stash.kopano.io/kgol/oidc-go"
"stash.kopano.io/kgol/rndm"
Expand Down
2 changes: 1 addition & 1 deletion identity/managers/guest.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"fmt"
"net/http"

"github.com/dgrijalva/jwt-go"
"github.com/golang-jwt/jwt/v4"
"github.com/gorilla/mux"
"github.com/sirupsen/logrus"
"stash.kopano.io/kgol/oidc-go"
Expand Down
2 changes: 1 addition & 1 deletion identity/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
package identity

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

// User defines a most simple user with an id defined as subject.
Expand Down
2 changes: 1 addition & 1 deletion identity/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ package identity
import (
"fmt"

"github.com/dgrijalva/jwt-go"
"github.com/golang-jwt/jwt/v4"
"stash.kopano.io/kgol/oidc-go"

konnectoidc "github.com/libregraph/lico/oidc"
Expand Down
2 changes: 1 addition & 1 deletion oidc/claims.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
package oidc

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

// IDTokenClaims define the claims found in OIDC ID Tokens.
Expand Down
2 changes: 1 addition & 1 deletion oidc/payload/authentication.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"strings"
"time"

"github.com/dgrijalva/jwt-go"
"github.com/golang-jwt/jwt/v4"
"stash.kopano.io/kgol/oidc-go"

konnectoidc "github.com/libregraph/lico/oidc"
Expand Down
2 changes: 1 addition & 1 deletion oidc/payload/endsession.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"net/http"
"net/url"

"github.com/dgrijalva/jwt-go"
"github.com/golang-jwt/jwt/v4"
"stash.kopano.io/kgol/oidc-go"

konnectoidc "github.com/libregraph/lico/oidc"
Expand Down
2 changes: 1 addition & 1 deletion oidc/payload/registration.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"net/url"
"strings"

"github.com/dgrijalva/jwt-go"
"github.com/golang-jwt/jwt/v4"
"github.com/mendsley/gojwk"
"stash.kopano.io/kgol/oidc-go"

Expand Down
2 changes: 1 addition & 1 deletion oidc/payload/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ package payload
import (
"errors"

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

"github.com/libregraph/lico/identity/clients"
)
Expand Down
2 changes: 1 addition & 1 deletion oidc/payload/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"net/url"
"strings"

"github.com/dgrijalva/jwt-go"
"github.com/golang-jwt/jwt/v4"
"stash.kopano.io/kgol/oidc-go"

konnectoidc "github.com/libregraph/lico/oidc"
Expand Down
2 changes: 1 addition & 1 deletion oidc/provider/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"net/http"
"strings"

"github.com/dgrijalva/jwt-go"
"github.com/golang-jwt/jwt/v4"
"github.com/sirupsen/logrus"
"gopkg.in/square/go-jose.v2"
"stash.kopano.io/kgol/oidc-go"
Expand Down
2 changes: 1 addition & 1 deletion oidc/provider/identity.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ package provider
import (
"errors"

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

"github.com/libregraph/lico/identity"
"github.com/libregraph/lico/oidc/payload"
Expand Down
2 changes: 1 addition & 1 deletion oidc/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"strings"
"time"

"github.com/dgrijalva/jwt-go"
"github.com/golang-jwt/jwt/v4"
"github.com/rs/cors"
"github.com/sirupsen/logrus"
"golang.org/x/crypto/ed25519"
Expand Down
2 changes: 1 addition & 1 deletion oidc/provider/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"encoding/gob"
"net/http"

"github.com/dgrijalva/jwt-go"
"github.com/golang-jwt/jwt/v4"
"stash.kopano.io/kgol/rndm"

konnect "github.com/libregraph/lico"
Expand Down
2 changes: 1 addition & 1 deletion oidc/provider/signing.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ package provider
import (
"crypto"

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

// A SigningKey bundles a signer with meta data and a signign method.
Expand Down
2 changes: 1 addition & 1 deletion oidc/provider/tokens.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"fmt"
"time"

"github.com/dgrijalva/jwt-go"
"github.com/golang-jwt/jwt/v4"
"stash.kopano.io/kgol/oidc-go"
"stash.kopano.io/kgol/rndm"

Expand Down
2 changes: 1 addition & 1 deletion signing/jwt.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"crypto/rand"
"errors"

"github.com/dgrijalva/jwt-go"
"github.com/golang-jwt/jwt/v4"
"golang.org/x/crypto/ed25519"
)

Expand Down

0 comments on commit 80b68ed

Please sign in to comment.