From 8442a4d74aac2fdc8b505aeb3dcdbd27df654325 Mon Sep 17 00:00:00 2001 From: rosstimothy <39066650+rosstimothy@users.noreply.github.com> Date: Mon, 5 Jun 2023 14:48:58 -0400 Subject: [PATCH 001/384] Update `github.com/gravitational/predicate` to `v1.3.1` (#27390) `v1.3.1` contains performance improvements that help address https://github.com/gravitational/teleport/issues/27228. --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 6bf6e92870e37..628b10d7733ce 100644 --- a/go.mod +++ b/go.mod @@ -404,7 +404,7 @@ replace ( // replace module github.com/moby/spdystream until https://github.com/moby/spdystream/pull/91 merges and deps are updated // otherwise tests fail with a data race detection. github.com/moby/spdystream => github.com/gravitational/spdystream v0.0.0-20230512133543-4e46862ca9bf - github.com/vulcand/predicate => github.com/gravitational/predicate v1.3.0 + github.com/vulcand/predicate => github.com/gravitational/predicate v1.3.1 // Use our internal crypto fork, to work around the issue with OpenSSH <= 7.6 mentioned here: https://github.com/golang/go/issues/53391 golang.org/x/crypto => github.com/gravitational/crypto v0.6.0-1 ) diff --git a/go.sum b/go.sum index 99384c2497a72..276a16bb10f7a 100644 --- a/go.sum +++ b/go.sum @@ -897,8 +897,8 @@ github.com/gravitational/license v0.0.0-20210218173955-6d8fb49b117a h1:PN5vAN1ZA github.com/gravitational/license v0.0.0-20210218173955-6d8fb49b117a/go.mod h1:jaxS7X2ouXfNd2Pxpybd01qNQK15UmkixKj4vtpp7f8= github.com/gravitational/oxy v0.0.0-20221029012416-9fbf4c444680 h1:acbjjEJoR2vu1cuSE15Q9YDgWZxWRFj7nr2Vsi/Pn18= github.com/gravitational/oxy v0.0.0-20221029012416-9fbf4c444680/go.mod h1:SP8xfwGas4wleDVXDmeVpfn/Fv+wD8rrb2SqN/DlNXQ= -github.com/gravitational/predicate v1.3.0 h1:n1lmH6YU1oX/Y546qHQNJb50FJy6Ou/+MvW8W9ICrlw= -github.com/gravitational/predicate v1.3.0/go.mod h1:wPNu01gNYh2LRVtIGmFBvRpfBzl4nI2EaxbYDG8Mm4w= +github.com/gravitational/predicate v1.3.1 h1:f1uGg2FF6z5wZbcafYpLZJ1gl+82I0MlSd0cQKDPQe0= +github.com/gravitational/predicate v1.3.1/go.mod h1:H5e9dUW7zb/cuKkkhfnyT9SsI/WHWJ8Ra011La16DTY= github.com/gravitational/protobuf v1.3.2-teleport.1 h1:h5mh+UOKPurqDxn1hRVcr1WzSkmBi+D9qkXpaXA9PFM= github.com/gravitational/protobuf v1.3.2-teleport.1/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/gravitational/redis/v9 v9.0.0-teleport.3 h1:Eg/j3jiNUZ558KDXOqzF682EFmf97vxAFFnMgZ0YHns= From 8b994fcec0220b7f5e555945915ff0e2b34f46f1 Mon Sep 17 00:00:00 2001 From: Lisa Kim Date: Mon, 5 Jun 2023 11:56:08 -0700 Subject: [PATCH 002/384] WebDiscover: Check for RDS length before setting a limit for listing DBs (#27194) * Fix bug: Check for fetched rds results before determining limit for fetching db servers * Address crs --- .../EnrollRdsDatabase/AwsRegionSelector.tsx | 103 +++++-------- .../EnrollRdsDatabase.story.tsx | 3 - .../EnrollRdsDatabase.test.tsx | 144 ++++++++++++++++++ .../EnrollRdsDatabase/EnrollRdsDatabase.tsx | 10 +- 4 files changed, 189 insertions(+), 71 deletions(-) create mode 100644 web/packages/teleport/src/Discover/Database/EnrollRdsDatabase/EnrollRdsDatabase.test.tsx diff --git a/web/packages/teleport/src/Discover/Database/EnrollRdsDatabase/AwsRegionSelector.tsx b/web/packages/teleport/src/Discover/Database/EnrollRdsDatabase/AwsRegionSelector.tsx index 9754fb1567806..d70b9329c294d 100644 --- a/web/packages/teleport/src/Discover/Database/EnrollRdsDatabase/AwsRegionSelector.tsx +++ b/web/packages/teleport/src/Discover/Database/EnrollRdsDatabase/AwsRegionSelector.tsx @@ -15,11 +15,8 @@ */ import React, { useState } from 'react'; -import { Box, ButtonPrimary, Text, Flex, ButtonSecondary } from 'design'; -import FieldSelect from 'shared/components/FieldSelect'; -import { Option } from 'shared/components/Select'; -import { requiredField } from 'shared/components/Validation/rules'; -import Validation, { Validator } from 'shared/components/Validation'; +import { Box, Text, Flex, ButtonSecondary, LabelInput } from 'design'; +import Select, { Option } from 'shared/components/Select'; import { Refresh as RefreshIcon } from 'design/Icon'; import { awsRegionMap, Regions } from 'teleport/services/integrations'; @@ -27,83 +24,59 @@ import { awsRegionMap, Regions } from 'teleport/services/integrations'; export function AwsRegionSelector({ onFetch, onRefresh, - disableFetch, disableSelector, clear, }: { onFetch(region: Regions): void; onRefresh(): void; - disableFetch: boolean; disableSelector: boolean; clear(): void; }) { const [selectedRegion, setSelectedRegion] = useState(); - function handleFetch(validator: Validator) { - if (!validator.validate()) { - return; - } - onFetch(selectedRegion.value); - } - function handleRegionSelect(option: RegionOption) { clear(); setSelectedRegion(option); + onFetch(option.value); } return ( - - {({ validator }) => ( - - - Select the AWS Region you would like to see databases for: - - - - - - - handleFetch(validator)} - width="160px" - height="40px" - mt={1} - > - Fetch Databases - - - - - - + + + Select the AWS Region you would like to see databases for: + + + + AWS Region +