From 48da75b96d6f621cad7bad3789fc3d210aa8d45f Mon Sep 17 00:00:00 2001
From: Krzysztof Adamski <krzysztof_adamski@o2.pl>
Date: Fri, 8 Jul 2022 09:55:10 +0200
Subject: [PATCH] Bump go to 1.17 and upgrade deps (#32)

Co-authored-by: Krzysztof Adamski <krzysztof.adamski@ing.com>
---
 .gitignore                |  1 +
 cmd/rdpgw/security/jwt.go | 12 +++++------
 go.mod                    | 45 +++++++++++++++++++++++++++++++++------
 3 files changed, 45 insertions(+), 13 deletions(-)
 create mode 100644 .gitignore

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..08cb523
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+go.sum
diff --git a/cmd/rdpgw/security/jwt.go b/cmd/rdpgw/security/jwt.go
index cfc37fd..cc3fb5a 100644
--- a/cmd/rdpgw/security/jwt.go
+++ b/cmd/rdpgw/security/jwt.go
@@ -7,8 +7,8 @@ import (
 	"github.com/bolkedebruin/rdpgw/cmd/rdpgw/common"
 	"github.com/bolkedebruin/rdpgw/cmd/rdpgw/protocol"
 	"github.com/coreos/go-oidc/v3/oidc"
-	"github.com/square/go-jose/v3"
-	"github.com/square/go-jose/v3/jwt"
+	"github.com/go-jose/go-jose/v3"
+	"github.com/go-jose/go-jose/v3/jwt"
 	"golang.org/x/oauth2"
 	"log"
 	"time"
@@ -19,8 +19,8 @@ var (
 	EncryptionKey     []byte
 	UserSigningKey    []byte
 	UserEncryptionKey []byte
-	OIDCProvider	  *oidc.Provider
-	Oauth2Config	  oauth2.Config
+	OIDCProvider      *oidc.Provider
+	Oauth2Config      oauth2.Config
 )
 
 var ExpiryTime time.Duration = 5
@@ -210,7 +210,7 @@ func UserInfo(ctx context.Context, token string) (jwt.Claims, error) {
 	// go-jose doesnt verify the expiry
 	err := standard.Validate(jwt.Expected{
 		Issuer: "rdpgw",
-		Time: time.Now(),
+		Time:   time.Now(),
 	})
 
 	if err != nil {
@@ -237,4 +237,4 @@ func verifyAlg(headers []jose.Header, alg string) (bool, error) {
 		}
 	}
 	return true, nil
-}
\ No newline at end of file
+}
diff --git a/go.mod b/go.mod
index 3db3e22..d89084e 100644
--- a/go.mod
+++ b/go.mod
@@ -1,15 +1,46 @@
 module github.com/bolkedebruin/rdpgw
 
-go 1.16
+go 1.17
 
 require (
-	github.com/coreos/go-oidc/v3 v3.0.0
+	github.com/coreos/go-oidc/v3 v3.1.0
+	github.com/go-jose/go-jose/v3 v3.0.0
 	github.com/gorilla/sessions v1.2.1
 	github.com/gorilla/websocket v1.4.2
 	github.com/patrickmn/go-cache v2.1.0+incompatible
-	github.com/prometheus/client_golang v1.10.0
-	github.com/spf13/cobra v1.1.3
-	github.com/spf13/viper v1.7.1
-	github.com/square/go-jose/v3 v3.0.0-20200630053402-0a67ce9b0693
-	golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
+	github.com/prometheus/client_golang v1.12.1
+	github.com/spf13/cobra v1.3.0
+	github.com/spf13/viper v1.10.1
+	golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8
+)
+
+require (
+	github.com/beorn7/perks v1.0.1 // indirect
+	github.com/cespare/xxhash/v2 v2.1.2 // indirect
+	github.com/fsnotify/fsnotify v1.5.1 // indirect
+	github.com/golang/protobuf v1.5.2 // indirect
+	github.com/gorilla/securecookie v1.1.1 // indirect
+	github.com/hashicorp/hcl v1.0.0 // indirect
+	github.com/inconshreveable/mousetrap v1.0.0 // indirect
+	github.com/magiconair/properties v1.8.5 // indirect
+	github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
+	github.com/mitchellh/mapstructure v1.4.3 // indirect
+	github.com/pelletier/go-toml v1.9.4 // indirect
+	github.com/prometheus/client_model v0.2.0 // indirect
+	github.com/prometheus/common v0.32.1 // indirect
+	github.com/prometheus/procfs v0.7.3 // indirect
+	github.com/spf13/afero v1.8.0 // indirect
+	github.com/spf13/cast v1.4.1 // indirect
+	github.com/spf13/jwalterweatherman v1.1.0 // indirect
+	github.com/spf13/pflag v1.0.5 // indirect
+	github.com/subosito/gotenv v1.2.0 // indirect
+	golang.org/x/crypto v0.0.0-20220128200615-198e4374d7ed // indirect
+	golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd // indirect
+	golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27 // indirect
+	golang.org/x/text v0.3.7 // indirect
+	google.golang.org/appengine v1.6.7 // indirect
+	google.golang.org/protobuf v1.27.1 // indirect
+	gopkg.in/ini.v1 v1.66.3 // indirect
+	gopkg.in/square/go-jose.v2 v2.6.0 // indirect
+	gopkg.in/yaml.v2 v2.4.0 // indirect
 )
-- 
GitLab