SSH Proxy support (#2736)

* initial commit
This commit is contained in:
Irena Rindos authored and GitHub committed 2023-01-09 13:43:02 -05:00
1 parent 1fb960575f
commit beb97ac9f2
9 files changed
+70 -36

No files matched your search

@@ -1,6 +1,9 @@
package proxy
import (
"net"
"reflect"
"runtime"
"testing"
serverpb "github.com/hashicorp/boundary/internal/gen/controller/servers/services"
@@ -26,4 +29,17 @@ func Test_GetOpts(t *testing.T) {
testOpts.WithInjectedApplicationCredentials = []*serverpb.Credential{c}
assert.Equal(opts, testOpts)
})
t.Run("WithPostConnectionHook", func(t *testing.T) {
assert := assert.New(t)
testFn := func(net.Conn) {}
opts := GetOpts(WithPostConnectionHook(testFn))
testOpts := getDefaultOptions()
assert.NotEqual(opts, testOpts)
testOpts.WithPostConnectionHook = testFn
assert.Equal(
runtime.FuncForPC(reflect.ValueOf(opts.WithPostConnectionHook).Pointer()).Name(),
runtime.FuncForPC(reflect.ValueOf(testOpts.WithPostConnectionHook).Pointer()).Name(),
)
})
}