From f2d23c7293d93233ce41556a5ba330c945f13abc Mon Sep 17 00:00:00 2001 From: Arthur Pitman Date: Thu, 2 Jun 2022 11:22:31 +0200 Subject: [PATCH] Remove deprecated functions from v2 Signed-off-by: Arthur Pitman --- pkg/api/utils/v2/apiUtils.go | 10 ---------- pkg/api/utils/v2/authUtils.go | 11 ----------- pkg/api/utils/v2/eventUtils.go | 10 ---------- pkg/api/utils/v2/logUtils.go | 10 ---------- pkg/api/utils/v2/projectUtils.go | 11 ----------- pkg/api/utils/v2/resourceUtils.go | 11 ----------- pkg/api/utils/v2/secretUtils.go | 11 ----------- pkg/api/utils/v2/sequenceUtils.go | 10 ---------- pkg/api/utils/v2/serviceUtils.go | 11 ----------- pkg/api/utils/v2/shipyardControllerUtils.go | 11 ----------- pkg/api/utils/v2/stageUtils.go | 11 ----------- pkg/api/utils/v2/uniformUtils.go | 10 ---------- 12 files changed, 127 deletions(-) diff --git a/pkg/api/utils/v2/apiUtils.go b/pkg/api/utils/v2/apiUtils.go index 8ba750b18..f60986642 100644 --- a/pkg/api/utils/v2/apiUtils.go +++ b/pkg/api/utils/v2/apiUtils.go @@ -70,16 +70,6 @@ type APIHandler struct { Scheme string } -// NewAuthenticatedAPIHandler returns a new APIHandler that authenticates at the api-service endpoint via the provided token -// Deprecated: use APISet instead -func NewAuthenticatedAPIHandler(baseURL string, authToken string, authHeader string, httpClient *http.Client, scheme string) *APIHandler { - if httpClient == nil { - httpClient = &http.Client{} - } - httpClient.Transport = wrapOtelTransport(getClientTransport(httpClient.Transport)) - return createAuthenticatedAPIHandler(baseURL, authToken, authHeader, httpClient, scheme) -} - func createAuthenticatedAPIHandler(baseURL string, authToken string, authHeader string, httpClient *http.Client, scheme string) *APIHandler { baseURL = strings.TrimPrefix(baseURL, "http://") baseURL = strings.TrimPrefix(baseURL, "https://") diff --git a/pkg/api/utils/v2/authUtils.go b/pkg/api/utils/v2/authUtils.go index 1e313064f..0376b951f 100644 --- a/pkg/api/utils/v2/authUtils.go +++ b/pkg/api/utils/v2/authUtils.go @@ -41,17 +41,6 @@ func NewAuthHandler(baseURL string) *AuthHandler { } } -// NewAuthenticatedAuthHandler returns a new AuthHandler that authenticates at the endpoint via the provided token -// Deprecated: use APISet instead -func NewAuthenticatedAuthHandler(baseURL string, authToken string, authHeader string, httpClient *http.Client, scheme string) *AuthHandler { - if httpClient == nil { - httpClient = &http.Client{} - } - httpClient.Transport = wrapOtelTransport(getClientTransport(httpClient.Transport)) - - return createAuthenticatedAuthHandler(baseURL, authToken, authHeader, httpClient, scheme) -} - func createAuthenticatedAuthHandler(baseURL string, authToken string, authHeader string, httpClient *http.Client, scheme string) *AuthHandler { baseURL = strings.TrimPrefix(baseURL, "http://") baseURL = strings.TrimPrefix(baseURL, "https://") diff --git a/pkg/api/utils/v2/eventUtils.go b/pkg/api/utils/v2/eventUtils.go index 2037ad734..285570683 100644 --- a/pkg/api/utils/v2/eventUtils.go +++ b/pkg/api/utils/v2/eventUtils.go @@ -67,16 +67,6 @@ func NewEventHandler(baseURL string) *EventHandler { const mongodbDatastoreServiceBaseUrl = "mongodb-datastore" -// NewAuthenticatedEventHandler returns a new EventHandler that authenticates at the endpoint via the provided token -// Deprecated: use APISet instead -func NewAuthenticatedEventHandler(baseURL string, authToken string, authHeader string, httpClient *http.Client, scheme string) *EventHandler { - if httpClient == nil { - httpClient = &http.Client{} - } - httpClient.Transport = wrapOtelTransport(getClientTransport(httpClient.Transport)) - return createAuthenticatedEventHandler(baseURL, authToken, authHeader, httpClient, scheme) -} - func createAuthenticatedEventHandler(baseURL string, authToken string, authHeader string, httpClient *http.Client, scheme string) *EventHandler { baseURL = strings.TrimPrefix(baseURL, "http://") baseURL = strings.TrimPrefix(baseURL, "https://") diff --git a/pkg/api/utils/v2/logUtils.go b/pkg/api/utils/v2/logUtils.go index 0426050f5..94f98562a 100644 --- a/pkg/api/utils/v2/logUtils.go +++ b/pkg/api/utils/v2/logUtils.go @@ -81,16 +81,6 @@ func NewLogHandler(baseURL string) *LogHandler { } } -// NewAuthenticatedLogHandler returns a new EventHandler that authenticates at the endpoint via the provided token -// Deprecated: use APISet instead -func NewAuthenticatedLogHandler(baseURL string, authToken string, authHeader string, httpClient *http.Client, scheme string) *LogHandler { - if httpClient == nil { - httpClient = &http.Client{} - } - httpClient.Transport = getClientTransport(httpClient.Transport) - return createAuthenticatedLogHandler(baseURL, authToken, authHeader, httpClient, scheme) -} - func createAuthenticatedLogHandler(baseURL string, authToken string, authHeader string, httpClient *http.Client, scheme string) *LogHandler { baseURL = strings.TrimPrefix(baseURL, "http://") baseURL = strings.TrimPrefix(baseURL, "https://") diff --git a/pkg/api/utils/v2/projectUtils.go b/pkg/api/utils/v2/projectUtils.go index 9c14a6f4b..72243fde3 100644 --- a/pkg/api/utils/v2/projectUtils.go +++ b/pkg/api/utils/v2/projectUtils.go @@ -67,17 +67,6 @@ func NewProjectHandler(baseURL string) *ProjectHandler { } } -// NewAuthenticatedProjectHandler returns a new ProjectHandler that authenticates at the api via the provided token -// and sends all requests directly to the configuration-service -// Deprecated: use APISet instead -func NewAuthenticatedProjectHandler(baseURL string, authToken string, authHeader string, httpClient *http.Client, scheme string) *ProjectHandler { - if httpClient == nil { - httpClient = &http.Client{} - } - httpClient.Transport = wrapOtelTransport(getClientTransport(httpClient.Transport)) - return createAuthProjectHandler(baseURL, authToken, authHeader, httpClient, scheme) -} - func createAuthProjectHandler(baseURL string, authToken string, authHeader string, httpClient *http.Client, scheme string) *ProjectHandler { baseURL = strings.TrimPrefix(baseURL, "http://") baseURL = strings.TrimPrefix(baseURL, "https://") diff --git a/pkg/api/utils/v2/resourceUtils.go b/pkg/api/utils/v2/resourceUtils.go index 3802b3298..e0777c67b 100644 --- a/pkg/api/utils/v2/resourceUtils.go +++ b/pkg/api/utils/v2/resourceUtils.go @@ -230,17 +230,6 @@ func NewResourceHandler(baseURL string) *ResourceHandler { } } -// NewAuthenticatedResourceHandler returns a new ResourceHandler that authenticates at the api via the provided token -// and sends all requests directly to the configuration-service -// Deprecated: use APISet instead -func NewAuthenticatedResourceHandler(baseURL string, authToken string, authHeader string, httpClient *http.Client, scheme string) *ResourceHandler { - if httpClient == nil { - httpClient = &http.Client{} - } - httpClient.Transport = wrapOtelTransport(getClientTransport(httpClient.Transport)) - return createAuthenticatedResourceHandler(baseURL, authToken, authHeader, httpClient, scheme) -} - func createAuthenticatedResourceHandler(baseURL string, authToken string, authHeader string, httpClient *http.Client, scheme string) *ResourceHandler { baseURL = strings.TrimPrefix(baseURL, "http://") baseURL = strings.TrimPrefix(baseURL, "https://") diff --git a/pkg/api/utils/v2/secretUtils.go b/pkg/api/utils/v2/secretUtils.go index 666cd81da..c6caad106 100644 --- a/pkg/api/utils/v2/secretUtils.go +++ b/pkg/api/utils/v2/secretUtils.go @@ -64,17 +64,6 @@ func NewSecretHandler(baseURL string) *SecretHandler { } } -// NewAuthenticatedSecretHandler returns a new SecretHandler that authenticates at the api via the provided token -// and sends all requests directly to the secret-service -// Deprecated: use APISet instead -func NewAuthenticatedSecretHandler(baseURL string, authToken string, authHeader string, httpClient *http.Client, scheme string) *SecretHandler { - if httpClient == nil { - httpClient = &http.Client{} - } - httpClient.Transport = wrapOtelTransport(getClientTransport(httpClient.Transport)) - return createAuthenticatedSecretHandler(baseURL, authToken, authHeader, httpClient, scheme) -} - func createAuthenticatedSecretHandler(baseURL string, authToken string, authHeader string, httpClient *http.Client, scheme string) *SecretHandler { baseURL = strings.TrimPrefix(baseURL, "http://") baseURL = strings.TrimPrefix(baseURL, "https://") diff --git a/pkg/api/utils/v2/sequenceUtils.go b/pkg/api/utils/v2/sequenceUtils.go index 6d01780be..40f4e3c9a 100644 --- a/pkg/api/utils/v2/sequenceUtils.go +++ b/pkg/api/utils/v2/sequenceUtils.go @@ -84,16 +84,6 @@ func NewSequenceControlHandler(baseURL string) *SequenceControlHandler { } } -// NewAuthenticatedSequenceControlHandler returns a new SequenceControlHandler that authenticates at the api via the provided token -// Deprecated: use APISet instead -func NewAuthenticatedSequenceControlHandler(baseURL string, authToken string, authHeader string, httpClient *http.Client, scheme string) *SequenceControlHandler { - if httpClient == nil { - httpClient = &http.Client{} - } - httpClient.Transport = wrapOtelTransport(getClientTransport(httpClient.Transport)) - return createAuthenticatedSequenceControlHandler(baseURL, authToken, authHeader, httpClient, scheme) -} - func createAuthenticatedSequenceControlHandler(baseURL string, authToken string, authHeader string, httpClient *http.Client, scheme string) *SequenceControlHandler { baseURL = strings.TrimPrefix(baseURL, "http://") baseURL = strings.TrimPrefix(baseURL, "https://") diff --git a/pkg/api/utils/v2/serviceUtils.go b/pkg/api/utils/v2/serviceUtils.go index d961e3e84..b194fe81e 100644 --- a/pkg/api/utils/v2/serviceUtils.go +++ b/pkg/api/utils/v2/serviceUtils.go @@ -62,17 +62,6 @@ func NewServiceHandler(baseURL string) *ServiceHandler { } } -// NewAuthenticatedServiceHandler returns a new ServiceHandler that authenticates at the api via the provided token -// and sends all requests directly to the configuration-service -// Deprecated: use APISet instead -func NewAuthenticatedServiceHandler(baseURL string, authToken string, authHeader string, httpClient *http.Client, scheme string) *ServiceHandler { - if httpClient == nil { - httpClient = &http.Client{} - } - httpClient.Transport = wrapOtelTransport(getClientTransport(httpClient.Transport)) - return createAuthenticatedServiceHandler(baseURL, authToken, authHeader, httpClient, scheme) -} - func createAuthenticatedServiceHandler(baseURL string, authToken string, authHeader string, httpClient *http.Client, scheme string) *ServiceHandler { baseURL = strings.TrimPrefix(baseURL, "http://") baseURL = strings.TrimPrefix(baseURL, "https://") diff --git a/pkg/api/utils/v2/shipyardControllerUtils.go b/pkg/api/utils/v2/shipyardControllerUtils.go index c4f44f595..7a46bb3f7 100644 --- a/pkg/api/utils/v2/shipyardControllerUtils.go +++ b/pkg/api/utils/v2/shipyardControllerUtils.go @@ -46,17 +46,6 @@ func NewShipyardControllerHandler(baseURL string) *ShipyardControllerHandler { } } -// NewAuthenticatedShipyardControllerHandler returns a new ShipyardControllerHandler that authenticates at the api via the provided token -// and sends all requests directly to the configuration-service -// Deprecated: use APISet instead -func NewAuthenticatedShipyardControllerHandler(baseURL string, authToken string, authHeader string, httpClient *http.Client, scheme string) *ShipyardControllerHandler { - if httpClient == nil { - httpClient = &http.Client{} - } - httpClient.Transport = wrapOtelTransport(getClientTransport(httpClient.Transport)) - return createAuthenticatedShipyardControllerHandler(baseURL, authToken, authHeader, httpClient, scheme) -} - func createAuthenticatedShipyardControllerHandler(baseURL string, authToken string, authHeader string, httpClient *http.Client, scheme string) *ShipyardControllerHandler { baseURL = strings.TrimPrefix(baseURL, "http://") baseURL = strings.TrimPrefix(baseURL, "https://") diff --git a/pkg/api/utils/v2/stageUtils.go b/pkg/api/utils/v2/stageUtils.go index c660ed520..3c75be390 100644 --- a/pkg/api/utils/v2/stageUtils.go +++ b/pkg/api/utils/v2/stageUtils.go @@ -51,17 +51,6 @@ func NewStageHandler(baseURL string) *StageHandler { } } -// NewAuthenticatedStageHandler returns a new StageHandler that authenticates at the api via the provided token -// and sends all requests directly to the configuration-service -// Deprecated: use APISet instead -func NewAuthenticatedStageHandler(baseURL string, authToken string, authHeader string, httpClient *http.Client, scheme string) *StageHandler { - if httpClient == nil { - httpClient = &http.Client{} - } - httpClient.Transport = wrapOtelTransport(getClientTransport(httpClient.Transport)) - return createAuthenticatedStageHandler(baseURL, authToken, authHeader, httpClient, scheme) -} - func createAuthenticatedStageHandler(baseURL string, authToken string, authHeader string, httpClient *http.Client, scheme string) *StageHandler { baseURL = strings.TrimPrefix(baseURL, "http://") baseURL = strings.TrimPrefix(baseURL, "https://") diff --git a/pkg/api/utils/v2/uniformUtils.go b/pkg/api/utils/v2/uniformUtils.go index 16b92a313..d6e270aaa 100644 --- a/pkg/api/utils/v2/uniformUtils.go +++ b/pkg/api/utils/v2/uniformUtils.go @@ -58,16 +58,6 @@ func NewUniformHandler(baseURL string) *UniformHandler { } } -// NewAuthenticatedUniformHandler returns a new UniformHandler that authenticates at the api via the provided token -// Deprecated: use APISet instead -func NewAuthenticatedUniformHandler(baseURL string, authToken string, authHeader string, httpClient *http.Client, scheme string) *UniformHandler { - if httpClient == nil { - httpClient = &http.Client{} - } - httpClient.Transport = getClientTransport(httpClient.Transport) - return createAuthenticatedUniformHandler(baseURL, authToken, authHeader, httpClient, scheme) -} - func createAuthenticatedUniformHandler(baseURL string, authToken string, authHeader string, httpClient *http.Client, scheme string) *UniformHandler { baseURL = httputils.TrimHTTPScheme(baseURL) baseURL = strings.TrimRight(baseURL, "/")