Close proxy listener if session is no longer active (#4850)

* Close proxy listener if session is no longer active
This commit is contained in:
Todd authored and GitHub committed 2024-05-30 16:12:17 -07:00
1 parent 4fd49f00f6
commit 98b5e3fa52
3 files changed
+50

No files matched your search

+13
View File
@@ -9,6 +9,7 @@ import (
"net/netip"
"time"
"github.com/hashicorp/boundary/api"
"github.com/hashicorp/boundary/api/targets"
)
@@ -37,6 +38,7 @@ type Options struct {
WithSessionAuthorizationData *targets.SessionAuthorizationData
WithSkipSessionTeardown bool
withSessionTeardownTimeout time.Duration
withApiClient *api.Client
}
// Option is a function that takes in an options struct and sets values or
@@ -129,3 +131,14 @@ func WithSessionTeardownTimeout(with time.Duration) Option {
return nil
}
}
// WithApiClient provides an optional Boundary API client
// Experimental: It is unclear whether the current usage of this option is the
// approach that we want to take in the long term. This may be removed at any
// point going forward.
func WithApiClient(with *api.Client) Option {
return func(o *Options) error {
o.withApiClient = with
return nil
}
}