Commit Graph
1103 Commits
Author SHA1 Message Date
4d8e23bb12 Updates port validation to restrict to valid port numbers 1-65535 (#21566)
* Updates port validation to restrict to valid port numbers instead of just 4 digits

* lint fix

* comment updates

Co-authored-by: Yassine Bounekhla <56373201+rudream@users.noreply.github.com>

* variable change

Co-authored-by: Yassine Bounekhla <56373201+rudream@users.noreply.github.com>

* variable change

Co-authored-by: Jeff Pihach <hatched@users.noreply.github.com>

* number eval change

Co-authored-by: Jeff Pihach <hatched@users.noreply.github.com>

* error message change

Co-authored-by: Jeff Pihach <hatched@users.noreply.github.com>

* variable change

* remove comment

* update error message

---------

Co-authored-by: Yassine Bounekhla <56373201+rudream@users.noreply.github.com>
Co-authored-by: Jeff Pihach <hatched@users.noreply.github.com>
2023-02-10 15:48:58 +00:00
Yassine Bounekhla 6edb26c60f [Web] Make language on mfa verify step dialog more clear (#20825)
* update text on dialog

* tweak language and overwrite error message

* address comments

* fix 'enter' to submit on newdevice form
2023-02-10 15:04:47 +00:00
Grzegorz Zdunek 9ed52c327d Ask for job role on the second launch (#21402)
* Ask for job role on the second run

* Add tests

* Call `onCancel` in mock
2023-02-10 14:16:27 +00:00
Michelle Bergquist 8dfa07559b capture custom role creation in prehog (#21123)
* add e2e role creation events

* add role name

* reset proto

* cleartext default role names

* constant
2023-02-09 19:23:29 +00:00
Ryan Clark ed5e8a7436 Change debug commands during discover flow (#21530) 2023-02-09 13:29:16 +00:00
Rafał Cieślak 94ec267823 Update JS grpc-tools to 1.12.4 (#21452)
* Update JS grpc-tools to 1.12.4

1.11.2 didn't have support for arm64 so we had to do all this extra stuff
in the Dockerfile.

1.11.3 added support for Darwin arm64 and 1.12.4 finally adds support for
Linux arm64. This means we can completely remove extra cruft and just
install grpc-tools 1.12.4 on all architectures.

* Add comment to ptyHostService.proto
2023-02-09 07:40:45 +00:00
Isaiah Becker-Mayer 5556af4a71 Fix uncaught errors in Desktop's Discover flow (#21343)
* Adds values for when labels aren't defined

* fixes formatting and prevents usePingTeleport from rerunning the poll when used twice within a single context

* Adds comments, pushes start logic into start itself

* polishing usePingTeleport api such that it reflects that either the join token or search term is used for search

* simplify and fix searchTerm bug
2023-02-08 18:13:01 +00:00
Jeff Pihach 3f75acb163 Add license headers to web files that were missing it. (#21315)
* Lint the web files but not node_modules or vendored files.

* Add license headers to web files that were missing it.

* Add missing licenses.
2023-02-07 16:27:31 +00:00
Rafał Cieślak 644e85336c Move Connect-specific MenuLogin story out of shared package (#21157)
* Move Connect-specific MenuLogin story out of shared package

* Copyright 2019 -> Copyright 2023
2023-02-07 10:24:27 +00:00
Lisa Kim 8aefef1ae6 [Web:Discover] Bring back db service checker (#21062)
* [Backend]: allow more db fields to be updatable

* Add preventing duplicate keys for label creator

* Add sort compare fn helper

* Update db request update object

* Update CreateDatabase component

- Uncomment and touch up db service checker
- Fix db service label checking
- Allow user to make changes to updatable db fields
- Split defining db name and the other fields into
  two views, to prevent user from changing the db name
  which is not allowed with the update action

* Address CR: use nil value to determine CACert update

* Few more touch ups
- address CR: don't OR update db request field CACert
  and use consistent camelCasing
- remove the skip button for deploying service since
  we have the service checker now, which auto skips it
  for user if detects service
- refactor label matching for both register database
  and deploy service steps

* Address CR: make all fields updatable

* Update service polling after rebase
2023-02-06 18:44:39 +00:00
Ryan ClarkandLisa Kim 9a605331f3 Remove timeouts from discover flows, fix desktop discovery (#20829)
* Allow for inputs to be disabled

* Remove timeouts from the discover workflows

* Correct the resource type to be cleared on unmount

* Update test snapshots

* Rename useJoinToken to useJoinTokenSuspender

* Remove TODO

* Simplify usePoll

* Simplify the hint box code, add a shared hook

* Add the generte command button back to db flow

* Store the joinToken in PingTeleportContext state instead of using the hook

* Fix rebase diff mistake

* Fix bug with polling for result

- once we get the result, we set the result
  back to null, so we can't proceed to next step

---------

Co-authored-by: Lisa Kim <lisa@goteleport.com>
2023-02-06 17:52:30 +00:00
Lisa Kim c7a11477ee [Web:Discover] Report events (#20581)
* Define event types

* Define event names for each flow

* Report events upon start, exiting, and next steps

* Update json property name change

* Emit user skipped event

* Emit error events

* Handle unloading event for 'completed' step

* Move updating event state into hook

* Finish emitting events for desktop

* Address CR: rename DiscoverDesktop to DiscoverResources

* Various changes:

- address CR: remove use of ref
- diagnostic traces can also be a success, only emit event on failed traces
- add mysql to discover events
- consistent naming on exit prompt

* Update and add new event names

* Update tests

* Emit events for unimplemented flows (apps and other dbs)

* Redo emitting events for test connection

Send event for EACH test connection failure or success.
If a user does not do any testing, send a skipped event.
2023-02-03 19:30:56 +00:00
Ryan ClarkandRafał Cieślak 3c464d658a Fix the navigation not listening to the back button (#21207)
* Fix the navigation not listening to the back button

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

Co-authored-by: Rafał Cieślak <rafal.cieslak@goteleport.com>

* Allow for history.Location and Location types to be used

* Run prettier

---------

Co-authored-by: Rafał Cieślak <rafal.cieslak@goteleport.com>
2023-02-03 17:12:39 +00:00
Rafał Cieślak 6e1a59bc25 Remove web/package.json, move scripts to package.json (#21134)
* Remove web/package.json, move scripts to package.json

Removed scripts:

Leftovers from webapps Dockerfile and CI on GCB:
- package-term-ci
- build-and-package-term-ci
- build-and-package-term
- nop

Leftovers from webapps Makefile, presumably:
- build-oss
- build-e

* Add back nop script

* Remove build-teleport* scripts
2023-02-03 15:34:57 +00:00
Rafał Cieślak 3ac5a0aedb Refactor prehog & teleterm protos to match project conventions (#20810)
* Adjust go_package of lib/prehog Go protobufs

This makes them follow the pattern set out by api/proto and proto.

* Adjust go_package of lib/teleterm Go protobufs

* Use single buf.gen.yaml to generate JS protos

This also entailed changing the location of lib/teleterm protos and changing
the value of their package specifier to match the conventions in other parts
of the codebase. This is a breaking change but that is fine for Connect
as the protos are used locally only and each build ships with matching
protobufs.

* Make web/packages/teleterm use protobufs from gen-proto-js

We used to copy protobufs over to web/packages/teleterm/src/services/tshd
since webapps used to be in a separate repo.

This is no longer the case, so we can just make teleterm use protobufs
from gen-proto-js.

* Move prehog & teleterm protos into proto/teleport/lib

* Generate JS protos to gen/proto/js

* Move lib/teleterm Go protobufs to gen/proto/go

* Move lib/prehog Go protobufs to gen/proto/go

* Rename lib/teleterm proto package

* Re-enable linter rules for teleterm & prehog

* Update prehogv1 path in usagereporter_test.go

* Use except instead of ignore_only to allow Google API-style responses

* Add UNARY_RPC to api/proto & proto

* Ignore gen/ when running addlicense

* buf-js.gen.yaml: Remove comment about lack of go_package for JS

* Move prehog protos to proto/prehog/v1alpha

* Adjust prehog's go_package to match proto package
2023-02-03 14:47:06 +00:00
Rafał Cieślak 641eeb1942 Connect: Check for existence of update-*-database in after-install (#21063) 2023-02-03 14:46:18 +00:00
Jeff Pihach 26f6022689 Initial pass at lint and test GHA for UI. (#21110)
* Initial pass at lint and test GHA for UI.

* Fix lint

* Add --frozen-lockfile

* Skip the e directory if it doesn't exist while linting.

* Update failing snapshots.

* use a more reasonable filter for eslint to support missing e

* ignore type check on e imports.

* ignore failing file that requires e teleterm file.

* fix lint

* quiet down the log output for prettier-write.
2023-02-02 22:56:55 +00:00
Vitor EnesandRafał Cieślak 74e366231a Improve error message when trying to rename resource (#20413)
* Improve error message when trying to rename resource

This commit improves the error message when a user tries to rename a
resource (role, auth connector and trusted cluster) using the web UI.

* Fix tests

* gofmt

* resourceExists -> getResource

* Improve comment.

Co-authored-by: Rafał Cieślak <rafal.cieslak@goteleport.com>

* Improve error message

Co-authored-by: Rafał Cieślak <rafal.cieslak@goteleport.com>

---------

Co-authored-by: Rafał Cieślak <rafal.cieslak@goteleport.com>
2023-02-02 20:50:17 +00:00
Grzegorz Zdunek ce86ad57ee Connect: fix "Connect a Cluster" screen flash (#20988)
* Render loading screen when initialization is in progress

* Wait with showing the window until it is ready to prevent "empty screen" flash

* Add comments
2023-02-01 08:21:41 +00:00
Steven Martin fd90bc9b5f Open Support links in UI to new page (#20926) 2023-01-31 12:19:32 +00:00
Grzegorz Zdunek 34e9b44880 Connect: add env file for dev/prod vars, use prehog staging only in dev environment (#20768)
* Create env file for dev/prod vars

* Rename `ENV` to `staticConfig`

* Simplify condition
2023-01-30 15:38:45 +00:00
Ryan Clark d699603519 Fix the navigation not allowing switching back to resources (#20812)
* Fix the navigation not allowing switching back to resources

* Remove redundant state update
2023-01-30 15:01:08 +00:00
Isaiah Becker-Mayer c4eabb48c4 Removes the "overflow: auto" from StyledXterm (#20747)
thus setting it to "overflow: hidden", which prevents it from
outgrowing its parent component.
2023-01-27 22:47:58 +00:00
Isaiah Becker-Mayer ec527ef926 Adds a refresh icon to the playback bar (#20745) 2023-01-27 22:43:53 +00:00
Ryan Clark 4c83a1d7fc Stop the support link pretending it's a dropdown (#20819) 2023-01-27 18:34:49 +00:00
Yassine Bounekhla 72bc16b3b4 fix lint error (#20827) 2023-01-27 16:54:14 +00:00
Rafał Cieślak ea1fc22045 Connect update xterm to 5.1.0 and xterm-addon-fit to 0.7.0 (#20767)
This makes teleterm match the versions used by teleport.
2023-01-27 12:10:37 +01:00
Yassine Bounekhla 4a90ff4632 [Web] Add support for Moderated Sessions in the Web UI (#20782) 2023-01-26 23:18:26 +00:00
Lisa Kim 83cf369e6b [Web:Discover] Enable mysql for aws (#20753) 2023-01-26 19:02:34 +00:00
Grzegorz Zdunek 3a0fc94aa6 Connect: wait for process to exit before closing app (#20673) 2023-01-26 14:34:14 +00:00
Rafał Cieślak 6791b48da9 Remove grpc-teleterm Make target and Dockerfile-teleterm (#20032)
* Remove CLANG_FORMAT from Makefiles

It was used to format protos but we use Buf for that since v10.

* Move installing grpc_node_plugin into Dockerfile

This commit basically takes grpc_node_plugin compilation from
Dockerfile-teleterm and moves it to Dockerfile.

* Replace Dockerfile-teleterm with Dockerfile

After moving grpc_node_plugin compilation to Dockerfile, the only remaining
thing that Dockerfile-teleterm does is installing rpm so that we can make
an RPM package for Connect during tag builds.

Installing this package can be simply moved to Dockerfile.

* Remove grpc-teleterm Make target in favor of grpc

* Add updated protobufs

It looks like they're a result of someone changing protos in lib/prehog
without running `make grpc-teleterm` separately. Which is why we're getting
rid of grpc-teleterm as a separate Make target in the first place. ;)
2023-01-26 09:41:07 +01:00
Lisa Kim 09d3e38453 [Web:Discover] Enable mysql flow (#20719)
* Change default port based on db type
* Require db name for postgres only for testing connection
2023-01-26 02:37:02 +00:00
Nic Klaassen a15f3f44e9 feat: frontend support for login rule audit events (#20722)
This PR adds frontend support to nicely display login rule audit events. I followed the guide [here](https://github.com/gravitational/teleport/tree/master/web#adding-an-audit-event) and mostly copied the types used for the role create/delete events.
2023-01-25 22:17:36 +00:00
Jeff Pihach b21204e9ff Move storybook to root package.json and fix config so e components are rendered. (#20723) 2023-01-25 20:31:14 +00:00
Zac Bergquist 3cefb38890 Update xterm-addon-fit (#20696)
This resolves an issue when starting an SSH session from the web UI,
and also fixes the out-of-date lock file.
2023-01-25 20:05:58 +00:00
Ryan Clark 42ec01c88a Refactor features, implement new design for navigation & user menu (#20553) 2023-01-25 17:53:59 +00:00
Ryan Clark 27ad839d47 Move jest, eslint & prettier to the root (#20698)
* Move jest, eslint & prettier to the root

* Update e ref
2023-01-25 17:19:22 +00:00
Rafał Cieślak 9b7355cd20 Connect: Add useWorkspaceLoggedInUser (#20552) 2023-01-24 15:31:39 +00:00
Jeff Pihach 0f21a8b8e3 Resolve issues to enable passing CI tests. (#20582)
* Move lint commands to root package.json

* Correctly resolve e-teleport paths.

* Fix prettier issues.

* move eslint configuration files to root.

* resolve lint errors.
2023-01-23 22:06:56 +00:00
Tiago Silva 10da451dd6 Add support for subResourceName to teleterm (#20541)
Initial support for `subResourceName` when listing resource access requests for `type=pod`.
2023-01-23 15:06:01 +00:00
Rafał Cieślak b94edcf450 Move tsconfig.json to root dir, remove web Makefile and Dockerfile (#20399)
* Move tsconfig.json to root dir

At the moment, it looks like the TS language server has problems with
recognizing imports when editing files inside e/web.

I figured this is probably because tsconfig.json is in web, so the lang
server doesn't recognize it when editing files from e/web.

* Remove web/Dockerfile and web/Makefile

* Misc updates to readme

* Fix links in readme
2023-01-23 11:50:16 +00:00
Michael Wilson 72e044c880 Decode URL encoded values from AppLauncher's ARN. (#20387)
The new app access authentication workflow inadvertently preserves the URL
encoded values present in the AWS role ARN, which are then passed directly
to the webapi/sessions endpoint. As a result, Teleport RBAC doesn't properly
match AWS role ARNs, as they contain (in particular) `/` characters encoded as
`%2F`.
2023-01-20 13:56:40 +00:00
Michael d9d61e859b Add .prettierrc to teleport root (#20448) 2023-01-19 17:17:55 -06:00
Jeff Pihach 34f102bdeb Enable building teleport with the new UI location (#20361)
* Changes for merging webapps into teleport.
2023-01-18 22:22:25 +00:00
Rafał Cieślak fd88f686f3 Update e ref (#1526) 2023-01-18 16:06:58 +01:00
matheus f1e0617e1d Update e ref (#1521) 2023-01-13 21:15:05 +00:00
Lisa Kim e120a945b4 Add device trust events (#1517) 2023-01-13 19:35:39 +00:00
Grzegorz Zdunek 834cf0e059 Connect: Ask for user job role (#1491) 2023-01-13 16:10:35 +01:00
Rafał Cieślak 7e988cdb3d Add --quiet to eslint package.json script (#1510)
By default, eslint outputs warnings as well as errors but doesn't sort
them in any way. When the lint step fails in CI because of an error, it's
hard to find that error among warnings.

The warnings are still useful when they show up in the editor, so let's
add --quiet which makes eslint output only errors and no warnings.
2023-01-13 14:22:38 +00:00
Ryan ClarkandLisa Kim 2a142742b5 Change the application access authentication flow (#1278)
* Simplify the app launcher flow

* Use `X-Cookie-Value` header instead of using a cookie name

* Export AppLauncher as default to allow for lazy loading

* Do not include credentials

* Include the port & credentials when making requests to applications

* Add the subject cookie header

* Update packages/teleport/src/AppLauncher/AppLauncher.tsx

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

* Handle the ?path= query param

* Remove `useAppLauncher`

* Improve the error handling

* Remove unused import

Co-authored-by: Lisa Kim <lisa@goteleport.com>
2023-01-12 21:23:49 +00:00