Skip to content

Commit

Permalink
Merge pull request #76 from h-fam/master
Browse files Browse the repository at this point in the history
Fix gofmt gaps
  • Loading branch information
marcushines authored Aug 4, 2023
2 parents c75672a + 0197d6d commit 90a6242
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 25 deletions.
31 changes: 16 additions & 15 deletions cmd/client/client.go
Original file line number Diff line number Diff line change
@@ -1,36 +1,37 @@
//
// Copyright 2019 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
//
// This binary creates a tunnel client to proxy incoming connections
// over a grpc transport.
// Exmaples to use this binary with ssh's ProxyCommand option:
// TLS:
// ssh -o ProxyCommand="client
// --tunnel_server_address=localhost:$PORT \
// --cert_file=$CERT_FILE \
// --dial_target=target1 \
// --dial_target_type=SSH" $USER@localhost
//
// ssh -o ProxyCommand="client
// --tunnel_server_address=localhost:$PORT \
// --cert_file=$CERT_FILE \
// --dial_target=target1 \
// --dial_target_type=SSH" $USER@localhost
//
// mTLS:
// ssh -o ProxyCommand="client
// --tunnel_server_address=localhost:$PORT \
// --cert_file=$CERT_FILE \
// --key_file=$KEY_FILE \
// --ca_file=$CA_FILE \
// --dial_target=target1 \
// --dial_target_type=SSH" $USER@localhost
//
// ssh -o ProxyCommand="client
// --tunnel_server_address=localhost:$PORT \
// --cert_file=$CERT_FILE \
// --key_file=$KEY_FILE \
// --ca_file=$CA_FILE \
// --dial_target=target1 \
// --dial_target_type=SSH" $USER@localhost
package main

import (
Expand Down
7 changes: 5 additions & 2 deletions cmd/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,13 @@
// This binary runs a tunnel server, which serves as a proxy between tunnel clients.
// Exmaples to use this binary is with ssh's ProxyCommand option:
// TLS:
// server --tunnel_address=localhost:$PORT \
// --cert_file=$CERT_FILE \
//
// server --tunnel_address=localhost:$PORT \
// --cert_file=$CERT_FILE \
// --key_file=$KEY_FILE
//
// mTLS:
//
// server --tunnel_address=localhost:$PORT \
// --cert_file=$CERT_FILE \
// --key_file=$KEY_FILE \
Expand Down
1 change: 1 addition & 0 deletions cmd/target/target.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
// If the incoming session is of supported type (SSH or GNMI), then it will be
// relayed to a local port with the provide port.
// Exmaple to use this binary:
//
// target --config_file=$CONFIG_FILE
package main

Expand Down
16 changes: 8 additions & 8 deletions tunnel/tunnel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -953,7 +953,7 @@ func TestClientRun(t *testing.T) {
ctx: ctx,
maxSends: 10,
streamRecv: []*tpb.RegisterOp{
&tpb.RegisterOp{},
{},
},
}},
c: client,
Expand Down Expand Up @@ -1012,7 +1012,7 @@ func TestClientStart(t *testing.T) {
client: &tunnelClient{
regStream: &registerClientStream{
streamRecv: []*tpb.RegisterOp{
&tpb.RegisterOp{Registration: &tpb.RegisterOp_Session{Session: &tpb.Session{Tag: 1, Accept: false, Target: "testID"}}},
{Registration: &tpb.RegisterOp_Session{Session: &tpb.Session{Tag: 1, Accept: false, Target: "testID"}}},
},
streamSend: []*tpb.RegisterOp{},
},
Expand All @@ -1024,7 +1024,7 @@ func TestClientStart(t *testing.T) {
client: &tunnelClient{
regStream: &registerClientStream{
streamRecv: []*tpb.RegisterOp{
&tpb.RegisterOp{Registration: &tpb.RegisterOp_Session{Session: &tpb.Session{Tag: 1, Accept: true, Target: "testID"}}},
{Registration: &tpb.RegisterOp_Session{Session: &tpb.Session{Tag: 1, Accept: true, Target: "testID"}}},
},
streamSend: []*tpb.RegisterOp{},
},
Expand Down Expand Up @@ -1211,7 +1211,7 @@ func TestClientStreamHandler(t *testing.T) {
client: &tunnelClient{
regStream: &registerClientStream{
streamRecv: []*tpb.RegisterOp{
&tpb.RegisterOp{Registration: &tpb.RegisterOp_Session{Session: &tpb.Session{Tag: 1, Accept: true, Target: "testID"}}},
{Registration: &tpb.RegisterOp_Session{Session: &tpb.Session{Tag: 1, Accept: true, Target: "testID"}}},
},
sendErr: true,
},
Expand All @@ -1228,7 +1228,7 @@ func TestClientStreamHandler(t *testing.T) {
client: &tunnelClient{
regStream: &registerClientStream{
streamRecv: []*tpb.RegisterOp{
&tpb.RegisterOp{Registration: &tpb.RegisterOp_Session{Session: &tpb.Session{Tag: 1, Accept: true, Target: "testID"}}},
{Registration: &tpb.RegisterOp_Session{Session: &tpb.Session{Tag: 1, Accept: true, Target: "testID"}}},
},
streamSend: []*tpb.RegisterOp{},
},
Expand All @@ -1248,7 +1248,7 @@ func TestClientStreamHandler(t *testing.T) {
client: &tunnelClient{
regStream: &registerClientStream{
streamRecv: []*tpb.RegisterOp{
&tpb.RegisterOp{Registration: &tpb.RegisterOp_Session{Session: &tpb.Session{Tag: 1, Accept: true, Target: "testID"}}},
{Registration: &tpb.RegisterOp_Session{Session: &tpb.Session{Tag: 1, Accept: true, Target: "testID"}}},
},
streamSend: []*tpb.RegisterOp{},
},
Expand All @@ -1270,7 +1270,7 @@ func TestClientStreamHandler(t *testing.T) {
client: &tunnelClient{
regStream: &registerClientStream{
streamRecv: []*tpb.RegisterOp{
&tpb.RegisterOp{Registration: &tpb.RegisterOp_Session{Session: &tpb.Session{Tag: 1, Accept: true, Target: "testID"}}},
{Registration: &tpb.RegisterOp_Session{Session: &tpb.Session{Tag: 1, Accept: true, Target: "testID"}}},
},
streamSend: []*tpb.RegisterOp{},
},
Expand All @@ -1290,7 +1290,7 @@ func TestClientStreamHandler(t *testing.T) {
client: &tunnelClient{
regStream: &registerClientStream{
streamRecv: []*tpb.RegisterOp{
&tpb.RegisterOp{Registration: &tpb.RegisterOp_Session{Session: &tpb.Session{Tag: 1, Accept: true, Target: "testID"}}},
{Registration: &tpb.RegisterOp_Session{Session: &tpb.Session{Tag: 1, Accept: true, Target: "testID"}}},
},
streamSend: []*tpb.RegisterOp{},
},
Expand Down

0 comments on commit 90a6242

Please sign in to comment.