diff --git a/cmd/zrok/testLoopPublic.go b/cmd/zrok/testLoopPublic.go index 38646708..7f7da550 100644 --- a/cmd/zrok/testLoopPublic.go +++ b/cmd/zrok/testLoopPublic.go @@ -4,14 +4,6 @@ import ( "bytes" "encoding/base64" "fmt" - "io" - "math/rand" - "net/http" - "os" - "os/signal" - "syscall" - "time" - "github.com/go-openapi/runtime" httptransport "github.com/go-openapi/runtime/client" "github.com/openziti/sdk-golang/ziti" @@ -25,6 +17,13 @@ import ( "github.com/openziti/zrok/zrokdir" "github.com/sirupsen/logrus" "github.com/spf13/cobra" + "io" + "math/rand" + "net/http" + "os" + "os/signal" + "syscall" + "time" ) func init() { diff --git a/controller/bootstrap.go b/controller/bootstrap.go index 021e592e..084c51b1 100644 --- a/controller/bootstrap.go +++ b/controller/bootstrap.go @@ -5,16 +5,12 @@ import ( "context" "encoding/json" "fmt" - "time" - "github.com/openziti/edge-api/rest_management_api_client" "github.com/openziti/edge-api/rest_management_api_client/config" - "github.com/openziti/edge-api/rest_management_api_client/edge_router_policy" "github.com/openziti/edge-api/rest_management_api_client/identity" rest_model_edge "github.com/openziti/edge-api/rest_model" "github.com/openziti/sdk-golang/ziti" - ziti_config "github.com/openziti/sdk-golang/ziti" zrok_config "github.com/openziti/zrok/controller/config" "github.com/openziti/zrok/controller/store" "github.com/openziti/zrok/controller/zrokEdgeSdk" @@ -22,6 +18,7 @@ import ( "github.com/openziti/zrok/zrokdir" "github.com/pkg/errors" "github.com/sirupsen/logrus" + "time" ) func Bootstrap(skipCtrl, skipFrontend bool, inCfg *zrok_config.Config) error { @@ -140,7 +137,7 @@ func getIdentityId(identityName string) (string, error) { if err != nil { return "", errors.Wrapf(err, "error opening identity '%v' from zrokdir", identityName) } - zcfg, err := ziti_config.NewConfigFromFile(zif) + zcfg, err := ziti.NewConfigFromFile(zif) if err != nil { return "", errors.Wrapf(err, "error loading ziti config from file '%v'", zif) } diff --git a/controller/createIdentity.go b/controller/createIdentity.go index e6504ed5..13e1cf3b 100644 --- a/controller/createIdentity.go +++ b/controller/createIdentity.go @@ -3,7 +3,6 @@ package controller import ( "bytes" "encoding/json" - "github.com/go-openapi/runtime/middleware" rest_model_edge "github.com/openziti/edge-api/rest_model" "github.com/openziti/zrok/controller/zrokEdgeSdk" diff --git a/controller/disable.go b/controller/disable.go index e946eb05..6b16f5f1 100644 --- a/controller/disable.go +++ b/controller/disable.go @@ -2,7 +2,6 @@ package controller import ( "fmt" - "github.com/go-openapi/runtime/middleware" "github.com/jmoiron/sqlx" "github.com/openziti/edge-api/rest_management_api_client" diff --git a/controller/gc.go b/controller/gc.go index 80366788..c4682f4a 100644 --- a/controller/gc.go +++ b/controller/gc.go @@ -3,9 +3,6 @@ package controller import ( "context" "fmt" - "strings" - "time" - "github.com/openziti/edge-api/rest_management_api_client" "github.com/openziti/edge-api/rest_management_api_client/config" "github.com/openziti/edge-api/rest_management_api_client/service" @@ -16,6 +13,8 @@ import ( "github.com/openziti/zrok/controller/zrokEdgeSdk" "github.com/pkg/errors" "github.com/sirupsen/logrus" + "strings" + "time" ) func GC(inCfg *zrok_config.Config) error { diff --git a/controller/startup.go b/controller/startup.go index 1ad28d6e..19ce1ceb 100644 --- a/controller/startup.go +++ b/controller/startup.go @@ -3,14 +3,13 @@ package controller import ( "context" "fmt" - "time" - "github.com/openziti/edge-api/rest_management_api_client" "github.com/openziti/edge-api/rest_management_api_client/config" "github.com/openziti/zrok/controller/zrokEdgeSdk" "github.com/openziti/zrok/model" "github.com/pkg/errors" "github.com/sirupsen/logrus" + "time" ) var zrokProxyConfigId string diff --git a/controller/unshare.go b/controller/unshare.go index 38820929..8d7fde96 100644 --- a/controller/unshare.go +++ b/controller/unshare.go @@ -3,8 +3,6 @@ package controller import ( "context" "fmt" - "time" - "github.com/go-openapi/runtime/middleware" "github.com/openziti/edge-api/rest_management_api_client" edge_service "github.com/openziti/edge-api/rest_management_api_client/service" @@ -14,6 +12,7 @@ import ( "github.com/openziti/zrok/rest_server_zrok/operations/share" "github.com/pkg/errors" "github.com/sirupsen/logrus" + "time" ) type unshareHandler struct{} diff --git a/controller/zrokEdgeSdk/client.go b/controller/zrokEdgeSdk/client.go index 00d8acc6..f0d21048 100644 --- a/controller/zrokEdgeSdk/client.go +++ b/controller/zrokEdgeSdk/client.go @@ -2,7 +2,6 @@ package zrokEdgeSdk import ( "crypto/x509" - "github.com/openziti/edge-api/rest_management_api_client" "github.com/openziti/edge-api/rest_util" ) diff --git a/controller/zrokEdgeSdk/config.go b/controller/zrokEdgeSdk/config.go index 775aefc5..46a67ba7 100644 --- a/controller/zrokEdgeSdk/config.go +++ b/controller/zrokEdgeSdk/config.go @@ -3,13 +3,12 @@ package zrokEdgeSdk import ( "context" "fmt" - "time" - "github.com/openziti/edge-api/rest_management_api_client" "github.com/openziti/edge-api/rest_management_api_client/config" "github.com/openziti/edge-api/rest_model" "github.com/openziti/zrok/model" "github.com/sirupsen/logrus" + "time" ) func CreateConfig(cfgTypeZId, envZId, shrToken string, authSchemeStr string, authUsers []*model.AuthUser, edge *rest_management_api_client.ZitiEdgeManagement) (cfgZId string, err error) { diff --git a/controller/zrokEdgeSdk/erp.go b/controller/zrokEdgeSdk/erp.go index 058be6c8..573f5a4c 100644 --- a/controller/zrokEdgeSdk/erp.go +++ b/controller/zrokEdgeSdk/erp.go @@ -3,12 +3,11 @@ package zrokEdgeSdk import ( "context" "fmt" - "time" - "github.com/openziti/edge-api/rest_management_api_client" "github.com/openziti/edge-api/rest_management_api_client/edge_router_policy" rest_model_edge "github.com/openziti/edge-api/rest_model" "github.com/sirupsen/logrus" + "time" ) func CreateEdgeRouterPolicy(name, zId string, edge *rest_management_api_client.ZitiEdgeManagement) error { diff --git a/controller/zrokEdgeSdk/identity.go b/controller/zrokEdgeSdk/identity.go index d7aac757..93140c10 100644 --- a/controller/zrokEdgeSdk/identity.go +++ b/controller/zrokEdgeSdk/identity.go @@ -3,14 +3,13 @@ package zrokEdgeSdk import ( "context" "fmt" - "time" - "github.com/openziti/edge-api/rest_management_api_client" "github.com/openziti/edge-api/rest_management_api_client/identity" rest_model_edge "github.com/openziti/edge-api/rest_model" "github.com/openziti/sdk-golang/ziti" "github.com/openziti/sdk-golang/ziti/enroll" "github.com/sirupsen/logrus" + "time" ) func CreateEnvironmentIdentity(uniqueToken, accountEmail, envDescription string, edge *rest_management_api_client.ZitiEdgeManagement) (*identity.CreateIdentityCreated, error) { diff --git a/controller/zrokEdgeSdk/serp.go b/controller/zrokEdgeSdk/serp.go index b1059da1..85712e4c 100644 --- a/controller/zrokEdgeSdk/serp.go +++ b/controller/zrokEdgeSdk/serp.go @@ -3,13 +3,12 @@ package zrokEdgeSdk import ( "context" "fmt" - "time" - "github.com/openziti/edge-api/rest_management_api_client" "github.com/openziti/edge-api/rest_management_api_client/service_edge_router_policy" "github.com/openziti/edge-api/rest_model" "github.com/pkg/errors" "github.com/sirupsen/logrus" + "time" ) func CreateShareServiceEdgeRouterPolicy(envZId, shrToken, shrZId string, edge *rest_management_api_client.ZitiEdgeManagement) error { diff --git a/controller/zrokEdgeSdk/service.go b/controller/zrokEdgeSdk/service.go index 830da08a..d6d3f9ed 100644 --- a/controller/zrokEdgeSdk/service.go +++ b/controller/zrokEdgeSdk/service.go @@ -3,13 +3,12 @@ package zrokEdgeSdk import ( "context" "fmt" - "time" - "github.com/openziti/edge-api/rest_management_api_client" edge_service "github.com/openziti/edge-api/rest_management_api_client/service" "github.com/openziti/edge-api/rest_model" "github.com/pkg/errors" "github.com/sirupsen/logrus" + "time" ) func FindShareService(svcZId string, edge *rest_management_api_client.ZitiEdgeManagement) (string, error) { diff --git a/controller/zrokEdgeSdk/sp.go b/controller/zrokEdgeSdk/sp.go index cac08daa..e6a49bac 100644 --- a/controller/zrokEdgeSdk/sp.go +++ b/controller/zrokEdgeSdk/sp.go @@ -3,13 +3,12 @@ package zrokEdgeSdk import ( "context" "fmt" - "time" - "github.com/openziti/edge-api/rest_management_api_client" "github.com/openziti/edge-api/rest_management_api_client/service_policy" "github.com/openziti/edge-api/rest_model" "github.com/pkg/errors" "github.com/sirupsen/logrus" + "time" ) const ( diff --git a/endpoints/proxy/backend.go b/endpoints/proxy/backend.go index 9b3a97aa..133d831d 100644 --- a/endpoints/proxy/backend.go +++ b/endpoints/proxy/backend.go @@ -3,17 +3,16 @@ package proxy import ( "crypto/tls" "fmt" - "net/http" - "net/http/httputil" - "net/url" - "time" - "github.com/openziti/sdk-golang/ziti" "github.com/openziti/sdk-golang/ziti/edge" "github.com/openziti/zrok/endpoints" "github.com/openziti/zrok/util" "github.com/pkg/errors" "github.com/sirupsen/logrus" + "net/http" + "net/http/httputil" + "net/url" + "time" ) type BackendConfig struct { diff --git a/endpoints/proxy/frontend.go b/endpoints/proxy/frontend.go index 1ef1a41a..be639335 100644 --- a/endpoints/proxy/frontend.go +++ b/endpoints/proxy/frontend.go @@ -3,12 +3,6 @@ package proxy import ( "context" "fmt" - "net" - "net/http" - "net/http/httputil" - "net/url" - "time" - "github.com/openziti/sdk-golang/ziti" "github.com/openziti/zrok/endpoints" "github.com/openziti/zrok/endpoints/publicProxy/notFoundUi" @@ -17,6 +11,11 @@ import ( "github.com/openziti/zrok/zrokdir" "github.com/pkg/errors" "github.com/sirupsen/logrus" + "net" + "net/http" + "net/http/httputil" + "net/url" + "time" ) type FrontendConfig struct { diff --git a/endpoints/proxy/webBackend.go b/endpoints/proxy/webBackend.go index 1311fd0c..5d330398 100644 --- a/endpoints/proxy/webBackend.go +++ b/endpoints/proxy/webBackend.go @@ -2,13 +2,12 @@ package proxy import ( "fmt" - "net/http" - "time" - "github.com/openziti/sdk-golang/ziti" "github.com/openziti/sdk-golang/ziti/edge" "github.com/openziti/zrok/endpoints" "github.com/pkg/errors" + "net/http" + "time" ) type WebBackendConfig struct { diff --git a/endpoints/publicProxy/http.go b/endpoints/publicProxy/http.go index 2397b846..e9aab21b 100644 --- a/endpoints/publicProxy/http.go +++ b/endpoints/publicProxy/http.go @@ -3,12 +3,6 @@ package publicProxy import ( "context" "fmt" - "net" - "net/http" - "net/http/httputil" - "net/url" - "strings" - "github.com/openziti/sdk-golang/ziti" "github.com/openziti/zrok/endpoints" "github.com/openziti/zrok/endpoints/publicProxy/healthUi" @@ -18,6 +12,11 @@ import ( "github.com/openziti/zrok/zrokdir" "github.com/pkg/errors" "github.com/sirupsen/logrus" + "net" + "net/http" + "net/http/httputil" + "net/url" + "strings" ) type httpFrontend struct { diff --git a/endpoints/tcpTunnel/backend.go b/endpoints/tcpTunnel/backend.go index 151b9217..2dcfb074 100644 --- a/endpoints/tcpTunnel/backend.go +++ b/endpoints/tcpTunnel/backend.go @@ -1,14 +1,13 @@ package tcpTunnel import ( - "net" - "time" - "github.com/openziti/sdk-golang/ziti" "github.com/openziti/sdk-golang/ziti/edge" "github.com/openziti/zrok/endpoints" "github.com/pkg/errors" "github.com/sirupsen/logrus" + "net" + "time" ) type BackendConfig struct { diff --git a/endpoints/tcpTunnel/frontend.go b/endpoints/tcpTunnel/frontend.go index 05bf3111..217a6353 100644 --- a/endpoints/tcpTunnel/frontend.go +++ b/endpoints/tcpTunnel/frontend.go @@ -1,15 +1,14 @@ package tcpTunnel import ( - "net" - "time" - "github.com/openziti/sdk-golang/ziti" "github.com/openziti/zrok/endpoints" "github.com/openziti/zrok/model" "github.com/openziti/zrok/zrokdir" "github.com/pkg/errors" "github.com/sirupsen/logrus" + "net" + "time" ) type FrontendConfig struct { diff --git a/endpoints/udpTunnel/backend.go b/endpoints/udpTunnel/backend.go index 7e055755..e38a7769 100644 --- a/endpoints/udpTunnel/backend.go +++ b/endpoints/udpTunnel/backend.go @@ -1,14 +1,13 @@ package udpTunnel import ( - "net" - "time" - "github.com/openziti/sdk-golang/ziti" "github.com/openziti/sdk-golang/ziti/edge" "github.com/openziti/zrok/endpoints" "github.com/pkg/errors" "github.com/sirupsen/logrus" + "net" + "time" ) type BackendConfig struct { diff --git a/endpoints/udpTunnel/frontend.go b/endpoints/udpTunnel/frontend.go index eb710132..954433cb 100644 --- a/endpoints/udpTunnel/frontend.go +++ b/endpoints/udpTunnel/frontend.go @@ -1,16 +1,15 @@ package udpTunnel import ( - "net" - "sync" - "time" - "github.com/openziti/sdk-golang/ziti" "github.com/openziti/zrok/endpoints" "github.com/openziti/zrok/model" "github.com/openziti/zrok/zrokdir" "github.com/pkg/errors" "github.com/sirupsen/logrus" + "net" + "sync" + "time" ) type FrontendConfig struct { diff --git a/endpoints/util.go b/endpoints/util.go index 75c70b5f..1b009f7e 100644 --- a/endpoints/util.go +++ b/endpoints/util.go @@ -1,12 +1,11 @@ package endpoints import ( - "net/url" - "strings" - "github.com/openziti/edge-api/rest_model" "github.com/openziti/sdk-golang/ziti" "github.com/sirupsen/logrus" + "net/url" + "strings" ) func GetRefreshedService(name string, ctx ziti.Context) (*rest_model.ServiceDetail, bool) {