Skip to content

Commit 1e8d39a

Browse files
committed
Support multi-underlay channels for edge connections. Fixes #701
1 parent 4824f2d commit 1e8d39a

File tree

21 files changed

+334
-73
lines changed

21 files changed

+334
-73
lines changed

example/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ require (
7979
github.com/muhlemmer/gu v0.3.1 // indirect
8080
github.com/oklog/ulid v1.3.1 // indirect
8181
github.com/opentracing/opentracing-go v1.2.0 // indirect
82-
github.com/openziti/channel/v3 v3.0.39 // indirect
82+
github.com/openziti/channel/v4 v4.0.0 // indirect
8383
github.com/openziti/edge-api v0.26.42 // indirect
8484
github.com/openziti/identity v1.0.100 // indirect
8585
github.com/openziti/metrics v1.3.0 // indirect

example/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -358,8 +358,8 @@ github.com/onsi/gomega v1.13.0 h1:7lLHu94wT9Ij0o6EWWclhu0aOh32VxhkwEJvzuWPeak=
358358
github.com/onsi/gomega v1.13.0/go.mod h1:lRk9szgn8TxENtWd0Tp4c3wjlRfMTMH27I+3Je41yGY=
359359
github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs=
360360
github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc=
361-
github.com/openziti/channel/v3 v3.0.39 h1:UM0iY0tbz4EbOVT3tX4mfN1wSAXxkkWIrKmQ7RhE/Hg=
362-
github.com/openziti/channel/v3 v3.0.39/go.mod h1:7k3mQhtWlgX0HaQBkllDTOH5WAf7DcyyMLqJXrL+/fI=
361+
github.com/openziti/channel/v4 v4.0.0 h1:nr5+DN7Ypg3vHYCiOGR0tnelZcCEM7hr9Gq6EmUzHnQ=
362+
github.com/openziti/channel/v4 v4.0.0/go.mod h1:EvALVUvbXuzYcFhgXsqOHg147c1Ocb+dUGOFqRTF7ik=
363363
github.com/openziti/edge-api v0.26.42 h1:Wi/BUttSUvedT9XGht7vi/zI/TNGc3ApvjkAviWhauA=
364364
github.com/openziti/edge-api v0.26.42/go.mod h1:sYHVpm26Jr1u7VooNJzTb2b2nGSlmCHMnbGC8XfWSng=
365365
github.com/openziti/foundation/v2 v2.0.59 h1:PJwrcTq62x+cONBeKMlnsuphsTlOvTz8j8prYnehm8o=

example/influxdb-client-go/go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ require (
9393
github.com/muhlemmer/gu v0.3.1 // indirect
9494
github.com/oklog/ulid v1.3.1 // indirect
9595
github.com/opentracing/opentracing-go v1.2.0 // indirect
96-
github.com/openziti/channel/v3 v3.0.39 // indirect
96+
github.com/openziti/channel/v4 v4.0.0 // indirect
9797
github.com/openziti/edge-api v0.26.42 // indirect
9898
github.com/openziti/foundation/v2 v2.0.59 // indirect
9999
github.com/openziti/identity v1.0.100 // indirect
@@ -139,7 +139,7 @@ require (
139139
golang.org/x/term v0.30.0 // indirect
140140
golang.org/x/text v0.23.0 // indirect
141141
golang.org/x/time v0.6.0 // indirect
142-
google.golang.org/protobuf v1.36.5 // indirect
142+
google.golang.org/protobuf v1.36.6 // indirect
143143
gopkg.in/go-jose/go-jose.v2 v2.6.3 // indirect
144144
gopkg.in/ini.v1 v1.67.0 // indirect
145145
gopkg.in/yaml.v3 v3.0.1 // indirect

example/influxdb-client-go/go.sum

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,7 @@ github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU=
173173
github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
174174
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
175175
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
176-
github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk=
177-
github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk=
176+
github.com/golang-jwt/jwt/v5 v5.2.2 h1:Rl4B7itRWVtYIHFrSNd7vhTiz9UpLdi6gZhZ3wEeDy8=
178177
github.com/golang-jwt/jwt/v5 v5.2.2/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk=
179178
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
180179
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
@@ -414,8 +413,8 @@ github.com/onsi/gomega v1.13.0 h1:7lLHu94wT9Ij0o6EWWclhu0aOh32VxhkwEJvzuWPeak=
414413
github.com/onsi/gomega v1.13.0/go.mod h1:lRk9szgn8TxENtWd0Tp4c3wjlRfMTMH27I+3Je41yGY=
415414
github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs=
416415
github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc=
417-
github.com/openziti/channel/v3 v3.0.39 h1:UM0iY0tbz4EbOVT3tX4mfN1wSAXxkkWIrKmQ7RhE/Hg=
418-
github.com/openziti/channel/v3 v3.0.39/go.mod h1:7k3mQhtWlgX0HaQBkllDTOH5WAf7DcyyMLqJXrL+/fI=
416+
github.com/openziti/channel/v4 v4.0.0 h1:nr5+DN7Ypg3vHYCiOGR0tnelZcCEM7hr9Gq6EmUzHnQ=
417+
github.com/openziti/channel/v4 v4.0.0/go.mod h1:EvALVUvbXuzYcFhgXsqOHg147c1Ocb+dUGOFqRTF7ik=
419418
github.com/openziti/edge-api v0.26.42 h1:Wi/BUttSUvedT9XGht7vi/zI/TNGc3ApvjkAviWhauA=
420419
github.com/openziti/edge-api v0.26.42/go.mod h1:sYHVpm26Jr1u7VooNJzTb2b2nGSlmCHMnbGC8XfWSng=
421420
github.com/openziti/foundation/v2 v2.0.59 h1:PJwrcTq62x+cONBeKMlnsuphsTlOvTz8j8prYnehm8o=
@@ -600,8 +599,7 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0
600599
golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
601600
golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM=
602601
golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=
603-
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g=
604-
golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k=
602+
golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 h1:vr/HnozRka3pE4EsMEg1lgkXJkTFJCVUX+S/ZT6wYzM=
605603
golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842/go.mod h1:XtvwrStGgqGPLc4cjQfWqZHG1YFdYs6swckp8vpsjnc=
606604
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
607605
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
@@ -950,8 +948,8 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj
950948
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
951949
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
952950
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
953-
google.golang.org/protobuf v1.36.5 h1:tPhr+woSbjfYvY6/GPufUoYizxw1cF/yFoxJ2fmpwlM=
954-
google.golang.org/protobuf v1.36.5/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
951+
google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY=
952+
google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY=
955953
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
956954
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
957955
gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ require (
1717
github.com/michaelquigley/pfxlog v0.6.10
1818
github.com/mitchellh/go-ps v1.0.0
1919
github.com/mitchellh/mapstructure v1.5.0
20-
github.com/openziti/channel/v3 v3.0.39
20+
github.com/openziti/channel/v4 v4.0.0
2121
github.com/openziti/edge-api v0.26.42
2222
github.com/openziti/foundation/v2 v2.0.59
2323
github.com/openziti/identity v1.0.100

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,8 +299,8 @@ github.com/onsi/gomega v1.13.0 h1:7lLHu94wT9Ij0o6EWWclhu0aOh32VxhkwEJvzuWPeak=
299299
github.com/onsi/gomega v1.13.0/go.mod h1:lRk9szgn8TxENtWd0Tp4c3wjlRfMTMH27I+3Je41yGY=
300300
github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs=
301301
github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc=
302-
github.com/openziti/channel/v3 v3.0.39 h1:UM0iY0tbz4EbOVT3tX4mfN1wSAXxkkWIrKmQ7RhE/Hg=
303-
github.com/openziti/channel/v3 v3.0.39/go.mod h1:7k3mQhtWlgX0HaQBkllDTOH5WAf7DcyyMLqJXrL+/fI=
302+
github.com/openziti/channel/v4 v4.0.0 h1:nr5+DN7Ypg3vHYCiOGR0tnelZcCEM7hr9Gq6EmUzHnQ=
303+
github.com/openziti/channel/v4 v4.0.0/go.mod h1:EvALVUvbXuzYcFhgXsqOHg147c1Ocb+dUGOFqRTF7ik=
304304
github.com/openziti/edge-api v0.26.42 h1:Wi/BUttSUvedT9XGht7vi/zI/TNGc3ApvjkAviWhauA=
305305
github.com/openziti/edge-api v0.26.42/go.mod h1:sYHVpm26Jr1u7VooNJzTb2b2nGSlmCHMnbGC8XfWSng=
306306
github.com/openziti/foundation/v2 v2.0.59 h1:PJwrcTq62x+cONBeKMlnsuphsTlOvTz8j8prYnehm8o=

version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.25
1+
0.26

ziti/config.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ type Config struct {
6060

6161
//Allows providing a function which controls how/where connections to a router are proxied.
6262
RouterProxy func(addr string) *transport.ProxyConfiguration `json:"-"`
63+
64+
// If set to true, the sdk will attempt to create a separate connection to edge routers for control plane data,
65+
// such as dials. This flag should not be considered part of the stable API yet. It may default to true at
66+
// some point in the future or be removed.
67+
EnableSeparateControlPlaneConnection bool `json:"-"`
6368
}
6469

6570
// NewConfig will create a new Config object from a provided Ziti Edge Client API URL and identity configuration.

ziti/contexts.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,14 @@ func NewContextWithOpts(cfg *Config, options *Options) (Context, error) {
8282
}
8383

8484
newContext := &ContextImpl{
85-
Id: NewId(),
86-
routerConnections: cmap.New[edge.RouterConn](),
87-
options: options,
88-
authQueryHandlers: map[string]func(query *rest_model.AuthQueryDetail, response MfaCodeResponse) error{},
89-
closeNotify: make(chan struct{}),
90-
EventEmmiter: events.New(),
91-
routerProxy: cfg.RouterProxy,
85+
Id: NewId(),
86+
routerConnections: cmap.New[edge.RouterConn](),
87+
options: options,
88+
authQueryHandlers: map[string]func(query *rest_model.AuthQueryDetail, response MfaCodeResponse) error{},
89+
closeNotify: make(chan struct{}),
90+
EventEmmiter: events.New(),
91+
routerProxy: cfg.RouterProxy,
92+
enableCtrlPlaneConnection: cfg.EnableSeparateControlPlaneConnection,
9293
}
9394

9495
if cfg.ID.Cert != "" && cfg.ID.Key != "" {

ziti/edge/addr.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@ func (e *Addr) Network() string {
2929
}
3030

3131
func (e *Addr) String() string {
32-
return fmt.Sprintf("ziti-edge-router connId=%v, logical=%v", e.MsgCh.Id(), e.MsgCh.LogicalName())
32+
return fmt.Sprintf("ziti-edge-router connId=%v, logical=%v", e.MsgCh.Id(), e.MsgCh.GetChannel().LogicalName())
3333
}

0 commit comments

Comments
 (0)