Commit graph

1158 commits

Author SHA1 Message Date
Michael fce1212fc5
Add lock target matcher and fix button themes (#24851) 2023-04-19 21:22:11 +00:00
Michelle Bergquist 093dab9779
fix typo (#24695) 2023-04-18 15:30:34 +00:00
Krzysztof Skrzętnicki b8eca7f6f8
Make audit log details dialog larger. (#24519)
* Make audit log details dialog larger.

* Remove empty line
2023-04-18 11:39:03 +00:00
Grzegorz Zdunek 6761b9e448
Connect: Update colors in the search bar (#24611)
* Update colors in the search bar

* Move `resourceIcons` outside the component

* Run prettier
2023-04-17 15:15:04 +00:00
Lisa Kim 62c5e0ab04
WebDiscover: Create Enroll a RDS Database Screen (#24509)
* Add new endpoint, hardcode aws regions

* Create aws region selector

* Create listing for rds databases

* Create the enroll database screen
2023-04-17 15:00:39 +00:00
Rafał Cieślak dd9c042a68
Connect: Show resource search errors in the search bar (#24520)
* Move tshd test helpers to a better location

* Support passing no props to tshd test helpers

* Refactor ResourcesService getServerByHostname tests

* Move pluralize to shared package

* SearchContext: Rename `opened` to `isOpen`

* ActionPicker story: Show auxiliary items in a separate column

* ActionPicker: Split getClusterName into two functions

getClusterName used to not return the name of the cluster if there's only
a single cluster present. Some places needed to get the cluster name
no matter what, such as the modal with resource errors that will be added
to ActionPicker.

* Refactor resource search to use Promise.allSettled

* useSearchAttempts has been renamed to useActionAttempts
* useActionAttempts returns resourceSearchAttempt in order to supply errors
  from ResourcesService.searchResources to ActionPicker.

* SearchContext: Implement lockOpen

We'll want to display error details in a modal. While the user interacts
with the modal, we don't want to close the search bar and reset the results.

So instead, we are going to force the search bar to stay open until the
user closes the modal. This will use the lockOpen function from this commit.

* Add modal for showing resource search errors

* Refactor mockedSearchContext to not be a top-level mutable var

* Show an item in search bar with resource search errors

* ResourceSearchError: Add instanceof check to tests, include clusterUri in message

* Make isLockedOpen into a ref

* Use table tests for lockOpen tests

* Revert "Make isLockedOpen into a ref"

This reverts commit 07f4206cc2.

* Move capitalization to ResourceSearchError.messageWithClusterName

* ResourceSearchError: Use `public` in constructor

* Connect: Improve focus management in search bar (#24665)
2023-04-17 12:46:39 +00:00
Krzysztof Skrzętnicki 477e1b108a
OpenSearch audit log improvements. (#24437)
* OpenSearch audit log improvements.

* Run prettier.

* Add missing license.

* Review: share event formatting code.

* Review: add comments.
2023-04-17 12:19:29 +00:00
Yassine Bounekhla 5a46f044b5
add themes to webui (#24507) 2023-04-14 21:45:23 +00:00
Lisa Kim ab1206a133
Discover: Add new usage reporting events (#24567)
* Add aws connect account and enroll rds dbs event

* Update FE types to reflect backend changes

* Rename

* Add missing convert usager
2023-04-14 18:23:18 +00:00
Lisa Kim c17a9da802
WebDiscover: Add delete integration operation (#24590)
* Fix malformed JSON error response for 200

* Fix making response when fetching integrations

* Create re-usable integration ops hook (only delete for now)

* Create delete dialog

* Allow deleting integrations

* Fix lint
2023-04-14 16:08:59 +00:00
Lisa Kim 46c05b321a
Add the new access verb use to web user context (#24463)
* BE: Add field for verb use for user ACL

* FE: Add the new use access verb

* Only define use verb for relevant resources
2023-04-14 16:04:59 +00:00
Grzegorz Zdunek c81ed24e56
Update Electron to 22.3.6 (#24596) 2023-04-14 15:09:10 +00:00
Steven Martin 64448b1b0e
Renders user auth types in User List in expected capitalization (#23514)
* Renders user auth types to match expected capitalization for GitHub, SAML and OIDC

* Update test to use cap OIDC

* Update SAML and GitHub auth type test compare

* UI lint fix

* Applied comments for function location and import

* lint fix

* lint fix

* fix typecheck
2023-04-14 14:10:36 +00:00
Rafał Cieślak a08601e789
Connect: Enable search bar feature flag by default (#24595) 2023-04-14 12:59:52 +00:00
Rafał Cieślak be498cf9dd
Update missing color in Connect, reorder More Options menu items (#24593) 2023-04-14 12:59:25 +00:00
Ryan Clark ce939bef15
Vite fixes (default exports, circular dependency) (#24591)
* Fix Vite production build with react-day-picker

* Fix circular dependency

* Remove unneeded typings

* Use an esmodule interop instead of Vite config
2023-04-14 11:11:24 +00:00
Grzegorz Zdunek e2bb8b747e
Connect: Do not hide any filters if the search term limits the list of clusters to just one cluster (#24447)
* Do not hide any filters if the search term limits the list of clusters to just one cluster

* Rename `ExtraComponent` -> `ExtraTopComponent`

* Use `active` prop only for `InteractiveItem`
2023-04-14 11:05:09 +00:00
Grzegorz Zdunek 4b31ba88ab
Connect: Create dedicated functions for connecting to resources (#24445)
* Create dedicated functions for connecting to resources

* Do not use spread operator

* Rename `params` -> `telemetry`

* Rename `connectToNode` -> `connectToServer`

* Remove unused imports
2023-04-14 09:46:06 +00:00
Lisa Kim e8e9ad39ae
WebDiscover: Create connect to aws account screen (#24506)
* Implement connect aws account screen

* Fix story

* Add integration yaml rule

* Clarify TODO comments

* Update TODO after rebasing
2023-04-13 21:16:21 +00:00
Lisa Kim 49aa9db73e
WebDiscover: Enroll New AWS Integration Flow (#24459)
* Enroll new AWS integration flow

* Move IntegrationEnroll/* into Integration/Enroll/*

* Rename AWS into AwsOidc, story expects pascal case
but ran into non-story issues where casing was a problem
even renaming AWS to Aws wasn't enough, i don't know
why

* Capitalize browser directory to Browser

* Remove passing in clusterId for integration requests

Also define IntegrationKind as enum string values
to avoid hard coding it all over.

* Add sub routing for lazy loading AwsOidc comp

* Fix some styling, remove unused props, and add story

* Add a success dialog after creating integration

* Remove first in wording for now

* Replace teleport.lol with root cluster public URI

* revert renaming browser to Browser

* Fix lint: add license headers

---------

Co-authored-by: Ryan Clark <ryan.clark@goteleport.com>
2023-04-13 19:40:21 +00:00
Justinas Stankevičius 067ccba2b8
Plugin UX improvement prerequisites (#24436)
* Add new assets for integration enroll flow

* Adapt integration status after switch to enum

* Prettier

* Fix some lints

* Rename enum numbers according to conventions
2023-04-13 13:13:36 +00:00
Michael d9023fad9a
[web] Add isModeratedSession flag to web ssh session (#24238)
* Add isModeratedSession flag to web ssh session

* Fix lint

* Change to snakecase

* Change to moderated
2023-04-12 21:26:57 +00:00
Grzegorz Zdunek 8cfff5b5ae
Connect: Limit results after sorting (#24270)
* Limit results after sorting

* Rename `sortAndLimitResults` -> `rankResults`

* Add `useResourceSearch` test, check if the items are sorted correctly

* Use `renderHook` from the testing library, fix test name
2023-04-12 16:20:36 +00:00
Rafał Cieślak f45309853e
Deprecate custom implementation of renderHook (#24442) 2023-04-12 15:57:19 +00:00
Grzegorz Zdunek b8bd16d86b
Connect: Migrate keymap.openCommandBar to keymap.openSearchBar (#24051)
* Migrate `keymap.openCommandBar` to `keymap.openSearchBar`

* Add license header

* Review fixes

* Improve comments
2023-04-12 13:41:36 +00:00
Michael 349ec9404b
[web] Add storeUser to console context (#24159)
* Add storeUser to console context

* Remove teleportcontext

* Change name

* Move init to console context and handle errors

* Remove unneeded function declaration

* Update error message
2023-04-11 18:54:46 +00:00
Lisa Kim 00d3b155bd
WebDiscover: Add open source integrations enrollment page (#24399)
* Create a shareable tooltip no permission badge comp

* Implement the open source enroll integration screen

Copied over tile styling and header description with
minor refactoring from enterprise

* Add integration feature

This feature is manually disabled.
The user ACL for this screen is manually
set to always return false.

* Remove testing implementation detail?

* Make open source check for only integration resource access

* Update snapshot
2023-04-11 18:21:53 +00:00
Lisa Kim 4597ee5b9b
WebDiscover: Add OS integrations page (#24108)
* Move icons to design pkg to share between packages

* Moved integration routes from enterprise

* Add integrations ACL to user context

Also fixes inaccurate plugin perm checking for features.
Plugin "create" is moved to new feature flag "enrollIntegrations".

* Moved feature definition from enterprise

* Add integration service and types

Also moved Plugin type from enterprise

* Create add integration button comp for use in both OS/enterprise

* Move integration list from enteprise (refactored)

* Create open source integrations comp

* Update user.test

* Address CRs

* Make updates in response to backend PR updates

* Add clarifying comment

* Remove return value, export integration list
2023-04-11 17:42:38 +00:00
Grzegorz Zdunek 5641b22f52
Connects: SearchBar improvements (#24190)
* Add stories for longer resource and cluster names

* Extract `PickerContainer`, improve styling of pickers and input

* Extract `FilterButton` component to avoid repeating the same code

* Add a message about excluded clusters

* Show a hint message when input is empty

* Show cluster filters only when there is more than one cluster

* Make search bar input responsive

* Review fixes

* Add a story for no results state

* Fix missing margin when input wraps

* Add license header

* Render `NoResultsItem` and `TypeToSearchItem` as extra items above regular items

* Use `calc` to calculate padding

* Fix comment

* Show TypeToSearchItem only after filter actions attempt finishes

* Run filter search synchronously

---------

Co-authored-by: Rafał Cieślak <rafal.cieslak@goteleport.com>
2023-04-11 13:20:54 +00:00
Edoardo Spadolini 851cb6598e
Fix package names for v1 protos, misc proto changes (#24183)
* Delete teleterm's ptyHost/v1, added by mistake

* Add package name to protos conforming to PACKAGE_VERSION_SUFFIX

* use go run in buf-connect-go.gen.yaml directly

* Run protogen in place

* Run the buf-go generation off of go run

This also adds protoc-gen-go-grpc to go.mod
2023-04-06 22:53:31 +00:00
Justinas Stankevičius 1ebefe3f35
Make react-router-dom and @types versions consistent (#24201) 2023-04-06 15:19:56 +00:00
Rafał Cieślak 84f050f623
Connect: Do not include staging feedback address in prod CSP (#24114)
Staging environments are typically less secure than production ones.
We should not include the staging feedback URL in the final packaged app
in case it gets compromised.
2023-04-06 09:59:20 +00:00
Lisa Kim f38f88e64c
DiscoverWeb: Emit events when clicking on unguided resources (#23746)
* Rename following naming convention

* Rename and add more db protocols

* Define new events and add event names to resource spec

* Emit events for unguided resources

Also clear the loc state if the search bar
was cleared to fix a weird quirk where
when user goes back to the select resources
screen, the preserved loc state applied
filter again

* Update tests

* Add database doc event types
2023-04-04 21:41:00 +00:00
Grzegorz Zdunek d229a53326
Connect: Add SearchBar (#23980)
This commit adds an MVP of the search bar to Connect. Currently it's
behind a feature flag (`feature.searchBar`) but we'll enable it by
default before the release. The plan was to merge the code ASAP,
potentially even straight to v12 when we have the chance, which didn't
exactly pan out but there's no harm to having this feature flag for now.

On top of that, this commit adds a new shortcut to open the search bar
(this replaces the current shortcut to open the command bar) and a
shortcut to open a new terminal tab.

The search works by essentially making a `ListResources` request for
each supported resource type to every cluster the user is logged in to.
We repurposed the old command palette UI for that but rewritten it to
use React context and hooks rather than a class and a store. This
allowed us to be a little bit more flexible as the old approach required
every picker to conform to the same interface, both in terms of UI and
code.

This implementation has two main pickers so far:

* `ActionPicker` which is the main one. It searches for resources but at
  the moment it also supports applying filters. In the future, we plan
  to add more actions to it such as "Open a new tab" or "Install tsh".
* `ParameterPicker` is activated when you pick an action from the
  `ActionPicker` that requires an additional parameter. Think choosing
  an SSH server or a db – you need to provide an SSH login or a db user
  for those item. In those situations, `ActionPicker` will switch to
  `ParameterPicker` and let you pick a relevant item from the list.

Everything is contained within `web/packages/teleterm/src/ui/Search`.
Arguably, `useSearch` could be refactored a little bit to maybe make its
structure a little more clear as it handles both the resource search and
the filter search. However, at the moment we're not totally sure how the
search bar will evolve, so we want to leave any bigger refactors for
later. We added a couple of basic tests for regressions that happened so
far. We also have stories for the items from the action picker.

Error handling will be added in an upcoming PR. Docs updates will be
done in a separate PR as well.

Co-authored-by: Rafał Cieślak <rafal.cieslak@goteleport.com>
2023-04-04 14:17:41 +00:00
Grzegorz Zdunek 057ff52f89
Connect: Collect protocol origin (#23898)
* Add `origin` field to protocol event

* Capture protocol event origin

* Use positional arguments

* Missing rename
2023-04-04 12:51:02 +00:00
Rafał Cieślak b8497e8789
ClusterItem: Remove usage of colors.secondary.lighter (#23979) 2023-04-03 13:06:54 +00:00
Justinas Stankevičius 10a075cfe1
Hosted plugins onboarding prerequisites (#23234)
* Respect route exactness in TopNav

* Allow submitting CSRF token via form

* Skip "safe" methods in CSRF checks

* Export getXCSRFToken

* Add WithAuth2

* Passthrough "name" of FieldInput

Allows it to be used in an actual form

* icomoon: add hashtag icon

* Add GetAvailablePluginTypes to PluginService proto

* Expose ProxyPublicAddr

For use in Enterprise web Plugin

* Run prettier

* Factor out app.MetaRedirect

* Rename: WithAuth2 -> WithAuthCookieAndCSRF

* Run GCI

* Renegerate protos
2023-03-31 16:05:51 +00:00
Isaiah Becker-Mayer f8057226f6
Fix vite development for desktop websocket endpoint (#23815)
* sets changeOrigin to false

* fixes README
2023-03-30 16:39:25 +00:00
Jeff Pihach 044e637e1c
Adds a new section to the UI for managing locks. (#22437)
New endpoints were added to the API server for fetching, creating and deleting locks.
The 'editor' role now has the ability to create, edit, and remove locks by default.
Created new SlidePanel component to easily add a panel that slides in from the right of the screen.
2023-03-30 16:11:50 +00:00
Yassine Bounekhla faecdcf3b7
Refactor theme (#23539) 2023-03-29 18:25:14 +00:00
Alan Parra 1b3598642c
Add device event update code to Web (#23713)
* Add device event update code to Web

* Update test snapshots
2023-03-29 16:12:44 +00:00
Michael 337bc1c5cb
Fix webapiPingPath (#23727) 2023-03-28 22:38:00 +00:00
Marco André Dinis 3102b82770
Use stable/cloud when Automatic Upgrades is on. (#23395)
* Use `cloud/stable` when Automatic Upgrades is on.

Teleport provides scripts to install teleport agents/services.
Those scripts use YUM/DEB repositories when possible.
Each repo has multiple channels:
- stable/v11
- stable/v12
- cloud/stable

We want to ensure that if the cluster is running in the cloud and
automatic upgrades is on (auth service was started with
TELEPORT_AUTOMATIC_UPGRADES=yes teleport ...), then the installation
script must offer the `cloud/stable` channel.

This PR changes the following scripts:
- Discover Install Node
- Discover Install Database Service
- Install App script
- EC2 default-installer and EC2 default-agentless-installer

* add helm chart knobs to enable auto updater

* use let instead of const and remove default export

* add HA to helm chart

* always return .automatic_upgrades in web ping response

* rename cloud/stable to stable/cloud

* fix ts test
2023-03-28 16:05:09 +00:00
Ryan Clark 255c97eba9
Fix the navigation only ever linking to the root cluster (#23567)
* Subscribe navigation items to clusterId updates

* Add a test for navigtion item changing correctly

* Add license to test

* Update license to match others
2023-03-28 11:33:13 +00:00
Lisa Kim c4a0fda97d
Web:Discover Refactor resource selector (#23018)
* Delete files

* Add new icons to discover assets

* Update context mocks for storybooking/tests

* Refactor PermissionErrorMessage

- Move file location to SelectResource directory
  (only used in SelectResource comp)
- Pass ResourceKind as prop to determine action
  and product name instead

* Hardcode resource specs and rename variables

- Split "resource" file into multiple parts since it
  was getting so large. Database got its own file b/c
  it's the biggest with potential to grow even larger
- Renamed stuff for clarity, a lot of things were getting
  named "resource"
- `shouldPrompt` for type ResourceViewConfig is now optional
  because resource flows will not start with "Select Resource Type"
  view now (change coming in later commit) so we don't have to
  skip the "first" view anymore

* Remove "Select Resource Type" as a view from resource configs

Each resource no longer needs its own "select view" as
resources are all combined into one view now (SelectResource.tsx)

* Refactor the SelectResource component

- Combines all resource kinds into one view
- Provides filtering by searching for keywords.
  As discussed in meeting, we did not want to provide
  like a sorting (filtering?) dropdown at this time
- Provides on hover explanation of why user can't
  add resources if user doesn't have access

* Update StepItem and step Navigation

 The first item of the step nav used to be "Select a Resource Type"
 which used to be part of the views list. The first item is now
 replaced with the resources assigned icon and the resource name.

* Refactor Discover component

Major change is now we init variables such as
indexing views and finding resource cfgs after a user has
selected a resource.

Updates how events are init and emitted
and handles user going back to the resource screen

* Remove duplicated type (defined in ResourceKind.ts)

* Minor micro changes from mostly path/variable rename/restruc

* Allows user to go back to the select resource screen

Adds a back button to the first view for each guided resource

* Update snapshot from rebasing with master

* Address Crs
2023-03-27 16:47:02 +00:00
Evan Freed 6dd7f70f14
switch Registry: k8s.gcr.io to registry.k8s.io (#23589)
Signed-off-by: Evan Freed <evan.freed@goteleport.com>
2023-03-27 08:20:58 +00:00
Sakshyam Shah 786be9ef0c
user acl for device trust ui (#23493)
* feat: user acl for device trust ui

* Update lib/web/ui/usercontext.go

Co-authored-by: Zac Bergquist <zac.bergquist@goteleport.com>

* revert e ref to current from master

* Update web/packages/teleport/src/stores/storeUserContext.ts

Co-authored-by: Lisa Kim <lisa@goteleport.com>

* Update web/packages/teleport/src/teleportContext.tsx

Co-authored-by: Lisa Kim <lisa@goteleport.com>

* update defaultAllowRules to RW()

* commend added to highlight preset rules should be same when added to defaultAllowRules

---------

Co-authored-by: Zac Bergquist <zac.bergquist@goteleport.com>
Co-authored-by: Lisa Kim <lisa@goteleport.com>
2023-03-24 04:26:04 +00:00
Steven Martin 47d5f236ef
Use GitHub camelcase for UI, examples, and Messages (#23369)
* Use GitHub camelcase

* Update example github to camelcase

* Update references to GitHub as camelcase
2023-03-22 22:10:12 +00:00
Michelle Bergquist 35b7ea0521
reorder prehog credential events (#23254)
- move both events to auth service
2023-03-22 17:35:37 +00:00
Jakub Nyckowski f24f59b5d0
Headless SSO web endpoint and UI (#22914)
* Update UI

Update UI text

Update the code to add headless request get

Remove commented code

Added simple UI and endpoints

* Update UI
Implement reject SSO handler and UI

* Fix linter issues

* Fix more linter issues

* Fix UI tests

* Use url.JoinPath.

* center spinner on the page and animate it.

* Address code review comments

* Address code review comments

* Renamed React component

* Address PR comments

---------

Co-authored-by: joerger <bjoerger@goteleport.com>
Co-authored-by: Jeff Pihach <jeff.pihach@goteleport.com>
2023-03-22 15:16:09 +00:00