Monitors both the UI<->Proxy and Proxy<->SSH host connections in
order to provide users with near real time latency data for ssh
connections established via the UI. The client portion of the
connection is measured by how long it takes to receive a web socket
pong in response to sending a web socket ping. The host portion of
the connection is measured by how long it takes to receive a reply
of a keepalive@openssh.com global SSH request. The statistics are
periodically sent via a new envelope type over the web socket where
they are consumed and displayed to users.
* assist: support recording non-interactive forwarded sessions
* assist: add integration tests for assist command recording on agentless
This also fixes a bugged openssh integration test check.
* Mock OpenAI API in integration tests.
Also fixes the OpenAI mock handler that was not supporting the "/v1/*"
routes used in some web/ tests.
* Docstrings + adressing again a feedback that got lost during a rebase
* restore signer function signature
* Address Jakub's feedback + diverse improvements
- improve comments
- simpler file creation
- more efficient rsa key generation
- use assert instead of require in other goroutines
- only save env vars if they are Teleport-related
- move more logic into newTestCredentials for readability
* Update lib/srv/forward/sshserver.go
Co-authored-by: Zac Bergquist <zac.bergquist@goteleport.com>
* Add a timeout in the ssh handler coroutine
---------
Co-authored-by: Zac Bergquist <zac.bergquist@goteleport.com>
* 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>
* 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
* Assist - Execution web endpoint
* Add test
Clean up code a bit
* Add missing username
* Address review comments
* Make more implementation shared between Terminal and Command Web Handlers
* Address review comments
* Address review comments
* Fixes after rebase
Add comments
* Add comments
Fix linter
* Add TELEPORT to Teleport related environment variable.