From d6e291db158fc100dc8cdee3e4161d259711cd59 Mon Sep 17 00:00:00 2001 From: cong meng Date: Thu, 26 Aug 2021 11:31:22 +1200 Subject: [PATCH 1/5] fix(kubectl): EE-1342 non-admin users cannot connect to the local kube cluster using kubectl shell (#5475) Co-authored-by: Simon Meng --- api/http/handler/websocket/shell_pod.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/api/http/handler/websocket/shell_pod.go b/api/http/handler/websocket/shell_pod.go index c47b311bc..e7e5861b3 100644 --- a/api/http/handler/websocket/shell_pod.go +++ b/api/http/handler/websocket/shell_pod.go @@ -86,17 +86,12 @@ func (handler *Handler) websocketShellPodExec(w http.ResponseWriter, r *http.Req return nil } - serviceAccountToken, isAdminToken, err := handler.getToken(r, endpoint, false) - if err != nil { - return &httperror.HandlerError{http.StatusInternalServerError, "Unable to get user service account token", err} - } - handlerErr := handler.hijackPodExecStartOperation( w, r, cli, - serviceAccountToken, - isAdminToken, + "", + true, endpoint, shellPod.Namespace, shellPod.PodName, From 7c02e4b725611f85e7e53b13841dab558652da91 Mon Sep 17 00:00:00 2001 From: testA113 <83188384+testA113@users.noreply.github.com> Date: Thu, 26 Aug 2021 12:05:28 +1200 Subject: [PATCH 2/5] Xt 485/give front end elements data cy attributes (#5483) * kubernetes attributes done, swarm attributes halfway, aci to go * all attributes for cypress selectors added * kubernetes attributes done, swarm attributes halfway, aci to go * all attributes for cypress selectors added * all attributes for cypress selectors added * fixed files from rebase, added docker sidebar element attributes * kubernetes attributes done, swarm attributes halfway, aci to go * all attributes for cypress selectors added * all attributes for cypress selectors added * removed files to match develop * ammended comments * removed bindings for switch --- .../azure-sidebar/azure-sidebar.html | 16 +++++- .../docker-sidebar/docker-sidebar.html | 57 +++++++++++++++---- .../imageRegistry/por-image-registry.html | 1 + .../edgeGroupsSelector.html | 2 +- .../edgeStacksDatatable.html | 30 +++++++--- app/edge/components/group-form/groupForm.html | 3 +- .../groups-datatable/groupsDatatable.html | 17 ++++-- .../createEdgeStackView.html | 11 ++-- .../containersDatatable.html | 2 +- .../applicationsDatatable.html | 35 +++++++++--- .../configurationsDatatable.html | 27 ++++++--- .../events-datatable/eventsDatatable.html | 10 +++- .../resourcePoolsDatatable.html | 11 +++- .../kubectl-shell/kubectl-shell.html | 12 ++-- .../kubernetesConfigurationData.html | 13 ++++- .../kubernetes-sidebar.html | 50 +++++++++++++--- .../resourceReservation.html | 7 ++- .../components/view-header/viewHeader.html | 2 +- .../templates/advancedDeploymentPanel.html | 5 +- .../views/applications/applications.html | 2 +- .../create/createApplication.html | 2 + .../views/applications/edit/application.html | 11 ++-- .../create/createConfiguration.html | 7 ++- .../configurations/edit/configuration.html | 9 +-- app/kubernetes/views/dashboard/dashboard.html | 8 +-- app/kubernetes/views/deploy/deploy.html | 22 +++++-- .../create/createResourcePool.html | 14 +++-- .../resource-pools/edit/resourcePool.html | 2 +- .../views/resource-pools/resourcePools.html | 1 + .../por-access-management-users-selector.html | 1 + .../accessManagement/porAccessManagement.html | 1 + .../associatedEndpointsSelector.html | 2 + .../endpointsDatatable.html | 15 ++++- .../groups-datatable/groupsDatatable.html | 17 ++++-- .../stacks-datatable/stacksDatatable.html | 17 ++++-- .../users-datatable/usersDatatable.html | 10 +++- .../endpoint-list/endpointList.html | 13 +++-- .../git-form-auth-fieldset.html | 4 +- .../git-form-ref-field.html | 10 +++- .../git-form-url-field.html | 1 + .../forms/por-switch/por-switch.html | 3 +- app/portainer/components/header-content.js | 2 +- .../sidebar/sidebar-menu/sidebar-menu.html | 2 +- .../components/tag-selector/tagSelector.html | 1 + app/portainer/views/auth/auth.html | 5 +- .../endpoints/create/createendpoint.html | 57 +++++++++++++++---- app/portainer/views/settings/settings.html | 14 ++++- app/portainer/views/sidebar/sidebar.html | 28 ++++----- app/portainer/views/teams/teams.html | 3 + app/portainer/views/users/users.html | 19 +++++-- gruntfile.js | 8 +-- 51 files changed, 471 insertions(+), 151 deletions(-) diff --git a/app/azure/components/azure-sidebar/azure-sidebar.html b/app/azure/components/azure-sidebar/azure-sidebar.html index 7f6c5345a..08fcec28e 100644 --- a/app/azure/components/azure-sidebar/azure-sidebar.html +++ b/app/azure/components/azure-sidebar/azure-sidebar.html @@ -1,7 +1,19 @@ - + Dashboard - + Container instances diff --git a/app/docker/components/docker-sidebar/docker-sidebar.html b/app/docker/components/docker-sidebar/docker-sidebar.html index 59866f008..7992dd60c 100644 --- a/app/docker/components/docker-sidebar/docker-sidebar.html +++ b/app/docker/components/docker-sidebar/docker-sidebar.html @@ -1,4 +1,10 @@ - + Dashboard @@ -11,32 +17,46 @@ is-sidebar-open="$ctrl.isSidebarOpen" children-paths="[]" > - + Custom Templates - + Stacks - + Services - + Containers - + Images - + Networks - + Volumes @@ -46,6 +66,7 @@ path-params="{ endpointId: $ctrl.endpointId }" icon-class="fa-file-code fa-fw" class-name="sidebar-list" + data-cy="dockerSidebar-configs" > Configs @@ -56,6 +77,7 @@ path-params="{ endpointId: $ctrl.endpointId }" icon-class="fa-user-secret fa-fw" class-name="sidebar-list" + data-cy="dockerSidebar-secrets" > Secrets @@ -66,6 +88,7 @@ path-params="{ endpointId: $ctrl.endpointId }" icon-class="fa-history fa-fw" class-name="sidebar-list" + data-cy="dockerSidebar-events" > Events @@ -85,11 +108,18 @@ path="docker.featuresConfiguration" path-params="{ endpointId: $ctrl.endpointId }" class-name="sidebar-sublist" + data-cy="dockerSidebar-setup" > Setup - + Registries @@ -110,11 +140,18 @@ path="docker.featuresConfiguration" path-params="{ endpointId: $ctrl.endpointId }" class-name="sidebar-sublist" + data-cy="swarmSidebar-setup" > Setup - + Registries diff --git a/app/docker/components/imageRegistry/por-image-registry.html b/app/docker/components/imageRegistry/por-image-registry.html index e332a9f4d..e3197f678 100644 --- a/app/docker/components/imageRegistry/por-image-registry.html +++ b/app/docker/components/imageRegistry/por-image-registry.html @@ -26,6 +26,7 @@ placeholder="e.g. myImage:myTag" ng-change="$ctrl.onImageChange()" required + data-cy="component-imageInput" /> + {{ $item.Name }} diff --git a/app/edge/components/edge-stacks-datatable/edgeStacksDatatable.html b/app/edge/components/edge-stacks-datatable/edgeStacksDatatable.html index a5e1dbc66..76c74c4e8 100644 --- a/app/edge/components/edge-stacks-datatable/edgeStacksDatatable.html +++ b/app/edge/components/edge-stacks-datatable/edgeStacksDatatable.html @@ -6,7 +6,7 @@ Edge Stacks -
+
Settings