teleport/lib/web
rosstimothy 4092acaf87
Improve web ui ssh performance (#18656)
Reduces latency creating ssh sessions via the web ui by:

1) No longer uses `TeleportClient.SSH` to establish a session
2) Reuses the user auth client for the web session to perform MFA ceremony
3) Ensures that connection attempts follow the flow outlined in RFD 93

The web api server now leverages the `proxy.Router` and `srv.SessionController`
directly, instead of doing so indirectly via `TeleportClient.SSH`. Using
the `TeleportClient` required an ssh connection to be established from the web
api server to the proxy ssh server, which are in the same process. This added
overhead can be avoided now that the routing logic and session control logic
exists in a reusable component. To create an interactive session on the node
once the connection is established, `client.NodeClient` is used. A new constructor
was added to facilitate creating one and remove duplicated creation code and a
`RunInteractiveShell` receiver method was added to allow callers outside of
`lib/client` to spawn a session.

`TerminalHandler.issueSessionMFACerts` used to check if per-session mfa was enabled
and perform the mfa ceremony via the `client.ProxyClient` which was constructed
with the `TeleportClient` established from connecting to the proxy ssh server.
This would dial the Auth server under the hood directly and call `IsMFARequired`
and do the ceremony if required. Each web session established via the web ui
already established an auth client with the credentials of the logged in user.
Again overhead is removed by leveraging the existing auth client and performing
the mfa ceremony manually.

Finally `TerminalHandler.makeClient` always attempted to perform the mfa ceremony
prior to returning the `TeleportClient`. As outlined in [RFD 93](https://github.com/gravitational/teleport/blob/master/rfd/0093-offline-access.md),
this causes additional latency and requires Auth connectivity to connect to nodes.
The connection flow is now modified to attempt connection to the nodes first, and
fall back to the mfa ceremony and reconnecting only if the node denies access.

Partially addresses #15167
2022-11-28 14:00:51 +00:00
..
app Use x/exp/slices instead of home grown utilities (#18524) 2022-11-17 15:25:46 +00:00
desktop RFD 91: streaming session playback (#17949) 2022-11-02 16:35:16 +00:00
mfajson Remove U2F support (#10476) 2022-02-24 19:54:28 +00:00
scripts File create/delete permission check in active dir install powershell script (#18469) 2022-11-15 21:17:34 -05:00
ui Use x/exp/slices instead of home grown utilities (#18524) 2022-11-17 15:25:46 +00:00
apiserver.go Improve web ui ssh performance (#18656) 2022-11-28 14:00:51 +00:00
apiserver_login_test.go [reopen] Handle private key policy errors for the web UI (#17928) 2022-10-31 23:18:54 +00:00
apiserver_ping_test.go PIV login enforcement (#15874) 2022-09-30 23:27:48 +00:00
apiserver_test.go Improve web ui ssh performance (#18656) 2022-11-28 14:00:51 +00:00
apps.go Fix web ListResources total count with apps and update tests (#18586) 2022-11-18 17:20:46 +00:00
assets.go Better webassets embedding (#17058) 2022-10-06 08:36:23 +00:00
conn_upgrade.go Enable GCI linter (#17894) 2022-10-28 20:20:28 +00:00
conn_upgrade_test.go Update golangci-lint to 1.49.0 (#16507) 2022-09-19 22:38:59 +00:00
connection_diagnostic.go Enable GCI linter (#17894) 2022-10-28 20:20:28 +00:00
cookie.go Set cookies with '__Host-' prefix 2021-03-01 22:14:10 +01:00
databases.go WebAPI: Get database endpoint (#18041) 2022-11-10 16:25:09 +00:00
databases_test.go Web API for getting database IAM policy (#17635) 2022-11-09 13:58:17 +00:00
desktop.go Fix trusted clusters for Desktop Access 2022-11-21 23:51:19 +00:00
desktop_playback.go Enable GCI linter (#17894) 2022-10-28 20:20:28 +00:00
envelope.pb.go Use Buf to build/lint/format lib/ protos (#15870) 2022-08-29 17:44:18 +00:00
files.go Enable GCI linter (#17894) 2022-10-28 20:20:28 +00:00
fuzz_test.go oss fuzz integration (#13473) 2022-06-18 21:28:07 +00:00
gziphandler.go Remove use of deprecated ioutil package (#11296) 2022-03-21 18:00:34 +00:00
join_tokens.go Improve error log for install script generation (#16760) 2022-11-11 17:35:32 -03:00
join_tokens_test.go spell fixes (#18545) 2022-11-17 16:28:05 +00:00
mfa.go Enable GCI linter (#17894) 2022-10-28 20:20:28 +00:00
mfa_codec.go Enable GCI linter (#17894) 2022-10-28 20:20:28 +00:00
password.go Migrate ChangePassword RPC from HTTP to gRPC (#18682) 2022-11-26 12:47:43 +00:00
resources.go Enable GCI linter (#17894) 2022-10-28 20:20:28 +00:00
resources_test.go Add ability to have multiple Github auth connector implementations (#17293) 2022-11-16 15:35:21 +00:00
servers.go WebAPI: Get database endpoint (#18041) 2022-11-10 16:25:09 +00:00
sessions.go Enable GCI linter (#17894) 2022-10-28 20:20:28 +00:00
sessions_test.go Enable GCI linter (#17894) 2022-10-28 20:20:28 +00:00
sign.go Update golangci-lint to 1.49.0 (#16507) 2022-09-19 22:38:59 +00:00
static_test.go Better webassets embedding (#17058) 2022-10-06 08:36:23 +00:00
terminal.go Improve web ui ssh performance (#18656) 2022-11-28 14:00:51 +00:00
users.go Enable GCI linter (#17894) 2022-10-28 20:20:28 +00:00
users_test.go Enable GCI linter (#17894) 2022-10-28 20:20:28 +00:00
web.go Enable GCI linter (#17894) 2022-10-28 20:20:28 +00:00
ws_io.go Implement Moderated Sessions (#8563) 2022-02-15 17:02:10 +01:00