Commit graph

1331 commits

Author SHA1 Message Date
Zac Bergquist eeffe0d4af
web: clean up auth connector page (#29368)
OSS counterpart of gravitational/teleport.e#1841
2023-07-21 15:18:32 +00:00
Michelle Bergquist 9d59b79eb4
Onboarding changes to support e survey (#28981)
* Display a survey during onboarding

- Adds user context wrapper to the Welcome flow in order to update preferences
- Sets selected resources on user preferences

* imports & describes

* named enums

* remove onboard survey from oss

- will be moved to /e
- export shared types

* refactor welcome

- move new credential to welcome prop

* refactor new credentails

- container passes questionnaire to component

* remove survey ls dispatch

* pr feedback

* Revert "pr feedback"

This reverts commit 060f34fb60242856f233df6a1006c5192ea321fb.
2023-07-20 22:41:12 +00:00
Yassine Bounekhla 2aee61b7f7
add saml apps to webui apps list (#28041) 2023-07-20 16:56:43 +00:00
Rafał Cieślak fa94d7e62d
Filter out cluster ID in Connect logs (#29348) 2023-07-20 14:39:40 +00:00
Rafał Cieślak 3c413840d1
Remove gateways on logout (#29341) 2023-07-20 14:22:53 +00:00
Rafał Cieślak 9009b5c86a
Make prettier a dev dep of root package.json (#29352) 2023-07-20 11:49:25 +00:00
Rafał Cieślak fc49acb722
Add role setup for Connect My Computer in tshd (#28891)
* Ignore specific teleterm proto file rather than whole package

* clusters.Storage: Avoid unnecessary casting of URI back to string

* Storage.fromProfile: Move loading profile status to separate function

* Return client.TeleportClient together with clusters.Cluster

This is a stopgap to make clusters.Cluster a regular struct with no extra
behavior and a much smaller interface.

At the moment, almost all RPCs go through layers like these:

gRPC handler → daemon.Service → clusters.Storage → clusters.Cluster →
→ TeleportClient

As a result, clusters.Cluster has a gigantic interface that's hard to test.

Instead, we want to make it hold basic information about the cluster.
The real work will be done by collaborator structs which take clusters.Cluster
and TeleportClient as args. This way we can mock them out more easily in tests.

See the issue linked in the comment of clusters.Storage.GetByResourceURI
for more details.

* Make AddMetadataToRetryableError public

Since we're moving away from doing everything in clusters.Cluster, we'll
need to use this function from within the daemon package.

* Add IsRoot and IsLeaf methods to uri.ResourceURI

These methods will be used to return early if someone tries to set up
roles for a leaf cluster. Connect My Computer works with root clusters only.

* Add handler for creating Connect My Computer role

* Add test for calling GenerateUserCerts with bogus request ID

* Fix checking logins of existing role

* Remove commented out argument to ReissueUserCerts

* Add a stopgap comment to Storage.GetByURI

* Remove invalid doc links

* Ensure owner node label has expected value if role already exists

* Add unit test which checks RoleSetup.Run idempotency

* Add godoc for Resolver

* Simplify watcher equality check, add a comment

* Expand the comment for DropAccessRequests

* Fix position of Connect My Computer popover

* Integrate role setup with setup document

* Add temporary action to additional actions

This will be removed once the parent PR is approved. I just wanted to give
reviewers a shortcut to triggering the endpoint from the actual app.

* Add return type to createRole

* Add useRetryWithRelogin

* Wrap role setup in retryWithRelogin

* Remove useRetryWithRelogin in favor of retryWithRelogin & useCallback

* Remove CMC role setup from AdditionalActions

* Prettier fix

* Fix eslint
2023-07-20 11:42:22 +00:00
Brian Joerger 2099ccc746
Teleport Connect headless watcher (#28844)
* Implement headless watcher backend for Teleport Connect.

* Add headless watcher to tshd daemon service.

* Add SendPendingHeadlessAuthentication rpc to tshd events service.

* Add UpdateHeadlessAuthenticationState rpc to the daemon service.

* Address comments.
2023-07-19 02:56:24 +00:00
Bartosz Leper 635a4e2062
Add SVG resource icons (#29250)
* Add SVG resource icons

These icons will be used both by the Discover and Unified Resources feature.

* Lint and test fixes

* More fixes

* Add licenses
2023-07-18 21:56:27 +00:00
Bartosz Leper aed52bbf2f
Make it official which browsers we aim to be compatible with (#29053) 2023-07-18 21:21:50 +00:00
Ryan Clark 60f9ca359a
[Assist] Add initial components for access requests (#28907)
* Add initial components for access requests

* Run prettier

* Remove unused variables
2023-07-18 18:41:24 +00:00
Gavin Frazar 5c12e45eb1
update discovery labels (#28917)
* update discovery labels and name overrides

* move all labels into api/types/constants.go
* add name override labels for GKE and AKS that are allowed tag names in
  GCP and Azure

* fix kubernetes typos

* support legacy and cloud-agnostic name override labels for AWS

* fix tests

* add tests for creating kube clusters from cloud kube clusters

* fix linter
2023-07-18 18:17:46 +00:00
Grzegorz Zdunek c999082b1c
Connect My Computer: Downloading the agent (#28698)
* Move `compareSemVers` function to `shared`

* Set correct `sessionData` path when the app is initialized

* Add `sessionDataDir`, `tempDataDir` and `agentBinaryPath` to `RuntimeSettings`

* Add `downloadAgent`

* Add a download step to CMC setup

* Escape spaces in the agent path only when used in a command

* Run prettier

* Change `sessionData` path for Windows too

* Improve comments

* Rename `AGENT_VERSION` to `CONNECT_CMC_AGENT_VERSION`

* Inspect HTTP status of the download response before using it

* Move `tar-fs` and `@types/tar-fs` to regular deps

* Switch to `execFile`

* Rename `isAgentAlreadyDownloaded` and `BinaryParams`

* Grammar fix

* Remove state from `FileDownloader`

* Remove custom check for the save path

* Deprecate old `compareSemVers` export instead of removing it

* Use vX.Y.Z format

* Improve comment

* Log fetch error and throw an error with status code

* Do not modify process.env in tests

* Add `ConnectMyComputerService`

* Fix comment and log message

* Run setup only when all statuses are ''

* Revert unintentionally removed comment

* Remove logger line

* Share the same promise across multiple callers

* Remove temp file

* Prettier

* Put CMC temp file in a directory

* Simplify `sharePromise` signature

* Rename `binaryName` to `tarballName`

* Use a correct path for cache on Linux
2023-07-14 15:47:28 +00:00
Yassine Bounekhla f43edbf242
add semicolon (#29088) 2023-07-14 15:05:55 +00:00
Yassine Bounekhla 073064c58e
fix mutualtls textarea (#29034) 2023-07-13 20:52:24 +00:00
Rafał Cieślak 550551182f
resolveNetworkAddress: Listen for close instead of exit; Fix FailedApp theme (#29046)
* resolveNetworkAddress: Listen for `close` instead of `exit`

* Fix defaultProps of Card

* Add theme to FailedApp
2023-07-13 17:03:13 +00:00
Ryan Clark 604db7b1af
[Assist] UI tweaks (#29001)
* Always show the typing dots when Assist is generating a reply

* Make the typing dots smaller and reactive to the theme

* Prevent the message list from scrolling if the user has scrolled up

* Move the landing page & improve the auto scrolling logic

* Improve the boolean logic for showing the footer
2023-07-13 16:09:35 +00:00
Nic Klaassen 8affae4027
suppress search events (#29032) 2023-07-13 15:47:14 +00:00
Tiago Silva b8118731cf
Fix listing servers when creating a new lock via webui (#28950)
This PR fixes the property `value` used by Servers when listing
connected nodes. The value was incorrectly switched from `node` to
`server_id` by mistake which crashed the list of Servers.

This regression was introduced in #27395.

Fixes #28948
2023-07-11 17:58:59 +00:00
Bartosz Leper 800e79b113
Add an audit event for creating provisioning tokens (#28769)
* Add a provision token creation event on the backend

* Support provision token creation audit event on frontend

* Modify the deprecated GenerateToken function

Also:
* Add some missing tests.
* Add error logging in emitTokenEvent().
* Fix lint errors.

* Fix import order

* Address review comments

* Fix final review comments, add docs

* Fix the broken test

* Revert "Fix the broken test"

This reverts commit e1b8d2e640.

* Properly fix emitting duplicated events
2023-07-11 12:21:26 +00:00
Sakshyam Shah 072519b3e2
supports newline and whitespace in motd: (#28747)
dquote> - renders vertical scrollbar for longer message
dquote> - caps width to 600px, height to 500px
2023-07-11 11:06:21 +00:00
Ryan Clark 116c5dab06
[Assist] Only parse messages from Assist as markdown (#28899)
* Only parse messages from Assist as markdown

* Move markdown into a separate component & disable images

* Update Markdown.tsx
2023-07-10 16:33:36 +00:00
Lisa Kim f6938613d2
WebDiscover: Finish auto deploy screen (iam configure script) (#28621)
* Define the return type

* Add endpoint for config script

* Store the entire integration object instead of just the name

* Build the correct script string, renames, emit event

* Enable auto deploy as default

* Fix script endpoint and update story

* Add regex check, update story

* Touch ups, add test

* Address CR

* Remove sudo from bash command

* Make into ui friendly object
2023-07-10 15:09:03 +00:00
dependabot-batcher[bot] c6529af658
Batched Dependabot updates (#28863)
* Bump @grpc/grpc-js from 1.6.7 to 1.8.8

Bumps [@grpc/grpc-js](https://github.com/grpc/grpc-node) from 1.6.7 to 1.8.8.
- [Release notes](https://github.com/grpc/grpc-node/releases)
- [Commits](https://github.com/grpc/grpc-node/compare/@grpc/grpc-js@1.6.7...@grpc/grpc-js@1.8.8)

---
updated-dependencies:
- dependency-name: "@grpc/grpc-js"
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump google.golang.org/grpc from 1.43.0 to 1.53.0 in /examples/go-client

Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.43.0 to 1.53.0.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.43.0...v1.53.0)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump google.golang.org/grpc in /examples/desktop-registration

Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.52.3 to 1.53.0.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.52.3...v1.53.0)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump tough-cookie from 4.1.2 to 4.1.3

Bumps [tough-cookie](https://github.com/salesforce/tough-cookie) from 4.1.2 to 4.1.3.
- [Release notes](https://github.com/salesforce/tough-cookie/releases)
- [Changelog](https://github.com/salesforce/tough-cookie/blob/master/CHANGELOG.md)
- [Commits](https://github.com/salesforce/tough-cookie/compare/v4.1.2...v4.1.3)

---
updated-dependencies:
- dependency-name: tough-cookie
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump golang.org/x/oauth2 from 0.9.0 to 0.10.0

Bumps [golang.org/x/oauth2](https://github.com/golang/oauth2) from 0.9.0 to 0.10.0.
- [Commits](https://github.com/golang/oauth2/compare/v0.9.0...v0.10.0)

---
updated-dependencies:
- dependency-name: golang.org/x/oauth2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump github.com/sashabaranov/go-openai from 1.12.0 to 1.13.0

Bumps [github.com/sashabaranov/go-openai](https://github.com/sashabaranov/go-openai) from 1.12.0 to 1.13.0.
- [Release notes](https://github.com/sashabaranov/go-openai/releases)
- [Commits](https://github.com/sashabaranov/go-openai/compare/v1.12.0...v1.13.0)

---
updated-dependencies:
- dependency-name: github.com/sashabaranov/go-openai
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump k8s.io/apiextensions-apiserver from 0.27.2 to 0.27.3

Bumps [k8s.io/apiextensions-apiserver](https://github.com/kubernetes/apiextensions-apiserver) from 0.27.2 to 0.27.3.
- [Release notes](https://github.com/kubernetes/apiextensions-apiserver/releases)
- [Commits](https://github.com/kubernetes/apiextensions-apiserver/compare/v0.27.2...v0.27.3)

---
updated-dependencies:
- dependency-name: k8s.io/apiextensions-apiserver
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump github.com/bufbuild/connect-go from 1.7.0 to 1.9.0

Bumps [github.com/bufbuild/connect-go](https://github.com/bufbuild/connect-go) from 1.7.0 to 1.9.0.
- [Release notes](https://github.com/bufbuild/connect-go/releases)
- [Commits](https://github.com/bufbuild/connect-go/compare/v1.7.0...v1.9.0)

---
updated-dependencies:
- dependency-name: github.com/bufbuild/connect-go
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump github.com/aws/aws-sdk-go-v2/service/sqs from 1.22.0 to 1.23.2

Bumps [github.com/aws/aws-sdk-go-v2/service/sqs](https://github.com/aws/aws-sdk-go-v2) from 1.22.0 to 1.23.2.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/s3/v1.22.0...service/ecs/v1.23.2)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/service/sqs
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump github.com/aws/aws-sdk-go-v2/service/glue from 1.53.0 to 1.54.0

Bumps [github.com/aws/aws-sdk-go-v2/service/glue](https://github.com/aws/aws-sdk-go-v2) from 1.53.0 to 1.54.0.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/ec2/v1.53.0...service/ec2/v1.54.0)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/service/glue
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump github.com/aws/aws-sdk-go-v2/service/s3 from 1.35.0 to 1.36.0

Bumps [github.com/aws/aws-sdk-go-v2/service/s3](https://github.com/aws/aws-sdk-go-v2) from 1.35.0 to 1.36.0.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/s3/v1.35.0...service/s3/v1.36.0)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/service/s3
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump golang.org/x/oauth2 from 0.9.0 to 0.10.0 in /assets/backport

Bumps [golang.org/x/oauth2](https://github.com/golang/oauth2) from 0.9.0 to 0.10.0.
- [Commits](https://github.com/golang/oauth2/compare/v0.9.0...v0.10.0)

---
updated-dependencies:
- dependency-name: golang.org/x/oauth2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump cloud.google.com/go/iam from 1.1.0 to 1.1.1

Bumps [cloud.google.com/go/iam](https://github.com/googleapis/google-cloud-go) from 1.1.0 to 1.1.1.
- [Release notes](https://github.com/googleapis/google-cloud-go/releases)
- [Changelog](https://github.com/googleapis/google-cloud-go/blob/main/documentai/CHANGES.md)
- [Commits](https://github.com/googleapis/google-cloud-go/compare/dlp/v1.1.0...iam/v1.1.1)

---
updated-dependencies:
- dependency-name: cloud.google.com/go/iam
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump google.golang.org/grpc from 1.56.1 to 1.56.2 in /api

Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.56.1 to 1.56.2.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.56.1...v1.56.2)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump golang.org/x/oauth2 from 0.9.0 to 0.10.0 in /build.assets/tooling

Bumps [golang.org/x/oauth2](https://github.com/golang/oauth2) from 0.9.0 to 0.10.0.
- [Commits](https://github.com/golang/oauth2/compare/v0.9.0...v0.10.0)

---
updated-dependencies:
- dependency-name: golang.org/x/oauth2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump github.com/aws/aws-sdk-go-v2/service/ec2 in /assets/aws

Bumps [github.com/aws/aws-sdk-go-v2/service/ec2](https://github.com/aws/aws-sdk-go-v2) from 1.102.0 to 1.103.0.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/ec2/v1.102.0...service/ec2/v1.103.0)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/service/ec2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* go mod tidy

* make grpc

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-batcher[bot] <122306277+dependabot-batcher[bot]@users.noreply.github.com>
Co-authored-by: Tim Ross <tim.ross@goteleport.com>
2023-07-10 15:07:46 +00:00
Noah Stride 6122933e68
Machine ID: Add guides to the Enroll Integration page (#28646)
* First pass at adding buttons to the integrations page

* Add analytics events for clicking Machine ID enrollment tiles

* Run prettier

* Fix eslint complaints

* Push fixed icons

* Flatten the styling for the Jenkins logo

* Rearrange machine ID title code

* Remove logs from event processing

* Switch to coloured gitLab icon

* Use GitLabs proper name for CI/Cd

* Fix imports

* Further adjustments from PR

---------

Co-authored-by: Ryan Clark <ryan.clark@goteleport.com>
2023-07-10 13:27:52 +00:00
Justinas Stankevičius f71c2484e0
Assist: mark individual nodes as finished (#28477)
* Mark nodes as done when command finishes in Assist

* Split Close/CloseWithPayload

* Expect a close message before the summary in test

* Remediate confusing type usage in test

`Envelope` is the outer layer used (in protobuf format)
for execution / terminal sessions.

Meanwhile `outEnvelope` is the inner layer
used (in JSON) spefically with assist (execution),
when outer envelope is of "raw" type

Using `Envelope` where decoding `outEnvelope` in tests
previously worked "by accident" due to matching field names

* Assert that server ID is set in the close message

* Refactor command execution logic and adjust WebSocket handling

This commit changes how command execution and WebSocket handling are performed in the code. Instead of manually managing session close signals and command execution notifications via WebSocket, we have wrapped it into more easily manageable form.

Changed parts: assist and websocket libraries, test and several components of 'teleport'.

Why:
This allows cleaner command management and error handling, leading to more reliable and maintainable application. Also made code more readable and easy to understand. Made WebSocket more precise with its handling to prevent cases where stale or incorrect data might interrupt the session.

Details:
Instead of sending a close signal after all commands have been executed, we now send individual session end updates for each command. Sessions no longer remain active unnecessarily.

Message handling in command execution has been refactored for better error propagation.

All these changes were also adjusted and reflected in the associated test cases.
Also, names and types of various data structures are edited to reflect their actual usage.

* Change ServerID to NodeID to improve code consistency

This commit replaces occurrences of `ServerID` with `NodeID` across several files.
`ServerID` was misleading and causing confusion as it was serving as an identifier for nodes, so to improve comprehension and consistency in the codebase, all instances of `ServerID` have been replaced with `NodeID`. Tests have also been updated to reflect this change.

---------

Co-authored-by: Jakub Nyckowski <jakub.nyckowski@goteleport.com>
2023-07-07 16:24:55 +00:00
Ryan Clark b204ebbe76
Fix theme not loading on first login & overflowing command result summary (#28702)
* Share styling between command result & summary

* Correctly override the theme preference with the legacy preference

* Update web/packages/teleport/src/services/localStorage/localStorage.ts

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

---------

Co-authored-by: Zac Bergquist <zac.bergquist@goteleport.com>
2023-07-06 09:24:14 +00:00
Ryan Clark c1efc0409e
[Assist] Clear the refresh websocket timeout when closing Assist (#28610)
* Clear the refresh websocket timeout when closing Assist

* Missing semicolon to please prettier

* Add comment to remove once the new session implementation is done
2023-07-05 17:11:03 +00:00
Lisa Kim 31b66f0922
WebDiscover: Partially implement auto deploy database server view (#27924)
* Add new endpoint, types, update types

* Preserve user selected aws rds db

* Rename DownloadScript to ManualDeploy

- Remove duplicate test
- Use discover context instead of passed in props
- Rename util to common
- Move hasMatchingLabels to common.tsx for re-use

* Add another action button and pass autoFocus field

* Implement auto deploy screen

* Implement auto manual view toggler

* Update db view config

* Only allow back on user trait if user manually deployed agent

* Add TODO comment

* Address CRs

* Fix lint/test

* Address CRs

* Revert back to original flow

* Define type for service deploy method

* Address CR and revert a change

- aws field for database has to be empty if the
  result comes back empty. this field determines
  if the database is hosted by aws
- add a clarifying comment

* Remove optional rds field
2023-07-04 03:39:38 +00:00
Lisa Kim adabe847d5
Add custom component prop type for react-select (#28596)
* Add custom select comp type for react-select

* use tsdoc comment style
2023-07-03 20:07:34 +00:00
Michelle Bergquist 79754a325d
set onboarding survey on user preferences (#28530) 2023-07-03 17:43:06 +00:00
Ryan Clark 6569a69065
Remove console.log in AssistContext (#28607) 2023-07-03 16:41:17 +00:00
Michelle Bergquist 010076f356
Posthog event for onboarding questionnaire submit (#28328)
* update protos

* create Posthog event for onboarding questionnaire submit
2023-07-03 15:12:38 +00:00
Joel 490d9d6030
[Assist] Provide interactive updates during agent execution (#27893)
* send progress update messages during agent thoughts

* handle new output format

* define json tags for serialized fields

* use streaming api

* fan streaming from model loop

* fix streaming

* stream progress updates

* Update lib/assist/assist.go

Co-authored-by: Jakub Nyckowski <jakub.nyckowski@goteleport.com>

* remove useless mute

* nits

* Update lib/ai/model/agent.go

Co-authored-by: Jakub Nyckowski <jakub.nyckowski@goteleport.com>

* fix merge

* fix misc

* more misc fixes

* what

* what2

* weird eof errors?

* Fix tests UI integration

* Fix other tests

* Linter fixes

* Comment out token counting for assist streams to avoid race condition.

* Fix more tests

---------

Co-authored-by: Jakub Nyckowski <jakub.nyckowski@goteleport.com>
2023-07-03 14:48:06 +00:00
Grzegorz Zdunek 3c4ed44a09
Connect My Computer: check permissions before showing in the UI (#28346)
* Move CMC icon and setup document to common `ConnectMyComputer` directory

* Add permissions to show CMC

* Use `cluster.leaf` to check if a cluster is a root cluster

* Rename `isConnectMyComputerPermittedForRootCluster` to `canUseConnectMyComputer`

* Add licenses

* Rename `DocumentSetup` to `DocumentConnectMyComputerSetup`

* Check `cluster.leaf` flag to verify if the cluster is a root cluster

* Do not throw in `canUseConnectMyComputer`

* Add comments

* Use the same field name in a documentation comment

* Use relative import
2023-07-03 08:14:11 +00:00
Alexander Klizhentas b3e83faead
Improve copy on the integrations page (#28111)
Removes happy text from the copy.
2023-07-02 22:16:43 +00:00
Lisa Kim b4d5297bc8
Web: Improve no access message and remove hard coded color (#28508)
* Provide a more actionable 'no access' message

* Replace hard coded color with theme defined color
2023-06-30 18:51:51 +00:00
Lisa Kim 7fca7f14a9
Web related tweaks for access request user groups (#28455)
* Enable muting tooltip info icon

* Require user group field

* Update snapshot as a result of changing css for tooltip

* Fix user group setting for UI

* Address CR
2023-06-30 18:16:48 +00:00
Ryan Clark cf23101efb
Add the UI for Assist's settings (#28413)
* Add the UI for Assist's settings

* Add typing

* Fix test by wrapping render in LayoutContextProvider

* Run prettier
2023-06-30 09:41:09 +00:00
Lisa Kim f6906f330e
Discover: Add deployed method field to deploy service event (#28336)
* Define a  deployed_method field to discover deploy event

* Add deployed_method field to expected events

* Add deployed method type and define its field when emitting event from web UI

* Address CR and add another field

* Address CR
2023-06-29 23:36:28 +00:00
matheus ff9ceb2d89
Change copy "Go To Dashboard" for "Go To Cluster" on new account screen (#28434)
* Replace dashboard for cluster unless it is a on-prem dashboard

* Add new tests and screenshots

* Revert e update
2023-06-29 16:01:45 +00:00
Ryan Clark 3b9053faae
Introduce user preferences (#28291)
* Add user preferences feature

* Add missing license header

* Fix the order of arguments to require.Equal

* Update lib/web/userpreferences.go

Co-authored-by: Michelle Bergquist <11967646+michellescripts@users.noreply.github.com>

* Add a `GetUserPreferencesResponse` message

* Remove unused logger

* Use .Put instead of .Create/.Update

* Add missing godoc

* trace.Wrap the happy path

---------

Co-authored-by: Michelle Bergquist <11967646+michellescripts@users.noreply.github.com>
2023-06-29 15:43:56 +00:00
Jakub Nyckowski c9bf80be65
Improve error handling and embedding prompts; fix typos (#28403)
* "Improve error handling and embedding prompts; fix typos"

This commit encompasses several changes. First, an error handling routine has been added in AssistContext.tsx to properly close a WebSocket connection and finish all results. The intent is to ensure that execution fails gracefully when a session doesn't end normally. In tool.go, user instructions have been made more explicit to ensure users check access to nodes before generating any commands. It warns them that not checking access will cause error. Also, some minor typos were corrected in agent.go and messages.go for better readability.

* "Refactor 'hosts' to 'nodes' in AI Tool Descriptions"

This commit refactors the language from 'host' terminology to 'node' terminology in the AI tool's generated responses as the LLM seems to be confused when generating queries with embeddings.

* Update expected test values in chat_test.go

The expected values in three different tests in chat_test.go have been updated. This change was required because the underlying algorithm has been adjusted and these modifications will keep the tests aligned with the current algorithm's behavior.
2023-06-29 14:41:39 +00:00
Grzegorz Zdunek 95996acb52
Add light & dark themes to YAML editor (#28378)
* Add data visualisation colors to theme

* Add YAML editor theme and use it

* Add new `ace-teleport` theme instead of overwriting `ace-monokai`

* In a standalone editor use `levels.sunken` background; when displayed inline, use `levels.deep`

* Remove unused component

* Remove custom class for `.ace-fold-widget` as it makes the folding arrow to always render in the "expanded" state
2023-06-28 16:55:59 +00:00
Hugo Shaka d386c422eb
ai: compute opportinistic summary of command execution (#28033)
* ai: compute opportinistic summary of command execution

* ai: add streaming summary back after rebase on new front-end

* Lint and fix tests pt.1

* reference nodes by name and add tests

* Lint, fix tests and address feedback

* Attempt to tame the stream close monster

* fixup! Attempt to tame the stream close monster

* [Assist] Do not close the WS after command execution (#28246)

* Revert "fixup! Attempt to tame the stream close monster"

This reverts commit 8537aa2163.

* Revert "Attempt to tame the stream close monster"

This reverts commit e0c861df40.

* Do not close the WS after command execution

* Fix tests and lint

* fixup! Fix tests and lint

* undo put web test command into constant

---------

Co-authored-by: Jakub Nyckowski <jakub.nyckowski@goteleport.com>
2023-06-27 16:14:03 +00:00
Michelle Bergquist ec78da1f3f
Add onboarding questionnaire components (#27977) 2023-06-26 15:51:21 +00:00
Michael Wilson e62e786946
Add associated applications and user groups to UI objects. (#28084)
* Add associated applications and user groups to UI objects.

The user groups UI object will now contain the list of associated applications
and the applications UI object will contain the list of associated user
groups. This will be used to improve the access request experience for
Okta applications and user groups.

* UI linting.

* Correct type issues.

* Add friendly names/descriptions to the app/user group objects. Additionally add in tests for these.

* Correct permissions issues when querying for associated user groups and applications. Update UI types.

* Correct user_groups to userGroups in application object.

* GCI.
2023-06-26 14:42:09 +00:00
Lisa Kim b3b37f1480
Preserve applications original URL's query (#28099)
* Preserve original URL's query along with path

* Preserve space (URLSearchParam converts encoded space to +)

* Shift test into describe block

* Address CR: handle possible duplicate query path key

* Address CR
2023-06-23 18:07:25 +00:00
Grzegorz Zdunek c0a8691cef
Web terminal themes (#28022)
* Convert `Terminal` to a functional component

* Remove custom terminal theme values

* Add theme switching to the SSH terminal and player terminal

* Remove any custom styling

* Rename navigation item "Main" to "Home"

We don't have anything like "Main".

* Update snapshots
2023-06-22 14:35:09 +00:00
Grzegorz Zdunek 92a2e6cb24
Connect My Computer: Add a setup document and an icon in the top bar (#28063)
* Add Connect My Computer setup document and an icon in the top bar

* Use theme values

* Keep all CMC stories in the same group

* Remove `opts` type, use `RootClusterUri`

* Revert code-style changes
2023-06-22 09:17:25 +00:00