Skip to content

Commit

Permalink
[v17] Add support for target port in gateways in Connect (#51014)
Browse files Browse the repository at this point in the history
* Add basic support for target port in gateways in Connect

* Update type for targetSubresourceName on DocumentGateway

The way DocumentsService.createGatewayDocument is implemented means that
the targetSubresourceName property is always present, but it can be undefined.

* Use "local port" instead of "port" in DocumentGatewapApp

* Rewrite gateway FieldInputs to use styled components

* Update comments in protos

* useGateway: Stabilize useAsync functions of ports

* Add padding to menu label if it's first child

* Add support for required prop to Input and FieldInput

* Add UI for changing target port

* ActionButtons: Show ports of multi-port apps when VNet is not supported

Now that we have support for the target port in Connect's gateways, we
can show the ports and then open a gateway for that specific port on
click.

* Add RWMutex to gateways

* Clear app gateway cert on target port change

* Remove gateways/app.LocalProxyURL

It was used only in tests and it made sense only for web apps anyway.

* TestTCP: Close connections when test ends

* Create context with timeout in testGatewayCertRenewal

…instead of in each function that uses it.

* Add tests for changing the target port of a TCP gateway

* Parallelize app gateway tests within MFA/non-MFA groups

* Make testGatewayConnection take ctx as first arg

This will be needed in tests that check target port validation.

* Validate target port of app gateways

* Increase timeouts in app gateway tests

* fix: Move testGatewayConnectionFunc to proxy_helpers.go

* Add field for changing target port if app gateway fails to start

* Make OfflineGateway use uncontrolled forms

* Pass form fields to OfflineGateway from outside

This will enable each callsite to establish it's own rules as to which
fields are required. This will be useful once we add required target
subresource name for TCP apps.

* Add tests for submitting form through OfflineGateway

* Make sure reconnect and formSchema operate on the same type

* Add comment for Terminal input

* Show available target ports in gateways for multi-port apps

* Allow opening multiple gateways for the same app but different target port

* Ensure uniqueness of gateways in tshd

* Add comments to a bunch of related types and functions

* Refactor ClustersService.findGatewayByConnectionParams

This makes it work with app gateways too.

* Remove gatewayUri from TrackedGatewayConnection

* Update document title on target port change

* MenuLogin: Support custom ButtonComponent and buttonText

* setUpAppGateway: Accept app URI instead of whole app

This will let us call this function from places which do not have access
to the whole app object.

* useGateway: Update doc title after creating gateway

* Change list of buttons with ports to MenuLogin with ports

* make grpc

---------

Co-authored-by: Alan Parra <[email protected]>
  • Loading branch information
ravicious and codingllama authored Jan 21, 2025
1 parent 49338c4 commit 5cef60f
Show file tree
Hide file tree
Showing 73 changed files with 3,194 additions and 919 deletions.
6 changes: 4 additions & 2 deletions gen/proto/go/teleport/lib/teleterm/v1/app.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions gen/proto/go/teleport/lib/teleterm/v1/gateway.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1,057 changes: 582 additions & 475 deletions gen/proto/go/teleport/lib/teleterm/v1/service.pb.go

Large diffs are not rendered by default.

42 changes: 42 additions & 0 deletions gen/proto/go/teleport/lib/teleterm/v1/service_grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions gen/proto/ts/teleport/lib/teleterm/v1/app_pb.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions gen/proto/ts/teleport/lib/teleterm/v1/gateway_pb.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions gen/proto/ts/teleport/lib/teleterm/v1/service_pb.client.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions gen/proto/ts/teleport/lib/teleterm/v1/service_pb.grpc-server.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

114 changes: 113 additions & 1 deletion gen/proto/ts/teleport/lib/teleterm/v1/service_pb.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions integration/appaccess/appaccess_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -831,6 +831,7 @@ func TestTCP(t *testing.T) {

conn, err := net.Dial("tcp", localProxyAddress)
require.NoError(t, err)
defer conn.Close()

buf := make([]byte, 1024)
n, err := conn.Read(buf)
Expand Down
Loading

0 comments on commit 5cef60f

Please sign in to comment.