Skip to content

Commit

Permalink
Update module github.com/MicahParks/keyfunc/v2 to v3 (#61)
Browse files Browse the repository at this point in the history
* Update module github.com/MicahParks/keyfunc/v2 to v3

* Migrated to v3

* Fixed order

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Christian Banse <oxisto@clouditor.io>
  • Loading branch information
renovate[bot] and oxisto committed Feb 26, 2024
1 parent 40241ed commit fcb6e37
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 19 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,12 @@ jobs:
runs-on: ubuntu-latest
steps:

- name: Set up Go 1.20
- name: Check out code into the Go module directory
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.20"
go-version-file: go.mod
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v4

- name: Build
run: go build -v .
11 changes: 9 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
module github.com/oxisto/evesso

go 1.20
go 1.21

toolchain go1.22.0

require (
github.com/MicahParks/keyfunc/v2 v2.1.0
github.com/MicahParks/keyfunc/v3 v3.2.5
github.com/golang-jwt/jwt/v5 v5.2.0
)

require (
github.com/MicahParks/jwkset v0.5.12 // indirect
golang.org/x/time v0.5.0 // indirect
)
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
github.com/MicahParks/keyfunc/v2 v2.1.0 h1:6ZXKb9Rp6qp1bDbJefnG7cTH8yMN1IC/4nf+GVjO99k=
github.com/MicahParks/keyfunc/v2 v2.1.0/go.mod h1:rW42fi+xgLJ2FRRXAfNx9ZA8WpD4OeE/yHVMteCkw9k=
github.com/golang-jwt/jwt/v5 v5.0.0 h1:1n1XNM9hk7O9mnQoNBGolZvzebBQ7p93ULHRc28XJUE=
github.com/golang-jwt/jwt/v5 v5.0.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk=
github.com/golang-jwt/jwt/v5 v5.1.0 h1:UGKbA/IPjtS6zLcdB7i5TyACMgSbOTiR8qzXgw8HWQU=
github.com/golang-jwt/jwt/v5 v5.1.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk=
github.com/MicahParks/jwkset v0.5.12 h1:wEwKZXB77yHFIHBtYoawNKIUwqC1X24S8tIhWutJHMA=
github.com/MicahParks/jwkset v0.5.12/go.mod h1:q8ptTGn/Z9c4MwbcfeCDssADeVQb3Pk7PnVxrvi+2QY=
github.com/MicahParks/keyfunc/v3 v3.2.5 h1:eg4s2zd2nfadnAzAsv9xvJCdCfLNy4s/aSiAxRn+aAk=
github.com/MicahParks/keyfunc/v3 v3.2.5/go.mod h1:8hmM7h/hNerfF8uC8cFVnT+afxBgh6nKRTR/0vAm5So=
github.com/golang-jwt/jwt/v5 v5.2.0 h1:d/ix8ftRUorsN+5eMIlF4T6J8CAt9rch3My2winC1Jw=
github.com/golang-jwt/jwt/v5 v5.2.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk=
golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk=
golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
10 changes: 5 additions & 5 deletions sso.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ import (
"strings"
"time"

"github.com/MicahParks/keyfunc/v2"
"github.com/MicahParks/keyfunc/v3"
"github.com/golang-jwt/jwt/v5"
)

var set *keyfunc.JWKS
var kf keyfunc.Keyfunc

const (
// LiveServer contains the url of the EVE live server.
Expand Down Expand Up @@ -98,16 +98,16 @@ func (sso *SingleSignOn) AccessToken(code string, refreshToken bool) (response T

func parseJwt(s string) (expiryTime time.Time, characterID int, characterName string, err error) {
// retrieve JWKs
if set == nil {
set, err = keyfunc.Get("https://login.eveonline.com/oauth/jwks", keyfunc.Options{})
if kf == nil {
kf, err = keyfunc.NewDefault([]string{"https://login.eveonline.com/oauth/jwks"})
if err != nil {
return
}
}

// parse token
var token *jwt.Token
token, err = jwt.Parse(s, set.Keyfunc)
token, err = jwt.Parse(s, kf.Keyfunc)
// parse will through an error, if there is a problem
if err != nil {
return
Expand Down

0 comments on commit fcb6e37

Please sign in to comment.