diff --git a/deploy/Dockerfile b/deploy/Dockerfile index a1798e7841..18a126410b 100644 --- a/deploy/Dockerfile +++ b/deploy/Dockerfile @@ -62,45 +62,45 @@ RUN curl -fsSLO "${KUBECTL_1_23_URL}" \ && mv kubectl "${KOTS_KUBECTL_BIN_DIR}/kubectl-v1.23" # Install Kubectl 1.24 -ENV KUBECTL_1_24_VERSION=v1.24.16 +ENV KUBECTL_1_24_VERSION=v1.24.17 ENV KUBECTL_1_24_URL=https://dl.k8s.io/release/${KUBECTL_1_24_VERSION}/bin/linux/amd64/kubectl -ENV KUBECTL_1_24_SHA256SUM=33f8179cd124ab97268ec0cf4c91a05514c8e82d7a341d337e92881401844d71 +ENV KUBECTL_1_24_SHA256SUM=3e9588e3326c7110a163103fc3ea101bb0e85f4d6fd228cf928fa9a2a20594d5 RUN curl -fsSLO "${KUBECTL_1_24_URL}" \ && echo "${KUBECTL_1_24_SHA256SUM} kubectl" | sha256sum -c - \ && chmod +x kubectl \ && mv kubectl "${KOTS_KUBECTL_BIN_DIR}/kubectl-v1.24" # Install Kubectl 1.25 -ENV KUBECTL_1_25_VERSION=v1.25.12 +ENV KUBECTL_1_25_VERSION=v1.25.15 ENV KUBECTL_1_25_URL=https://dl.k8s.io/release/${KUBECTL_1_25_VERSION}/bin/linux/amd64/kubectl -ENV KUBECTL_1_25_SHA256SUM=75842752ea07cb8ee2210df40faa7c61e1317e76d5c7968e380cae83447d4a0f +ENV KUBECTL_1_25_SHA256SUM=6428297af0b06d1bb87601258fb61c13d82bf3187b2329b5f38b6f0fec5be575 RUN curl -fsSLO "${KUBECTL_1_25_URL}" \ && echo "${KUBECTL_1_25_SHA256SUM} kubectl" | sha256sum -c - \ && chmod +x kubectl \ && mv kubectl "${KOTS_KUBECTL_BIN_DIR}/kubectl-v1.25" # Install Kubectl 1.26 -ENV KUBECTL_1_26_VERSION=v1.26.7 +ENV KUBECTL_1_26_VERSION=v1.26.10 ENV KUBECTL_1_26_URL=https://dl.k8s.io/release/${KUBECTL_1_26_VERSION}/bin/linux/amd64/kubectl -ENV KUBECTL_1_26_SHA256SUM=d9dc7741e5f279c28ef32fbbe1daa8ebc36622391c33470efed5eb8426959971 +ENV KUBECTL_1_26_SHA256SUM=93ad44b4072669237247bfbc171be816f08e7e9e4260418d2cfdd0da1704ae86 RUN curl -fsSLO "${KUBECTL_1_26_URL}" \ && echo "${KUBECTL_1_26_SHA256SUM} kubectl" | sha256sum -c - \ && chmod +x kubectl \ && mv kubectl "${KOTS_KUBECTL_BIN_DIR}/kubectl-v1.26" # Install Kubectl 1.27 -ENV KUBECTL_1_27_VERSION=v1.27.4 +ENV KUBECTL_1_27_VERSION=v1.27.7 ENV KUBECTL_1_27_URL=https://dl.k8s.io/release/${KUBECTL_1_27_VERSION}/bin/linux/amd64/kubectl -ENV KUBECTL_1_27_SHA256SUM=4685bfcf732260f72fce58379e812e091557ef1dfc1bc8084226c7891dd6028f +ENV KUBECTL_1_27_SHA256SUM=e5fe510ba6f421958358d3d43b3f0b04c2957d4bc3bb24cf541719af61a06d79 RUN curl -fsSLO "${KUBECTL_1_27_URL}" \ && echo "${KUBECTL_1_27_SHA256SUM} kubectl" | sha256sum -c - \ && chmod +x kubectl \ && mv kubectl "${KOTS_KUBECTL_BIN_DIR}/kubectl-v1.27" # Install Kubectl 1.28 -ENV KUBECTL_1_28_VERSION=v1.28.1 +ENV KUBECTL_1_28_VERSION=v1.28.3 ENV KUBECTL_1_28_URL=https://dl.k8s.io/release/${KUBECTL_1_28_VERSION}/bin/linux/amd64/kubectl -ENV KUBECTL_1_28_SHA256SUM=e7a7d6f9d06fab38b4128785aa80f65c54f6675a0d2abef655259ddd852274e1 +ENV KUBECTL_1_28_SHA256SUM=0c680c90892c43e5ce708e918821f92445d1d244f9b3d7513023bcae9a6246d1 RUN curl -fsSLO "${KUBECTL_1_28_URL}" \ && echo "${KUBECTL_1_28_SHA256SUM} kubectl" | sha256sum -c - \ && chmod +x kubectl \ @@ -136,9 +136,9 @@ RUN curl -fsSL -o kustomize.tar.gz "${KUSTOMIZE5_URL}" \ ENV KOTS_HELM_BIN_DIR=/usr/local/bin # Install helm v3 -ENV HELM3_VERSION=3.13.0 +ENV HELM3_VERSION=3.13.1 ENV HELM3_URL=https://get.helm.sh/helm-v${HELM3_VERSION}-linux-amd64.tar.gz -ENV HELM3_SHA256SUM=138676351483e61d12dfade70da6c03d471bbdcac84eaadeb5e1d06fa114a24f +ENV HELM3_SHA256SUM=98c363564d00afd0cc3088e8f830f2a0eeb5f28755b3d8c48df89866374a1ed0 RUN cd /tmp && curl -fsSL -o helm.tar.gz "${HELM3_URL}" \ && echo "${HELM3_SHA256SUM} helm.tar.gz" | sha256sum -c - \ && tar -xzvf helm.tar.gz \ diff --git a/deploy/okteto/okteto-v2.Dockerfile b/deploy/okteto/okteto-v2.Dockerfile index d449cf5cf2..355e01d416 100644 --- a/deploy/okteto/okteto-v2.Dockerfile +++ b/deploy/okteto/okteto-v2.Dockerfile @@ -63,45 +63,45 @@ RUN curl -fsSLO "${KUBECTL_1_23_URL}" \ && mv kubectl "${KOTS_KUBECTL_BIN_DIR}/kubectl-v1.23" # Install Kubectl 1.24 -ENV KUBECTL_1_24_VERSION=v1.24.16 +ENV KUBECTL_1_24_VERSION=v1.24.17 ENV KUBECTL_1_24_URL=https://dl.k8s.io/release/${KUBECTL_1_24_VERSION}/bin/linux/amd64/kubectl -ENV KUBECTL_1_24_SHA256SUM=33f8179cd124ab97268ec0cf4c91a05514c8e82d7a341d337e92881401844d71 +ENV KUBECTL_1_24_SHA256SUM=3e9588e3326c7110a163103fc3ea101bb0e85f4d6fd228cf928fa9a2a20594d5 RUN curl -fsSLO "${KUBECTL_1_24_URL}" \ && echo "${KUBECTL_1_24_SHA256SUM} kubectl" | sha256sum -c - \ && chmod +x kubectl \ && mv kubectl "${KOTS_KUBECTL_BIN_DIR}/kubectl-v1.24" # Install Kubectl 1.25 -ENV KUBECTL_1_25_VERSION=v1.25.12 +ENV KUBECTL_1_25_VERSION=v1.25.15 ENV KUBECTL_1_25_URL=https://dl.k8s.io/release/${KUBECTL_1_25_VERSION}/bin/linux/amd64/kubectl -ENV KUBECTL_1_25_SHA256SUM=75842752ea07cb8ee2210df40faa7c61e1317e76d5c7968e380cae83447d4a0f +ENV KUBECTL_1_25_SHA256SUM=6428297af0b06d1bb87601258fb61c13d82bf3187b2329b5f38b6f0fec5be575 RUN curl -fsSLO "${KUBECTL_1_25_URL}" \ && echo "${KUBECTL_1_25_SHA256SUM} kubectl" | sha256sum -c - \ && chmod +x kubectl \ && mv kubectl "${KOTS_KUBECTL_BIN_DIR}/kubectl-v1.25" # Install Kubectl 1.26 -ENV KUBECTL_1_26_VERSION=v1.26.7 +ENV KUBECTL_1_26_VERSION=v1.26.10 ENV KUBECTL_1_26_URL=https://dl.k8s.io/release/${KUBECTL_1_26_VERSION}/bin/linux/amd64/kubectl -ENV KUBECTL_1_26_SHA256SUM=d9dc7741e5f279c28ef32fbbe1daa8ebc36622391c33470efed5eb8426959971 +ENV KUBECTL_1_26_SHA256SUM=93ad44b4072669237247bfbc171be816f08e7e9e4260418d2cfdd0da1704ae86 RUN curl -fsSLO "${KUBECTL_1_26_URL}" \ && echo "${KUBECTL_1_26_SHA256SUM} kubectl" | sha256sum -c - \ && chmod +x kubectl \ && mv kubectl "${KOTS_KUBECTL_BIN_DIR}/kubectl-v1.26" # Install Kubectl 1.27 -ENV KUBECTL_1_27_VERSION=v1.27.4 +ENV KUBECTL_1_27_VERSION=v1.27.7 ENV KUBECTL_1_27_URL=https://dl.k8s.io/release/${KUBECTL_1_27_VERSION}/bin/linux/amd64/kubectl -ENV KUBECTL_1_27_SHA256SUM=4685bfcf732260f72fce58379e812e091557ef1dfc1bc8084226c7891dd6028f +ENV KUBECTL_1_27_SHA256SUM=e5fe510ba6f421958358d3d43b3f0b04c2957d4bc3bb24cf541719af61a06d79 RUN curl -fsSLO "${KUBECTL_1_27_URL}" \ && echo "${KUBECTL_1_27_SHA256SUM} kubectl" | sha256sum -c - \ && chmod +x kubectl \ && mv kubectl "${KOTS_KUBECTL_BIN_DIR}/kubectl-v1.27" # Install Kubectl 1.28 -ENV KUBECTL_1_28_VERSION=v1.28.1 +ENV KUBECTL_1_28_VERSION=v1.28.3 ENV KUBECTL_1_28_URL=https://dl.k8s.io/release/${KUBECTL_1_28_VERSION}/bin/linux/amd64/kubectl -ENV KUBECTL_1_28_SHA256SUM=e7a7d6f9d06fab38b4128785aa80f65c54f6675a0d2abef655259ddd852274e1 +ENV KUBECTL_1_28_SHA256SUM=0c680c90892c43e5ce708e918821f92445d1d244f9b3d7513023bcae9a6246d1 RUN curl -fsSLO "${KUBECTL_1_28_URL}" \ && echo "${KUBECTL_1_28_SHA256SUM} kubectl" | sha256sum -c - \ && chmod +x kubectl \ @@ -136,9 +136,9 @@ RUN curl -fsSL -o kustomize.tar.gz "${KUSTOMIZE5_URL}" \ ENV KOTS_HELM_BIN_DIR=/usr/local/bin # Install helm v3 -ENV HELM3_VERSION=3.13.0 +ENV HELM3_VERSION=3.13.1 ENV HELM3_URL=https://get.helm.sh/helm-v${HELM3_VERSION}-linux-amd64.tar.gz -ENV HELM3_SHA256SUM=138676351483e61d12dfade70da6c03d471bbdcac84eaadeb5e1d06fa114a24f +ENV HELM3_SHA256SUM=98c363564d00afd0cc3088e8f830f2a0eeb5f28755b3d8c48df89866374a1ed0 RUN cd /tmp && curl -fsSL -o helm.tar.gz "${HELM3_URL}" \ && echo "${HELM3_SHA256SUM} helm.tar.gz" | sha256sum -c - \ && tar -xzvf helm.tar.gz \ diff --git a/deploy/okteto/okteto.Dockerfile b/deploy/okteto/okteto.Dockerfile index c98a583c61..4f281322f2 100644 --- a/deploy/okteto/okteto.Dockerfile +++ b/deploy/okteto/okteto.Dockerfile @@ -64,45 +64,45 @@ RUN curl -fsSLO "${KUBECTL_1_23_URL}" \ && mv kubectl "${KOTS_KUBECTL_BIN_DIR}/kubectl-v1.23" # Install Kubectl 1.24 -ENV KUBECTL_1_24_VERSION=v1.24.16 +ENV KUBECTL_1_24_VERSION=v1.24.17 ENV KUBECTL_1_24_URL=https://dl.k8s.io/release/${KUBECTL_1_24_VERSION}/bin/linux/amd64/kubectl -ENV KUBECTL_1_24_SHA256SUM=33f8179cd124ab97268ec0cf4c91a05514c8e82d7a341d337e92881401844d71 +ENV KUBECTL_1_24_SHA256SUM=3e9588e3326c7110a163103fc3ea101bb0e85f4d6fd228cf928fa9a2a20594d5 RUN curl -fsSLO "${KUBECTL_1_24_URL}" \ && echo "${KUBECTL_1_24_SHA256SUM} kubectl" | sha256sum -c - \ && chmod +x kubectl \ && mv kubectl "${KOTS_KUBECTL_BIN_DIR}/kubectl-v1.24" # Install Kubectl 1.25 -ENV KUBECTL_1_25_VERSION=v1.25.12 +ENV KUBECTL_1_25_VERSION=v1.25.15 ENV KUBECTL_1_25_URL=https://dl.k8s.io/release/${KUBECTL_1_25_VERSION}/bin/linux/amd64/kubectl -ENV KUBECTL_1_25_SHA256SUM=75842752ea07cb8ee2210df40faa7c61e1317e76d5c7968e380cae83447d4a0f +ENV KUBECTL_1_25_SHA256SUM=6428297af0b06d1bb87601258fb61c13d82bf3187b2329b5f38b6f0fec5be575 RUN curl -fsSLO "${KUBECTL_1_25_URL}" \ && echo "${KUBECTL_1_25_SHA256SUM} kubectl" | sha256sum -c - \ && chmod +x kubectl \ && mv kubectl "${KOTS_KUBECTL_BIN_DIR}/kubectl-v1.25" # Install Kubectl 1.26 -ENV KUBECTL_1_26_VERSION=v1.26.7 +ENV KUBECTL_1_26_VERSION=v1.26.10 ENV KUBECTL_1_26_URL=https://dl.k8s.io/release/${KUBECTL_1_26_VERSION}/bin/linux/amd64/kubectl -ENV KUBECTL_1_26_SHA256SUM=d9dc7741e5f279c28ef32fbbe1daa8ebc36622391c33470efed5eb8426959971 +ENV KUBECTL_1_26_SHA256SUM=93ad44b4072669237247bfbc171be816f08e7e9e4260418d2cfdd0da1704ae86 RUN curl -fsSLO "${KUBECTL_1_26_URL}" \ && echo "${KUBECTL_1_26_SHA256SUM} kubectl" | sha256sum -c - \ && chmod +x kubectl \ && mv kubectl "${KOTS_KUBECTL_BIN_DIR}/kubectl-v1.26" # Install Kubectl 1.27 -ENV KUBECTL_1_27_VERSION=v1.27.4 +ENV KUBECTL_1_27_VERSION=v1.27.7 ENV KUBECTL_1_27_URL=https://dl.k8s.io/release/${KUBECTL_1_27_VERSION}/bin/linux/amd64/kubectl -ENV KUBECTL_1_27_SHA256SUM=4685bfcf732260f72fce58379e812e091557ef1dfc1bc8084226c7891dd6028f +ENV KUBECTL_1_27_SHA256SUM=e5fe510ba6f421958358d3d43b3f0b04c2957d4bc3bb24cf541719af61a06d79 RUN curl -fsSLO "${KUBECTL_1_27_URL}" \ && echo "${KUBECTL_1_27_SHA256SUM} kubectl" | sha256sum -c - \ && chmod +x kubectl \ && mv kubectl "${KOTS_KUBECTL_BIN_DIR}/kubectl-v1.27" # Install Kubectl 1.28 -ENV KUBECTL_1_28_VERSION=v1.28.1 +ENV KUBECTL_1_28_VERSION=v1.28.3 ENV KUBECTL_1_28_URL=https://dl.k8s.io/release/${KUBECTL_1_28_VERSION}/bin/linux/amd64/kubectl -ENV KUBECTL_1_28_SHA256SUM=e7a7d6f9d06fab38b4128785aa80f65c54f6675a0d2abef655259ddd852274e1 +ENV KUBECTL_1_28_SHA256SUM=0c680c90892c43e5ce708e918821f92445d1d244f9b3d7513023bcae9a6246d1 RUN curl -fsSLO "${KUBECTL_1_28_URL}" \ && echo "${KUBECTL_1_28_SHA256SUM} kubectl" | sha256sum -c - \ && chmod +x kubectl \ @@ -137,9 +137,9 @@ RUN curl -fsSL -o kustomize.tar.gz "${KUSTOMIZE5_URL}" \ ENV KOTS_HELM_BIN_DIR=/usr/local/bin # Install helm v3 -ENV HELM3_VERSION=3.13.0 +ENV HELM3_VERSION=3.13.1 ENV HELM3_URL=https://get.helm.sh/helm-v${HELM3_VERSION}-linux-amd64.tar.gz -ENV HELM3_SHA256SUM=138676351483e61d12dfade70da6c03d471bbdcac84eaadeb5e1d06fa114a24f +ENV HELM3_SHA256SUM=98c363564d00afd0cc3088e8f830f2a0eeb5f28755b3d8c48df89866374a1ed0 RUN cd /tmp && curl -fsSL -o helm.tar.gz "${HELM3_URL}" \ && echo "${HELM3_SHA256SUM} helm.tar.gz" | sha256sum -c - \ && tar -xzvf helm.tar.gz \ diff --git a/hack/dev/skaffold.Dockerfile b/hack/dev/skaffold.Dockerfile index 94f2d65109..e70ac942bb 100644 --- a/hack/dev/skaffold.Dockerfile +++ b/hack/dev/skaffold.Dockerfile @@ -81,45 +81,45 @@ RUN curl -fsSLO "${KUBECTL_1_23_URL}" \ && mv kubectl "${KOTS_KUBECTL_BIN_DIR}/kubectl-v1.23" # Install Kubectl 1.24 -ENV KUBECTL_1_24_VERSION=v1.24.16 +ENV KUBECTL_1_24_VERSION=v1.24.17 ENV KUBECTL_1_24_URL=https://dl.k8s.io/release/${KUBECTL_1_24_VERSION}/bin/linux/amd64/kubectl -ENV KUBECTL_1_24_SHA256SUM=33f8179cd124ab97268ec0cf4c91a05514c8e82d7a341d337e92881401844d71 +ENV KUBECTL_1_24_SHA256SUM=3e9588e3326c7110a163103fc3ea101bb0e85f4d6fd228cf928fa9a2a20594d5 RUN curl -fsSLO "${KUBECTL_1_24_URL}" \ && echo "${KUBECTL_1_24_SHA256SUM} kubectl" | sha256sum -c - \ && chmod +x kubectl \ && mv kubectl "${KOTS_KUBECTL_BIN_DIR}/kubectl-v1.24" # Install Kubectl 1.25 -ENV KUBECTL_1_25_VERSION=v1.25.12 +ENV KUBECTL_1_25_VERSION=v1.25.15 ENV KUBECTL_1_25_URL=https://dl.k8s.io/release/${KUBECTL_1_25_VERSION}/bin/linux/amd64/kubectl -ENV KUBECTL_1_25_SHA256SUM=75842752ea07cb8ee2210df40faa7c61e1317e76d5c7968e380cae83447d4a0f +ENV KUBECTL_1_25_SHA256SUM=6428297af0b06d1bb87601258fb61c13d82bf3187b2329b5f38b6f0fec5be575 RUN curl -fsSLO "${KUBECTL_1_25_URL}" \ && echo "${KUBECTL_1_25_SHA256SUM} kubectl" | sha256sum -c - \ && chmod +x kubectl \ && mv kubectl "${KOTS_KUBECTL_BIN_DIR}/kubectl-v1.25" # Install Kubectl 1.26 -ENV KUBECTL_1_26_VERSION=v1.26.7 +ENV KUBECTL_1_26_VERSION=v1.26.10 ENV KUBECTL_1_26_URL=https://dl.k8s.io/release/${KUBECTL_1_26_VERSION}/bin/linux/amd64/kubectl -ENV KUBECTL_1_26_SHA256SUM=d9dc7741e5f279c28ef32fbbe1daa8ebc36622391c33470efed5eb8426959971 +ENV KUBECTL_1_26_SHA256SUM=93ad44b4072669237247bfbc171be816f08e7e9e4260418d2cfdd0da1704ae86 RUN curl -fsSLO "${KUBECTL_1_26_URL}" \ && echo "${KUBECTL_1_26_SHA256SUM} kubectl" | sha256sum -c - \ && chmod +x kubectl \ && mv kubectl "${KOTS_KUBECTL_BIN_DIR}/kubectl-v1.26" # Install Kubectl 1.27 -ENV KUBECTL_1_27_VERSION=v1.27.4 +ENV KUBECTL_1_27_VERSION=v1.27.7 ENV KUBECTL_1_27_URL=https://dl.k8s.io/release/${KUBECTL_1_27_VERSION}/bin/linux/amd64/kubectl -ENV KUBECTL_1_27_SHA256SUM=4685bfcf732260f72fce58379e812e091557ef1dfc1bc8084226c7891dd6028f +ENV KUBECTL_1_27_SHA256SUM=e5fe510ba6f421958358d3d43b3f0b04c2957d4bc3bb24cf541719af61a06d79 RUN curl -fsSLO "${KUBECTL_1_27_URL}" \ && echo "${KUBECTL_1_27_SHA256SUM} kubectl" | sha256sum -c - \ && chmod +x kubectl \ && mv kubectl "${KOTS_KUBECTL_BIN_DIR}/kubectl-v1.27" # Install Kubectl 1.28 -ENV KUBECTL_1_28_VERSION=v1.28.1 +ENV KUBECTL_1_28_VERSION=v1.28.3 ENV KUBECTL_1_28_URL=https://dl.k8s.io/release/${KUBECTL_1_28_VERSION}/bin/linux/amd64/kubectl -ENV KUBECTL_1_28_SHA256SUM=e7a7d6f9d06fab38b4128785aa80f65c54f6675a0d2abef655259ddd852274e1 +ENV KUBECTL_1_28_SHA256SUM=0c680c90892c43e5ce708e918821f92445d1d244f9b3d7513023bcae9a6246d1 RUN curl -fsSLO "${KUBECTL_1_28_URL}" \ && echo "${KUBECTL_1_28_SHA256SUM} kubectl" | sha256sum -c - \ && chmod +x kubectl \ @@ -153,9 +153,9 @@ RUN curl -fsSL -o kustomize.tar.gz "${KUSTOMIZE5_URL}" \ ENV KOTS_HELM_BIN_DIR=/usr/local/bin # Install helm v3 -ENV HELM3_VERSION=3.13.0 +ENV HELM3_VERSION=3.13.1 ENV HELM3_URL=https://get.helm.sh/helm-v${HELM3_VERSION}-linux-amd64.tar.gz -ENV HELM3_SHA256SUM=138676351483e61d12dfade70da6c03d471bbdcac84eaadeb5e1d06fa114a24f +ENV HELM3_SHA256SUM=98c363564d00afd0cc3088e8f830f2a0eeb5f28755b3d8c48df89866374a1ed0 RUN cd /tmp && curl -fsSL -o helm.tar.gz "${HELM3_URL}" \ && echo "${HELM3_SHA256SUM} helm.tar.gz" | sha256sum -c - \ && tar -xzvf helm.tar.gz \ diff --git a/pkg/apiserver/server.go b/pkg/apiserver/server.go index acea21be6c..8938f0986f 100644 --- a/pkg/apiserver/server.go +++ b/pkg/apiserver/server.go @@ -187,12 +187,6 @@ func Start(params *APIServerParams) { handlers.RegisterTokenAuthRoutes(handler, debugRouter, loggingRouter) - /********************************************************************** - * License ID auth routes - **********************************************************************/ - - handlers.RegisterLicenseIDAuthRoutes(r.PathPrefix("").Subrouter(), kotsStore, handler) - /********************************************************************** * Session auth routes **********************************************************************/ diff --git a/pkg/handlers/handlers.go b/pkg/handlers/handlers.go index aa711b7b89..637f1651ab 100644 --- a/pkg/handlers/handlers.go +++ b/pkg/handlers/handlers.go @@ -357,12 +357,6 @@ func RegisterUnauthenticatedRoutes(handler *Handler, kotsStore store.Store, debu loggingRouter.Path("/api/v1/app/custom-metrics").Methods("POST").HandlerFunc(handler.GetSendCustomAppMetricsHandler(kotsStore)) } -func RegisterLicenseIDAuthRoutes(r *mux.Router, kotsStore store.Store, handler KOTSHandler) { - r.Use(LoggingMiddleware, RequireValidLicenseMiddleware(kotsStore)) - - r.Name("GetAppMetrics").Path("/api/v1/app/metrics").Methods("GET").HandlerFunc(handler.GetAppMetrics) -} - func StreamJSON(c *websocket.Conn, payload interface{}) { response, err := json.Marshal(payload) if err != nil { diff --git a/pkg/handlers/interface.go b/pkg/handlers/interface.go index c6cb2a00db..69b3539288 100644 --- a/pkg/handlers/interface.go +++ b/pkg/handlers/interface.go @@ -162,7 +162,4 @@ type KOTSHandler interface { // Helm IsHelmManaged(w http.ResponseWriter, r *http.Request) GetAppValuesFile(w http.ResponseWriter, r *http.Request) - - // APIs available to applications (except legacy /license/v1/license) - GetAppMetrics(w http.ResponseWriter, r *http.Request) } diff --git a/pkg/handlers/metrics.go b/pkg/handlers/metrics.go index 38de662f2b..62677c9ea0 100644 --- a/pkg/handlers/metrics.go +++ b/pkg/handlers/metrics.go @@ -10,19 +10,9 @@ import ( "github.com/replicatedhq/kots/pkg/kotsutil" "github.com/replicatedhq/kots/pkg/logger" "github.com/replicatedhq/kots/pkg/replicatedapp" - "github.com/replicatedhq/kots/pkg/reporting" - "github.com/replicatedhq/kots/pkg/session" "github.com/replicatedhq/kots/pkg/store" ) -func (h *Handler) GetAppMetrics(w http.ResponseWriter, r *http.Request) { - app := session.ContextGetApp(r) - reportingInfo := reporting.GetReportingInfo(app.ID) - headers := reporting.GetReportingInfoHeaders(reportingInfo) - - JSON(w, http.StatusOK, headers) -} - type SendCustomAppMetricsRequest struct { Data CustomAppMetricsData `json:"data"` } diff --git a/pkg/handlers/middleware.go b/pkg/handlers/middleware.go index 82ca484693..ea328f8a89 100644 --- a/pkg/handlers/middleware.go +++ b/pkg/handlers/middleware.go @@ -107,21 +107,3 @@ func RequireValidSessionQuietMiddleware(kotsStore store.Store) mux.MiddlewareFun }) } } - -func RequireValidLicenseMiddleware(kotsStore store.Store) mux.MiddlewareFunc { - return func(next http.Handler) http.Handler { - return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - license, app, err := requireValidLicense(kotsStore, w, r) - if err != nil { - if !kotsStore.IsNotFound(err) { - logger.Error(errors.Wrapf(err, "request %q", r.RequestURI)) - } - return - } - - r = session.ContextSetLicense(r, license) - r = session.ContextSetApp(r, app) - next.ServeHTTP(w, r) - }) - } -} diff --git a/pkg/handlers/mock/mock.go b/pkg/handlers/mock/mock.go index cf9fe09ede..7440665850 100644 --- a/pkg/handlers/mock/mock.go +++ b/pkg/handlers/mock/mock.go @@ -598,18 +598,6 @@ func (mr *MockKOTSHandlerMockRecorder) GetAppIdentityServiceConfig(w, r interfac return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAppIdentityServiceConfig", reflect.TypeOf((*MockKOTSHandler)(nil).GetAppIdentityServiceConfig), w, r) } -// GetAppMetrics mocks base method. -func (m *MockKOTSHandler) GetAppMetrics(w http.ResponseWriter, r *http.Request) { - m.ctrl.T.Helper() - m.ctrl.Call(m, "GetAppMetrics", w, r) -} - -// GetAppMetrics indicates an expected call of GetAppMetrics. -func (mr *MockKOTSHandlerMockRecorder) GetAppMetrics(w, r interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAppMetrics", reflect.TypeOf((*MockKOTSHandler)(nil).GetAppMetrics), w, r) -} - // GetAppRegistry mocks base method. func (m *MockKOTSHandler) GetAppRegistry(w http.ResponseWriter, r *http.Request) { m.ctrl.T.Helper() diff --git a/pkg/handlers/session.go b/pkg/handlers/session.go index 819e41db1c..2179f996ed 100644 --- a/pkg/handlers/session.go +++ b/pkg/handlers/session.go @@ -8,16 +8,13 @@ import ( "time" "github.com/pkg/errors" - apptypes "github.com/replicatedhq/kots/pkg/app/types" "github.com/replicatedhq/kots/pkg/handlers/types" "github.com/replicatedhq/kots/pkg/k8sutil" - "github.com/replicatedhq/kots/pkg/kotsutil" "github.com/replicatedhq/kots/pkg/logger" "github.com/replicatedhq/kots/pkg/session" sessiontypes "github.com/replicatedhq/kots/pkg/session/types" "github.com/replicatedhq/kots/pkg/store" "github.com/replicatedhq/kots/pkg/util" - kotsv1beta1 "github.com/replicatedhq/kotskinds/apis/kots/v1beta1" kuberneteserrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) @@ -158,47 +155,3 @@ func requireValidKOTSToken(w http.ResponseWriter, r *http.Request) error { return errors.New("invalid auth") } - -func requireValidLicense(kotsStore store.Store, w http.ResponseWriter, r *http.Request) (*kotsv1beta1.License, *apptypes.App, error) { - if r.Method == "OPTIONS" { - return nil, nil, nil - } - - licenseID := r.Header.Get("authorization") - if licenseID == "" { - err := errors.New("missing authorization header") - response := types.ErrorResponse{Error: util.StrPointer(err.Error())} - JSON(w, http.StatusUnauthorized, response) - return nil, nil, err - } - - apps, err := kotsStore.ListInstalledApps() - if err != nil { - return nil, nil, errors.Wrap(err, "get all apps") - } - - var license *kotsv1beta1.License - var app *apptypes.App - - for _, a := range apps { - l, err := kotsutil.LoadLicenseFromBytes([]byte(a.License)) - if err != nil { - return nil, nil, errors.Wrap(err, "load license") - } - - if l.Spec.LicenseID == licenseID { - license = l - app = a - break - } - } - - if license == nil { - err := errors.New("license ID is not valid") - response := types.ErrorResponse{Error: util.StrPointer(err.Error())} - JSON(w, http.StatusUnauthorized, response) - return nil, nil, err - } - - return license, app, nil -} diff --git a/pkg/session/middleware.go b/pkg/session/middleware.go index 22d46a06b0..91b0394f86 100644 --- a/pkg/session/middleware.go +++ b/pkg/session/middleware.go @@ -4,9 +4,7 @@ import ( "context" "net/http" - apptypes "github.com/replicatedhq/kots/pkg/app/types" "github.com/replicatedhq/kots/pkg/session/types" - "github.com/replicatedhq/kotskinds/apis/kots/v1beta1" ) type sessionKey struct{} @@ -20,21 +18,3 @@ func ContextGetSession(r *http.Request) *types.Session { sess, _ := val.(*types.Session) return sess } - -func ContextSetLicense(r *http.Request, license *v1beta1.License) *http.Request { - return r.WithContext(context.WithValue(r.Context(), "kotsLicense", license)) -} - -func ContextGetLicense(r *http.Request) *v1beta1.License { - val := r.Context().Value("kotsLicense") - return val.(*v1beta1.License) -} - -func ContextSetApp(r *http.Request, app *apptypes.App) *http.Request { - return r.WithContext(context.WithValue(r.Context(), "kotsApp", app)) -} - -func ContextGetApp(r *http.Request) *apptypes.App { - val := r.Context().Value("kotsApp") - return val.(*apptypes.App) -}