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
* Add bottom shadow for inactive tabs and inset for the active one
* Add shadow for new tab item by using common styling
* Adjust `KeyboardShortcutsPanel` to the light theme
* Center Servers/Databases/Kubes navbar vertically between tabs and table by using the same margin values (8px)
* Set title on the element that is dragged
* Update Electron to 25.1, TypeScript to 5.1
* Use the same focusing mechanism on all platforms
* Use `role: about` in the app menu as Linux supports it
* Bump Electron to 25.1.1
* Add a config item for the theme and adjust Electron's `nativeTheme` based on that
* Listen to theme changes and update the app accordingly
* React to theme changes in teleterm stories
* Rename channel
* Return boolean from handlers
* Do not mock the whole app context in storybook
* Fix linting issue
* Fix typo
* feat: adds motd to the ui
* address review suggestions:
- update MOTD to Motd
- moved motd state to useLogin
- added behaviour tests
* add motd test to apiserver_test.go webconfig. update snapshot test to address motd warning
* git mv to update MOTD to Motd
* multiple fix:
- add unmount test
- remove motd title
- group states together in useLogin
- update arrow func to classic js func
* remove unused waitForElementToBeRemoved
* At the notion of friendly names to access request details.
Access request details can now return friendly names. This will help display
access request resources in a way that allows easier reviewing of Okta apps
and user groups, where the names are not human readable.
* Use friendly name for nodes, tune variable names.
* Add in DetailsID helper function for use by the enterprise UI.
* Request apps instead of app servers, remove DetailsID as its no longer needed.
* Push friendly name into app and usergroup UI objects.
* Fix apps test.
* Linting.
* [Connect] Add FriendlyName to AccessRequest (#27694)
---------
Co-authored-by: Michael <michael.myers@goteleport.com>
* Rewrite Assist & implement a new UI
* Use the node name from the API
* Code review comments
* Address UI code review comments
* Add some tests for the service
* Rename "MiniAssit" to "Assist"
* Impose a max height for the floating assist for small windows
* Add missing license header
* Update web/packages/teleport/src/Assist/Conversation/ExecuteRemoteCommandEntry.tsx
Co-authored-by: Lisa Kim <lisa@goteleport.com>
* Code review improvements
* Only use stopPropagation so links still work and assist does not close
* Make errors only show when error message isn't null
* Add websocket refresh to avoid session expirations
* Mark the conversation as not streaming when assist returns a full message
* Improvements to error handling and icon spacing
* Use encodeChallengeResponse to match the MFA backend changes
* Run prettier
* Usability improvements
---------
Co-authored-by: Lisa Kim <lisa@goteleport.com>
* Fix moderated session presence checking
Addresses all of the issues that were preventing presence checking during
moderated sessions from working as described in
[#18092](https://github.com/gravitational/teleport/issues/18092#issuecomment-1540900859).
Closes#18092
* make presence test clearer
* fix presence checking on the web ui
* Refactor web socket message handling
A single message processing loop handles retrieving the envelope
and passing it off to individual message handlers. This allows all
messages to be processed outside of `Read` which was dependent on
the terminal being active to process any messages.
The webauthn challenge response was also moved from a raw message
to a webauthn message. By sending it as a raw message it made
presence checking fail because the response has a `t` in it which
caused the session to be killed during moderated sessions.
* enforce mfa ceremony when joining and cluster wide mfa is enabled
* fix conflicts with master
* moderated tests
* Add moderated session tests for the UI
* Add moderated session integration test
* fix lints
* clean up presence test
* refactor envelope handling
* fix build
* fix: revert test debug timeout
* fix: use local context in tests
* simplify closing streams
* generalize waitForOutput to work with an io.Reader
* fix error handling in stream close
* unexport PresenceOptions
* Improve waitForOutput to match against output in successive reads