Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 36 additions & 35 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.

14 changes: 7 additions & 7 deletions gen/proto/js/teleport/lib/teleterm/v1/gateway_pb.d.ts

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

82 changes: 41 additions & 41 deletions gen/proto/js/teleport/lib/teleterm/v1/gateway_pb.js

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

2 changes: 1 addition & 1 deletion lib/teleterm/apiserver/handler/handler_gateways.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func newAPIGateway(gateway gateway.Gateway) (*api.Gateway, error) {
Protocol: gateway.Protocol(),
LocalAddress: gateway.LocalAddress(),
LocalPort: gateway.LocalPort(),
CliCommand: command,
GatewayCliCommand: command,
}, nil
}

Expand Down
17 changes: 9 additions & 8 deletions proto/teleport/lib/teleterm/v1/gateway.proto
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,18 @@ message Gateway {
string local_port = 6;
// protocol is the gateway protocol
string protocol = 7;
// cli_command represents a command that the user can execute to connect to the resource within
// a CLI, if the given resource has a CLI client.
//
// Instead of generating those commands in in the frontend code, they are returned from the tsh
// daemon.
// This means that the Database Access team can add support for a new protocol and Teleterm will
// support it right away without any changes to Teleterm's code.
GatewayCLICommand cli_command = 8;
reserved 8;
reserved "cli_command";
// target_subresource_name points at a subresource of the remote resource, for example a
// database name on a database server.
string target_subresource_name = 9;
// gateway_cli_client represents a command that the user can execute to connect to the resource
// through the gateway.
//
// Instead of generating those commands in in the frontend code, they are returned from the tsh
// daemon. This means that the Database Access team can add support for a new protocol and
// Connect will support it right away with no extra changes.
GatewayCLICommand gateway_cli_command = 10;
}

// GatewayCLICommand represents a command that the user can execute to connect to the gateway
Expand Down
2 changes: 1 addition & 1 deletion web/packages/teleterm/src/services/tshd/testHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export const makeGateway = (props: Partial<tsh.Gateway> = {}): tsh.Gateway => ({
localAddress: 'localhost',
localPort: '1337',
protocol: 'postgres',
cliCommand: {
gatewayCliCommand: {
path: '/foo/psql',
argsList: ['psql', 'localhost:1337'],
envList: [],
Expand Down
4 changes: 2 additions & 2 deletions web/packages/teleterm/src/services/tshd/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ export interface Server extends apiServer.Server.AsObject {
export interface Gateway extends apiGateway.Gateway.AsObject {
uri: uri.GatewayUri;
targetUri: uri.DatabaseUri;
// The type of cliCommand was repeated here just to refer to the type with the JSDoc.
cliCommand: GatewayCLICommand;
// The type of gatewayCliCommand was repeated here just to refer to the type with the JSDoc.
gatewayCliCommand: GatewayCLICommand;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const gateway = makeGateway({
protocol: 'postgres',
targetSubresourceName: 'bar',
});
gateway.cliCommand.preview = 'connect-me-to-db-please';
gateway.gatewayCliCommand.preview = 'connect-me-to-db-please';

const onlineDocumentGatewayProps: DocumentGatewayProps = {
gateway: gateway,
Expand Down Expand Up @@ -75,7 +75,7 @@ export function OnlineWithLongValues() {
targetSubresourceName:
'foo-bar-baz-quux-quuz-foo-bar-baz-quux-quuz-foo-bar-baz-quux-quuz',
});
gateway.cliCommand.preview =
gateway.gatewayCliCommand.preview =
'connect-me-to-db-please-baz-quux-quuz-foo-baz-quux-quuz-foo-baz-quux-quuz-foo';

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export function OnlineDocumentGateway(props: OnlineDocumentGatewayProps) {
</Validation>
</Flex>
<CliCommand
cliCommand={props.gateway.cliCommand.preview}
cliCommand={props.gateway.gatewayCliCommand.preview}
isLoading={isPortOrDbNameProcessing}
onRun={props.runCliCommand}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export function useDocumentGateway(doc: types.DocumentGateway) {
});

const runCliCommand = () => {
const command = tshdGateway.getCliCommandArgv0(gateway.cliCommand);
const command = tshdGateway.getCliCommandArgv0(gateway.gatewayCliCommand);
const title = `${command} · ${doc.targetUser}@${doc.targetName}`;

const cliDoc = workspaceDocumentsService.createGatewayCliDocument({
Expand Down
Loading