* 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.
* 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
* 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
* 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
* 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
* 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
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
* 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
* 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>
* 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>
* Clear the refresh websocket timeout when closing Assist
* Missing semicolon to please prettier
* Add comment to remove once the new session implementation is done
* 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
* 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
* 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
* 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
* "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.
* 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
* 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>
* 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.
* 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
* 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
* 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