diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index ee6fa8c4..a5d04098 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -14,7 +14,7 @@ jobs: - uses: actions/setup-go@v5 with: go-version: stable - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: golangci-lint uses: golangci/golangci-lint-action@v8 with: diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c35b4f90..a8bcd68f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Git Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: persist-credentials: false diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c079e643..5902614b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Git Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: fetch-depth: 0 diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c83fc13..f5e47c92 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +# Release notes 1.2.3 + +## Issues Fixed and Dependency Updates + +* github.com/openziti/sdk-golang: [v1.2.2 -> v1.2.3](https://github.com/openziti/sdk-golang/compare/v1.2.2...v1.2.3) + * [Issue #779](https://github.com/openziti/sdk-golang/issues/779) - Remove need to EnableHA flag in Go SDK + +* github.com/openziti/channel/v4: [v4.2.19 -> v4.2.21](https://github.com/openziti/channel/compare/v4.2.19...v4.2.21) + # Release notes 1.2.2 ## Issues Fixed and Dependency Updates diff --git a/example/go.mod b/example/go.mod index dd9a1149..04952837 100644 --- a/example/go.mod +++ b/example/go.mod @@ -81,7 +81,7 @@ require ( github.com/muhlemmer/gu v0.3.1 // indirect github.com/oklog/ulid v1.3.1 // indirect github.com/opentracing/opentracing-go v1.2.0 // indirect - github.com/openziti/channel/v4 v4.2.19 // indirect + github.com/openziti/channel/v4 v4.2.21 // indirect github.com/openziti/edge-api v0.26.47 // indirect github.com/openziti/identity v1.0.109 // indirect github.com/openziti/metrics v1.4.2 // indirect diff --git a/example/go.sum b/example/go.sum index 6b09b159..665a47e9 100644 --- a/example/go.sum +++ b/example/go.sum @@ -365,8 +365,8 @@ github.com/onsi/gomega v1.13.0 h1:7lLHu94wT9Ij0o6EWWclhu0aOh32VxhkwEJvzuWPeak= github.com/onsi/gomega v1.13.0/go.mod h1:lRk9szgn8TxENtWd0Tp4c3wjlRfMTMH27I+3Je41yGY= github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= -github.com/openziti/channel/v4 v4.2.19 h1:dsiL2wPrR0a034KTyuc15ud49ZFLjplRKfqfa9a37Sk= -github.com/openziti/channel/v4 v4.2.19/go.mod h1:v8AOCXLqE++BHGmDK7Ut8Uc2nCGyOu9hjkJNoWgpcyU= +github.com/openziti/channel/v4 v4.2.21 h1:MkTCCCC8efBvQxKBkds827SEMzBlORnD4VzkONUnde4= +github.com/openziti/channel/v4 v4.2.21/go.mod h1:EjTaldx8LMejfIlyr0eQQYurUujgGJYXKV1bFKKXW+0= github.com/openziti/edge-api v0.26.47 h1:5QZeqhD4HFtox7FS5z816M1+MpJED1DdS6oOH128nI8= github.com/openziti/edge-api v0.26.47/go.mod h1:sYHVpm26Jr1u7VooNJzTb2b2nGSlmCHMnbGC8XfWSng= github.com/openziti/foundation/v2 v2.0.70 h1:1g4jIl7nIdqW8oCgRcwlbNvK8dwk4mPyrwjjtjH1tp8= diff --git a/example/influxdb-client-go/go.mod b/example/influxdb-client-go/go.mod index c7c48b85..6fabeaf3 100644 --- a/example/influxdb-client-go/go.mod +++ b/example/influxdb-client-go/go.mod @@ -94,7 +94,7 @@ require ( github.com/muhlemmer/gu v0.3.1 // indirect github.com/oklog/ulid v1.3.1 // indirect github.com/opentracing/opentracing-go v1.2.0 // indirect - github.com/openziti/channel/v4 v4.2.19 // indirect + github.com/openziti/channel/v4 v4.2.21 // indirect github.com/openziti/edge-api v0.26.47 // indirect github.com/openziti/foundation/v2 v2.0.70 // indirect github.com/openziti/identity v1.0.109 // indirect diff --git a/example/influxdb-client-go/go.sum b/example/influxdb-client-go/go.sum index 2c9d8a25..68af3202 100644 --- a/example/influxdb-client-go/go.sum +++ b/example/influxdb-client-go/go.sum @@ -418,8 +418,8 @@ github.com/onsi/gomega v1.13.0 h1:7lLHu94wT9Ij0o6EWWclhu0aOh32VxhkwEJvzuWPeak= github.com/onsi/gomega v1.13.0/go.mod h1:lRk9szgn8TxENtWd0Tp4c3wjlRfMTMH27I+3Je41yGY= github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= -github.com/openziti/channel/v4 v4.2.19 h1:dsiL2wPrR0a034KTyuc15ud49ZFLjplRKfqfa9a37Sk= -github.com/openziti/channel/v4 v4.2.19/go.mod h1:v8AOCXLqE++BHGmDK7Ut8Uc2nCGyOu9hjkJNoWgpcyU= +github.com/openziti/channel/v4 v4.2.21 h1:MkTCCCC8efBvQxKBkds827SEMzBlORnD4VzkONUnde4= +github.com/openziti/channel/v4 v4.2.21/go.mod h1:EjTaldx8LMejfIlyr0eQQYurUujgGJYXKV1bFKKXW+0= github.com/openziti/edge-api v0.26.47 h1:5QZeqhD4HFtox7FS5z816M1+MpJED1DdS6oOH128nI8= github.com/openziti/edge-api v0.26.47/go.mod h1:sYHVpm26Jr1u7VooNJzTb2b2nGSlmCHMnbGC8XfWSng= github.com/openziti/foundation/v2 v2.0.70 h1:1g4jIl7nIdqW8oCgRcwlbNvK8dwk4mPyrwjjtjH1tp8= diff --git a/go.mod b/go.mod index 5fc272ea..c81e0402 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,7 @@ require ( github.com/michaelquigley/pfxlog v0.6.10 github.com/mitchellh/go-ps v1.0.0 github.com/mitchellh/mapstructure v1.5.0 - github.com/openziti/channel/v4 v4.2.19 + github.com/openziti/channel/v4 v4.2.21 github.com/openziti/edge-api v0.26.47 github.com/openziti/foundation/v2 v2.0.70 github.com/openziti/identity v1.0.109 diff --git a/go.sum b/go.sum index af7b6824..dc7d20cc 100644 --- a/go.sum +++ b/go.sum @@ -303,8 +303,8 @@ github.com/onsi/gomega v1.13.0 h1:7lLHu94wT9Ij0o6EWWclhu0aOh32VxhkwEJvzuWPeak= github.com/onsi/gomega v1.13.0/go.mod h1:lRk9szgn8TxENtWd0Tp4c3wjlRfMTMH27I+3Je41yGY= github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= -github.com/openziti/channel/v4 v4.2.19 h1:dsiL2wPrR0a034KTyuc15ud49ZFLjplRKfqfa9a37Sk= -github.com/openziti/channel/v4 v4.2.19/go.mod h1:v8AOCXLqE++BHGmDK7Ut8Uc2nCGyOu9hjkJNoWgpcyU= +github.com/openziti/channel/v4 v4.2.21 h1:MkTCCCC8efBvQxKBkds827SEMzBlORnD4VzkONUnde4= +github.com/openziti/channel/v4 v4.2.21/go.mod h1:EjTaldx8LMejfIlyr0eQQYurUujgGJYXKV1bFKKXW+0= github.com/openziti/edge-api v0.26.47 h1:5QZeqhD4HFtox7FS5z816M1+MpJED1DdS6oOH128nI8= github.com/openziti/edge-api v0.26.47/go.mod h1:sYHVpm26Jr1u7VooNJzTb2b2nGSlmCHMnbGC8XfWSng= github.com/openziti/foundation/v2 v2.0.70 h1:1g4jIl7nIdqW8oCgRcwlbNvK8dwk4mPyrwjjtjH1tp8= diff --git a/ziti/config.go b/ziti/config.go index 4c6a499b..314ba480 100644 --- a/ziti/config.go +++ b/ziti/config.go @@ -19,14 +19,15 @@ package ziti import ( "crypto/x509" "encoding/json" + "net/http" + "net/url" + "os" + "github.com/openziti/edge-api/rest_util" "github.com/openziti/identity" apis "github.com/openziti/sdk-golang/edge-apis" "github.com/openziti/transport/v2" "github.com/pkg/errors" - "net/http" - "net/url" - "os" ) type Config struct { @@ -48,8 +49,11 @@ type Config struct { //to populate this field with credentials. Credentials apis.Credentials `json:"-"` - //EnableHa will signal to the SDK to query and use OIDC authentication which is required for HA controller setups. - //This is a temporary feature flag that will be removed and "default to true" at a later date. + // EnableHa is now deprecated and will be removed in a future revision. The SDK will now query the controller + // and use OIDC authentication if its enabled. This flag is now ignored. + // + // Deprecated: This flag is now ignored + // EnableHa bool `json:"enableHa"` //Allows providing a function which controls how/where request to a controller are proxied. diff --git a/ziti/contexts.go b/ziti/contexts.go index 1d25164f..ae2eb202 100644 --- a/ziti/contexts.go +++ b/ziti/contexts.go @@ -26,6 +26,10 @@ package ziti import ( + "net/http" + "net/url" + "strconv" + "github.com/kataras/go-events" "github.com/michaelquigley/pfxlog" "github.com/openziti/edge-api/rest_model" @@ -34,9 +38,6 @@ import ( "github.com/openziti/sdk-golang/ziti/edge/posture" cmap "github.com/orcaman/concurrent-map/v2" "github.com/pkg/errors" - "net/http" - "net/url" - "strconv" ) var idCount = 0 @@ -164,7 +165,7 @@ func NewContextWithOpts(cfg *Config, options *Options) (Context, error) { ConfigTypes: cfg.ConfigTypes, } - newContext.CtrlClt.SetAllowOidcDynamicallyEnabled(cfg.EnableHa) + newContext.CtrlClt.SetAllowOidcDynamicallyEnabled(true) newContext.CtrlClt.PostureCache = posture.NewCache(newContext.CtrlClt, newContext.closeNotify) newContext.CtrlClt.AddOnControllerUpdateListeners(func(urls []*url.URL) { diff --git a/ziti/sdkinfo/build_info.go b/ziti/sdkinfo/build_info.go index 15dc6da3..676010fc 100644 --- a/ziti/sdkinfo/build_info.go +++ b/ziti/sdkinfo/build_info.go @@ -20,5 +20,5 @@ package sdkinfo const ( - Version = "v1.2.2" + Version = "v1.2.3" ) diff --git a/ziti/ziti.go b/ziti/ziti.go index 8e3b8aa4..8b5cdc8e 100644 --- a/ziti/ziti.go +++ b/ziti/ziti.go @@ -20,6 +20,17 @@ import ( "encoding/json" "errors" "fmt" + "math" + "math/rand" + "net" + "net/url" + "reflect" + "strconv" + "strings" + "sync" + "sync/atomic" + "time" + "github.com/go-openapi/strfmt" "github.com/google/uuid" "github.com/kataras/go-events" @@ -34,16 +45,6 @@ import ( "github.com/openziti/sdk-golang/xgress" "github.com/openziti/secretstream/kx" "github.com/zitadel/oidc/v3/pkg/oidc" - "math" - "math/rand" - "net" - "net/url" - "reflect" - "strconv" - "strings" - "sync" - "sync/atomic" - "time" "github.com/cenkalti/backoff/v4" "github.com/michaelquigley/pfxlog" @@ -1508,16 +1509,17 @@ func (context *ContextImpl) connectEdgeRouter(routerName, ingressUrl string) *ed useConn := context.routerConnections.Upsert(ingressUrl, edgeConn, func(exist bool, oldV edge.RouterConn, newV edge.RouterConn) edge.RouterConn { - if exist { // use the routerConnection already in the map, close new one + if exist && !oldV.IsClosed() { // use the routerConnection already in the map, close new one pfxlog.Logger().Infof("connection to %s already established, closing duplicate connection", ingressUrl) go func() { - if err := newV.Close(); err != nil { - pfxlog.Logger().Errorf("unable to close router connection (%v)", err) + if closeErr := newV.Close(); closeErr != nil { + pfxlog.Logger().Errorf("unable to close router connection (%v)", closeErr) } }() return oldV } + h := context.metrics.Histogram("latency." + ingressUrl) h.Update(int64(connectTime))